diff --git a/melos.yaml b/melos.yaml index b0cbd7f6b3d0..097dd2c48f92 100644 --- a/melos.yaml +++ b/melos.yaml @@ -239,6 +239,7 @@ scripts: melos exec -- "flutter pub run pigeon --input ./pigeons/messages.dart" && \ melos run generate:pigeon:macos --no-select && \ melos run generate:pigeon:android --no-select && \ + melos run generate:pigeon:windows --no-select && \ melos run format-ci --no-select packageFilters: fileExists: 'pigeons/messages.dart' @@ -259,6 +260,13 @@ scripts: dirExists: 'android' description: Transform the method toList() into a public one to be used in EventChannel + generate:pigeon:windows: + run: | + melos exec -- "perl -i -pe 's{^(\s+::flutter::EncodableList ToEncodableList\(\) const;)\n}{ public:\n\$1\n private:\n}' ./windows/messages.g.h" + packageFilters: + fileExists: 'windows/messages.g.h' + description: Make ToEncodableList public so it can be called from plugin code. + # Additional cleanup lifecycle script, executed when `melos clean` is run. postclean: > melos exec -c 6 -- "flutter clean" diff --git a/packages/cloud_firestore/analysis_options.yaml b/packages/cloud_firestore/analysis_options.yaml new file mode 100644 index 000000000000..5dcab3c843d2 --- /dev/null +++ b/packages/cloud_firestore/analysis_options.yaml @@ -0,0 +1,11 @@ +# Copyright 2026 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# in the LICENSE file. + +include: ../../analysis_options.yaml + +analyzer: + exclude: + - cloud_firestore_platform_interface/lib/src/pigeon/messages.pigeon.dart + - cloud_firestore_platform_interface/test/pigeon/test_api.dart + - cloud_firestore_platform_interface/pigeons/messages.dart diff --git a/packages/cloud_firestore/cloud_firestore/android/src/main/java/io/flutter/plugins/firebase/firestore/FlutterFirebaseFirestorePlugin.java b/packages/cloud_firestore/cloud_firestore/android/src/main/java/io/flutter/plugins/firebase/firestore/FlutterFirebaseFirestorePlugin.java index e7af885e3454..14cea06420c1 100644 --- a/packages/cloud_firestore/cloud_firestore/android/src/main/java/io/flutter/plugins/firebase/firestore/FlutterFirebaseFirestorePlugin.java +++ b/packages/cloud_firestore/cloud_firestore/android/src/main/java/io/flutter/plugins/firebase/firestore/FlutterFirebaseFirestorePlugin.java @@ -77,8 +77,7 @@ public class FlutterFirebaseFirestorePlugin private static final String METHOD_CHANNEL_NAME = "plugins.flutter.io/firebase_firestore"; final StandardMethodCodec MESSAGE_CODEC = - new StandardMethodCodec( - io.flutter.plugins.firebase.firestore.FlutterFirebaseFirestoreMessageCodec.INSTANCE); + new StandardMethodCodec(GeneratedAndroidFirebaseFirestore.PigeonCodec.INSTANCE); private BinaryMessenger binaryMessenger; @@ -183,7 +182,7 @@ private void initInstance(BinaryMessenger messenger) { FlutterFirebasePluginRegistry.registerPlugin(METHOD_CHANNEL_NAME, this); - GeneratedAndroidFirebaseFirestore.FirebaseFirestoreHostApi.setup(binaryMessenger, this); + GeneratedAndroidFirebaseFirestore.FirebaseFirestoreHostApi.setUp(binaryMessenger, this); } @Override @@ -355,10 +354,10 @@ public void loadBundle( public void namedQueryGet( @NonNull GeneratedAndroidFirebaseFirestore.FirestorePigeonFirebaseApp app, @NonNull String name, - @NonNull GeneratedAndroidFirebaseFirestore.PigeonGetOptions options, + @NonNull GeneratedAndroidFirebaseFirestore.InternalGetOptions options, @NonNull GeneratedAndroidFirebaseFirestore.Result< - GeneratedAndroidFirebaseFirestore.PigeonQuerySnapshot> + GeneratedAndroidFirebaseFirestore.InternalQuerySnapshot> result) { cachedThreadPool.execute( @@ -391,13 +390,13 @@ public void namedQueryGet( @Override public void clearPersistence( @NonNull GeneratedAndroidFirebaseFirestore.FirestorePigeonFirebaseApp app, - @NonNull GeneratedAndroidFirebaseFirestore.Result result) { + @NonNull GeneratedAndroidFirebaseFirestore.VoidResult result) { cachedThreadPool.execute( () -> { try { FirebaseFirestore firestore = getFirestoreFromPigeon(app); Tasks.await(firestore.clearPersistence()); - result.success(null); + result.success(); } catch (Exception e) { ExceptionConverter.sendErrorToFlutter(result, e); } @@ -407,13 +406,13 @@ public void clearPersistence( @Override public void disableNetwork( @NonNull GeneratedAndroidFirebaseFirestore.FirestorePigeonFirebaseApp app, - @NonNull GeneratedAndroidFirebaseFirestore.Result result) { + @NonNull GeneratedAndroidFirebaseFirestore.VoidResult result) { cachedThreadPool.execute( () -> { try { FirebaseFirestore firestore = getFirestoreFromPigeon(app); Tasks.await(firestore.disableNetwork()); - result.success(null); + result.success(); } catch (Exception e) { ExceptionConverter.sendErrorToFlutter(result, e); } @@ -423,13 +422,13 @@ public void disableNetwork( @Override public void enableNetwork( @NonNull GeneratedAndroidFirebaseFirestore.FirestorePigeonFirebaseApp app, - @NonNull GeneratedAndroidFirebaseFirestore.Result result) { + @NonNull GeneratedAndroidFirebaseFirestore.VoidResult result) { cachedThreadPool.execute( () -> { try { FirebaseFirestore firestore = getFirestoreFromPigeon(app); Tasks.await(firestore.enableNetwork()); - result.success(null); + result.success(); } catch (Exception e) { ExceptionConverter.sendErrorToFlutter(result, e); } @@ -439,14 +438,14 @@ public void enableNetwork( @Override public void terminate( @NonNull GeneratedAndroidFirebaseFirestore.FirestorePigeonFirebaseApp app, - @NonNull GeneratedAndroidFirebaseFirestore.Result result) { + @NonNull GeneratedAndroidFirebaseFirestore.VoidResult result) { cachedThreadPool.execute( () -> { try { FirebaseFirestore firestore = getFirestoreFromPigeon(app); Tasks.await(firestore.terminate()); destroyCachedFirebaseFirestoreInstanceForKey(firestore); - result.success(null); + result.success(); } catch (Exception e) { ExceptionConverter.sendErrorToFlutter(result, e); } @@ -456,13 +455,13 @@ public void terminate( @Override public void waitForPendingWrites( @NonNull GeneratedAndroidFirebaseFirestore.FirestorePigeonFirebaseApp app, - @NonNull GeneratedAndroidFirebaseFirestore.Result result) { + @NonNull GeneratedAndroidFirebaseFirestore.VoidResult result) { cachedThreadPool.execute( () -> { try { FirebaseFirestore firestore = getFirestoreFromPigeon(app); Tasks.await(firestore.waitForPendingWrites()); - result.success(null); + result.success(); } catch (Exception e) { ExceptionConverter.sendErrorToFlutter(result, e); } @@ -475,14 +474,14 @@ public void waitForPendingWrites( public void setIndexConfiguration( @NonNull GeneratedAndroidFirebaseFirestore.FirestorePigeonFirebaseApp app, @NonNull String indexConfiguration, - @NonNull GeneratedAndroidFirebaseFirestore.Result result) { + @NonNull GeneratedAndroidFirebaseFirestore.VoidResult result) { cachedThreadPool.execute( () -> { try { FirebaseFirestore firestore = getFirestoreFromPigeon(app); Tasks.await(firestore.setIndexConfiguration(indexConfiguration)); - result.success(null); + result.success(); } catch (Exception e) { ExceptionConverter.sendErrorToFlutter(result, e); } @@ -493,7 +492,7 @@ public void setIndexConfiguration( public void persistenceCacheIndexManagerRequest( @NonNull GeneratedAndroidFirebaseFirestore.FirestorePigeonFirebaseApp app, @NonNull GeneratedAndroidFirebaseFirestore.PersistenceCacheIndexManagerRequest request, - @NonNull GeneratedAndroidFirebaseFirestore.Result result) { + @NonNull GeneratedAndroidFirebaseFirestore.VoidResult result) { cachedThreadPool.execute( () -> { PersistentCacheIndexManager indexManager = @@ -514,20 +513,20 @@ public void persistenceCacheIndexManagerRequest( Log.d(TAG, "`PersistentCacheIndexManager` is not available."); } - result.success(null); + result.success(); }); } @Override public void setLoggingEnabled( @NonNull Boolean loggingEnabled, - @NonNull GeneratedAndroidFirebaseFirestore.Result result) { + @NonNull GeneratedAndroidFirebaseFirestore.VoidResult result) { cachedThreadPool.execute( () -> { try { FirebaseFirestore.setLoggingEnabled(loggingEnabled); - result.success(null); + result.success(); } catch (Exception e) { ExceptionConverter.sendErrorToFlutter(result, e); } @@ -570,12 +569,12 @@ public void transactionCreate( @Override public void transactionStoreResult( @NonNull String transactionId, - @NonNull GeneratedAndroidFirebaseFirestore.PigeonTransactionResult resultType, - @Nullable List commands, - @NonNull GeneratedAndroidFirebaseFirestore.Result result) { + @NonNull GeneratedAndroidFirebaseFirestore.InternalTransactionResult resultType, + @Nullable List commands, + @NonNull GeneratedAndroidFirebaseFirestore.VoidResult result) { Objects.requireNonNull(transactionHandlers.get(transactionId)) .receiveTransactionResponse(resultType, commands); - result.success(null); + result.success(); } @Override @@ -585,7 +584,7 @@ public void transactionGet( @NonNull String path, @NonNull GeneratedAndroidFirebaseFirestore.Result< - GeneratedAndroidFirebaseFirestore.PigeonDocumentSnapshot> + GeneratedAndroidFirebaseFirestore.InternalDocumentSnapshot> result) { cachedThreadPool.execute( () -> { @@ -616,7 +615,7 @@ public void transactionGet( public void documentReferenceSet( @NonNull GeneratedAndroidFirebaseFirestore.FirestorePigeonFirebaseApp app, @NonNull GeneratedAndroidFirebaseFirestore.DocumentReferenceRequest request, - @NonNull GeneratedAndroidFirebaseFirestore.Result result) { + @NonNull GeneratedAndroidFirebaseFirestore.VoidResult result) { cachedThreadPool.execute( () -> { try { @@ -639,7 +638,8 @@ public void documentReferenceSet( setTask = documentReference.set(data); } - result.success(Tasks.await(setTask)); + Tasks.await(setTask); + result.success(); } catch (Exception e) { ExceptionConverter.sendErrorToFlutter(result, e); } @@ -650,7 +650,7 @@ public void documentReferenceSet( public void documentReferenceUpdate( @NonNull GeneratedAndroidFirebaseFirestore.FirestorePigeonFirebaseApp app, @NonNull GeneratedAndroidFirebaseFirestore.DocumentReferenceRequest request, - @NonNull GeneratedAndroidFirebaseFirestore.Result result) { + @NonNull GeneratedAndroidFirebaseFirestore.VoidResult result) { cachedThreadPool.execute( () -> { try { @@ -683,9 +683,9 @@ public void documentReferenceUpdate( flattenData.add(fieldPath); flattenData.add(data.get(fieldPath)); } - result.success( - Tasks.await( - documentReference.update(firstFieldPath, firstObject, flattenData.toArray()))); + Tasks.await( + documentReference.update(firstFieldPath, firstObject, flattenData.toArray())); + result.success(); } catch (Exception e) { ExceptionConverter.sendErrorToFlutter(result, e); } @@ -698,7 +698,7 @@ public void documentReferenceGet( @NonNull GeneratedAndroidFirebaseFirestore.DocumentReferenceRequest request, @NonNull GeneratedAndroidFirebaseFirestore.Result< - GeneratedAndroidFirebaseFirestore.PigeonDocumentSnapshot> + GeneratedAndroidFirebaseFirestore.InternalDocumentSnapshot> result) { cachedThreadPool.execute( () -> { @@ -726,14 +726,15 @@ public void documentReferenceGet( public void documentReferenceDelete( @NonNull GeneratedAndroidFirebaseFirestore.FirestorePigeonFirebaseApp app, @NonNull GeneratedAndroidFirebaseFirestore.DocumentReferenceRequest request, - @NonNull GeneratedAndroidFirebaseFirestore.Result result) { + @NonNull GeneratedAndroidFirebaseFirestore.VoidResult result) { cachedThreadPool.execute( () -> { try { DocumentReference documentReference = getFirestoreFromPigeon(app).document(request.getPath()); - result.success(Tasks.await(documentReference.delete())); + Tasks.await(documentReference.delete()); + result.success(); } catch (Exception e) { ExceptionConverter.sendErrorToFlutter(result, e); } @@ -745,11 +746,11 @@ public void queryGet( @NonNull GeneratedAndroidFirebaseFirestore.FirestorePigeonFirebaseApp app, @NonNull String path, @NonNull Boolean isCollectionGroup, - @NonNull GeneratedAndroidFirebaseFirestore.PigeonQueryParameters parameters, - @NonNull GeneratedAndroidFirebaseFirestore.PigeonGetOptions options, + @NonNull GeneratedAndroidFirebaseFirestore.InternalQueryParameters parameters, + @NonNull GeneratedAndroidFirebaseFirestore.InternalGetOptions options, @NonNull GeneratedAndroidFirebaseFirestore.Result< - GeneratedAndroidFirebaseFirestore.PigeonQuerySnapshot> + GeneratedAndroidFirebaseFirestore.InternalQuerySnapshot> result) { cachedThreadPool.execute( () -> { @@ -784,7 +785,7 @@ public void queryGet( public void aggregateQuery( @NonNull GeneratedAndroidFirebaseFirestore.FirestorePigeonFirebaseApp app, @NonNull String path, - @NonNull GeneratedAndroidFirebaseFirestore.PigeonQueryParameters parameters, + @NonNull GeneratedAndroidFirebaseFirestore.InternalQueryParameters parameters, @NonNull GeneratedAndroidFirebaseFirestore.AggregateSource source, @NonNull List queries, @NonNull Boolean isCollectionGroup, @@ -876,16 +877,16 @@ public void aggregateQuery( @Override public void writeBatchCommit( @NonNull GeneratedAndroidFirebaseFirestore.FirestorePigeonFirebaseApp app, - @NonNull List writes, - @NonNull GeneratedAndroidFirebaseFirestore.Result result) { + @NonNull List writes, + @NonNull GeneratedAndroidFirebaseFirestore.VoidResult result) { cachedThreadPool.execute( () -> { try { FirebaseFirestore firestore = getFirestoreFromPigeon(app); WriteBatch batch = firestore.batch(); - for (GeneratedAndroidFirebaseFirestore.PigeonTransactionCommand write : writes) { - GeneratedAndroidFirebaseFirestore.PigeonTransactionType type = + for (GeneratedAndroidFirebaseFirestore.InternalTransactionCommand write : writes) { + GeneratedAndroidFirebaseFirestore.InternalTransactionType type = Objects.requireNonNull(write.getType()); String path = Objects.requireNonNull(write.getPath()); DocumentReference documentReference = firestore.document(path); @@ -925,7 +926,7 @@ public void writeBatchCommit( @SuppressWarnings("unchecked") Map setData = (Map) (Map) Objects.requireNonNull(write.getData()); - GeneratedAndroidFirebaseFirestore.PigeonDocumentOption options = + GeneratedAndroidFirebaseFirestore.InternalDocumentOption options = Objects.requireNonNull(write.getOption()); if (options.getMerge() != null && options.getMerge()) { @@ -948,7 +949,7 @@ public void writeBatchCommit( } Tasks.await(batch.commit()); - result.success(null); + result.success(); } catch (Exception e) { ExceptionConverter.sendErrorToFlutter(result, e); } @@ -960,8 +961,8 @@ public void querySnapshot( @NonNull GeneratedAndroidFirebaseFirestore.FirestorePigeonFirebaseApp app, @NonNull String path, @NonNull Boolean isCollectionGroup, - @NonNull GeneratedAndroidFirebaseFirestore.PigeonQueryParameters parameters, - @NonNull GeneratedAndroidFirebaseFirestore.PigeonGetOptions options, + @NonNull GeneratedAndroidFirebaseFirestore.InternalQueryParameters parameters, + @NonNull GeneratedAndroidFirebaseFirestore.InternalGetOptions options, @NonNull Boolean includeMetadataChanges, @NonNull GeneratedAndroidFirebaseFirestore.ListenSource source, @NonNull GeneratedAndroidFirebaseFirestore.Result result) { @@ -1018,7 +1019,7 @@ public void executePipeline( @Nullable Map options, @NonNull GeneratedAndroidFirebaseFirestore.Result< - GeneratedAndroidFirebaseFirestore.PigeonPipelineSnapshot> + GeneratedAndroidFirebaseFirestore.InternalPipelineSnapshot> result) { cachedThreadPool.execute( () -> { @@ -1028,14 +1029,14 @@ public void executePipeline( // Execute pipeline using Android Firestore SDK Pipeline.Snapshot snapshot = PipelineParser.executePipeline(firestore, stages, options); - // Convert Pipeline.Snapshot to PigeonPipelineSnapshot - List pipelineResults = + // Convert Pipeline.Snapshot to InternalPipelineSnapshot + List pipelineResults = new ArrayList<>(); // Iterate through snapshot results for (PipelineResult pipelineResult : snapshot.getResults()) { - GeneratedAndroidFirebaseFirestore.PigeonPipelineResult.Builder resultBuilder = - new GeneratedAndroidFirebaseFirestore.PigeonPipelineResult.Builder(); + GeneratedAndroidFirebaseFirestore.InternalPipelineResult.Builder resultBuilder = + new GeneratedAndroidFirebaseFirestore.InternalPipelineResult.Builder(); if (pipelineResult.getRef() != null) { resultBuilder.setDocumentPath(pipelineResult.getRef().getPath()); } @@ -1056,8 +1057,8 @@ public void executePipeline( } // Build the snapshot - GeneratedAndroidFirebaseFirestore.PigeonPipelineSnapshot.Builder snapshotBuilder = - new GeneratedAndroidFirebaseFirestore.PigeonPipelineSnapshot.Builder(); + GeneratedAndroidFirebaseFirestore.InternalPipelineSnapshot.Builder snapshotBuilder = + new GeneratedAndroidFirebaseFirestore.InternalPipelineSnapshot.Builder(); snapshotBuilder.setResults(pipelineResults); // Set execution time when available. Do not fabricate a value when null. diff --git a/packages/cloud_firestore/cloud_firestore/android/src/main/java/io/flutter/plugins/firebase/firestore/GeneratedAndroidFirebaseFirestore.java b/packages/cloud_firestore/cloud_firestore/android/src/main/java/io/flutter/plugins/firebase/firestore/GeneratedAndroidFirebaseFirestore.java index bf5bb3fff9ef..60f2d8ff6638 100644 --- a/packages/cloud_firestore/cloud_firestore/android/src/main/java/io/flutter/plugins/firebase/firestore/GeneratedAndroidFirebaseFirestore.java +++ b/packages/cloud_firestore/cloud_firestore/android/src/main/java/io/flutter/plugins/firebase/firestore/GeneratedAndroidFirebaseFirestore.java @@ -1,11 +1,14 @@ // Copyright 2023, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v11.0.1), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), do not edit directly. // See also: https://pub.dev/packages/pigeon package io.flutter.plugins.firebase.firestore; +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.RetentionPolicy.CLASS; + import android.util.Log; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -13,14 +16,174 @@ import io.flutter.plugin.common.BinaryMessenger; import io.flutter.plugin.common.MessageCodec; import java.io.ByteArrayOutputStream; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; import java.nio.ByteBuffer; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.Map; /** Generated class from Pigeon. */ @SuppressWarnings({"unused", "unchecked", "CodeBlock2Expr", "RedundantSuppression", "serial"}) public class GeneratedAndroidFirebaseFirestore { + static boolean pigeonDoubleEquals(double a, double b) { + // Normalize -0.0 to 0.0 and handle NaN equality. + return (a == 0.0 ? 0.0 : a) == (b == 0.0 ? 0.0 : b) || (Double.isNaN(a) && Double.isNaN(b)); + } + + static boolean pigeonFloatEquals(float a, float b) { + // Normalize -0.0 to 0.0 and handle NaN equality. + return (a == 0.0f ? 0.0f : a) == (b == 0.0f ? 0.0f : b) || (Float.isNaN(a) && Float.isNaN(b)); + } + + static int pigeonDoubleHashCode(double d) { + // Normalize -0.0 to 0.0 and handle NaN to ensure consistent hash codes. + if (d == 0.0) { + d = 0.0; + } + long bits = Double.doubleToLongBits(d); + return (int) (bits ^ (bits >>> 32)); + } + + static int pigeonFloatHashCode(float f) { + // Normalize -0.0 to 0.0 and handle NaN to ensure consistent hash codes. + if (f == 0.0f) { + f = 0.0f; + } + return Float.floatToIntBits(f); + } + + static boolean pigeonDeepEquals(Object a, Object b) { + if (a == b) { + return true; + } + if (a == null || b == null) { + return false; + } + if (a instanceof byte[] && b instanceof byte[]) { + return Arrays.equals((byte[]) a, (byte[]) b); + } + if (a instanceof int[] && b instanceof int[]) { + return Arrays.equals((int[]) a, (int[]) b); + } + if (a instanceof long[] && b instanceof long[]) { + return Arrays.equals((long[]) a, (long[]) b); + } + if (a instanceof double[] && b instanceof double[]) { + double[] da = (double[]) a; + double[] db = (double[]) b; + if (da.length != db.length) { + return false; + } + for (int i = 0; i < da.length; i++) { + if (!pigeonDoubleEquals(da[i], db[i])) { + return false; + } + } + return true; + } + if (a instanceof List && b instanceof List) { + List listA = (List) a; + List listB = (List) b; + if (listA.size() != listB.size()) { + return false; + } + for (int i = 0; i < listA.size(); i++) { + if (!pigeonDeepEquals(listA.get(i), listB.get(i))) { + return false; + } + } + return true; + } + if (a instanceof Map && b instanceof Map) { + Map mapA = (Map) a; + Map mapB = (Map) b; + if (mapA.size() != mapB.size()) { + return false; + } + for (Map.Entry entryA : mapA.entrySet()) { + Object keyA = entryA.getKey(); + Object valueA = entryA.getValue(); + boolean found = false; + for (Map.Entry entryB : mapB.entrySet()) { + Object keyB = entryB.getKey(); + if (pigeonDeepEquals(keyA, keyB)) { + Object valueB = entryB.getValue(); + if (pigeonDeepEquals(valueA, valueB)) { + found = true; + break; + } else { + return false; + } + } + } + if (!found) { + return false; + } + } + return true; + } + if (a instanceof Double && b instanceof Double) { + return pigeonDoubleEquals((double) a, (double) b); + } + if (a instanceof Float && b instanceof Float) { + return pigeonFloatEquals((float) a, (float) b); + } + return a.equals(b); + } + + static int pigeonDeepHashCode(Object value) { + if (value == null) { + return 0; + } + if (value instanceof byte[]) { + return Arrays.hashCode((byte[]) value); + } + if (value instanceof int[]) { + return Arrays.hashCode((int[]) value); + } + if (value instanceof long[]) { + return Arrays.hashCode((long[]) value); + } + if (value instanceof double[]) { + double[] da = (double[]) value; + int result = 1; + for (double d : da) { + result = 31 * result + pigeonDoubleHashCode(d); + } + return result; + } + if (value instanceof List) { + int result = 1; + for (Object item : (List) value) { + result = 31 * result + pigeonDeepHashCode(item); + } + return result; + } + if (value instanceof Map) { + int result = 0; + for (Map.Entry entry : ((Map) value).entrySet()) { + result += + ((pigeonDeepHashCode(entry.getKey()) * 31) ^ pigeonDeepHashCode(entry.getValue())); + } + return result; + } + if (value instanceof Object[]) { + int result = 1; + for (Object item : (Object[]) value) { + result = 31 * result + pigeonDeepHashCode(item); + } + return result; + } + if (value instanceof Double) { + return pigeonDoubleHashCode((double) value); + } + if (value instanceof Float) { + return pigeonFloatHashCode((float) value); + } + return value.hashCode(); + } /** Error class for passing custom error details to Flutter via a thrown PlatformException. */ public static class FlutterError extends RuntimeException { @@ -40,7 +203,7 @@ public FlutterError(@NonNull String code, @Nullable String message, @Nullable Ob @NonNull protected static ArrayList wrapError(@NonNull Throwable exception) { - ArrayList errorList = new ArrayList(3); + ArrayList errorList = new ArrayList<>(3); if (exception instanceof FlutterError) { FlutterError error = (FlutterError) exception; errorList.add(error.code); @@ -55,6 +218,10 @@ protected static ArrayList wrapError(@NonNull Throwable exception) { return errorList; } + @Target(METHOD) + @Retention(CLASS) + @interface CanIgnoreReturnValue {} + /** An enumeration of document change types. */ public enum DocumentChangeType { /** Indicates a new document was added to the set of documents matching the query. */ @@ -69,7 +236,7 @@ public enum DocumentChangeType { final int index; - private DocumentChangeType(final int index) { + DocumentChangeType(final int index) { this.index = index; } } @@ -99,7 +266,7 @@ public enum Source { final int index; - private Source(final int index) { + Source(final int index) { this.index = index; } } @@ -128,7 +295,7 @@ public enum ListenSource { final int index; - private ListenSource(final int index) { + ListenSource(final int index) { this.index = index; } } @@ -149,7 +316,7 @@ public enum ServerTimestampBehavior { final int index; - private ServerTimestampBehavior(final int index) { + ServerTimestampBehavior(final int index) { this.index = index; } } @@ -161,7 +328,7 @@ public enum AggregateSource { final int index; - private AggregateSource(final int index) { + AggregateSource(final int index) { this.index = index; } } @@ -177,23 +344,23 @@ public enum PersistenceCacheIndexManagerRequest { final int index; - private PersistenceCacheIndexManagerRequest(final int index) { + PersistenceCacheIndexManagerRequest(final int index) { this.index = index; } } - public enum PigeonTransactionResult { + public enum InternalTransactionResult { SUCCESS(0), FAILURE(1); final int index; - private PigeonTransactionResult(final int index) { + InternalTransactionResult(final int index) { this.index = index; } } - public enum PigeonTransactionType { + public enum InternalTransactionType { GET(0), UPDATE(1), SET(2), @@ -201,7 +368,7 @@ public enum PigeonTransactionType { final int index; - private PigeonTransactionType(final int index) { + InternalTransactionType(final int index) { this.index = index; } } @@ -213,13 +380,13 @@ public enum AggregateType { final int index; - private AggregateType(final int index) { + AggregateType(final int index) { this.index = index; } } /** Generated class from Pigeon that represents data sent in messages. */ - public static final class PigeonFirebaseSettings { + public static final class InternalFirebaseSettings { private @Nullable Boolean persistenceEnabled; public @Nullable Boolean getPersistenceEnabled() { @@ -274,12 +441,43 @@ public void setIgnoreUndefinedProperties(@NonNull Boolean setterArg) { } /** Constructor is non-public to enforce null safety; use Builder. */ - PigeonFirebaseSettings() {} + InternalFirebaseSettings() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InternalFirebaseSettings that = (InternalFirebaseSettings) o; + return pigeonDeepEquals(persistenceEnabled, that.persistenceEnabled) + && pigeonDeepEquals(host, that.host) + && pigeonDeepEquals(sslEnabled, that.sslEnabled) + && pigeonDeepEquals(cacheSizeBytes, that.cacheSizeBytes) + && pigeonDeepEquals(ignoreUndefinedProperties, that.ignoreUndefinedProperties); + } + + @Override + public int hashCode() { + Object[] fields = + new Object[] { + getClass(), + persistenceEnabled, + host, + sslEnabled, + cacheSizeBytes, + ignoreUndefinedProperties + }; + return pigeonDeepHashCode(fields); + } public static final class Builder { private @Nullable Boolean persistenceEnabled; + @CanIgnoreReturnValue public @NonNull Builder setPersistenceEnabled(@Nullable Boolean setterArg) { this.persistenceEnabled = setterArg; return this; @@ -287,6 +485,7 @@ public static final class Builder { private @Nullable String host; + @CanIgnoreReturnValue public @NonNull Builder setHost(@Nullable String setterArg) { this.host = setterArg; return this; @@ -294,6 +493,7 @@ public static final class Builder { private @Nullable Boolean sslEnabled; + @CanIgnoreReturnValue public @NonNull Builder setSslEnabled(@Nullable Boolean setterArg) { this.sslEnabled = setterArg; return this; @@ -301,6 +501,7 @@ public static final class Builder { private @Nullable Long cacheSizeBytes; + @CanIgnoreReturnValue public @NonNull Builder setCacheSizeBytes(@Nullable Long setterArg) { this.cacheSizeBytes = setterArg; return this; @@ -308,13 +509,14 @@ public static final class Builder { private @Nullable Boolean ignoreUndefinedProperties; + @CanIgnoreReturnValue public @NonNull Builder setIgnoreUndefinedProperties(@NonNull Boolean setterArg) { this.ignoreUndefinedProperties = setterArg; return this; } - public @NonNull PigeonFirebaseSettings build() { - PigeonFirebaseSettings pigeonReturn = new PigeonFirebaseSettings(); + public @NonNull InternalFirebaseSettings build() { + InternalFirebaseSettings pigeonReturn = new InternalFirebaseSettings(); pigeonReturn.setPersistenceEnabled(persistenceEnabled); pigeonReturn.setHost(host); pigeonReturn.setSslEnabled(sslEnabled); @@ -326,7 +528,7 @@ public static final class Builder { @NonNull public ArrayList toList() { - ArrayList toListResult = new ArrayList(5); + ArrayList toListResult = new ArrayList<>(5); toListResult.add(persistenceEnabled); toListResult.add(host); toListResult.add(sslEnabled); @@ -335,22 +537,17 @@ public ArrayList toList() { return toListResult; } - static @NonNull PigeonFirebaseSettings fromList(@NonNull ArrayList list) { - PigeonFirebaseSettings pigeonResult = new PigeonFirebaseSettings(); - Object persistenceEnabled = list.get(0); + static @NonNull InternalFirebaseSettings fromList(@NonNull ArrayList pigeonVar_list) { + InternalFirebaseSettings pigeonResult = new InternalFirebaseSettings(); + Object persistenceEnabled = pigeonVar_list.get(0); pigeonResult.setPersistenceEnabled((Boolean) persistenceEnabled); - Object host = list.get(1); + Object host = pigeonVar_list.get(1); pigeonResult.setHost((String) host); - Object sslEnabled = list.get(2); + Object sslEnabled = pigeonVar_list.get(2); pigeonResult.setSslEnabled((Boolean) sslEnabled); - Object cacheSizeBytes = list.get(3); - pigeonResult.setCacheSizeBytes( - (cacheSizeBytes == null) - ? null - : ((cacheSizeBytes instanceof Integer) - ? (Integer) cacheSizeBytes - : (Long) cacheSizeBytes)); - Object ignoreUndefinedProperties = list.get(4); + Object cacheSizeBytes = pigeonVar_list.get(3); + pigeonResult.setCacheSizeBytes((Long) cacheSizeBytes); + Object ignoreUndefinedProperties = pigeonVar_list.get(4); pigeonResult.setIgnoreUndefinedProperties((Boolean) ignoreUndefinedProperties); return pigeonResult; } @@ -371,13 +568,13 @@ public void setAppName(@NonNull String setterArg) { this.appName = setterArg; } - private @NonNull PigeonFirebaseSettings settings; + private @NonNull InternalFirebaseSettings settings; - public @NonNull PigeonFirebaseSettings getSettings() { + public @NonNull InternalFirebaseSettings getSettings() { return settings; } - public void setSettings(@NonNull PigeonFirebaseSettings setterArg) { + public void setSettings(@NonNull InternalFirebaseSettings setterArg) { if (setterArg == null) { throw new IllegalStateException("Nonnull field \"settings\" is null."); } @@ -400,24 +597,47 @@ public void setDatabaseURL(@NonNull String setterArg) { /** Constructor is non-public to enforce null safety; use Builder. */ FirestorePigeonFirebaseApp() {} + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FirestorePigeonFirebaseApp that = (FirestorePigeonFirebaseApp) o; + return pigeonDeepEquals(appName, that.appName) + && pigeonDeepEquals(settings, that.settings) + && pigeonDeepEquals(databaseURL, that.databaseURL); + } + + @Override + public int hashCode() { + Object[] fields = new Object[] {getClass(), appName, settings, databaseURL}; + return pigeonDeepHashCode(fields); + } + public static final class Builder { private @Nullable String appName; + @CanIgnoreReturnValue public @NonNull Builder setAppName(@NonNull String setterArg) { this.appName = setterArg; return this; } - private @Nullable PigeonFirebaseSettings settings; + private @Nullable InternalFirebaseSettings settings; - public @NonNull Builder setSettings(@NonNull PigeonFirebaseSettings setterArg) { + @CanIgnoreReturnValue + public @NonNull Builder setSettings(@NonNull InternalFirebaseSettings setterArg) { this.settings = setterArg; return this; } private @Nullable String databaseURL; + @CanIgnoreReturnValue public @NonNull Builder setDatabaseURL(@NonNull String setterArg) { this.databaseURL = setterArg; return this; @@ -434,30 +654,27 @@ public static final class Builder { @NonNull public ArrayList toList() { - ArrayList toListResult = new ArrayList(3); + ArrayList toListResult = new ArrayList<>(3); toListResult.add(appName); - toListResult.add((settings == null) ? null : settings.toList()); + toListResult.add(settings); toListResult.add(databaseURL); return toListResult; } - static @NonNull FirestorePigeonFirebaseApp fromList(@NonNull ArrayList list) { + static @NonNull FirestorePigeonFirebaseApp fromList(@NonNull ArrayList pigeonVar_list) { FirestorePigeonFirebaseApp pigeonResult = new FirestorePigeonFirebaseApp(); - Object appName = list.get(0); + Object appName = pigeonVar_list.get(0); pigeonResult.setAppName((String) appName); - Object settings = list.get(1); - pigeonResult.setSettings( - (settings == null) - ? null - : PigeonFirebaseSettings.fromList((ArrayList) settings)); - Object databaseURL = list.get(2); + Object settings = pigeonVar_list.get(1); + pigeonResult.setSettings((InternalFirebaseSettings) settings); + Object databaseURL = pigeonVar_list.get(2); pigeonResult.setDatabaseURL((String) databaseURL); return pigeonResult; } } /** Generated class from Pigeon that represents data sent in messages. */ - public static final class PigeonSnapshotMetadata { + public static final class InternalSnapshotMetadata { private @NonNull Boolean hasPendingWrites; public @NonNull Boolean getHasPendingWrites() { @@ -485,12 +702,32 @@ public void setIsFromCache(@NonNull Boolean setterArg) { } /** Constructor is non-public to enforce null safety; use Builder. */ - PigeonSnapshotMetadata() {} + InternalSnapshotMetadata() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InternalSnapshotMetadata that = (InternalSnapshotMetadata) o; + return pigeonDeepEquals(hasPendingWrites, that.hasPendingWrites) + && pigeonDeepEquals(isFromCache, that.isFromCache); + } + + @Override + public int hashCode() { + Object[] fields = new Object[] {getClass(), hasPendingWrites, isFromCache}; + return pigeonDeepHashCode(fields); + } public static final class Builder { private @Nullable Boolean hasPendingWrites; + @CanIgnoreReturnValue public @NonNull Builder setHasPendingWrites(@NonNull Boolean setterArg) { this.hasPendingWrites = setterArg; return this; @@ -498,13 +735,14 @@ public static final class Builder { private @Nullable Boolean isFromCache; + @CanIgnoreReturnValue public @NonNull Builder setIsFromCache(@NonNull Boolean setterArg) { this.isFromCache = setterArg; return this; } - public @NonNull PigeonSnapshotMetadata build() { - PigeonSnapshotMetadata pigeonReturn = new PigeonSnapshotMetadata(); + public @NonNull InternalSnapshotMetadata build() { + InternalSnapshotMetadata pigeonReturn = new InternalSnapshotMetadata(); pigeonReturn.setHasPendingWrites(hasPendingWrites); pigeonReturn.setIsFromCache(isFromCache); return pigeonReturn; @@ -513,24 +751,24 @@ public static final class Builder { @NonNull public ArrayList toList() { - ArrayList toListResult = new ArrayList(2); + ArrayList toListResult = new ArrayList<>(2); toListResult.add(hasPendingWrites); toListResult.add(isFromCache); return toListResult; } - static @NonNull PigeonSnapshotMetadata fromList(@NonNull ArrayList list) { - PigeonSnapshotMetadata pigeonResult = new PigeonSnapshotMetadata(); - Object hasPendingWrites = list.get(0); + static @NonNull InternalSnapshotMetadata fromList(@NonNull ArrayList pigeonVar_list) { + InternalSnapshotMetadata pigeonResult = new InternalSnapshotMetadata(); + Object hasPendingWrites = pigeonVar_list.get(0); pigeonResult.setHasPendingWrites((Boolean) hasPendingWrites); - Object isFromCache = list.get(1); + Object isFromCache = pigeonVar_list.get(1); pigeonResult.setIsFromCache((Boolean) isFromCache); return pigeonResult; } } /** Generated class from Pigeon that represents data sent in messages. */ - public static final class PigeonDocumentSnapshot { + public static final class InternalDocumentSnapshot { private @NonNull String path; public @NonNull String getPath() { @@ -554,13 +792,13 @@ public void setData(@Nullable Map setterArg) { this.data = setterArg; } - private @NonNull PigeonSnapshotMetadata metadata; + private @NonNull InternalSnapshotMetadata metadata; - public @NonNull PigeonSnapshotMetadata getMetadata() { + public @NonNull InternalSnapshotMetadata getMetadata() { return metadata; } - public void setMetadata(@NonNull PigeonSnapshotMetadata setterArg) { + public void setMetadata(@NonNull InternalSnapshotMetadata setterArg) { if (setterArg == null) { throw new IllegalStateException("Nonnull field \"metadata\" is null."); } @@ -568,12 +806,33 @@ public void setMetadata(@NonNull PigeonSnapshotMetadata setterArg) { } /** Constructor is non-public to enforce null safety; use Builder. */ - PigeonDocumentSnapshot() {} + InternalDocumentSnapshot() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InternalDocumentSnapshot that = (InternalDocumentSnapshot) o; + return pigeonDeepEquals(path, that.path) + && pigeonDeepEquals(data, that.data) + && pigeonDeepEquals(metadata, that.metadata); + } + + @Override + public int hashCode() { + Object[] fields = new Object[] {getClass(), path, data, metadata}; + return pigeonDeepHashCode(fields); + } public static final class Builder { private @Nullable String path; + @CanIgnoreReturnValue public @NonNull Builder setPath(@NonNull String setterArg) { this.path = setterArg; return this; @@ -581,20 +840,22 @@ public static final class Builder { private @Nullable Map data; + @CanIgnoreReturnValue public @NonNull Builder setData(@Nullable Map setterArg) { this.data = setterArg; return this; } - private @Nullable PigeonSnapshotMetadata metadata; + private @Nullable InternalSnapshotMetadata metadata; - public @NonNull Builder setMetadata(@NonNull PigeonSnapshotMetadata setterArg) { + @CanIgnoreReturnValue + public @NonNull Builder setMetadata(@NonNull InternalSnapshotMetadata setterArg) { this.metadata = setterArg; return this; } - public @NonNull PigeonDocumentSnapshot build() { - PigeonDocumentSnapshot pigeonReturn = new PigeonDocumentSnapshot(); + public @NonNull InternalDocumentSnapshot build() { + InternalDocumentSnapshot pigeonReturn = new InternalDocumentSnapshot(); pigeonReturn.setPath(path); pigeonReturn.setData(data); pigeonReturn.setMetadata(metadata); @@ -604,30 +865,27 @@ public static final class Builder { @NonNull public ArrayList toList() { - ArrayList toListResult = new ArrayList(3); + ArrayList toListResult = new ArrayList<>(3); toListResult.add(path); toListResult.add(data); - toListResult.add((metadata == null) ? null : metadata.toList()); + toListResult.add(metadata); return toListResult; } - static @NonNull PigeonDocumentSnapshot fromList(@NonNull ArrayList list) { - PigeonDocumentSnapshot pigeonResult = new PigeonDocumentSnapshot(); - Object path = list.get(0); + static @NonNull InternalDocumentSnapshot fromList(@NonNull ArrayList pigeonVar_list) { + InternalDocumentSnapshot pigeonResult = new InternalDocumentSnapshot(); + Object path = pigeonVar_list.get(0); pigeonResult.setPath((String) path); - Object data = list.get(1); + Object data = pigeonVar_list.get(1); pigeonResult.setData((Map) data); - Object metadata = list.get(2); - pigeonResult.setMetadata( - (metadata == null) - ? null - : PigeonSnapshotMetadata.fromList((ArrayList) metadata)); + Object metadata = pigeonVar_list.get(2); + pigeonResult.setMetadata((InternalSnapshotMetadata) metadata); return pigeonResult; } } /** Generated class from Pigeon that represents data sent in messages. */ - public static final class PigeonDocumentChange { + public static final class InternalDocumentChange { private @NonNull DocumentChangeType type; public @NonNull DocumentChangeType getType() { @@ -641,13 +899,13 @@ public void setType(@NonNull DocumentChangeType setterArg) { this.type = setterArg; } - private @NonNull PigeonDocumentSnapshot document; + private @NonNull InternalDocumentSnapshot document; - public @NonNull PigeonDocumentSnapshot getDocument() { + public @NonNull InternalDocumentSnapshot getDocument() { return document; } - public void setDocument(@NonNull PigeonDocumentSnapshot setterArg) { + public void setDocument(@NonNull InternalDocumentSnapshot setterArg) { if (setterArg == null) { throw new IllegalStateException("Nonnull field \"document\" is null."); } @@ -681,26 +939,50 @@ public void setNewIndex(@NonNull Long setterArg) { } /** Constructor is non-public to enforce null safety; use Builder. */ - PigeonDocumentChange() {} + InternalDocumentChange() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InternalDocumentChange that = (InternalDocumentChange) o; + return pigeonDeepEquals(type, that.type) + && pigeonDeepEquals(document, that.document) + && pigeonDeepEquals(oldIndex, that.oldIndex) + && pigeonDeepEquals(newIndex, that.newIndex); + } + + @Override + public int hashCode() { + Object[] fields = new Object[] {getClass(), type, document, oldIndex, newIndex}; + return pigeonDeepHashCode(fields); + } public static final class Builder { private @Nullable DocumentChangeType type; + @CanIgnoreReturnValue public @NonNull Builder setType(@NonNull DocumentChangeType setterArg) { this.type = setterArg; return this; } - private @Nullable PigeonDocumentSnapshot document; + private @Nullable InternalDocumentSnapshot document; - public @NonNull Builder setDocument(@NonNull PigeonDocumentSnapshot setterArg) { + @CanIgnoreReturnValue + public @NonNull Builder setDocument(@NonNull InternalDocumentSnapshot setterArg) { this.document = setterArg; return this; } private @Nullable Long oldIndex; + @CanIgnoreReturnValue public @NonNull Builder setOldIndex(@NonNull Long setterArg) { this.oldIndex = setterArg; return this; @@ -708,13 +990,14 @@ public static final class Builder { private @Nullable Long newIndex; + @CanIgnoreReturnValue public @NonNull Builder setNewIndex(@NonNull Long setterArg) { this.newIndex = setterArg; return this; } - public @NonNull PigeonDocumentChange build() { - PigeonDocumentChange pigeonReturn = new PigeonDocumentChange(); + public @NonNull InternalDocumentChange build() { + InternalDocumentChange pigeonReturn = new InternalDocumentChange(); pigeonReturn.setType(type); pigeonReturn.setDocument(document); pigeonReturn.setOldIndex(oldIndex); @@ -725,72 +1008,63 @@ public static final class Builder { @NonNull public ArrayList toList() { - ArrayList toListResult = new ArrayList(4); - toListResult.add(type == null ? null : type.index); - toListResult.add((document == null) ? null : document.toList()); + ArrayList toListResult = new ArrayList<>(4); + toListResult.add(type); + toListResult.add(document); toListResult.add(oldIndex); toListResult.add(newIndex); return toListResult; } - static @NonNull PigeonDocumentChange fromList(@NonNull ArrayList list) { - PigeonDocumentChange pigeonResult = new PigeonDocumentChange(); - Object type = list.get(0); - pigeonResult.setType(DocumentChangeType.values()[(int) type]); - Object document = list.get(1); - pigeonResult.setDocument( - (document == null) - ? null - : PigeonDocumentSnapshot.fromList((ArrayList) document)); - Object oldIndex = list.get(2); - pigeonResult.setOldIndex( - (oldIndex == null) - ? null - : ((oldIndex instanceof Integer) ? (Integer) oldIndex : (Long) oldIndex)); - Object newIndex = list.get(3); - pigeonResult.setNewIndex( - (newIndex == null) - ? null - : ((newIndex instanceof Integer) ? (Integer) newIndex : (Long) newIndex)); + static @NonNull InternalDocumentChange fromList(@NonNull ArrayList pigeonVar_list) { + InternalDocumentChange pigeonResult = new InternalDocumentChange(); + Object type = pigeonVar_list.get(0); + pigeonResult.setType((DocumentChangeType) type); + Object document = pigeonVar_list.get(1); + pigeonResult.setDocument((InternalDocumentSnapshot) document); + Object oldIndex = pigeonVar_list.get(2); + pigeonResult.setOldIndex((Long) oldIndex); + Object newIndex = pigeonVar_list.get(3); + pigeonResult.setNewIndex((Long) newIndex); return pigeonResult; } } /** Generated class from Pigeon that represents data sent in messages. */ - public static final class PigeonQuerySnapshot { - private @NonNull List documents; + public static final class InternalQuerySnapshot { + private @NonNull List documents; - public @NonNull List getDocuments() { + public @NonNull List getDocuments() { return documents; } - public void setDocuments(@NonNull List setterArg) { + public void setDocuments(@NonNull List setterArg) { if (setterArg == null) { throw new IllegalStateException("Nonnull field \"documents\" is null."); } this.documents = setterArg; } - private @NonNull List documentChanges; + private @NonNull List documentChanges; - public @NonNull List getDocumentChanges() { + public @NonNull List getDocumentChanges() { return documentChanges; } - public void setDocumentChanges(@NonNull List setterArg) { + public void setDocumentChanges(@NonNull List setterArg) { if (setterArg == null) { throw new IllegalStateException("Nonnull field \"documentChanges\" is null."); } this.documentChanges = setterArg; } - private @NonNull PigeonSnapshotMetadata metadata; + private @NonNull InternalSnapshotMetadata metadata; - public @NonNull PigeonSnapshotMetadata getMetadata() { + public @NonNull InternalSnapshotMetadata getMetadata() { return metadata; } - public void setMetadata(@NonNull PigeonSnapshotMetadata setterArg) { + public void setMetadata(@NonNull InternalSnapshotMetadata setterArg) { if (setterArg == null) { throw new IllegalStateException("Nonnull field \"metadata\" is null."); } @@ -798,33 +1072,56 @@ public void setMetadata(@NonNull PigeonSnapshotMetadata setterArg) { } /** Constructor is non-public to enforce null safety; use Builder. */ - PigeonQuerySnapshot() {} + InternalQuerySnapshot() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InternalQuerySnapshot that = (InternalQuerySnapshot) o; + return pigeonDeepEquals(documents, that.documents) + && pigeonDeepEquals(documentChanges, that.documentChanges) + && pigeonDeepEquals(metadata, that.metadata); + } + + @Override + public int hashCode() { + Object[] fields = new Object[] {getClass(), documents, documentChanges, metadata}; + return pigeonDeepHashCode(fields); + } public static final class Builder { - private @Nullable List documents; + private @Nullable List documents; - public @NonNull Builder setDocuments(@NonNull List setterArg) { + @CanIgnoreReturnValue + public @NonNull Builder setDocuments(@NonNull List setterArg) { this.documents = setterArg; return this; } - private @Nullable List documentChanges; + private @Nullable List documentChanges; - public @NonNull Builder setDocumentChanges(@NonNull List setterArg) { + @CanIgnoreReturnValue + public @NonNull Builder setDocumentChanges(@NonNull List setterArg) { this.documentChanges = setterArg; return this; } - private @Nullable PigeonSnapshotMetadata metadata; + private @Nullable InternalSnapshotMetadata metadata; - public @NonNull Builder setMetadata(@NonNull PigeonSnapshotMetadata setterArg) { + @CanIgnoreReturnValue + public @NonNull Builder setMetadata(@NonNull InternalSnapshotMetadata setterArg) { this.metadata = setterArg; return this; } - public @NonNull PigeonQuerySnapshot build() { - PigeonQuerySnapshot pigeonReturn = new PigeonQuerySnapshot(); + public @NonNull InternalQuerySnapshot build() { + InternalQuerySnapshot pigeonReturn = new InternalQuerySnapshot(); pigeonReturn.setDocuments(documents); pigeonReturn.setDocumentChanges(documentChanges); pigeonReturn.setMetadata(metadata); @@ -834,30 +1131,27 @@ public static final class Builder { @NonNull public ArrayList toList() { - ArrayList toListResult = new ArrayList(3); + ArrayList toListResult = new ArrayList<>(3); toListResult.add(documents); toListResult.add(documentChanges); - toListResult.add((metadata == null) ? null : metadata.toList()); + toListResult.add(metadata); return toListResult; } - static @NonNull PigeonQuerySnapshot fromList(@NonNull ArrayList list) { - PigeonQuerySnapshot pigeonResult = new PigeonQuerySnapshot(); - Object documents = list.get(0); - pigeonResult.setDocuments((List) documents); - Object documentChanges = list.get(1); - pigeonResult.setDocumentChanges((List) documentChanges); - Object metadata = list.get(2); - pigeonResult.setMetadata( - (metadata == null) - ? null - : PigeonSnapshotMetadata.fromList((ArrayList) metadata)); + static @NonNull InternalQuerySnapshot fromList(@NonNull ArrayList pigeonVar_list) { + InternalQuerySnapshot pigeonResult = new InternalQuerySnapshot(); + Object documents = pigeonVar_list.get(0); + pigeonResult.setDocuments((List) documents); + Object documentChanges = pigeonVar_list.get(1); + pigeonResult.setDocumentChanges((List) documentChanges); + Object metadata = pigeonVar_list.get(2); + pigeonResult.setMetadata((InternalSnapshotMetadata) metadata); return pigeonResult; } } /** Generated class from Pigeon that represents data sent in messages. */ - public static final class PigeonPipelineResult { + public static final class InternalPipelineResult { private @Nullable String documentPath; public @Nullable String getDocumentPath() { @@ -899,10 +1193,32 @@ public void setData(@Nullable Map setterArg) { this.data = setterArg; } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InternalPipelineResult that = (InternalPipelineResult) o; + return pigeonDeepEquals(documentPath, that.documentPath) + && pigeonDeepEquals(createTime, that.createTime) + && pigeonDeepEquals(updateTime, that.updateTime) + && pigeonDeepEquals(data, that.data); + } + + @Override + public int hashCode() { + Object[] fields = new Object[] {getClass(), documentPath, createTime, updateTime, data}; + return pigeonDeepHashCode(fields); + } + public static final class Builder { private @Nullable String documentPath; + @CanIgnoreReturnValue public @NonNull Builder setDocumentPath(@Nullable String setterArg) { this.documentPath = setterArg; return this; @@ -910,6 +1226,7 @@ public static final class Builder { private @Nullable Long createTime; + @CanIgnoreReturnValue public @NonNull Builder setCreateTime(@Nullable Long setterArg) { this.createTime = setterArg; return this; @@ -917,6 +1234,7 @@ public static final class Builder { private @Nullable Long updateTime; + @CanIgnoreReturnValue public @NonNull Builder setUpdateTime(@Nullable Long setterArg) { this.updateTime = setterArg; return this; @@ -924,13 +1242,14 @@ public static final class Builder { private @Nullable Map data; + @CanIgnoreReturnValue public @NonNull Builder setData(@Nullable Map setterArg) { this.data = setterArg; return this; } - public @NonNull PigeonPipelineResult build() { - PigeonPipelineResult pigeonReturn = new PigeonPipelineResult(); + public @NonNull InternalPipelineResult build() { + InternalPipelineResult pigeonReturn = new InternalPipelineResult(); pigeonReturn.setDocumentPath(documentPath); pigeonReturn.setCreateTime(createTime); pigeonReturn.setUpdateTime(updateTime); @@ -941,7 +1260,7 @@ public static final class Builder { @NonNull public ArrayList toList() { - ArrayList toListResult = new ArrayList(4); + ArrayList toListResult = new ArrayList<>(4); toListResult.add(documentPath); toListResult.add(createTime); toListResult.add(updateTime); @@ -949,35 +1268,29 @@ public ArrayList toList() { return toListResult; } - static @NonNull PigeonPipelineResult fromList(@NonNull ArrayList list) { - PigeonPipelineResult pigeonResult = new PigeonPipelineResult(); - Object documentPath = list.get(0); + static @NonNull InternalPipelineResult fromList(@NonNull ArrayList pigeonVar_list) { + InternalPipelineResult pigeonResult = new InternalPipelineResult(); + Object documentPath = pigeonVar_list.get(0); pigeonResult.setDocumentPath((String) documentPath); - Object createTime = list.get(1); - pigeonResult.setCreateTime( - (createTime == null) - ? null - : ((createTime instanceof Integer) ? (Integer) createTime : (Long) createTime)); - Object updateTime = list.get(2); - pigeonResult.setUpdateTime( - (updateTime == null) - ? null - : ((updateTime instanceof Integer) ? (Integer) updateTime : (Long) updateTime)); - Object data = list.get(3); + Object createTime = pigeonVar_list.get(1); + pigeonResult.setCreateTime((Long) createTime); + Object updateTime = pigeonVar_list.get(2); + pigeonResult.setUpdateTime((Long) updateTime); + Object data = pigeonVar_list.get(3); pigeonResult.setData((Map) data); return pigeonResult; } } /** Generated class from Pigeon that represents data sent in messages. */ - public static final class PigeonPipelineSnapshot { - private @NonNull List results; + public static final class InternalPipelineSnapshot { + private @NonNull List results; - public @NonNull List getResults() { + public @NonNull List getResults() { return results; } - public void setResults(@NonNull List setterArg) { + public void setResults(@NonNull List setterArg) { if (setterArg == null) { throw new IllegalStateException("Nonnull field \"results\" is null."); } @@ -998,26 +1311,47 @@ public void setExecutionTime(@NonNull Long setterArg) { } /** Constructor is non-public to enforce null safety; use Builder. */ - PigeonPipelineSnapshot() {} + InternalPipelineSnapshot() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InternalPipelineSnapshot that = (InternalPipelineSnapshot) o; + return pigeonDeepEquals(results, that.results) + && pigeonDeepEquals(executionTime, that.executionTime); + } + + @Override + public int hashCode() { + Object[] fields = new Object[] {getClass(), results, executionTime}; + return pigeonDeepHashCode(fields); + } public static final class Builder { - private @Nullable List results; + private @Nullable List results; - public @NonNull Builder setResults(@NonNull List setterArg) { + @CanIgnoreReturnValue + public @NonNull Builder setResults(@NonNull List setterArg) { this.results = setterArg; return this; } private @Nullable Long executionTime; + @CanIgnoreReturnValue public @NonNull Builder setExecutionTime(@NonNull Long setterArg) { this.executionTime = setterArg; return this; } - public @NonNull PigeonPipelineSnapshot build() { - PigeonPipelineSnapshot pigeonReturn = new PigeonPipelineSnapshot(); + public @NonNull InternalPipelineSnapshot build() { + InternalPipelineSnapshot pigeonReturn = new InternalPipelineSnapshot(); pigeonReturn.setResults(results); pigeonReturn.setExecutionTime(executionTime); return pigeonReturn; @@ -1026,29 +1360,24 @@ public static final class Builder { @NonNull public ArrayList toList() { - ArrayList toListResult = new ArrayList(2); + ArrayList toListResult = new ArrayList<>(2); toListResult.add(results); toListResult.add(executionTime); return toListResult; } - static @NonNull PigeonPipelineSnapshot fromList(@NonNull ArrayList list) { - PigeonPipelineSnapshot pigeonResult = new PigeonPipelineSnapshot(); - Object results = list.get(0); - pigeonResult.setResults((List) results); - Object executionTime = list.get(1); - pigeonResult.setExecutionTime( - (executionTime == null) - ? null - : ((executionTime instanceof Integer) - ? (Integer) executionTime - : (Long) executionTime)); + static @NonNull InternalPipelineSnapshot fromList(@NonNull ArrayList pigeonVar_list) { + InternalPipelineSnapshot pigeonResult = new InternalPipelineSnapshot(); + Object results = pigeonVar_list.get(0); + pigeonResult.setResults((List) results); + Object executionTime = pigeonVar_list.get(1); + pigeonResult.setExecutionTime((Long) executionTime); return pigeonResult; } } /** Generated class from Pigeon that represents data sent in messages. */ - public static final class PigeonGetOptions { + public static final class InternalGetOptions { private @NonNull Source source; public @NonNull Source getSource() { @@ -1076,12 +1405,32 @@ public void setServerTimestampBehavior(@NonNull ServerTimestampBehavior setterAr } /** Constructor is non-public to enforce null safety; use Builder. */ - PigeonGetOptions() {} + InternalGetOptions() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InternalGetOptions that = (InternalGetOptions) o; + return pigeonDeepEquals(source, that.source) + && pigeonDeepEquals(serverTimestampBehavior, that.serverTimestampBehavior); + } + + @Override + public int hashCode() { + Object[] fields = new Object[] {getClass(), source, serverTimestampBehavior}; + return pigeonDeepHashCode(fields); + } public static final class Builder { private @Nullable Source source; + @CanIgnoreReturnValue public @NonNull Builder setSource(@NonNull Source setterArg) { this.source = setterArg; return this; @@ -1089,14 +1438,15 @@ public static final class Builder { private @Nullable ServerTimestampBehavior serverTimestampBehavior; + @CanIgnoreReturnValue public @NonNull Builder setServerTimestampBehavior( @NonNull ServerTimestampBehavior setterArg) { this.serverTimestampBehavior = setterArg; return this; } - public @NonNull PigeonGetOptions build() { - PigeonGetOptions pigeonReturn = new PigeonGetOptions(); + public @NonNull InternalGetOptions build() { + InternalGetOptions pigeonReturn = new InternalGetOptions(); pigeonReturn.setSource(source); pigeonReturn.setServerTimestampBehavior(serverTimestampBehavior); return pigeonReturn; @@ -1105,25 +1455,24 @@ public static final class Builder { @NonNull public ArrayList toList() { - ArrayList toListResult = new ArrayList(2); - toListResult.add(source == null ? null : source.index); - toListResult.add(serverTimestampBehavior == null ? null : serverTimestampBehavior.index); + ArrayList toListResult = new ArrayList<>(2); + toListResult.add(source); + toListResult.add(serverTimestampBehavior); return toListResult; } - static @NonNull PigeonGetOptions fromList(@NonNull ArrayList list) { - PigeonGetOptions pigeonResult = new PigeonGetOptions(); - Object source = list.get(0); - pigeonResult.setSource(Source.values()[(int) source]); - Object serverTimestampBehavior = list.get(1); - pigeonResult.setServerTimestampBehavior( - ServerTimestampBehavior.values()[(int) serverTimestampBehavior]); + static @NonNull InternalGetOptions fromList(@NonNull ArrayList pigeonVar_list) { + InternalGetOptions pigeonResult = new InternalGetOptions(); + Object source = pigeonVar_list.get(0); + pigeonResult.setSource((Source) source); + Object serverTimestampBehavior = pigeonVar_list.get(1); + pigeonResult.setServerTimestampBehavior((ServerTimestampBehavior) serverTimestampBehavior); return pigeonResult; } } /** Generated class from Pigeon that represents data sent in messages. */ - public static final class PigeonDocumentOption { + public static final class InternalDocumentOption { private @Nullable Boolean merge; public @Nullable Boolean getMerge() { @@ -1144,10 +1493,29 @@ public void setMergeFields(@Nullable List> setterArg) { this.mergeFields = setterArg; } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InternalDocumentOption that = (InternalDocumentOption) o; + return pigeonDeepEquals(merge, that.merge) && pigeonDeepEquals(mergeFields, that.mergeFields); + } + + @Override + public int hashCode() { + Object[] fields = new Object[] {getClass(), merge, mergeFields}; + return pigeonDeepHashCode(fields); + } + public static final class Builder { private @Nullable Boolean merge; + @CanIgnoreReturnValue public @NonNull Builder setMerge(@Nullable Boolean setterArg) { this.merge = setterArg; return this; @@ -1155,13 +1523,14 @@ public static final class Builder { private @Nullable List> mergeFields; + @CanIgnoreReturnValue public @NonNull Builder setMergeFields(@Nullable List> setterArg) { this.mergeFields = setterArg; return this; } - public @NonNull PigeonDocumentOption build() { - PigeonDocumentOption pigeonReturn = new PigeonDocumentOption(); + public @NonNull InternalDocumentOption build() { + InternalDocumentOption pigeonReturn = new InternalDocumentOption(); pigeonReturn.setMerge(merge); pigeonReturn.setMergeFields(mergeFields); return pigeonReturn; @@ -1170,31 +1539,31 @@ public static final class Builder { @NonNull public ArrayList toList() { - ArrayList toListResult = new ArrayList(2); + ArrayList toListResult = new ArrayList<>(2); toListResult.add(merge); toListResult.add(mergeFields); return toListResult; } - static @NonNull PigeonDocumentOption fromList(@NonNull ArrayList list) { - PigeonDocumentOption pigeonResult = new PigeonDocumentOption(); - Object merge = list.get(0); + static @NonNull InternalDocumentOption fromList(@NonNull ArrayList pigeonVar_list) { + InternalDocumentOption pigeonResult = new InternalDocumentOption(); + Object merge = pigeonVar_list.get(0); pigeonResult.setMerge((Boolean) merge); - Object mergeFields = list.get(1); + Object mergeFields = pigeonVar_list.get(1); pigeonResult.setMergeFields((List>) mergeFields); return pigeonResult; } } /** Generated class from Pigeon that represents data sent in messages. */ - public static final class PigeonTransactionCommand { - private @NonNull PigeonTransactionType type; + public static final class InternalTransactionCommand { + private @NonNull InternalTransactionType type; - public @NonNull PigeonTransactionType getType() { + public @NonNull InternalTransactionType getType() { return type; } - public void setType(@NonNull PigeonTransactionType setterArg) { + public void setType(@NonNull InternalTransactionType setterArg) { if (setterArg == null) { throw new IllegalStateException("Nonnull field \"type\" is null."); } @@ -1224,30 +1593,53 @@ public void setData(@Nullable Map setterArg) { this.data = setterArg; } - private @Nullable PigeonDocumentOption option; + private @Nullable InternalDocumentOption option; - public @Nullable PigeonDocumentOption getOption() { + public @Nullable InternalDocumentOption getOption() { return option; } - public void setOption(@Nullable PigeonDocumentOption setterArg) { + public void setOption(@Nullable InternalDocumentOption setterArg) { this.option = setterArg; } /** Constructor is non-public to enforce null safety; use Builder. */ - PigeonTransactionCommand() {} + InternalTransactionCommand() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InternalTransactionCommand that = (InternalTransactionCommand) o; + return pigeonDeepEquals(type, that.type) + && pigeonDeepEquals(path, that.path) + && pigeonDeepEquals(data, that.data) + && pigeonDeepEquals(option, that.option); + } + + @Override + public int hashCode() { + Object[] fields = new Object[] {getClass(), type, path, data, option}; + return pigeonDeepHashCode(fields); + } public static final class Builder { - private @Nullable PigeonTransactionType type; + private @Nullable InternalTransactionType type; - public @NonNull Builder setType(@NonNull PigeonTransactionType setterArg) { + @CanIgnoreReturnValue + public @NonNull Builder setType(@NonNull InternalTransactionType setterArg) { this.type = setterArg; return this; } private @Nullable String path; + @CanIgnoreReturnValue public @NonNull Builder setPath(@NonNull String setterArg) { this.path = setterArg; return this; @@ -1255,20 +1647,22 @@ public static final class Builder { private @Nullable Map data; + @CanIgnoreReturnValue public @NonNull Builder setData(@Nullable Map setterArg) { this.data = setterArg; return this; } - private @Nullable PigeonDocumentOption option; + private @Nullable InternalDocumentOption option; - public @NonNull Builder setOption(@Nullable PigeonDocumentOption setterArg) { + @CanIgnoreReturnValue + public @NonNull Builder setOption(@Nullable InternalDocumentOption setterArg) { this.option = setterArg; return this; } - public @NonNull PigeonTransactionCommand build() { - PigeonTransactionCommand pigeonReturn = new PigeonTransactionCommand(); + public @NonNull InternalTransactionCommand build() { + InternalTransactionCommand pigeonReturn = new InternalTransactionCommand(); pigeonReturn.setType(type); pigeonReturn.setPath(path); pigeonReturn.setData(data); @@ -1279,25 +1673,24 @@ public static final class Builder { @NonNull public ArrayList toList() { - ArrayList toListResult = new ArrayList(4); - toListResult.add(type == null ? null : type.index); + ArrayList toListResult = new ArrayList<>(4); + toListResult.add(type); toListResult.add(path); toListResult.add(data); - toListResult.add((option == null) ? null : option.toList()); + toListResult.add(option); return toListResult; } - static @NonNull PigeonTransactionCommand fromList(@NonNull ArrayList list) { - PigeonTransactionCommand pigeonResult = new PigeonTransactionCommand(); - Object type = list.get(0); - pigeonResult.setType(PigeonTransactionType.values()[(int) type]); - Object path = list.get(1); + static @NonNull InternalTransactionCommand fromList(@NonNull ArrayList pigeonVar_list) { + InternalTransactionCommand pigeonResult = new InternalTransactionCommand(); + Object type = pigeonVar_list.get(0); + pigeonResult.setType((InternalTransactionType) type); + Object path = pigeonVar_list.get(1); pigeonResult.setPath((String) path); - Object data = list.get(2); + Object data = pigeonVar_list.get(2); pigeonResult.setData((Map) data); - Object option = list.get(3); - pigeonResult.setOption( - (option == null) ? null : PigeonDocumentOption.fromList((ArrayList) option)); + Object option = pigeonVar_list.get(3); + pigeonResult.setOption((InternalDocumentOption) option); return pigeonResult; } } @@ -1327,13 +1720,13 @@ public void setData(@Nullable Map setterArg) { this.data = setterArg; } - private @Nullable PigeonDocumentOption option; + private @Nullable InternalDocumentOption option; - public @Nullable PigeonDocumentOption getOption() { + public @Nullable InternalDocumentOption getOption() { return option; } - public void setOption(@Nullable PigeonDocumentOption setterArg) { + public void setOption(@Nullable InternalDocumentOption setterArg) { this.option = setterArg; } @@ -1360,10 +1753,34 @@ public void setServerTimestampBehavior(@Nullable ServerTimestampBehavior setterA /** Constructor is non-public to enforce null safety; use Builder. */ DocumentReferenceRequest() {} + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DocumentReferenceRequest that = (DocumentReferenceRequest) o; + return pigeonDeepEquals(path, that.path) + && pigeonDeepEquals(data, that.data) + && pigeonDeepEquals(option, that.option) + && pigeonDeepEquals(source, that.source) + && pigeonDeepEquals(serverTimestampBehavior, that.serverTimestampBehavior); + } + + @Override + public int hashCode() { + Object[] fields = + new Object[] {getClass(), path, data, option, source, serverTimestampBehavior}; + return pigeonDeepHashCode(fields); + } + public static final class Builder { private @Nullable String path; + @CanIgnoreReturnValue public @NonNull Builder setPath(@NonNull String setterArg) { this.path = setterArg; return this; @@ -1371,20 +1788,23 @@ public static final class Builder { private @Nullable Map data; + @CanIgnoreReturnValue public @NonNull Builder setData(@Nullable Map setterArg) { this.data = setterArg; return this; } - private @Nullable PigeonDocumentOption option; + private @Nullable InternalDocumentOption option; - public @NonNull Builder setOption(@Nullable PigeonDocumentOption setterArg) { + @CanIgnoreReturnValue + public @NonNull Builder setOption(@Nullable InternalDocumentOption setterArg) { this.option = setterArg; return this; } private @Nullable Source source; + @CanIgnoreReturnValue public @NonNull Builder setSource(@Nullable Source setterArg) { this.source = setterArg; return this; @@ -1392,6 +1812,7 @@ public static final class Builder { private @Nullable ServerTimestampBehavior serverTimestampBehavior; + @CanIgnoreReturnValue public @NonNull Builder setServerTimestampBehavior( @Nullable ServerTimestampBehavior setterArg) { this.serverTimestampBehavior = setterArg; @@ -1411,37 +1832,33 @@ public static final class Builder { @NonNull public ArrayList toList() { - ArrayList toListResult = new ArrayList(5); + ArrayList toListResult = new ArrayList<>(5); toListResult.add(path); toListResult.add(data); - toListResult.add((option == null) ? null : option.toList()); - toListResult.add(source == null ? null : source.index); - toListResult.add(serverTimestampBehavior == null ? null : serverTimestampBehavior.index); + toListResult.add(option); + toListResult.add(source); + toListResult.add(serverTimestampBehavior); return toListResult; } - static @NonNull DocumentReferenceRequest fromList(@NonNull ArrayList list) { + static @NonNull DocumentReferenceRequest fromList(@NonNull ArrayList pigeonVar_list) { DocumentReferenceRequest pigeonResult = new DocumentReferenceRequest(); - Object path = list.get(0); + Object path = pigeonVar_list.get(0); pigeonResult.setPath((String) path); - Object data = list.get(1); + Object data = pigeonVar_list.get(1); pigeonResult.setData((Map) data); - Object option = list.get(2); - pigeonResult.setOption( - (option == null) ? null : PigeonDocumentOption.fromList((ArrayList) option)); - Object source = list.get(3); - pigeonResult.setSource(source == null ? null : Source.values()[(int) source]); - Object serverTimestampBehavior = list.get(4); - pigeonResult.setServerTimestampBehavior( - serverTimestampBehavior == null - ? null - : ServerTimestampBehavior.values()[(int) serverTimestampBehavior]); + Object option = pigeonVar_list.get(2); + pigeonResult.setOption((InternalDocumentOption) option); + Object source = pigeonVar_list.get(3); + pigeonResult.setSource((Source) source); + Object serverTimestampBehavior = pigeonVar_list.get(4); + pigeonResult.setServerTimestampBehavior((ServerTimestampBehavior) serverTimestampBehavior); return pigeonResult; } } /** Generated class from Pigeon that represents data sent in messages. */ - public static final class PigeonQueryParameters { + public static final class InternalQueryParameters { private @Nullable List> where; public @Nullable List> getWhere() { @@ -1532,10 +1949,49 @@ public void setFilters(@Nullable Map setterArg) { this.filters = setterArg; } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InternalQueryParameters that = (InternalQueryParameters) o; + return pigeonDeepEquals(where, that.where) + && pigeonDeepEquals(orderBy, that.orderBy) + && pigeonDeepEquals(limit, that.limit) + && pigeonDeepEquals(limitToLast, that.limitToLast) + && pigeonDeepEquals(startAt, that.startAt) + && pigeonDeepEquals(startAfter, that.startAfter) + && pigeonDeepEquals(endAt, that.endAt) + && pigeonDeepEquals(endBefore, that.endBefore) + && pigeonDeepEquals(filters, that.filters); + } + + @Override + public int hashCode() { + Object[] fields = + new Object[] { + getClass(), + where, + orderBy, + limit, + limitToLast, + startAt, + startAfter, + endAt, + endBefore, + filters + }; + return pigeonDeepHashCode(fields); + } + public static final class Builder { private @Nullable List> where; + @CanIgnoreReturnValue public @NonNull Builder setWhere(@Nullable List> setterArg) { this.where = setterArg; return this; @@ -1543,6 +1999,7 @@ public static final class Builder { private @Nullable List> orderBy; + @CanIgnoreReturnValue public @NonNull Builder setOrderBy(@Nullable List> setterArg) { this.orderBy = setterArg; return this; @@ -1550,6 +2007,7 @@ public static final class Builder { private @Nullable Long limit; + @CanIgnoreReturnValue public @NonNull Builder setLimit(@Nullable Long setterArg) { this.limit = setterArg; return this; @@ -1557,6 +2015,7 @@ public static final class Builder { private @Nullable Long limitToLast; + @CanIgnoreReturnValue public @NonNull Builder setLimitToLast(@Nullable Long setterArg) { this.limitToLast = setterArg; return this; @@ -1564,6 +2023,7 @@ public static final class Builder { private @Nullable List startAt; + @CanIgnoreReturnValue public @NonNull Builder setStartAt(@Nullable List setterArg) { this.startAt = setterArg; return this; @@ -1571,6 +2031,7 @@ public static final class Builder { private @Nullable List startAfter; + @CanIgnoreReturnValue public @NonNull Builder setStartAfter(@Nullable List setterArg) { this.startAfter = setterArg; return this; @@ -1578,6 +2039,7 @@ public static final class Builder { private @Nullable List endAt; + @CanIgnoreReturnValue public @NonNull Builder setEndAt(@Nullable List setterArg) { this.endAt = setterArg; return this; @@ -1585,6 +2047,7 @@ public static final class Builder { private @Nullable List endBefore; + @CanIgnoreReturnValue public @NonNull Builder setEndBefore(@Nullable List setterArg) { this.endBefore = setterArg; return this; @@ -1592,13 +2055,14 @@ public static final class Builder { private @Nullable Map filters; + @CanIgnoreReturnValue public @NonNull Builder setFilters(@Nullable Map setterArg) { this.filters = setterArg; return this; } - public @NonNull PigeonQueryParameters build() { - PigeonQueryParameters pigeonReturn = new PigeonQueryParameters(); + public @NonNull InternalQueryParameters build() { + InternalQueryParameters pigeonReturn = new InternalQueryParameters(); pigeonReturn.setWhere(where); pigeonReturn.setOrderBy(orderBy); pigeonReturn.setLimit(limit); @@ -1614,7 +2078,7 @@ public static final class Builder { @NonNull public ArrayList toList() { - ArrayList toListResult = new ArrayList(9); + ArrayList toListResult = new ArrayList<>(9); toListResult.add(where); toListResult.add(orderBy); toListResult.add(limit); @@ -1627,29 +2091,25 @@ public ArrayList toList() { return toListResult; } - static @NonNull PigeonQueryParameters fromList(@NonNull ArrayList list) { - PigeonQueryParameters pigeonResult = new PigeonQueryParameters(); - Object where = list.get(0); + static @NonNull InternalQueryParameters fromList(@NonNull ArrayList pigeonVar_list) { + InternalQueryParameters pigeonResult = new InternalQueryParameters(); + Object where = pigeonVar_list.get(0); pigeonResult.setWhere((List>) where); - Object orderBy = list.get(1); + Object orderBy = pigeonVar_list.get(1); pigeonResult.setOrderBy((List>) orderBy); - Object limit = list.get(2); - pigeonResult.setLimit( - (limit == null) ? null : ((limit instanceof Integer) ? (Integer) limit : (Long) limit)); - Object limitToLast = list.get(3); - pigeonResult.setLimitToLast( - (limitToLast == null) - ? null - : ((limitToLast instanceof Integer) ? (Integer) limitToLast : (Long) limitToLast)); - Object startAt = list.get(4); + Object limit = pigeonVar_list.get(2); + pigeonResult.setLimit((Long) limit); + Object limitToLast = pigeonVar_list.get(3); + pigeonResult.setLimitToLast((Long) limitToLast); + Object startAt = pigeonVar_list.get(4); pigeonResult.setStartAt((List) startAt); - Object startAfter = list.get(5); + Object startAfter = pigeonVar_list.get(5); pigeonResult.setStartAfter((List) startAfter); - Object endAt = list.get(6); + Object endAt = pigeonVar_list.get(6); pigeonResult.setEndAt((List) endAt); - Object endBefore = list.get(7); + Object endBefore = pigeonVar_list.get(7); pigeonResult.setEndBefore((List) endBefore); - Object filters = list.get(8); + Object filters = pigeonVar_list.get(8); pigeonResult.setFilters((Map) filters); return pigeonResult; } @@ -1683,10 +2143,29 @@ public void setField(@Nullable String setterArg) { /** Constructor is non-public to enforce null safety; use Builder. */ AggregateQuery() {} + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AggregateQuery that = (AggregateQuery) o; + return pigeonDeepEquals(type, that.type) && pigeonDeepEquals(field, that.field); + } + + @Override + public int hashCode() { + Object[] fields = new Object[] {getClass(), type, field}; + return pigeonDeepHashCode(fields); + } + public static final class Builder { private @Nullable AggregateType type; + @CanIgnoreReturnValue public @NonNull Builder setType(@NonNull AggregateType setterArg) { this.type = setterArg; return this; @@ -1694,6 +2173,7 @@ public static final class Builder { private @Nullable String field; + @CanIgnoreReturnValue public @NonNull Builder setField(@Nullable String setterArg) { this.field = setterArg; return this; @@ -1709,17 +2189,17 @@ public static final class Builder { @NonNull public ArrayList toList() { - ArrayList toListResult = new ArrayList(2); - toListResult.add(type == null ? null : type.index); + ArrayList toListResult = new ArrayList<>(2); + toListResult.add(type); toListResult.add(field); return toListResult; } - static @NonNull AggregateQuery fromList(@NonNull ArrayList list) { + static @NonNull AggregateQuery fromList(@NonNull ArrayList pigeonVar_list) { AggregateQuery pigeonResult = new AggregateQuery(); - Object type = list.get(0); - pigeonResult.setType(AggregateType.values()[(int) type]); - Object field = list.get(1); + Object type = pigeonVar_list.get(0); + pigeonResult.setType((AggregateType) type); + Object field = pigeonVar_list.get(1); pigeonResult.setField((String) field); return pigeonResult; } @@ -1763,10 +2243,31 @@ public void setValue(@Nullable Double setterArg) { /** Constructor is non-public to enforce null safety; use Builder. */ AggregateQueryResponse() {} + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AggregateQueryResponse that = (AggregateQueryResponse) o; + return pigeonDeepEquals(type, that.type) + && pigeonDeepEquals(field, that.field) + && pigeonDeepEquals(value, that.value); + } + + @Override + public int hashCode() { + Object[] fields = new Object[] {getClass(), type, field, value}; + return pigeonDeepHashCode(fields); + } + public static final class Builder { private @Nullable AggregateType type; + @CanIgnoreReturnValue public @NonNull Builder setType(@NonNull AggregateType setterArg) { this.type = setterArg; return this; @@ -1774,6 +2275,7 @@ public static final class Builder { private @Nullable String field; + @CanIgnoreReturnValue public @NonNull Builder setField(@Nullable String setterArg) { this.field = setterArg; return this; @@ -1781,6 +2283,7 @@ public static final class Builder { private @Nullable Double value; + @CanIgnoreReturnValue public @NonNull Builder setValue(@Nullable Double setterArg) { this.value = setterArg; return this; @@ -1797,71 +2300,116 @@ public static final class Builder { @NonNull public ArrayList toList() { - ArrayList toListResult = new ArrayList(3); - toListResult.add(type == null ? null : type.index); + ArrayList toListResult = new ArrayList<>(3); + toListResult.add(type); toListResult.add(field); toListResult.add(value); return toListResult; } - static @NonNull AggregateQueryResponse fromList(@NonNull ArrayList list) { + static @NonNull AggregateQueryResponse fromList(@NonNull ArrayList pigeonVar_list) { AggregateQueryResponse pigeonResult = new AggregateQueryResponse(); - Object type = list.get(0); - pigeonResult.setType(AggregateType.values()[(int) type]); - Object field = list.get(1); + Object type = pigeonVar_list.get(0); + pigeonResult.setType((AggregateType) type); + Object field = pigeonVar_list.get(1); pigeonResult.setField((String) field); - Object value = list.get(2); + Object value = pigeonVar_list.get(2); pigeonResult.setValue((Double) value); return pigeonResult; } } - public interface Result { - @SuppressWarnings("UnknownNullness") - void success(T result); - - void error(@NonNull Throwable error); - } - - private static class FirebaseFirestoreHostApiCodec extends FlutterFirebaseFirestoreMessageCodec { - public static final FirebaseFirestoreHostApiCodec INSTANCE = - new FirebaseFirestoreHostApiCodec(); + public static class PigeonCodec extends FlutterFirebaseFirestoreMessageCodec { + public static final PigeonCodec INSTANCE = new PigeonCodec(); - private FirebaseFirestoreHostApiCodec() {} + private PigeonCodec() {} @Override protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { switch (type) { - case (byte) 128: - return AggregateQuery.fromList((ArrayList) readValue(buffer)); case (byte) 129: - return AggregateQueryResponse.fromList((ArrayList) readValue(buffer)); + { + Object value = readValue(buffer); + return value == null ? null : DocumentChangeType.values()[((Long) value).intValue()]; + } case (byte) 130: - return DocumentReferenceRequest.fromList((ArrayList) readValue(buffer)); + { + Object value = readValue(buffer); + return value == null ? null : Source.values()[((Long) value).intValue()]; + } case (byte) 131: - return FirestorePigeonFirebaseApp.fromList((ArrayList) readValue(buffer)); + { + Object value = readValue(buffer); + return value == null ? null : ListenSource.values()[((Long) value).intValue()]; + } case (byte) 132: - return PigeonDocumentChange.fromList((ArrayList) readValue(buffer)); + { + Object value = readValue(buffer); + return value == null + ? null + : ServerTimestampBehavior.values()[((Long) value).intValue()]; + } case (byte) 133: - return PigeonDocumentOption.fromList((ArrayList) readValue(buffer)); + { + Object value = readValue(buffer); + return value == null ? null : AggregateSource.values()[((Long) value).intValue()]; + } case (byte) 134: - return PigeonDocumentSnapshot.fromList((ArrayList) readValue(buffer)); + { + Object value = readValue(buffer); + return value == null + ? null + : PersistenceCacheIndexManagerRequest.values()[((Long) value).intValue()]; + } case (byte) 135: - return PigeonFirebaseSettings.fromList((ArrayList) readValue(buffer)); + { + Object value = readValue(buffer); + return value == null + ? null + : InternalTransactionResult.values()[((Long) value).intValue()]; + } case (byte) 136: - return PigeonGetOptions.fromList((ArrayList) readValue(buffer)); + { + Object value = readValue(buffer); + return value == null + ? null + : InternalTransactionType.values()[((Long) value).intValue()]; + } case (byte) 137: - return PigeonPipelineResult.fromList((ArrayList) readValue(buffer)); + { + Object value = readValue(buffer); + return value == null ? null : AggregateType.values()[((Long) value).intValue()]; + } case (byte) 138: - return PigeonPipelineSnapshot.fromList((ArrayList) readValue(buffer)); + return InternalFirebaseSettings.fromList((ArrayList) readValue(buffer)); case (byte) 139: - return PigeonQueryParameters.fromList((ArrayList) readValue(buffer)); + return FirestorePigeonFirebaseApp.fromList((ArrayList) readValue(buffer)); case (byte) 140: - return PigeonQuerySnapshot.fromList((ArrayList) readValue(buffer)); + return InternalSnapshotMetadata.fromList((ArrayList) readValue(buffer)); case (byte) 141: - return PigeonSnapshotMetadata.fromList((ArrayList) readValue(buffer)); + return InternalDocumentSnapshot.fromList((ArrayList) readValue(buffer)); case (byte) 142: - return PigeonTransactionCommand.fromList((ArrayList) readValue(buffer)); + return InternalDocumentChange.fromList((ArrayList) readValue(buffer)); + case (byte) 143: + return InternalQuerySnapshot.fromList((ArrayList) readValue(buffer)); + case (byte) 144: + return InternalPipelineResult.fromList((ArrayList) readValue(buffer)); + case (byte) 145: + return InternalPipelineSnapshot.fromList((ArrayList) readValue(buffer)); + case (byte) 146: + return InternalGetOptions.fromList((ArrayList) readValue(buffer)); + case (byte) 147: + return InternalDocumentOption.fromList((ArrayList) readValue(buffer)); + case (byte) 148: + return InternalTransactionCommand.fromList((ArrayList) readValue(buffer)); + case (byte) 149: + return DocumentReferenceRequest.fromList((ArrayList) readValue(buffer)); + case (byte) 150: + return InternalQueryParameters.fromList((ArrayList) readValue(buffer)); + case (byte) 151: + return AggregateQuery.fromList((ArrayList) readValue(buffer)); + case (byte) 152: + return AggregateQueryResponse.fromList((ArrayList) readValue(buffer)); default: return super.readValueOfType(type, buffer); } @@ -1869,57 +2417,109 @@ protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { @Override protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { - if (value instanceof AggregateQuery) { - stream.write(128); - writeValue(stream, ((AggregateQuery) value).toList()); - } else if (value instanceof AggregateQueryResponse) { + if (value instanceof DocumentChangeType) { stream.write(129); - writeValue(stream, ((AggregateQueryResponse) value).toList()); - } else if (value instanceof DocumentReferenceRequest) { + writeValue(stream, value == null ? null : ((DocumentChangeType) value).index); + } else if (value instanceof Source) { stream.write(130); - writeValue(stream, ((DocumentReferenceRequest) value).toList()); - } else if (value instanceof FirestorePigeonFirebaseApp) { + writeValue(stream, value == null ? null : ((Source) value).index); + } else if (value instanceof ListenSource) { stream.write(131); - writeValue(stream, ((FirestorePigeonFirebaseApp) value).toList()); - } else if (value instanceof PigeonDocumentChange) { + writeValue(stream, value == null ? null : ((ListenSource) value).index); + } else if (value instanceof ServerTimestampBehavior) { stream.write(132); - writeValue(stream, ((PigeonDocumentChange) value).toList()); - } else if (value instanceof PigeonDocumentOption) { + writeValue(stream, value == null ? null : ((ServerTimestampBehavior) value).index); + } else if (value instanceof AggregateSource) { stream.write(133); - writeValue(stream, ((PigeonDocumentOption) value).toList()); - } else if (value instanceof PigeonDocumentSnapshot) { + writeValue(stream, value == null ? null : ((AggregateSource) value).index); + } else if (value instanceof PersistenceCacheIndexManagerRequest) { stream.write(134); - writeValue(stream, ((PigeonDocumentSnapshot) value).toList()); - } else if (value instanceof PigeonFirebaseSettings) { + writeValue( + stream, value == null ? null : ((PersistenceCacheIndexManagerRequest) value).index); + } else if (value instanceof InternalTransactionResult) { stream.write(135); - writeValue(stream, ((PigeonFirebaseSettings) value).toList()); - } else if (value instanceof PigeonGetOptions) { + writeValue(stream, value == null ? null : ((InternalTransactionResult) value).index); + } else if (value instanceof InternalTransactionType) { stream.write(136); - writeValue(stream, ((PigeonGetOptions) value).toList()); - } else if (value instanceof PigeonPipelineResult) { + writeValue(stream, value == null ? null : ((InternalTransactionType) value).index); + } else if (value instanceof AggregateType) { stream.write(137); - writeValue(stream, ((PigeonPipelineResult) value).toList()); - } else if (value instanceof PigeonPipelineSnapshot) { + writeValue(stream, value == null ? null : ((AggregateType) value).index); + } else if (value instanceof InternalFirebaseSettings) { stream.write(138); - writeValue(stream, ((PigeonPipelineSnapshot) value).toList()); - } else if (value instanceof PigeonQueryParameters) { + writeValue(stream, ((InternalFirebaseSettings) value).toList()); + } else if (value instanceof FirestorePigeonFirebaseApp) { stream.write(139); - writeValue(stream, ((PigeonQueryParameters) value).toList()); - } else if (value instanceof PigeonQuerySnapshot) { + writeValue(stream, ((FirestorePigeonFirebaseApp) value).toList()); + } else if (value instanceof InternalSnapshotMetadata) { stream.write(140); - writeValue(stream, ((PigeonQuerySnapshot) value).toList()); - } else if (value instanceof PigeonSnapshotMetadata) { + writeValue(stream, ((InternalSnapshotMetadata) value).toList()); + } else if (value instanceof InternalDocumentSnapshot) { stream.write(141); - writeValue(stream, ((PigeonSnapshotMetadata) value).toList()); - } else if (value instanceof PigeonTransactionCommand) { + writeValue(stream, ((InternalDocumentSnapshot) value).toList()); + } else if (value instanceof InternalDocumentChange) { stream.write(142); - writeValue(stream, ((PigeonTransactionCommand) value).toList()); + writeValue(stream, ((InternalDocumentChange) value).toList()); + } else if (value instanceof InternalQuerySnapshot) { + stream.write(143); + writeValue(stream, ((InternalQuerySnapshot) value).toList()); + } else if (value instanceof InternalPipelineResult) { + stream.write(144); + writeValue(stream, ((InternalPipelineResult) value).toList()); + } else if (value instanceof InternalPipelineSnapshot) { + stream.write(145); + writeValue(stream, ((InternalPipelineSnapshot) value).toList()); + } else if (value instanceof InternalGetOptions) { + stream.write(146); + writeValue(stream, ((InternalGetOptions) value).toList()); + } else if (value instanceof InternalDocumentOption) { + stream.write(147); + writeValue(stream, ((InternalDocumentOption) value).toList()); + } else if (value instanceof InternalTransactionCommand) { + stream.write(148); + writeValue(stream, ((InternalTransactionCommand) value).toList()); + } else if (value instanceof DocumentReferenceRequest) { + stream.write(149); + writeValue(stream, ((DocumentReferenceRequest) value).toList()); + } else if (value instanceof InternalQueryParameters) { + stream.write(150); + writeValue(stream, ((InternalQueryParameters) value).toList()); + } else if (value instanceof AggregateQuery) { + stream.write(151); + writeValue(stream, ((AggregateQuery) value).toList()); + } else if (value instanceof AggregateQueryResponse) { + stream.write(152); + writeValue(stream, ((AggregateQueryResponse) value).toList()); } else { super.writeValue(stream, value); } } } + /** Asynchronous error handling return type for non-nullable API method returns. */ + public interface Result { + /** Success case callback method for handling returns. */ + void success(@NonNull T result); + + /** Failure case callback method for handling errors. */ + void error(@NonNull Throwable error); + } + /** Asynchronous error handling return type for nullable API method returns. */ + public interface NullableResult { + /** Success case callback method for handling returns. */ + void success(@Nullable T result); + + /** Failure case callback method for handling errors. */ + void error(@NonNull Throwable error); + } + /** Asynchronous error handling return type for void API method returns. */ + public interface VoidResult { + /** Success case callback method for handling returns. */ + void success(); + + /** Failure case callback method for handling errors. */ + void error(@NonNull Throwable error); + } /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface FirebaseFirestoreHostApi { @@ -1931,26 +2531,25 @@ void loadBundle( void namedQueryGet( @NonNull FirestorePigeonFirebaseApp app, @NonNull String name, - @NonNull PigeonGetOptions options, - @NonNull Result result); + @NonNull InternalGetOptions options, + @NonNull Result result); - void clearPersistence(@NonNull FirestorePigeonFirebaseApp app, @NonNull Result result); + void clearPersistence(@NonNull FirestorePigeonFirebaseApp app, @NonNull VoidResult result); - void disableNetwork(@NonNull FirestorePigeonFirebaseApp app, @NonNull Result result); + void disableNetwork(@NonNull FirestorePigeonFirebaseApp app, @NonNull VoidResult result); - void enableNetwork(@NonNull FirestorePigeonFirebaseApp app, @NonNull Result result); + void enableNetwork(@NonNull FirestorePigeonFirebaseApp app, @NonNull VoidResult result); - void terminate(@NonNull FirestorePigeonFirebaseApp app, @NonNull Result result); + void terminate(@NonNull FirestorePigeonFirebaseApp app, @NonNull VoidResult result); - void waitForPendingWrites( - @NonNull FirestorePigeonFirebaseApp app, @NonNull Result result); + void waitForPendingWrites(@NonNull FirestorePigeonFirebaseApp app, @NonNull VoidResult result); void setIndexConfiguration( @NonNull FirestorePigeonFirebaseApp app, @NonNull String indexConfiguration, - @NonNull Result result); + @NonNull VoidResult result); - void setLoggingEnabled(@NonNull Boolean loggingEnabled, @NonNull Result result); + void setLoggingEnabled(@NonNull Boolean loggingEnabled, @NonNull VoidResult result); void snapshotsInSyncSetup( @NonNull FirestorePigeonFirebaseApp app, @NonNull Result result); @@ -1963,48 +2562,48 @@ void transactionCreate( void transactionStoreResult( @NonNull String transactionId, - @NonNull PigeonTransactionResult resultType, - @Nullable List commands, - @NonNull Result result); + @NonNull InternalTransactionResult resultType, + @Nullable List commands, + @NonNull VoidResult result); void transactionGet( @NonNull FirestorePigeonFirebaseApp app, @NonNull String transactionId, @NonNull String path, - @NonNull Result result); + @NonNull Result result); void documentReferenceSet( @NonNull FirestorePigeonFirebaseApp app, @NonNull DocumentReferenceRequest request, - @NonNull Result result); + @NonNull VoidResult result); void documentReferenceUpdate( @NonNull FirestorePigeonFirebaseApp app, @NonNull DocumentReferenceRequest request, - @NonNull Result result); + @NonNull VoidResult result); void documentReferenceGet( @NonNull FirestorePigeonFirebaseApp app, @NonNull DocumentReferenceRequest request, - @NonNull Result result); + @NonNull Result result); void documentReferenceDelete( @NonNull FirestorePigeonFirebaseApp app, @NonNull DocumentReferenceRequest request, - @NonNull Result result); + @NonNull VoidResult result); void queryGet( @NonNull FirestorePigeonFirebaseApp app, @NonNull String path, @NonNull Boolean isCollectionGroup, - @NonNull PigeonQueryParameters parameters, - @NonNull PigeonGetOptions options, - @NonNull Result result); + @NonNull InternalQueryParameters parameters, + @NonNull InternalGetOptions options, + @NonNull Result result); void aggregateQuery( @NonNull FirestorePigeonFirebaseApp app, @NonNull String path, - @NonNull PigeonQueryParameters parameters, + @NonNull InternalQueryParameters parameters, @NonNull AggregateSource source, @NonNull List queries, @NonNull Boolean isCollectionGroup, @@ -2012,15 +2611,15 @@ void aggregateQuery( void writeBatchCommit( @NonNull FirestorePigeonFirebaseApp app, - @NonNull List writes, - @NonNull Result result); + @NonNull List writes, + @NonNull VoidResult result); void querySnapshot( @NonNull FirestorePigeonFirebaseApp app, @NonNull String path, @NonNull Boolean isCollectionGroup, - @NonNull PigeonQueryParameters parameters, - @NonNull PigeonGetOptions options, + @NonNull InternalQueryParameters parameters, + @NonNull InternalGetOptions options, @NonNull Boolean includeMetadataChanges, @NonNull ListenSource source, @NonNull Result result); @@ -2035,34 +2634,43 @@ void documentReferenceSnapshot( void persistenceCacheIndexManagerRequest( @NonNull FirestorePigeonFirebaseApp app, @NonNull PersistenceCacheIndexManagerRequest request, - @NonNull Result result); + @NonNull VoidResult result); void executePipeline( @NonNull FirestorePigeonFirebaseApp app, @NonNull List> stages, @Nullable Map options, - @NonNull Result result); + @NonNull Result result); /** The codec used by FirebaseFirestoreHostApi. */ static @NonNull MessageCodec getCodec() { - return FirebaseFirestoreHostApiCodec.INSTANCE; + return PigeonCodec.INSTANCE; } /** * Sets up an instance of `FirebaseFirestoreHostApi` to handle messages through the * `binaryMessenger`. */ - static void setup( + static void setUp( @NonNull BinaryMessenger binaryMessenger, @Nullable FirebaseFirestoreHostApi api) { + setUp(binaryMessenger, "", api); + } + + static void setUp( + @NonNull BinaryMessenger binaryMessenger, + @NonNull String messageChannelSuffix, + @Nullable FirebaseFirestoreHostApi api) { + messageChannelSuffix = messageChannelSuffix.isEmpty() ? "" : "." + messageChannelSuffix; { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.loadBundle", + "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.loadBundle" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; FirestorePigeonFirebaseApp appArg = (FirestorePigeonFirebaseApp) args.get(0); byte[] bundleArg = (byte[]) args.get(1); @@ -2089,19 +2697,20 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.namedQueryGet", + "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.namedQueryGet" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; FirestorePigeonFirebaseApp appArg = (FirestorePigeonFirebaseApp) args.get(0); String nameArg = (String) args.get(1); - PigeonGetOptions optionsArg = (PigeonGetOptions) args.get(2); - Result resultCallback = - new Result() { - public void success(PigeonQuerySnapshot result) { + InternalGetOptions optionsArg = (InternalGetOptions) args.get(2); + Result resultCallback = + new Result() { + public void success(InternalQuerySnapshot result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -2122,17 +2731,18 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.clearPersistence", + "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.clearPersistence" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; FirestorePigeonFirebaseApp appArg = (FirestorePigeonFirebaseApp) args.get(0); - Result resultCallback = - new Result() { - public void success(Void result) { + VoidResult resultCallback = + new VoidResult() { + public void success() { wrapped.add(0, null); reply.reply(wrapped); } @@ -2153,17 +2763,18 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.disableNetwork", + "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.disableNetwork" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; FirestorePigeonFirebaseApp appArg = (FirestorePigeonFirebaseApp) args.get(0); - Result resultCallback = - new Result() { - public void success(Void result) { + VoidResult resultCallback = + new VoidResult() { + public void success() { wrapped.add(0, null); reply.reply(wrapped); } @@ -2184,17 +2795,18 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.enableNetwork", + "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.enableNetwork" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; FirestorePigeonFirebaseApp appArg = (FirestorePigeonFirebaseApp) args.get(0); - Result resultCallback = - new Result() { - public void success(Void result) { + VoidResult resultCallback = + new VoidResult() { + public void success() { wrapped.add(0, null); reply.reply(wrapped); } @@ -2215,17 +2827,18 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.terminate", + "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.terminate" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; FirestorePigeonFirebaseApp appArg = (FirestorePigeonFirebaseApp) args.get(0); - Result resultCallback = - new Result() { - public void success(Void result) { + VoidResult resultCallback = + new VoidResult() { + public void success() { wrapped.add(0, null); reply.reply(wrapped); } @@ -2246,17 +2859,18 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.waitForPendingWrites", + "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.waitForPendingWrites" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; FirestorePigeonFirebaseApp appArg = (FirestorePigeonFirebaseApp) args.get(0); - Result resultCallback = - new Result() { - public void success(Void result) { + VoidResult resultCallback = + new VoidResult() { + public void success() { wrapped.add(0, null); reply.reply(wrapped); } @@ -2277,18 +2891,19 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.setIndexConfiguration", + "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.setIndexConfiguration" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; FirestorePigeonFirebaseApp appArg = (FirestorePigeonFirebaseApp) args.get(0); String indexConfigurationArg = (String) args.get(1); - Result resultCallback = - new Result() { - public void success(Void result) { + VoidResult resultCallback = + new VoidResult() { + public void success() { wrapped.add(0, null); reply.reply(wrapped); } @@ -2309,17 +2924,18 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.setLoggingEnabled", + "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.setLoggingEnabled" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; Boolean loggingEnabledArg = (Boolean) args.get(0); - Result resultCallback = - new Result() { - public void success(Void result) { + VoidResult resultCallback = + new VoidResult() { + public void success() { wrapped.add(0, null); reply.reply(wrapped); } @@ -2340,12 +2956,13 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.snapshotsInSyncSetup", + "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.snapshotsInSyncSetup" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; FirestorePigeonFirebaseApp appArg = (FirestorePigeonFirebaseApp) args.get(0); Result resultCallback = @@ -2371,16 +2988,17 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.transactionCreate", + "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.transactionCreate" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; FirestorePigeonFirebaseApp appArg = (FirestorePigeonFirebaseApp) args.get(0); - Number timeoutArg = (Number) args.get(1); - Number maxAttemptsArg = (Number) args.get(2); + Long timeoutArg = (Long) args.get(1); + Long maxAttemptsArg = (Long) args.get(2); Result resultCallback = new Result() { public void success(String result) { @@ -2394,11 +3012,7 @@ public void error(Throwable error) { } }; - api.transactionCreate( - appArg, - (timeoutArg == null) ? null : timeoutArg.longValue(), - (maxAttemptsArg == null) ? null : maxAttemptsArg.longValue(), - resultCallback); + api.transactionCreate(appArg, timeoutArg, maxAttemptsArg, resultCallback); }); } else { channel.setMessageHandler(null); @@ -2408,21 +3022,21 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.transactionStoreResult", + "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.transactionStoreResult" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; String transactionIdArg = (String) args.get(0); - PigeonTransactionResult resultTypeArg = - PigeonTransactionResult.values()[(int) args.get(1)]; - List commandsArg = - (List) args.get(2); - Result resultCallback = - new Result() { - public void success(Void result) { + InternalTransactionResult resultTypeArg = (InternalTransactionResult) args.get(1); + List commandsArg = + (List) args.get(2); + VoidResult resultCallback = + new VoidResult() { + public void success() { wrapped.add(0, null); reply.reply(wrapped); } @@ -2444,19 +3058,20 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.transactionGet", + "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.transactionGet" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; FirestorePigeonFirebaseApp appArg = (FirestorePigeonFirebaseApp) args.get(0); String transactionIdArg = (String) args.get(1); String pathArg = (String) args.get(2); - Result resultCallback = - new Result() { - public void success(PigeonDocumentSnapshot result) { + Result resultCallback = + new Result() { + public void success(InternalDocumentSnapshot result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -2477,18 +3092,19 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceSet", + "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceSet" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; FirestorePigeonFirebaseApp appArg = (FirestorePigeonFirebaseApp) args.get(0); DocumentReferenceRequest requestArg = (DocumentReferenceRequest) args.get(1); - Result resultCallback = - new Result() { - public void success(Void result) { + VoidResult resultCallback = + new VoidResult() { + public void success() { wrapped.add(0, null); reply.reply(wrapped); } @@ -2509,18 +3125,19 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceUpdate", + "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceUpdate" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; FirestorePigeonFirebaseApp appArg = (FirestorePigeonFirebaseApp) args.get(0); DocumentReferenceRequest requestArg = (DocumentReferenceRequest) args.get(1); - Result resultCallback = - new Result() { - public void success(Void result) { + VoidResult resultCallback = + new VoidResult() { + public void success() { wrapped.add(0, null); reply.reply(wrapped); } @@ -2541,18 +3158,19 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceGet", + "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceGet" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; FirestorePigeonFirebaseApp appArg = (FirestorePigeonFirebaseApp) args.get(0); DocumentReferenceRequest requestArg = (DocumentReferenceRequest) args.get(1); - Result resultCallback = - new Result() { - public void success(PigeonDocumentSnapshot result) { + Result resultCallback = + new Result() { + public void success(InternalDocumentSnapshot result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -2573,18 +3191,19 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceDelete", + "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceDelete" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; FirestorePigeonFirebaseApp appArg = (FirestorePigeonFirebaseApp) args.get(0); DocumentReferenceRequest requestArg = (DocumentReferenceRequest) args.get(1); - Result resultCallback = - new Result() { - public void success(Void result) { + VoidResult resultCallback = + new VoidResult() { + public void success() { wrapped.add(0, null); reply.reply(wrapped); } @@ -2605,21 +3224,22 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.queryGet", + "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.queryGet" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; FirestorePigeonFirebaseApp appArg = (FirestorePigeonFirebaseApp) args.get(0); String pathArg = (String) args.get(1); Boolean isCollectionGroupArg = (Boolean) args.get(2); - PigeonQueryParameters parametersArg = (PigeonQueryParameters) args.get(3); - PigeonGetOptions optionsArg = (PigeonGetOptions) args.get(4); - Result resultCallback = - new Result() { - public void success(PigeonQuerySnapshot result) { + InternalQueryParameters parametersArg = (InternalQueryParameters) args.get(3); + InternalGetOptions optionsArg = (InternalGetOptions) args.get(4); + Result resultCallback = + new Result() { + public void success(InternalQuerySnapshot result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -2646,17 +3266,18 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.aggregateQuery", + "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.aggregateQuery" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; FirestorePigeonFirebaseApp appArg = (FirestorePigeonFirebaseApp) args.get(0); String pathArg = (String) args.get(1); - PigeonQueryParameters parametersArg = (PigeonQueryParameters) args.get(2); - AggregateSource sourceArg = AggregateSource.values()[(int) args.get(3)]; + InternalQueryParameters parametersArg = (InternalQueryParameters) args.get(2); + AggregateSource sourceArg = (AggregateSource) args.get(3); List queriesArg = (List) args.get(4); Boolean isCollectionGroupArg = (Boolean) args.get(5); Result> resultCallback = @@ -2689,19 +3310,20 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.writeBatchCommit", + "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.writeBatchCommit" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; FirestorePigeonFirebaseApp appArg = (FirestorePigeonFirebaseApp) args.get(0); - List writesArg = - (List) args.get(1); - Result resultCallback = - new Result() { - public void success(Void result) { + List writesArg = + (List) args.get(1); + VoidResult resultCallback = + new VoidResult() { + public void success() { wrapped.add(0, null); reply.reply(wrapped); } @@ -2722,20 +3344,21 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.querySnapshot", + "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.querySnapshot" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; FirestorePigeonFirebaseApp appArg = (FirestorePigeonFirebaseApp) args.get(0); String pathArg = (String) args.get(1); Boolean isCollectionGroupArg = (Boolean) args.get(2); - PigeonQueryParameters parametersArg = (PigeonQueryParameters) args.get(3); - PigeonGetOptions optionsArg = (PigeonGetOptions) args.get(4); + InternalQueryParameters parametersArg = (InternalQueryParameters) args.get(3); + InternalGetOptions optionsArg = (InternalGetOptions) args.get(4); Boolean includeMetadataChangesArg = (Boolean) args.get(5); - ListenSource sourceArg = ListenSource.values()[(int) args.get(6)]; + ListenSource sourceArg = (ListenSource) args.get(6); Result resultCallback = new Result() { public void success(String result) { @@ -2767,17 +3390,18 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceSnapshot", + "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceSnapshot" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; FirestorePigeonFirebaseApp appArg = (FirestorePigeonFirebaseApp) args.get(0); DocumentReferenceRequest parametersArg = (DocumentReferenceRequest) args.get(1); Boolean includeMetadataChangesArg = (Boolean) args.get(2); - ListenSource sourceArg = ListenSource.values()[(int) args.get(3)]; + ListenSource sourceArg = (ListenSource) args.get(3); Result resultCallback = new Result() { public void success(String result) { @@ -2802,19 +3426,20 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.persistenceCacheIndexManagerRequest", + "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.persistenceCacheIndexManagerRequest" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; FirestorePigeonFirebaseApp appArg = (FirestorePigeonFirebaseApp) args.get(0); PersistenceCacheIndexManagerRequest requestArg = - PersistenceCacheIndexManagerRequest.values()[(int) args.get(1)]; - Result resultCallback = - new Result() { - public void success(Void result) { + (PersistenceCacheIndexManagerRequest) args.get(1); + VoidResult resultCallback = + new VoidResult() { + public void success() { wrapped.add(0, null); reply.reply(wrapped); } @@ -2835,19 +3460,20 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.executePipeline", + "dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.executePipeline" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; FirestorePigeonFirebaseApp appArg = (FirestorePigeonFirebaseApp) args.get(0); List> stagesArg = (List>) args.get(1); Map optionsArg = (Map) args.get(2); - Result resultCallback = - new Result() { - public void success(PigeonPipelineSnapshot result) { + Result resultCallback = + new Result() { + public void success(InternalPipelineSnapshot result) { wrapped.add(0, result); reply.reply(wrapped); } diff --git a/packages/cloud_firestore/cloud_firestore/android/src/main/java/io/flutter/plugins/firebase/firestore/streamhandler/DocumentSnapshotsStreamHandler.java b/packages/cloud_firestore/cloud_firestore/android/src/main/java/io/flutter/plugins/firebase/firestore/streamhandler/DocumentSnapshotsStreamHandler.java index 270966a3176e..b2e1245d2e87 100644 --- a/packages/cloud_firestore/cloud_firestore/android/src/main/java/io/flutter/plugins/firebase/firestore/streamhandler/DocumentSnapshotsStreamHandler.java +++ b/packages/cloud_firestore/cloud_firestore/android/src/main/java/io/flutter/plugins/firebase/firestore/streamhandler/DocumentSnapshotsStreamHandler.java @@ -62,9 +62,13 @@ public void onListen(Object arguments, EventSink events) { onCancel(null); } else { + // Emit the Pigeon object directly; the Pigeon-aware codec on the + // MessageChannel serializes it end-to-end. Pigeon 26 no longer flattens + // nested types via `.toList()`, so calling `.toList()` here would send a + // raw list that the Dart side can no longer decode. events.success( - PigeonParser.toPigeonDocumentSnapshot(documentSnapshot, serverTimestampBehavior) - .toList()); + PigeonParser.toPigeonDocumentSnapshot( + documentSnapshot, serverTimestampBehavior)); } }); } diff --git a/packages/cloud_firestore/cloud_firestore/android/src/main/java/io/flutter/plugins/firebase/firestore/streamhandler/OnTransactionResultListener.java b/packages/cloud_firestore/cloud_firestore/android/src/main/java/io/flutter/plugins/firebase/firestore/streamhandler/OnTransactionResultListener.java index 665858ec6290..e0974cad01e0 100644 --- a/packages/cloud_firestore/cloud_firestore/android/src/main/java/io/flutter/plugins/firebase/firestore/streamhandler/OnTransactionResultListener.java +++ b/packages/cloud_firestore/cloud_firestore/android/src/main/java/io/flutter/plugins/firebase/firestore/streamhandler/OnTransactionResultListener.java @@ -12,6 +12,6 @@ /** callback when a transaction result has been computed. */ public interface OnTransactionResultListener { void receiveTransactionResponse( - GeneratedAndroidFirebaseFirestore.PigeonTransactionResult resultType, - List commands); + GeneratedAndroidFirebaseFirestore.InternalTransactionResult resultType, + List commands); } diff --git a/packages/cloud_firestore/cloud_firestore/android/src/main/java/io/flutter/plugins/firebase/firestore/streamhandler/QuerySnapshotsStreamHandler.java b/packages/cloud_firestore/cloud_firestore/android/src/main/java/io/flutter/plugins/firebase/firestore/streamhandler/QuerySnapshotsStreamHandler.java index c48f3941d8ca..e0fe62b31ec7 100644 --- a/packages/cloud_firestore/cloud_firestore/android/src/main/java/io/flutter/plugins/firebase/firestore/streamhandler/QuerySnapshotsStreamHandler.java +++ b/packages/cloud_firestore/cloud_firestore/android/src/main/java/io/flutter/plugins/firebase/firestore/streamhandler/QuerySnapshotsStreamHandler.java @@ -8,7 +8,6 @@ import static io.flutter.plugins.firebase.firestore.FlutterFirebaseFirestorePlugin.DEFAULT_ERROR_CODE; -import com.google.firebase.firestore.DocumentChange; import com.google.firebase.firestore.DocumentSnapshot; import com.google.firebase.firestore.ListenSource; import com.google.firebase.firestore.ListenerRegistration; @@ -19,7 +18,6 @@ import io.flutter.plugin.common.EventChannel.StreamHandler; import io.flutter.plugins.firebase.firestore.utils.ExceptionConverter; import io.flutter.plugins.firebase.firestore.utils.PigeonParser; -import java.util.ArrayList; import java.util.Map; public class QuerySnapshotsStreamHandler implements StreamHandler { @@ -61,28 +59,12 @@ public void onListen(Object arguments, EventSink events) { onCancel(null); } else { - ArrayList toListResult = new ArrayList(3); - ArrayList documents = - new ArrayList(querySnapshot.getDocuments().size()); - ArrayList documentChanges = - new ArrayList(querySnapshot.getDocumentChanges().size()); - for (DocumentSnapshot documentSnapshot : querySnapshot.getDocuments()) { - documents.add( - PigeonParser.toPigeonDocumentSnapshot( - documentSnapshot, serverTimestampBehavior) - .toList()); - } - for (DocumentChange documentChange : querySnapshot.getDocumentChanges()) { - documentChanges.add( - PigeonParser.toPigeonDocumentChange(documentChange, serverTimestampBehavior) - .toList()); - } - toListResult.add(documents); - toListResult.add(documentChanges); - toListResult.add( - PigeonParser.toPigeonSnapshotMetadata(querySnapshot.getMetadata()).toList()); - - events.success(toListResult); + // Emit the Pigeon object directly; the Pigeon-aware codec serializes + // nested `InternalDocumentSnapshot` / `InternalDocumentChange` / + // `InternalSnapshotMetadata` with their proper type codes. Pigeon 26 + // no longer flattens nested types via `.toList()`. + events.success( + PigeonParser.toPigeonQuerySnapshot(querySnapshot, serverTimestampBehavior)); } }); } diff --git a/packages/cloud_firestore/cloud_firestore/android/src/main/java/io/flutter/plugins/firebase/firestore/streamhandler/TransactionStreamHandler.java b/packages/cloud_firestore/cloud_firestore/android/src/main/java/io/flutter/plugins/firebase/firestore/streamhandler/TransactionStreamHandler.java index 67c6c1fac5bb..32f16bc2555b 100644 --- a/packages/cloud_firestore/cloud_firestore/android/src/main/java/io/flutter/plugins/firebase/firestore/streamhandler/TransactionStreamHandler.java +++ b/packages/cloud_firestore/cloud_firestore/android/src/main/java/io/flutter/plugins/firebase/firestore/streamhandler/TransactionStreamHandler.java @@ -59,8 +59,8 @@ public TransactionStreamHandler( } final Semaphore semaphore = new Semaphore(0); - private GeneratedAndroidFirebaseFirestore.PigeonTransactionResult resultType; - private List commands; + private GeneratedAndroidFirebaseFirestore.InternalTransactionResult resultType; + private List commands; final Handler mainLooper = new Handler(Looper.getMainLooper()); @@ -91,11 +91,13 @@ public void onListen(Object arguments, EventSink events) { return FlutterFirebaseFirestoreTransactionResult.complete(); } - if (resultType == GeneratedAndroidFirebaseFirestore.PigeonTransactionResult.FAILURE) { + if (resultType + == GeneratedAndroidFirebaseFirestore.InternalTransactionResult.FAILURE) { return FlutterFirebaseFirestoreTransactionResult.complete(); } - for (GeneratedAndroidFirebaseFirestore.PigeonTransactionCommand command : commands) { + for (GeneratedAndroidFirebaseFirestore.InternalTransactionCommand command : + commands) { DocumentReference documentReference = firestore.document(command.getPath()); switch (command.getType()) { @@ -129,7 +131,7 @@ public void onListen(Object arguments, EventSink events) { } case SET: { - GeneratedAndroidFirebaseFirestore.PigeonDocumentOption options = + GeneratedAndroidFirebaseFirestore.InternalDocumentOption options = Objects.requireNonNull(command.getOption()); SetOptions setOptions = null; @@ -187,8 +189,8 @@ public void onCancel(Object arguments) { @Override public void receiveTransactionResponse( - GeneratedAndroidFirebaseFirestore.PigeonTransactionResult resultType, - List commands) { + GeneratedAndroidFirebaseFirestore.InternalTransactionResult resultType, + List commands) { this.resultType = resultType; this.commands = commands; semaphore.release(); diff --git a/packages/cloud_firestore/cloud_firestore/android/src/main/java/io/flutter/plugins/firebase/firestore/utils/ExceptionConverter.java b/packages/cloud_firestore/cloud_firestore/android/src/main/java/io/flutter/plugins/firebase/firestore/utils/ExceptionConverter.java index 49fb299dd04d..a7538cd73bfb 100644 --- a/packages/cloud_firestore/cloud_firestore/android/src/main/java/io/flutter/plugins/firebase/firestore/utils/ExceptionConverter.java +++ b/packages/cloud_firestore/cloud_firestore/android/src/main/java/io/flutter/plugins/firebase/firestore/utils/ExceptionConverter.java @@ -63,4 +63,14 @@ public static void sendErrorToFlutter( exception != null ? exception.getMessage() : null, exceptionDetails)); } + + public static void sendErrorToFlutter( + GeneratedAndroidFirebaseFirestore.VoidResult result, Exception exception) { + Map exceptionDetails = ExceptionConverter.createDetails(exception); + result.error( + new GeneratedAndroidFirebaseFirestore.FlutterError( + DEFAULT_ERROR_CODE, + exception != null ? exception.getMessage() : null, + exceptionDetails)); + } } diff --git a/packages/cloud_firestore/cloud_firestore/android/src/main/java/io/flutter/plugins/firebase/firestore/utils/PigeonParser.java b/packages/cloud_firestore/cloud_firestore/android/src/main/java/io/flutter/plugins/firebase/firestore/utils/PigeonParser.java index 84ca398a85f3..305a62120f8b 100644 --- a/packages/cloud_firestore/cloud_firestore/android/src/main/java/io/flutter/plugins/firebase/firestore/utils/PigeonParser.java +++ b/packages/cloud_firestore/cloud_firestore/android/src/main/java/io/flutter/plugins/firebase/firestore/utils/PigeonParser.java @@ -56,11 +56,11 @@ public static DocumentSnapshot.ServerTimestampBehavior parsePigeonServerTimestam } } - public static GeneratedAndroidFirebaseFirestore.PigeonQuerySnapshot toPigeonQuerySnapshot( + public static GeneratedAndroidFirebaseFirestore.InternalQuerySnapshot toPigeonQuerySnapshot( com.google.firebase.firestore.QuerySnapshot querySnapshot, DocumentSnapshot.ServerTimestampBehavior serverTimestampBehavior) { - GeneratedAndroidFirebaseFirestore.PigeonQuerySnapshot.Builder pigeonQuerySnapshot = - new GeneratedAndroidFirebaseFirestore.PigeonQuerySnapshot.Builder(); + GeneratedAndroidFirebaseFirestore.InternalQuerySnapshot.Builder pigeonQuerySnapshot = + new GeneratedAndroidFirebaseFirestore.InternalQuerySnapshot.Builder(); pigeonQuerySnapshot.setMetadata(toPigeonSnapshotMetadata(querySnapshot.getMetadata())); pigeonQuerySnapshot.setDocumentChanges( toPigeonDocumentChanges(querySnapshot.getDocumentChanges(), serverTimestampBehavior)); @@ -69,20 +69,20 @@ public static GeneratedAndroidFirebaseFirestore.PigeonQuerySnapshot toPigeonQuer return pigeonQuerySnapshot.build(); } - public static GeneratedAndroidFirebaseFirestore.PigeonSnapshotMetadata toPigeonSnapshotMetadata( + public static GeneratedAndroidFirebaseFirestore.InternalSnapshotMetadata toPigeonSnapshotMetadata( com.google.firebase.firestore.SnapshotMetadata snapshotMetadata) { - GeneratedAndroidFirebaseFirestore.PigeonSnapshotMetadata.Builder pigeonSnapshotMetadata = - new GeneratedAndroidFirebaseFirestore.PigeonSnapshotMetadata.Builder(); + GeneratedAndroidFirebaseFirestore.InternalSnapshotMetadata.Builder pigeonSnapshotMetadata = + new GeneratedAndroidFirebaseFirestore.InternalSnapshotMetadata.Builder(); pigeonSnapshotMetadata.setHasPendingWrites(snapshotMetadata.hasPendingWrites()); pigeonSnapshotMetadata.setIsFromCache(snapshotMetadata.isFromCache()); return pigeonSnapshotMetadata.build(); } - public static List + public static List toPigeonDocumentChanges( List documentChanges, DocumentSnapshot.ServerTimestampBehavior serverTimestampBehavior) { - List pigeonDocumentChanges = + List pigeonDocumentChanges = new ArrayList<>(documentChanges.size()); for (com.google.firebase.firestore.DocumentChange documentChange : documentChanges) { pigeonDocumentChanges.add(toPigeonDocumentChange(documentChange, serverTimestampBehavior)); @@ -90,11 +90,11 @@ public static GeneratedAndroidFirebaseFirestore.PigeonSnapshotMetadata toPigeonS return pigeonDocumentChanges; } - public static GeneratedAndroidFirebaseFirestore.PigeonDocumentChange toPigeonDocumentChange( + public static GeneratedAndroidFirebaseFirestore.InternalDocumentChange toPigeonDocumentChange( com.google.firebase.firestore.DocumentChange documentChange, DocumentSnapshot.ServerTimestampBehavior serverTimestampBehavior) { - GeneratedAndroidFirebaseFirestore.PigeonDocumentChange.Builder pigeonDocumentChange = - new GeneratedAndroidFirebaseFirestore.PigeonDocumentChange.Builder(); + GeneratedAndroidFirebaseFirestore.InternalDocumentChange.Builder pigeonDocumentChange = + new GeneratedAndroidFirebaseFirestore.InternalDocumentChange.Builder(); pigeonDocumentChange.setType(toPigeonDocumentChangeType(documentChange.getType())); pigeonDocumentChange.setOldIndex((long) documentChange.getOldIndex()); pigeonDocumentChange.setNewIndex((long) documentChange.getNewIndex()); @@ -129,22 +129,22 @@ public static ListenSource parseListenSource( } } - public static GeneratedAndroidFirebaseFirestore.PigeonDocumentSnapshot toPigeonDocumentSnapshot( + public static GeneratedAndroidFirebaseFirestore.InternalDocumentSnapshot toPigeonDocumentSnapshot( com.google.firebase.firestore.DocumentSnapshot documentSnapshot, DocumentSnapshot.ServerTimestampBehavior serverTimestampBehavior) { - GeneratedAndroidFirebaseFirestore.PigeonDocumentSnapshot.Builder pigeonDocumentSnapshot = - new GeneratedAndroidFirebaseFirestore.PigeonDocumentSnapshot.Builder(); + GeneratedAndroidFirebaseFirestore.InternalDocumentSnapshot.Builder pigeonDocumentSnapshot = + new GeneratedAndroidFirebaseFirestore.InternalDocumentSnapshot.Builder(); pigeonDocumentSnapshot.setMetadata(toPigeonSnapshotMetadata(documentSnapshot.getMetadata())); pigeonDocumentSnapshot.setData(documentSnapshot.getData(serverTimestampBehavior)); pigeonDocumentSnapshot.setPath(documentSnapshot.getReference().getPath()); return pigeonDocumentSnapshot.build(); } - public static List + public static List toPigeonDocumentSnapshots( List documentSnapshots, DocumentSnapshot.ServerTimestampBehavior serverTimestampBehavior) { - List pigeonDocumentSnapshots = + List pigeonDocumentSnapshots = new ArrayList<>(documentSnapshots.size()); for (com.google.firebase.firestore.DocumentSnapshot documentSnapshot : documentSnapshots) { pigeonDocumentSnapshots.add( @@ -165,7 +165,7 @@ public static Query parseQuery( FirebaseFirestore firestore, @NonNull String path, boolean isCollectionGroup, - GeneratedAndroidFirebaseFirestore.PigeonQueryParameters parameters) { + GeneratedAndroidFirebaseFirestore.InternalQueryParameters parameters) { try { Query query; if (isCollectionGroup) { diff --git a/packages/cloud_firestore/cloud_firestore/example/android/app/build.gradle b/packages/cloud_firestore/cloud_firestore/example/android/app/build.gradle index cf782a8a5d88..b572f8ff646f 100644 --- a/packages/cloud_firestore/cloud_firestore/example/android/app/build.gradle +++ b/packages/cloud_firestore/cloud_firestore/example/android/app/build.gradle @@ -45,7 +45,7 @@ android { applicationId = "io.flutter.plugins.firebase.firestore.example" // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. - minSdk = 23 + minSdkVersion = flutter.minSdkVersion targetSdk = flutter.targetSdkVersion versionCode = flutterVersionCode.toInteger() versionName = flutterVersionName diff --git a/packages/cloud_firestore/cloud_firestore/example/ios/Flutter/AppFrameworkInfo.plist b/packages/cloud_firestore/cloud_firestore/example/ios/Flutter/AppFrameworkInfo.plist index 7c5696400627..391a902b2beb 100644 --- a/packages/cloud_firestore/cloud_firestore/example/ios/Flutter/AppFrameworkInfo.plist +++ b/packages/cloud_firestore/cloud_firestore/example/ios/Flutter/AppFrameworkInfo.plist @@ -20,7 +20,5 @@ ???? CFBundleVersion 1.0 - MinimumOSVersion - 12.0 diff --git a/packages/cloud_firestore/cloud_firestore/example/ios/Runner.xcodeproj/project.pbxproj b/packages/cloud_firestore/cloud_firestore/example/ios/Runner.xcodeproj/project.pbxproj index cd6121c60ef7..9ded141d1e15 100644 --- a/packages/cloud_firestore/cloud_firestore/example/ios/Runner.xcodeproj/project.pbxproj +++ b/packages/cloud_firestore/cloud_firestore/example/ios/Runner.xcodeproj/project.pbxproj @@ -50,6 +50,7 @@ 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; A2D71CA981BE46B8B7F14013 /* GoogleService-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "Runner/GoogleService-Info.plist"; sourceTree = ""; }; E8EC7192C60686BF1D599360 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -68,6 +69,7 @@ 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */, 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 9740EEB21CF90195004384FC /* Debug.xcconfig */, 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, diff --git a/packages/cloud_firestore/cloud_firestore/example/macos/Runner.xcodeproj/project.pbxproj b/packages/cloud_firestore/cloud_firestore/example/macos/Runner.xcodeproj/project.pbxproj index 38a0d1b5c6cf..16ab9abc74ca 100644 --- a/packages/cloud_firestore/cloud_firestore/example/macos/Runner.xcodeproj/project.pbxproj +++ b/packages/cloud_firestore/cloud_firestore/example/macos/Runner.xcodeproj/project.pbxproj @@ -29,6 +29,7 @@ 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; 7C6B704452E88DBDC96F005F /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1127055D8A6FA8F8B81D64A8 /* Pods_Runner.framework */; }; F086503D2C16E7BB001AC8E8 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = F086503C2C16E7BB001AC8E8 /* GoogleService-Info.plist */; }; + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -85,6 +86,7 @@ 8075C6E6575C8FD1BB2ACCEE /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; F086503C2C16E7BB001AC8E8 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -99,6 +101,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */, 7C6B704452E88DBDC96F005F /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -160,6 +163,7 @@ 33CEB47122A05771004F2AC0 /* Flutter */ = { isa = PBXGroup; children = ( + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */, 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */, 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */, 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */, @@ -222,6 +226,9 @@ productType = "com.apple.product-type.bundle.unit-test"; }; 33CC10EC2044A3C60003C045 /* Runner */ = { + packageProductDependencies = ( + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */, + ); isa = PBXNativeTarget; buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( @@ -248,6 +255,9 @@ /* Begin PBXProject section */ 33CC10E52044A3C60003C045 /* Project object */ = { + packageReferences = ( + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */, + ); isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = YES; @@ -784,6 +794,18 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ +/* Begin XCLocalSwiftPackageReference section */ + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; + }; +/* End XCLocalSwiftPackageReference section */ +/* Begin XCSwiftPackageProductDependency section */ + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = { + isa = XCSwiftPackageProductDependency; + productName = FlutterGeneratedPluginSwiftPackage; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 33CC10E52044A3C60003C045 /* Project object */; } diff --git a/packages/cloud_firestore/cloud_firestore/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/cloud_firestore/cloud_firestore/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 15368eccb25a..ee5d00fc0aa9 100644 --- a/packages/cloud_firestore/cloud_firestore/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/packages/cloud_firestore/cloud_firestore/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -5,6 +5,24 @@ + + + + + + + + + + diff --git a/packages/cloud_firestore/cloud_firestore/example/macos/Runner/AppDelegate.swift b/packages/cloud_firestore/cloud_firestore/example/macos/Runner/AppDelegate.swift index 8e02df288835..b3c176141221 100644 --- a/packages/cloud_firestore/cloud_firestore/example/macos/Runner/AppDelegate.swift +++ b/packages/cloud_firestore/cloud_firestore/example/macos/Runner/AppDelegate.swift @@ -6,4 +6,8 @@ class AppDelegate: FlutterAppDelegate { override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } } diff --git a/packages/cloud_firestore/cloud_firestore/ios/cloud_firestore/Sources/cloud_firestore/FLTDocumentSnapshotStreamHandler.m b/packages/cloud_firestore/cloud_firestore/ios/cloud_firestore/Sources/cloud_firestore/FLTDocumentSnapshotStreamHandler.m index a787f8ad92b9..e8119c70d761 100644 --- a/packages/cloud_firestore/cloud_firestore/ios/cloud_firestore/Sources/cloud_firestore/FLTDocumentSnapshotStreamHandler.m +++ b/packages/cloud_firestore/cloud_firestore/ios/cloud_firestore/Sources/cloud_firestore/FLTDocumentSnapshotStreamHandler.m @@ -55,9 +55,11 @@ - (FlutterError *_Nullable)onListenWithArguments:(id _Nullable)arguments }); } else { dispatch_async(dispatch_get_main_queue(), ^{ - events( - [[FirestorePigeonParser toPigeonDocumentSnapshot:snapshot - serverTimestampBehavior:self.serverTimestampBehavior] toList]); + // Emit the Pigeon object directly; the Pigeon-aware codec on the + // MessageChannel serializes it end-to-end. Pigeon 26 no longer flattens + // nested types via `toList`. + events([FirestorePigeonParser toPigeonDocumentSnapshot:snapshot + serverTimestampBehavior:self.serverTimestampBehavior]); }); } }; diff --git a/packages/cloud_firestore/cloud_firestore/ios/cloud_firestore/Sources/cloud_firestore/FLTFirebaseFirestorePlugin.m b/packages/cloud_firestore/cloud_firestore/ios/cloud_firestore/Sources/cloud_firestore/FLTFirebaseFirestorePlugin.m index ab826056264f..66ca1c3a12ac 100644 --- a/packages/cloud_firestore/cloud_firestore/ios/cloud_firestore/Sources/cloud_firestore/FLTFirebaseFirestorePlugin.m +++ b/packages/cloud_firestore/cloud_firestore/ios/cloud_firestore/Sources/cloud_firestore/FLTFirebaseFirestorePlugin.m @@ -21,6 +21,14 @@ #import "include/cloud_firestore/Private/FLTTransactionStreamHandler.h" #import "include/cloud_firestore/Private/FirestorePigeonParser.h" #import "include/cloud_firestore/Public/FLTFirebaseFirestorePlugin.h" +#import "include/cloud_firestore/Public/FirestoreMessages.g.h" + +// Forward-declare the Pigeon-generated reader/writer defined in +// `FirestoreMessages.g.m`. It bundles `FLTFirebaseFirestoreReader/Writer` with +// Pigeon type serialization, so it's safe to use on the plugin's method/event +// channels. +@interface FirebaseFirestoreHostApiCodecReaderWriter : FlutterStandardReaderWriter +@end NSString *const kFLTFirebaseFirestoreChannelName = @"plugins.flutter.io/firebase_firestore"; NSString *const kFLTFirebaseFirestoreQuerySnapshotEventChannelName = @@ -106,8 +114,13 @@ @implementation FLTFirebaseFirestorePlugin { } + (void)initialize { - _codec = - [FlutterStandardMethodCodec codecWithReaderWriter:[FLTFirebaseFirestoreReaderWriter new]]; + // Use the Pigeon-generated reader/writer for MethodChannel/EventChannels so + // Pigeon types emitted by stream handlers (e.g. `InternalDocumentSnapshot`, + // `InternalSnapshotMetadata`) serialize correctly. The reader/writer extend + // `FLTFirebaseFirestoreReader/Writer`, so Firestore-specific types + // (Timestamp, GeoPoint, FieldValue, ...) still round-trip. + _codec = [FlutterStandardMethodCodec + codecWithReaderWriter:[[FirebaseFirestoreHostApiCodecReaderWriter alloc] init]]; } #pragma mark - FlutterPlugin @@ -151,7 +164,7 @@ + (void)registerWithRegistrar:(NSObject *)registrar { #else [registrar publish:instance]; #endif - FirebaseFirestoreHostApiSetup(registrar.messenger, instance); + SetUpFirebaseFirestoreHostApi(registrar.messenger, instance); } - (void)cleanupEventListeners { @@ -353,7 +366,7 @@ - (void)terminate:(id)arguments withMethodCallResult:(FLTFirebaseMethodCallResul - (void)documentReferenceGetApp:(nonnull FirestorePigeonFirebaseApp *)app request:(nonnull DocumentReferenceRequest *)request - completion:(nonnull void (^)(PigeonDocumentSnapshot *_Nullable, + completion:(nonnull void (^)(InternalDocumentSnapshot *_Nullable, FlutterError *_Nullable))completion { FIRFirestore *firestore = [self getFIRFirestoreFromAppNameFromPigeon:app]; FIRDocumentReference *document = [firestore documentWithPath:request.path]; @@ -402,7 +415,7 @@ - (void)documentReferenceSetApp:(nonnull FirestorePigeonFirebaseApp *)app - (void)documentReferenceSnapshotApp:(nonnull FirestorePigeonFirebaseApp *)app parameters:(nonnull DocumentReferenceRequest *)parameters - includeMetadataChanges:(nonnull NSNumber *)includeMetadataChanges + includeMetadataChanges:(BOOL)includeMetadataChanges source:(ListenSource)source completion:(nonnull void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { @@ -418,7 +431,6 @@ - (void)documentReferenceSnapshotApp:(nonnull FirestorePigeonFirebaseApp *)app initWithFirestore:firestore reference:document includeMetadataChanges:includeMetadataChanges - .boolValue serverTimestampBehavior:serverTimestampBehavior source:listenSource]], nil); @@ -467,8 +479,8 @@ - (void)loadBundleApp:(nonnull FirestorePigeonFirebaseApp *)app - (void)namedQueryGetApp:(nonnull FirestorePigeonFirebaseApp *)app name:(nonnull NSString *)name - options:(nonnull PigeonGetOptions *)options - completion:(nonnull void (^)(PigeonQuerySnapshot *_Nullable, + options:(nonnull InternalGetOptions *)options + completion:(nonnull void (^)(InternalQuerySnapshot *_Nullable, FlutterError *_Nullable))completion { FIRFirestore *firestore = [self getFIRFirestoreFromAppNameFromPigeon:app]; @@ -505,16 +517,16 @@ - (void)namedQueryGetApp:(nonnull FirestorePigeonFirebaseApp *)app - (void)queryGetApp:(nonnull FirestorePigeonFirebaseApp *)app path:(nonnull NSString *)path - isCollectionGroup:(nonnull NSNumber *)isCollectionGroup - parameters:(nonnull PigeonQueryParameters *)parameters - options:(nonnull PigeonGetOptions *)options - completion:(nonnull void (^)(PigeonQuerySnapshot *_Nullable, + isCollectionGroup:(BOOL)isCollectionGroup + parameters:(nonnull InternalQueryParameters *)parameters + options:(nonnull InternalGetOptions *)options + completion:(nonnull void (^)(InternalQuerySnapshot *_Nullable, FlutterError *_Nullable))completion { FIRFirestore *firestore = [self getFIRFirestoreFromAppNameFromPigeon:app]; FIRQuery *query = [FirestorePigeonParser parseQueryWithParameters:parameters firestore:firestore path:path - isCollectionGroup:[isCollectionGroup boolValue]]; + isCollectionGroup:isCollectionGroup]; if (query == nil) { completion(nil, [FlutterError errorWithCode:@"error-parsing" message:@"An error occurred while parsing query arguments, " @@ -542,10 +554,10 @@ - (void)queryGetApp:(nonnull FirestorePigeonFirebaseApp *)app - (void)querySnapshotApp:(nonnull FirestorePigeonFirebaseApp *)app path:(nonnull NSString *)path - isCollectionGroup:(nonnull NSNumber *)isCollectionGroup - parameters:(nonnull PigeonQueryParameters *)parameters - options:(nonnull PigeonGetOptions *)options - includeMetadataChanges:(nonnull NSNumber *)includeMetadataChanges + isCollectionGroup:(BOOL)isCollectionGroup + parameters:(nonnull InternalQueryParameters *)parameters + options:(nonnull InternalGetOptions *)options + includeMetadataChanges:(BOOL)includeMetadataChanges source:(ListenSource)source completion: (nonnull void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { @@ -553,7 +565,7 @@ - (void)querySnapshotApp:(nonnull FirestorePigeonFirebaseApp *)app FIRQuery *query = [FirestorePigeonParser parseQueryWithParameters:parameters firestore:firestore path:path - isCollectionGroup:[isCollectionGroup boolValue]]; + isCollectionGroup:isCollectionGroup]; if (query == nil) { completion(nil, [FlutterError errorWithCode:@"error-parsing" message:@"An error occurred while parsing query arguments, " @@ -572,7 +584,6 @@ - (void)querySnapshotApp:(nonnull FirestorePigeonFirebaseApp *)app initWithFirestore:firestore query:query includeMetadataChanges:includeMetadataChanges - .boolValue serverTimestampBehavior:serverTimestampBehavior source:listenSource]], nil); @@ -618,9 +629,9 @@ - (void)persistenceCacheIndexManagerRequestApp:(FirestorePigeonFirebaseApp *)app completion(nil); } -- (void)setLoggingEnabledLoggingEnabled:(nonnull NSNumber *)loggingEnabled +- (void)setLoggingEnabledLoggingEnabled:(BOOL)loggingEnabled completion:(nonnull void (^)(FlutterError *_Nullable))completion { - [FIRFirestore enableLogging:[loggingEnabled boolValue]]; + [FIRFirestore enableLogging:loggingEnabled]; completion(nil); } @@ -643,7 +654,7 @@ - (void)terminateApp:(nonnull FirestorePigeonFirebaseApp *)app - (void)transactionGetApp:(nonnull FirestorePigeonFirebaseApp *)app transactionId:(nonnull NSString *)transactionId path:(nonnull NSString *)path - completion:(nonnull void (^)(PigeonDocumentSnapshot *_Nullable, + completion:(nonnull void (^)(InternalDocumentSnapshot *_Nullable, FlutterError *_Nullable))completion { // Dispatching to main thread allow us to ensure that the auth token are fetched in time // for the transaction @@ -680,8 +691,9 @@ - (void)transactionGetApp:(nonnull FirestorePigeonFirebaseApp *)app } - (void)transactionStoreResultTransactionId:(nonnull NSString *)transactionId - resultType:(PigeonTransactionResult)resultType - commands:(nullable NSArray *)commands + resultType:(InternalTransactionResult)resultType + commands: + (nullable NSArray *)commands completion:(nonnull void (^)(FlutterError *_Nullable))completion { [_transactionHandlers[transactionId] receiveTransactionResponse:resultType commands:commands]; @@ -701,26 +713,26 @@ - (void)waitForPendingWritesApp:(nonnull FirestorePigeonFirebaseApp *)app } - (void)writeBatchCommitApp:(nonnull FirestorePigeonFirebaseApp *)app - writes:(nonnull NSArray *)writes + writes:(nonnull NSArray *)writes completion:(nonnull void (^)(FlutterError *_Nullable))completion { FIRFirestore *firestore = [self getFIRFirestoreFromAppNameFromPigeon:app]; FIRWriteBatch *batch = [firestore batch]; - for (PigeonTransactionCommand *write in writes) { - PigeonTransactionType type = write.type; + for (InternalTransactionCommand *write in writes) { + InternalTransactionType type = write.type; NSString *path = write.path; FIRDocumentReference *reference = [firestore documentWithPath:path]; switch (type) { - case PigeonTransactionTypeGet: + case InternalTransactionTypeGet: break; - case PigeonTransactionTypeDeleteType: + case InternalTransactionTypeDeleteType: [batch deleteDocument:reference]; break; - case PigeonTransactionTypeUpdate: + case InternalTransactionTypeUpdate: [batch updateData:write.data forDocument:reference]; break; - case PigeonTransactionTypeSet: + case InternalTransactionTypeSet: if ([write.option.merge isEqual:@YES]) { [batch setData:write.data forDocument:reference merge:YES]; } else if (write.option.mergeFields) { @@ -756,8 +768,8 @@ - (void)snapshotsInSyncSetupApp:(nonnull FirestorePigeonFirebaseApp *)app } - (void)transactionCreateApp:(nonnull FirestorePigeonFirebaseApp *)app - timeout:(nonnull NSNumber *)timeout - maxAttempts:(nonnull NSNumber *)maxAttempts + timeout:(NSInteger)timeout + maxAttempts:(NSInteger)maxAttempts completion: (nonnull void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { FIRFirestore *firestore = [self getFIRFirestoreFromAppNameFromPigeon:app]; @@ -786,10 +798,10 @@ - (void)transactionCreateApp:(nonnull FirestorePigeonFirebaseApp *)app - (void)aggregateQueryApp:(nonnull FirestorePigeonFirebaseApp *)app path:(nonnull NSString *)path - parameters:(nonnull PigeonQueryParameters *)parameters + parameters:(nonnull InternalQueryParameters *)parameters source:(AggregateSource)source queries:(nonnull NSArray *)queries - isCollectionGroup:(NSNumber *)isCollectionGroup + isCollectionGroup:(BOOL)isCollectionGroup completion:(nonnull void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { FIRFirestore *firestore = [self getFIRFirestoreFromAppNameFromPigeon:app]; @@ -797,7 +809,7 @@ - (void)aggregateQueryApp:(nonnull FirestorePigeonFirebaseApp *)app FIRQuery *query = [FirestorePigeonParser parseQueryWithParameters:parameters firestore:firestore path:path - isCollectionGroup:[isCollectionGroup boolValue]]; + isCollectionGroup:isCollectionGroup]; if (query == nil) { completion(nil, [FlutterError errorWithCode:@"error-parsing" message:@"An error occurred while parsing query arguments, " @@ -901,7 +913,7 @@ - (void)aggregateQueryApp:(nonnull FirestorePigeonFirebaseApp *)app - (void)executePipelineApp:(nonnull FirestorePigeonFirebaseApp *)app stages:(nonnull NSArray *> *)stages options:(nullable NSDictionary *)options - completion:(nonnull void (^)(PigeonPipelineSnapshot *_Nullable, + completion:(nonnull void (^)(InternalPipelineSnapshot *_Nullable, FlutterError *_Nullable))completion { FIRFirestore *firestore = [self getFIRFirestoreFromAppNameFromPigeon:app]; @@ -923,7 +935,7 @@ - (void)executePipelineApp:(nonnull FirestorePigeonFirebaseApp *)app return; } - NSMutableArray *pigeonResults = + NSMutableArray *pigeonResults = [NSMutableArray array]; NSArray *results = [snapshot results]; if ([results isKindOfClass:[NSArray class]]) { @@ -937,11 +949,11 @@ - (void)executePipelineApp:(nonnull FirestorePigeonFirebaseApp *)app NSNumber *updateTime = FLTPipelineTimestampToMs([result valueForKey:@"update_time"]); NSDictionary *data = FLTPipelineNullSafe([result data]); - PigeonPipelineResult *pigeonResult = - [PigeonPipelineResult makeWithDocumentPath:path - createTime:createTime - updateTime:updateTime - data:data]; + InternalPipelineResult *pigeonResult = + [InternalPipelineResult makeWithDocumentPath:path + createTime:createTime + updateTime:updateTime + data:data]; [pigeonResults addObject:pigeonResult]; } } @@ -953,9 +965,9 @@ - (void)executePipelineApp:(nonnull FirestorePigeonFirebaseApp *)app @((int64_t)([[NSDate date] timeIntervalSince1970] * 1000)); } - PigeonPipelineSnapshot *pigeonSnapshot = - [PigeonPipelineSnapshot makeWithResults:pigeonResults - executionTime:executionTime]; + InternalPipelineSnapshot *pigeonSnapshot = [InternalPipelineSnapshot + makeWithResults:pigeonResults + executionTime:[executionTime longLongValue]]; completion(pigeonSnapshot, nil); }]; } diff --git a/packages/cloud_firestore/cloud_firestore/ios/cloud_firestore/Sources/cloud_firestore/FLTQuerySnapshotStreamHandler.m b/packages/cloud_firestore/cloud_firestore/ios/cloud_firestore/Sources/cloud_firestore/FLTQuerySnapshotStreamHandler.m index bb80a2d6e69e..b90ee46db10a 100644 --- a/packages/cloud_firestore/cloud_firestore/ios/cloud_firestore/Sources/cloud_firestore/FLTQuerySnapshotStreamHandler.m +++ b/packages/cloud_firestore/cloud_firestore/ios/cloud_firestore/Sources/cloud_firestore/FLTQuerySnapshotStreamHandler.m @@ -65,32 +65,12 @@ - (FlutterError *_Nullable)onListenWithArguments:(id _Nullable)arguments }); } else { dispatch_async(dispatch_get_main_queue(), ^{ - NSMutableArray *toListResult = [[NSMutableArray alloc] initWithCapacity:3]; - - NSMutableArray *documents = - [[NSMutableArray alloc] initWithCapacity:snapshot.documents.count]; - NSMutableArray *documentChanges = - [[NSMutableArray alloc] initWithCapacity:snapshot.documentChanges.count]; - - for (FIRDocumentSnapshot *documentSnapshot in snapshot.documents) { - [documents addObject:[[FirestorePigeonParser - toPigeonDocumentSnapshot:documentSnapshot - serverTimestampBehavior:self.serverTimestampBehavior] toList]]; - } - - for (FIRDocumentChange *documentChange in snapshot.documentChanges) { - [documentChanges - addObject:[[FirestorePigeonParser toPigeonDocumentChange:documentChange - serverTimestampBehavior:self.serverTimestampBehavior] - toList]]; - } - - [toListResult addObject:documents]; - [toListResult addObject:documentChanges]; - [toListResult - addObject:[[FirestorePigeonParser toPigeonSnapshotMetadata:snapshot.metadata] toList]]; - - events(toListResult); + // Emit the Pigeon object directly; the Pigeon-aware codec serializes nested + // `InternalDocumentSnapshot` / `InternalDocumentChange` / `InternalSnapshotMetadata` + // with their proper type codes. Pigeon 26 no longer flattens nested types + // via `toList`. + events([FirestorePigeonParser toPigeonQuerySnapshot:snapshot + serverTimestampBehavior:self.serverTimestampBehavior]); }); } }; diff --git a/packages/cloud_firestore/cloud_firestore/ios/cloud_firestore/Sources/cloud_firestore/FLTTransactionStreamHandler.m b/packages/cloud_firestore/cloud_firestore/ios/cloud_firestore/Sources/cloud_firestore/FLTTransactionStreamHandler.m index 29252ca4821c..8cd347b0b269 100644 --- a/packages/cloud_firestore/cloud_firestore/ios/cloud_firestore/Sources/cloud_firestore/FLTTransactionStreamHandler.m +++ b/packages/cloud_firestore/cloud_firestore/ios/cloud_firestore/Sources/cloud_firestore/FLTTransactionStreamHandler.m @@ -17,8 +17,8 @@ @interface FLTTransactionStreamHandler () @property(nonatomic, copy, nonnull) void (^started)(FIRTransaction *); @property(nonatomic, copy, nonnull) void (^ended)(void); @property(strong) dispatch_semaphore_t semaphore; -@property PigeonTransactionResult resultType; -@property NSArray *commands; +@property InternalTransactionResult resultType; +@property NSArray *commands; @end @@ -28,8 +28,8 @@ @implementation FLTTransactionStreamHandler { - (instancetype)initWithId:(NSString *)transactionId firestore:(FIRFirestore *)firestore - timeout:(nonnull NSNumber *)timeout - maxAttempts:(nonnull NSNumber *)maxAttempts + timeout:(NSInteger)timeout + maxAttempts:(NSInteger)maxAttempts started:(void (^)(FIRTransaction *))startedListener ended:(void (^)(void))endedListener { self = [super init]; @@ -60,8 +60,7 @@ - (FlutterError *_Nullable)onListenWithArguments:(id _Nullable)arguments }); long timedOut = dispatch_semaphore_wait( - strongSelf.semaphore, - dispatch_time(DISPATCH_TIME_NOW, [self.timeout integerValue] * NSEC_PER_MSEC)); + strongSelf.semaphore, dispatch_time(DISPATCH_TIME_NOW, self.timeout * NSEC_PER_MSEC)); if (timedOut) { NSArray *codeAndMessage = [FLTFirebaseFirestoreUtils @@ -80,24 +79,24 @@ - (FlutterError *_Nullable)onListenWithArguments:(id _Nullable)arguments }); } - if (self.resultType == PigeonTransactionResultFailure) { + if (self.resultType == InternalTransactionResultFailure) { // Do nothing - already handled in Dart land. return nil; } - for (PigeonTransactionCommand *command in self.commands) { - PigeonTransactionType commandType = command.type; + for (InternalTransactionCommand *command in self.commands) { + InternalTransactionType commandType = command.type; NSString *documentPath = command.path; FIRDocumentReference *reference = [self.firestore documentWithPath:documentPath]; switch (commandType) { - case PigeonTransactionTypeDeleteType: + case InternalTransactionTypeDeleteType: [transaction deleteDocument:reference]; break; - case PigeonTransactionTypeUpdate: + case InternalTransactionTypeUpdate: [transaction updateData:command.data forDocument:reference]; break; - case PigeonTransactionTypeSet: + case InternalTransactionTypeSet: if ([command.option.merge isEqual:@YES]) { [transaction setData:command.data forDocument:reference merge:YES]; } else if (command.option.mergeFields) { @@ -142,7 +141,7 @@ - (FlutterError *_Nullable)onListenWithArguments:(id _Nullable)arguments strongSelf.ended(); }; FIRTransactionOptions *options = [[FIRTransactionOptions alloc] init]; - options.maxAttempts = _maxAttempts.integerValue; + options.maxAttempts = _maxAttempts; [_firestore runTransactionWithOptions:options block:transactionRunBlock @@ -157,8 +156,8 @@ - (FlutterError *_Nullable)onCancelWithArguments:(id _Nullable)arguments { return nil; } -- (void)receiveTransactionResponse:(PigeonTransactionResult)resultType - commands:(NSArray *)commands { +- (void)receiveTransactionResponse:(InternalTransactionResult)resultType + commands:(NSArray *)commands { self.resultType = resultType; self.commands = commands; diff --git a/packages/cloud_firestore/cloud_firestore/ios/cloud_firestore/Sources/cloud_firestore/FirestoreMessages.g.m b/packages/cloud_firestore/cloud_firestore/ios/cloud_firestore/Sources/cloud_firestore/FirestoreMessages.g.m index 891377333685..f9594c6e943f 100644 --- a/packages/cloud_firestore/cloud_firestore/ios/cloud_firestore/Sources/cloud_firestore/FirestoreMessages.g.m +++ b/packages/cloud_firestore/cloud_firestore/ios/cloud_firestore/Sources/cloud_firestore/FirestoreMessages.g.m @@ -1,7 +1,7 @@ // Copyright 2023, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v11.0.1), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), do not edit directly. // See also: https://pub.dev/packages/pigeon #import "FirestoreMessages.g.h" @@ -9,14 +9,115 @@ #import "FLTFirebaseFirestoreWriter.h" #if TARGET_OS_OSX -#import +@import FlutterMacOS; #else -#import +@import Flutter; #endif -#if !__has_feature(objc_arc) -#error File requires ARC to be enabled. -#endif +static BOOL __attribute__((unused)) FLTPigeonDeepEquals(id _Nullable a, id _Nullable b) { + if (a == b) { + return YES; + } + if (a == nil) { + return b == [NSNull null]; + } + if (b == nil) { + return a == [NSNull null]; + } + if ([a isKindOfClass:[NSNumber class]] && [b isKindOfClass:[NSNumber class]]) { + return + [a isEqual:b] || (isnan([(NSNumber *)a doubleValue]) && isnan([(NSNumber *)b doubleValue])); + } + if ([a isKindOfClass:[NSArray class]] && [b isKindOfClass:[NSArray class]]) { + NSArray *arrayA = (NSArray *)a; + NSArray *arrayB = (NSArray *)b; + if (arrayA.count != arrayB.count) { + return NO; + } + for (NSUInteger i = 0; i < arrayA.count; i++) { + if (!FLTPigeonDeepEquals(arrayA[i], arrayB[i])) { + return NO; + } + } + return YES; + } + if ([a isKindOfClass:[NSDictionary class]] && [b isKindOfClass:[NSDictionary class]]) { + NSDictionary *dictA = (NSDictionary *)a; + NSDictionary *dictB = (NSDictionary *)b; + if (dictA.count != dictB.count) { + return NO; + } + for (id keyA in dictA) { + id valueA = dictA[keyA]; + BOOL found = NO; + for (id keyB in dictB) { + if (FLTPigeonDeepEquals(keyA, keyB)) { + id valueB = dictB[keyB]; + if (FLTPigeonDeepEquals(valueA, valueB)) { + found = YES; + break; + } else { + return NO; + } + } + } + if (!found) { + return NO; + } + } + return YES; + } + return [a isEqual:b]; +} + +static NSUInteger __attribute__((unused)) FLTPigeonDeepHash(id _Nullable value) { + if (value == nil || value == (id)[NSNull null]) { + return 0; + } + if ([value isKindOfClass:[NSNumber class]]) { + NSNumber *n = (NSNumber *)value; + double d = n.doubleValue; + if (isnan(d)) { + // Normalize NaN to a consistent hash. + return (NSUInteger)0x7FF8000000000000; + } + if (d == 0.0) { + // Normalize -0.0 to 0.0 so they have the same hash code. + d = 0.0; + } + return @(d).hash; + } + if ([value isKindOfClass:[NSArray class]]) { + NSUInteger result = 1; + for (id item in (NSArray *)value) { + result = result * 31 + FLTPigeonDeepHash(item); + } + return result; + } + if ([value isKindOfClass:[NSDictionary class]]) { + NSUInteger result = 0; + NSDictionary *dict = (NSDictionary *)value; + for (id key in dict) { + result += ((FLTPigeonDeepHash(key) * 31) ^ FLTPigeonDeepHash(dict[key])); + } + return result; + } + return [value hash]; +} + +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; +} /// An enumeration of document change types. @implementation DocumentChangeTypeBox @@ -89,8 +190,8 @@ - (instancetype)initWithValue:(PersistenceCacheIndexManagerRequest)value { } @end -@implementation PigeonTransactionResultBox -- (instancetype)initWithValue:(PigeonTransactionResult)value { +@implementation InternalTransactionResultBox +- (instancetype)initWithValue:(InternalTransactionResult)value { self = [super init]; if (self) { _value = value; @@ -99,8 +200,8 @@ - (instancetype)initWithValue:(PigeonTransactionResult)value { } @end -@implementation PigeonTransactionTypeBox -- (instancetype)initWithValue:(PigeonTransactionType)value { +@implementation InternalTransactionTypeBox +- (instancetype)initWithValue:(InternalTransactionType)value { self = [super init]; if (self) { _value = value; @@ -119,116 +220,103 @@ - (instancetype)initWithValue:(AggregateType)value { } @end -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 PigeonFirebaseSettings () -+ (PigeonFirebaseSettings *)fromList:(NSArray *)list; -+ (nullable PigeonFirebaseSettings *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; +@interface InternalFirebaseSettings () ++ (InternalFirebaseSettings *)fromList:(NSArray *)list; ++ (nullable InternalFirebaseSettings *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end @interface FirestorePigeonFirebaseApp () -+ (FirestorePigeonFirebaseApp *)fromList:(NSArray *)list; -+ (nullable FirestorePigeonFirebaseApp *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; ++ (FirestorePigeonFirebaseApp *)fromList:(NSArray *)list; ++ (nullable FirestorePigeonFirebaseApp *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end -@interface PigeonSnapshotMetadata () -+ (PigeonSnapshotMetadata *)fromList:(NSArray *)list; -+ (nullable PigeonSnapshotMetadata *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; +@interface InternalSnapshotMetadata () ++ (InternalSnapshotMetadata *)fromList:(NSArray *)list; ++ (nullable InternalSnapshotMetadata *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end -@interface PigeonDocumentSnapshot () -+ (PigeonDocumentSnapshot *)fromList:(NSArray *)list; -+ (nullable PigeonDocumentSnapshot *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; +@interface InternalDocumentSnapshot () ++ (InternalDocumentSnapshot *)fromList:(NSArray *)list; ++ (nullable InternalDocumentSnapshot *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end -@interface PigeonDocumentChange () -+ (PigeonDocumentChange *)fromList:(NSArray *)list; -+ (nullable PigeonDocumentChange *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; +@interface InternalDocumentChange () ++ (InternalDocumentChange *)fromList:(NSArray *)list; ++ (nullable InternalDocumentChange *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end -@interface PigeonQuerySnapshot () -+ (PigeonQuerySnapshot *)fromList:(NSArray *)list; -+ (nullable PigeonQuerySnapshot *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; +@interface InternalQuerySnapshot () ++ (InternalQuerySnapshot *)fromList:(NSArray *)list; ++ (nullable InternalQuerySnapshot *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end -@interface PigeonPipelineResult () -+ (PigeonPipelineResult *)fromList:(NSArray *)list; -+ (nullable PigeonPipelineResult *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; +@interface InternalPipelineResult () ++ (InternalPipelineResult *)fromList:(NSArray *)list; ++ (nullable InternalPipelineResult *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end -@interface PigeonPipelineSnapshot () -+ (PigeonPipelineSnapshot *)fromList:(NSArray *)list; -+ (nullable PigeonPipelineSnapshot *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; +@interface InternalPipelineSnapshot () ++ (InternalPipelineSnapshot *)fromList:(NSArray *)list; ++ (nullable InternalPipelineSnapshot *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end -@interface PigeonGetOptions () -+ (PigeonGetOptions *)fromList:(NSArray *)list; -+ (nullable PigeonGetOptions *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; +@interface InternalGetOptions () ++ (InternalGetOptions *)fromList:(NSArray *)list; ++ (nullable InternalGetOptions *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end -@interface PigeonDocumentOption () -+ (PigeonDocumentOption *)fromList:(NSArray *)list; -+ (nullable PigeonDocumentOption *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; +@interface InternalDocumentOption () ++ (InternalDocumentOption *)fromList:(NSArray *)list; ++ (nullable InternalDocumentOption *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end -@interface PigeonTransactionCommand () -+ (PigeonTransactionCommand *)fromList:(NSArray *)list; -+ (nullable PigeonTransactionCommand *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; +@interface InternalTransactionCommand () ++ (InternalTransactionCommand *)fromList:(NSArray *)list; ++ (nullable InternalTransactionCommand *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end @interface DocumentReferenceRequest () -+ (DocumentReferenceRequest *)fromList:(NSArray *)list; -+ (nullable DocumentReferenceRequest *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; ++ (DocumentReferenceRequest *)fromList:(NSArray *)list; ++ (nullable DocumentReferenceRequest *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end -@interface PigeonQueryParameters () -+ (PigeonQueryParameters *)fromList:(NSArray *)list; -+ (nullable PigeonQueryParameters *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; +@interface InternalQueryParameters () ++ (InternalQueryParameters *)fromList:(NSArray *)list; ++ (nullable InternalQueryParameters *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end @interface AggregateQuery () -+ (AggregateQuery *)fromList:(NSArray *)list; -+ (nullable AggregateQuery *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; ++ (AggregateQuery *)fromList:(NSArray *)list; ++ (nullable AggregateQuery *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end @interface AggregateQueryResponse () -+ (AggregateQueryResponse *)fromList:(NSArray *)list; -+ (nullable AggregateQueryResponse *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; ++ (AggregateQueryResponse *)fromList:(NSArray *)list; ++ (nullable AggregateQueryResponse *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end -@implementation PigeonFirebaseSettings +@implementation InternalFirebaseSettings + (instancetype)makeWithPersistenceEnabled:(nullable NSNumber *)persistenceEnabled host:(nullable NSString *)host sslEnabled:(nullable NSNumber *)sslEnabled cacheSizeBytes:(nullable NSNumber *)cacheSizeBytes - ignoreUndefinedProperties:(NSNumber *)ignoreUndefinedProperties { - PigeonFirebaseSettings *pigeonResult = [[PigeonFirebaseSettings alloc] init]; + ignoreUndefinedProperties:(BOOL)ignoreUndefinedProperties { + InternalFirebaseSettings *pigeonResult = [[InternalFirebaseSettings alloc] init]; pigeonResult.persistenceEnabled = persistenceEnabled; pigeonResult.host = host; pigeonResult.sslEnabled = sslEnabled; @@ -236,33 +324,56 @@ + (instancetype)makeWithPersistenceEnabled:(nullable NSNumber *)persistenceEnabl pigeonResult.ignoreUndefinedProperties = ignoreUndefinedProperties; return pigeonResult; } -+ (PigeonFirebaseSettings *)fromList:(NSArray *)list { - PigeonFirebaseSettings *pigeonResult = [[PigeonFirebaseSettings alloc] init]; ++ (InternalFirebaseSettings *)fromList:(NSArray *)list { + InternalFirebaseSettings *pigeonResult = [[InternalFirebaseSettings alloc] init]; pigeonResult.persistenceEnabled = GetNullableObjectAtIndex(list, 0); pigeonResult.host = GetNullableObjectAtIndex(list, 1); pigeonResult.sslEnabled = GetNullableObjectAtIndex(list, 2); pigeonResult.cacheSizeBytes = GetNullableObjectAtIndex(list, 3); - pigeonResult.ignoreUndefinedProperties = GetNullableObjectAtIndex(list, 4); - NSAssert(pigeonResult.ignoreUndefinedProperties != nil, @""); + pigeonResult.ignoreUndefinedProperties = [GetNullableObjectAtIndex(list, 4) boolValue]; return pigeonResult; } -+ (nullable PigeonFirebaseSettings *)nullableFromList:(NSArray *)list { - return (list) ? [PigeonFirebaseSettings fromList:list] : nil; ++ (nullable InternalFirebaseSettings *)nullableFromList:(NSArray *)list { + return (list) ? [InternalFirebaseSettings fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ - (self.persistenceEnabled ?: [NSNull null]), - (self.host ?: [NSNull null]), - (self.sslEnabled ?: [NSNull null]), - (self.cacheSizeBytes ?: [NSNull null]), - (self.ignoreUndefinedProperties ?: [NSNull null]), + self.persistenceEnabled ?: [NSNull null], + self.host ?: [NSNull null], + self.sslEnabled ?: [NSNull null], + self.cacheSizeBytes ?: [NSNull null], + @(self.ignoreUndefinedProperties), ]; } +- (BOOL)isEqual:(id)object { + if (self == object) { + return YES; + } + if (![object isKindOfClass:[self class]]) { + return NO; + } + InternalFirebaseSettings *other = (InternalFirebaseSettings *)object; + return FLTPigeonDeepEquals(self.persistenceEnabled, other.persistenceEnabled) && + FLTPigeonDeepEquals(self.host, other.host) && + FLTPigeonDeepEquals(self.sslEnabled, other.sslEnabled) && + FLTPigeonDeepEquals(self.cacheSizeBytes, other.cacheSizeBytes) && + self.ignoreUndefinedProperties == other.ignoreUndefinedProperties; +} + +- (NSUInteger)hash { + NSUInteger result = [self class].hash; + result = result * 31 + FLTPigeonDeepHash(self.persistenceEnabled); + result = result * 31 + FLTPigeonDeepHash(self.host); + result = result * 31 + FLTPigeonDeepHash(self.sslEnabled); + result = result * 31 + FLTPigeonDeepHash(self.cacheSizeBytes); + result = result * 31 + @(self.ignoreUndefinedProperties).hash; + return result; +} @end @implementation FirestorePigeonFirebaseApp + (instancetype)makeWithAppName:(NSString *)appName - settings:(PigeonFirebaseSettings *)settings + settings:(InternalFirebaseSettings *)settings databaseURL:(NSString *)databaseURL { FirestorePigeonFirebaseApp *pigeonResult = [[FirestorePigeonFirebaseApp alloc] init]; pigeonResult.appName = appName; @@ -270,306 +381,482 @@ + (instancetype)makeWithAppName:(NSString *)appName pigeonResult.databaseURL = databaseURL; return pigeonResult; } -+ (FirestorePigeonFirebaseApp *)fromList:(NSArray *)list { ++ (FirestorePigeonFirebaseApp *)fromList:(NSArray *)list { FirestorePigeonFirebaseApp *pigeonResult = [[FirestorePigeonFirebaseApp alloc] init]; pigeonResult.appName = GetNullableObjectAtIndex(list, 0); - NSAssert(pigeonResult.appName != nil, @""); - pigeonResult.settings = - [PigeonFirebaseSettings nullableFromList:(GetNullableObjectAtIndex(list, 1))]; - NSAssert(pigeonResult.settings != nil, @""); + pigeonResult.settings = GetNullableObjectAtIndex(list, 1); pigeonResult.databaseURL = GetNullableObjectAtIndex(list, 2); - NSAssert(pigeonResult.databaseURL != nil, @""); return pigeonResult; } -+ (nullable FirestorePigeonFirebaseApp *)nullableFromList:(NSArray *)list { ++ (nullable FirestorePigeonFirebaseApp *)nullableFromList:(NSArray *)list { return (list) ? [FirestorePigeonFirebaseApp fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ - (self.appName ?: [NSNull null]), - (self.settings ? [self.settings toList] : [NSNull null]), - (self.databaseURL ?: [NSNull null]), + self.appName ?: [NSNull null], + self.settings ?: [NSNull null], + self.databaseURL ?: [NSNull null], ]; } +- (BOOL)isEqual:(id)object { + if (self == object) { + return YES; + } + if (![object isKindOfClass:[self class]]) { + return NO; + } + FirestorePigeonFirebaseApp *other = (FirestorePigeonFirebaseApp *)object; + return FLTPigeonDeepEquals(self.appName, other.appName) && + FLTPigeonDeepEquals(self.settings, other.settings) && + FLTPigeonDeepEquals(self.databaseURL, other.databaseURL); +} + +- (NSUInteger)hash { + NSUInteger result = [self class].hash; + result = result * 31 + FLTPigeonDeepHash(self.appName); + result = result * 31 + FLTPigeonDeepHash(self.settings); + result = result * 31 + FLTPigeonDeepHash(self.databaseURL); + return result; +} @end -@implementation PigeonSnapshotMetadata -+ (instancetype)makeWithHasPendingWrites:(NSNumber *)hasPendingWrites - isFromCache:(NSNumber *)isFromCache { - PigeonSnapshotMetadata *pigeonResult = [[PigeonSnapshotMetadata alloc] init]; +@implementation InternalSnapshotMetadata ++ (instancetype)makeWithHasPendingWrites:(BOOL)hasPendingWrites isFromCache:(BOOL)isFromCache { + InternalSnapshotMetadata *pigeonResult = [[InternalSnapshotMetadata alloc] init]; pigeonResult.hasPendingWrites = hasPendingWrites; pigeonResult.isFromCache = isFromCache; return pigeonResult; } -+ (PigeonSnapshotMetadata *)fromList:(NSArray *)list { - PigeonSnapshotMetadata *pigeonResult = [[PigeonSnapshotMetadata alloc] init]; - pigeonResult.hasPendingWrites = GetNullableObjectAtIndex(list, 0); - NSAssert(pigeonResult.hasPendingWrites != nil, @""); - pigeonResult.isFromCache = GetNullableObjectAtIndex(list, 1); - NSAssert(pigeonResult.isFromCache != nil, @""); ++ (InternalSnapshotMetadata *)fromList:(NSArray *)list { + InternalSnapshotMetadata *pigeonResult = [[InternalSnapshotMetadata alloc] init]; + pigeonResult.hasPendingWrites = [GetNullableObjectAtIndex(list, 0) boolValue]; + pigeonResult.isFromCache = [GetNullableObjectAtIndex(list, 1) boolValue]; return pigeonResult; } -+ (nullable PigeonSnapshotMetadata *)nullableFromList:(NSArray *)list { - return (list) ? [PigeonSnapshotMetadata fromList:list] : nil; ++ (nullable InternalSnapshotMetadata *)nullableFromList:(NSArray *)list { + return (list) ? [InternalSnapshotMetadata fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ - (self.hasPendingWrites ?: [NSNull null]), - (self.isFromCache ?: [NSNull null]), + @(self.hasPendingWrites), + @(self.isFromCache), ]; } +- (BOOL)isEqual:(id)object { + if (self == object) { + return YES; + } + if (![object isKindOfClass:[self class]]) { + return NO; + } + InternalSnapshotMetadata *other = (InternalSnapshotMetadata *)object; + return self.hasPendingWrites == other.hasPendingWrites && self.isFromCache == other.isFromCache; +} + +- (NSUInteger)hash { + NSUInteger result = [self class].hash; + result = result * 31 + @(self.hasPendingWrites).hash; + result = result * 31 + @(self.isFromCache).hash; + return result; +} @end -@implementation PigeonDocumentSnapshot +@implementation InternalDocumentSnapshot + (instancetype)makeWithPath:(NSString *)path data:(nullable NSDictionary *)data - metadata:(PigeonSnapshotMetadata *)metadata { - PigeonDocumentSnapshot *pigeonResult = [[PigeonDocumentSnapshot alloc] init]; + metadata:(InternalSnapshotMetadata *)metadata { + InternalDocumentSnapshot *pigeonResult = [[InternalDocumentSnapshot alloc] init]; pigeonResult.path = path; pigeonResult.data = data; pigeonResult.metadata = metadata; return pigeonResult; } -+ (PigeonDocumentSnapshot *)fromList:(NSArray *)list { - PigeonDocumentSnapshot *pigeonResult = [[PigeonDocumentSnapshot alloc] init]; ++ (InternalDocumentSnapshot *)fromList:(NSArray *)list { + InternalDocumentSnapshot *pigeonResult = [[InternalDocumentSnapshot alloc] init]; pigeonResult.path = GetNullableObjectAtIndex(list, 0); - NSAssert(pigeonResult.path != nil, @""); pigeonResult.data = GetNullableObjectAtIndex(list, 1); - pigeonResult.metadata = - [PigeonSnapshotMetadata nullableFromList:(GetNullableObjectAtIndex(list, 2))]; - NSAssert(pigeonResult.metadata != nil, @""); + pigeonResult.metadata = GetNullableObjectAtIndex(list, 2); return pigeonResult; } -+ (nullable PigeonDocumentSnapshot *)nullableFromList:(NSArray *)list { - return (list) ? [PigeonDocumentSnapshot fromList:list] : nil; ++ (nullable InternalDocumentSnapshot *)nullableFromList:(NSArray *)list { + return (list) ? [InternalDocumentSnapshot fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ - (self.path ?: [NSNull null]), - (self.data ?: [NSNull null]), - (self.metadata ? [self.metadata toList] : [NSNull null]), + self.path ?: [NSNull null], + self.data ?: [NSNull null], + self.metadata ?: [NSNull null], ]; } +- (BOOL)isEqual:(id)object { + if (self == object) { + return YES; + } + if (![object isKindOfClass:[self class]]) { + return NO; + } + InternalDocumentSnapshot *other = (InternalDocumentSnapshot *)object; + return FLTPigeonDeepEquals(self.path, other.path) && FLTPigeonDeepEquals(self.data, other.data) && + FLTPigeonDeepEquals(self.metadata, other.metadata); +} + +- (NSUInteger)hash { + NSUInteger result = [self class].hash; + result = result * 31 + FLTPigeonDeepHash(self.path); + result = result * 31 + FLTPigeonDeepHash(self.data); + result = result * 31 + FLTPigeonDeepHash(self.metadata); + return result; +} @end -@implementation PigeonDocumentChange +@implementation InternalDocumentChange + (instancetype)makeWithType:(DocumentChangeType)type - document:(PigeonDocumentSnapshot *)document - oldIndex:(NSNumber *)oldIndex - newIndex:(NSNumber *)newIndex { - PigeonDocumentChange *pigeonResult = [[PigeonDocumentChange alloc] init]; + document:(InternalDocumentSnapshot *)document + oldIndex:(NSInteger)oldIndex + newIndex:(NSInteger)newIndex { + InternalDocumentChange *pigeonResult = [[InternalDocumentChange alloc] init]; pigeonResult.type = type; pigeonResult.document = document; pigeonResult.oldIndex = oldIndex; - pigeonResult.index = newIndex; + pigeonResult.newIndex = newIndex; return pigeonResult; } -+ (PigeonDocumentChange *)fromList:(NSArray *)list { - PigeonDocumentChange *pigeonResult = [[PigeonDocumentChange alloc] init]; - pigeonResult.type = [GetNullableObjectAtIndex(list, 0) integerValue]; - pigeonResult.document = - [PigeonDocumentSnapshot nullableFromList:(GetNullableObjectAtIndex(list, 1))]; - NSAssert(pigeonResult.document != nil, @""); - pigeonResult.oldIndex = GetNullableObjectAtIndex(list, 2); - NSAssert(pigeonResult.oldIndex != nil, @""); - pigeonResult.index = GetNullableObjectAtIndex(list, 3); - NSAssert(pigeonResult.index != nil, @""); ++ (InternalDocumentChange *)fromList:(NSArray *)list { + InternalDocumentChange *pigeonResult = [[InternalDocumentChange alloc] init]; + DocumentChangeTypeBox *boxedDocumentChangeType = GetNullableObjectAtIndex(list, 0); + pigeonResult.type = boxedDocumentChangeType.value; + pigeonResult.document = GetNullableObjectAtIndex(list, 1); + pigeonResult.oldIndex = [GetNullableObjectAtIndex(list, 2) integerValue]; + pigeonResult.newIndex = [GetNullableObjectAtIndex(list, 3) integerValue]; return pigeonResult; } -+ (nullable PigeonDocumentChange *)nullableFromList:(NSArray *)list { - return (list) ? [PigeonDocumentChange fromList:list] : nil; ++ (nullable InternalDocumentChange *)nullableFromList:(NSArray *)list { + return (list) ? [InternalDocumentChange fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ - @(self.type), - (self.document ? [self.document toList] : [NSNull null]), - (self.oldIndex ?: [NSNull null]), - (self.index ?: [NSNull null]), + [[DocumentChangeTypeBox alloc] initWithValue:self.type], + self.document ?: [NSNull null], + @(self.oldIndex), + @(self.newIndex), ]; } +- (BOOL)isEqual:(id)object { + if (self == object) { + return YES; + } + if (![object isKindOfClass:[self class]]) { + return NO; + } + InternalDocumentChange *other = (InternalDocumentChange *)object; + return self.type == other.type && FLTPigeonDeepEquals(self.document, other.document) && + self.oldIndex == other.oldIndex && self.newIndex == other.newIndex; +} + +- (NSUInteger)hash { + NSUInteger result = [self class].hash; + result = result * 31 + @(self.type).hash; + result = result * 31 + FLTPigeonDeepHash(self.document); + result = result * 31 + @(self.oldIndex).hash; + result = result * 31 + @(self.newIndex).hash; + return result; +} @end -@implementation PigeonQuerySnapshot -+ (instancetype)makeWithDocuments:(NSArray *)documents - documentChanges:(NSArray *)documentChanges - metadata:(PigeonSnapshotMetadata *)metadata { - PigeonQuerySnapshot *pigeonResult = [[PigeonQuerySnapshot alloc] init]; +@implementation InternalQuerySnapshot ++ (instancetype)makeWithDocuments:(NSArray *)documents + documentChanges:(NSArray *)documentChanges + metadata:(InternalSnapshotMetadata *)metadata { + InternalQuerySnapshot *pigeonResult = [[InternalQuerySnapshot alloc] init]; pigeonResult.documents = documents; pigeonResult.documentChanges = documentChanges; pigeonResult.metadata = metadata; return pigeonResult; } -+ (PigeonQuerySnapshot *)fromList:(NSArray *)list { - PigeonQuerySnapshot *pigeonResult = [[PigeonQuerySnapshot alloc] init]; ++ (InternalQuerySnapshot *)fromList:(NSArray *)list { + InternalQuerySnapshot *pigeonResult = [[InternalQuerySnapshot alloc] init]; pigeonResult.documents = GetNullableObjectAtIndex(list, 0); - NSAssert(pigeonResult.documents != nil, @""); pigeonResult.documentChanges = GetNullableObjectAtIndex(list, 1); - NSAssert(pigeonResult.documentChanges != nil, @""); - pigeonResult.metadata = - [PigeonSnapshotMetadata nullableFromList:(GetNullableObjectAtIndex(list, 2))]; - NSAssert(pigeonResult.metadata != nil, @""); + pigeonResult.metadata = GetNullableObjectAtIndex(list, 2); return pigeonResult; } -+ (nullable PigeonQuerySnapshot *)nullableFromList:(NSArray *)list { - return (list) ? [PigeonQuerySnapshot fromList:list] : nil; ++ (nullable InternalQuerySnapshot *)nullableFromList:(NSArray *)list { + return (list) ? [InternalQuerySnapshot fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ - (self.documents ?: [NSNull null]), - (self.documentChanges ?: [NSNull null]), - (self.metadata ? [self.metadata toList] : [NSNull null]), + self.documents ?: [NSNull null], + self.documentChanges ?: [NSNull null], + self.metadata ?: [NSNull null], ]; } +- (BOOL)isEqual:(id)object { + if (self == object) { + return YES; + } + if (![object isKindOfClass:[self class]]) { + return NO; + } + InternalQuerySnapshot *other = (InternalQuerySnapshot *)object; + return FLTPigeonDeepEquals(self.documents, other.documents) && + FLTPigeonDeepEquals(self.documentChanges, other.documentChanges) && + FLTPigeonDeepEquals(self.metadata, other.metadata); +} + +- (NSUInteger)hash { + NSUInteger result = [self class].hash; + result = result * 31 + FLTPigeonDeepHash(self.documents); + result = result * 31 + FLTPigeonDeepHash(self.documentChanges); + result = result * 31 + FLTPigeonDeepHash(self.metadata); + return result; +} @end -@implementation PigeonPipelineResult +@implementation InternalPipelineResult + (instancetype)makeWithDocumentPath:(nullable NSString *)documentPath createTime:(nullable NSNumber *)createTime updateTime:(nullable NSNumber *)updateTime data:(nullable NSDictionary *)data { - PigeonPipelineResult *pigeonResult = [[PigeonPipelineResult alloc] init]; + InternalPipelineResult *pigeonResult = [[InternalPipelineResult alloc] init]; pigeonResult.documentPath = documentPath; pigeonResult.createTime = createTime; pigeonResult.updateTime = updateTime; pigeonResult.data = data; return pigeonResult; } -+ (PigeonPipelineResult *)fromList:(NSArray *)list { - PigeonPipelineResult *pigeonResult = [[PigeonPipelineResult alloc] init]; ++ (InternalPipelineResult *)fromList:(NSArray *)list { + InternalPipelineResult *pigeonResult = [[InternalPipelineResult alloc] init]; pigeonResult.documentPath = GetNullableObjectAtIndex(list, 0); pigeonResult.createTime = GetNullableObjectAtIndex(list, 1); pigeonResult.updateTime = GetNullableObjectAtIndex(list, 2); pigeonResult.data = GetNullableObjectAtIndex(list, 3); return pigeonResult; } -+ (nullable PigeonPipelineResult *)nullableFromList:(NSArray *)list { - return (list) ? [PigeonPipelineResult fromList:list] : nil; ++ (nullable InternalPipelineResult *)nullableFromList:(NSArray *)list { + return (list) ? [InternalPipelineResult fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ - (self.documentPath ?: [NSNull null]), - (self.createTime ?: [NSNull null]), - (self.updateTime ?: [NSNull null]), - (self.data ?: [NSNull null]), + self.documentPath ?: [NSNull null], + self.createTime ?: [NSNull null], + self.updateTime ?: [NSNull null], + self.data ?: [NSNull null], ]; } +- (BOOL)isEqual:(id)object { + if (self == object) { + return YES; + } + if (![object isKindOfClass:[self class]]) { + return NO; + } + InternalPipelineResult *other = (InternalPipelineResult *)object; + return FLTPigeonDeepEquals(self.documentPath, other.documentPath) && + FLTPigeonDeepEquals(self.createTime, other.createTime) && + FLTPigeonDeepEquals(self.updateTime, other.updateTime) && + FLTPigeonDeepEquals(self.data, other.data); +} + +- (NSUInteger)hash { + NSUInteger result = [self class].hash; + result = result * 31 + FLTPigeonDeepHash(self.documentPath); + result = result * 31 + FLTPigeonDeepHash(self.createTime); + result = result * 31 + FLTPigeonDeepHash(self.updateTime); + result = result * 31 + FLTPigeonDeepHash(self.data); + return result; +} @end -@implementation PigeonPipelineSnapshot -+ (instancetype)makeWithResults:(NSArray *)results - executionTime:(NSNumber *)executionTime { - PigeonPipelineSnapshot *pigeonResult = [[PigeonPipelineSnapshot alloc] init]; +@implementation InternalPipelineSnapshot ++ (instancetype)makeWithResults:(NSArray *)results + executionTime:(NSInteger)executionTime { + InternalPipelineSnapshot *pigeonResult = [[InternalPipelineSnapshot alloc] init]; pigeonResult.results = results; pigeonResult.executionTime = executionTime; return pigeonResult; } -+ (PigeonPipelineSnapshot *)fromList:(NSArray *)list { - PigeonPipelineSnapshot *pigeonResult = [[PigeonPipelineSnapshot alloc] init]; ++ (InternalPipelineSnapshot *)fromList:(NSArray *)list { + InternalPipelineSnapshot *pigeonResult = [[InternalPipelineSnapshot alloc] init]; pigeonResult.results = GetNullableObjectAtIndex(list, 0); - NSAssert(pigeonResult.results != nil, @""); - pigeonResult.executionTime = GetNullableObjectAtIndex(list, 1); - NSAssert(pigeonResult.executionTime != nil, @""); + pigeonResult.executionTime = [GetNullableObjectAtIndex(list, 1) integerValue]; return pigeonResult; } -+ (nullable PigeonPipelineSnapshot *)nullableFromList:(NSArray *)list { - return (list) ? [PigeonPipelineSnapshot fromList:list] : nil; ++ (nullable InternalPipelineSnapshot *)nullableFromList:(NSArray *)list { + return (list) ? [InternalPipelineSnapshot fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ - (self.results ?: [NSNull null]), - (self.executionTime ?: [NSNull null]), + self.results ?: [NSNull null], + @(self.executionTime), ]; } +- (BOOL)isEqual:(id)object { + if (self == object) { + return YES; + } + if (![object isKindOfClass:[self class]]) { + return NO; + } + InternalPipelineSnapshot *other = (InternalPipelineSnapshot *)object; + return FLTPigeonDeepEquals(self.results, other.results) && + self.executionTime == other.executionTime; +} + +- (NSUInteger)hash { + NSUInteger result = [self class].hash; + result = result * 31 + FLTPigeonDeepHash(self.results); + result = result * 31 + @(self.executionTime).hash; + return result; +} @end -@implementation PigeonGetOptions +@implementation InternalGetOptions + (instancetype)makeWithSource:(Source)source serverTimestampBehavior:(ServerTimestampBehavior)serverTimestampBehavior { - PigeonGetOptions *pigeonResult = [[PigeonGetOptions alloc] init]; + InternalGetOptions *pigeonResult = [[InternalGetOptions alloc] init]; pigeonResult.source = source; pigeonResult.serverTimestampBehavior = serverTimestampBehavior; return pigeonResult; } -+ (PigeonGetOptions *)fromList:(NSArray *)list { - PigeonGetOptions *pigeonResult = [[PigeonGetOptions alloc] init]; - pigeonResult.source = [GetNullableObjectAtIndex(list, 0) integerValue]; - pigeonResult.serverTimestampBehavior = [GetNullableObjectAtIndex(list, 1) integerValue]; ++ (InternalGetOptions *)fromList:(NSArray *)list { + InternalGetOptions *pigeonResult = [[InternalGetOptions alloc] init]; + SourceBox *boxedSource = GetNullableObjectAtIndex(list, 0); + pigeonResult.source = boxedSource.value; + ServerTimestampBehaviorBox *boxedServerTimestampBehavior = GetNullableObjectAtIndex(list, 1); + pigeonResult.serverTimestampBehavior = boxedServerTimestampBehavior.value; return pigeonResult; } -+ (nullable PigeonGetOptions *)nullableFromList:(NSArray *)list { - return (list) ? [PigeonGetOptions fromList:list] : nil; ++ (nullable InternalGetOptions *)nullableFromList:(NSArray *)list { + return (list) ? [InternalGetOptions fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ - @(self.source), - @(self.serverTimestampBehavior), + [[SourceBox alloc] initWithValue:self.source], + [[ServerTimestampBehaviorBox alloc] initWithValue:self.serverTimestampBehavior], ]; } +- (BOOL)isEqual:(id)object { + if (self == object) { + return YES; + } + if (![object isKindOfClass:[self class]]) { + return NO; + } + InternalGetOptions *other = (InternalGetOptions *)object; + return self.source == other.source && + self.serverTimestampBehavior == other.serverTimestampBehavior; +} + +- (NSUInteger)hash { + NSUInteger result = [self class].hash; + result = result * 31 + @(self.source).hash; + result = result * 31 + @(self.serverTimestampBehavior).hash; + return result; +} @end -@implementation PigeonDocumentOption +@implementation InternalDocumentOption + (instancetype)makeWithMerge:(nullable NSNumber *)merge mergeFields:(nullable NSArray *> *)mergeFields { - PigeonDocumentOption *pigeonResult = [[PigeonDocumentOption alloc] init]; + InternalDocumentOption *pigeonResult = [[InternalDocumentOption alloc] init]; pigeonResult.merge = merge; pigeonResult.mergeFields = mergeFields; return pigeonResult; } -+ (PigeonDocumentOption *)fromList:(NSArray *)list { - PigeonDocumentOption *pigeonResult = [[PigeonDocumentOption alloc] init]; ++ (InternalDocumentOption *)fromList:(NSArray *)list { + InternalDocumentOption *pigeonResult = [[InternalDocumentOption alloc] init]; pigeonResult.merge = GetNullableObjectAtIndex(list, 0); pigeonResult.mergeFields = GetNullableObjectAtIndex(list, 1); return pigeonResult; } -+ (nullable PigeonDocumentOption *)nullableFromList:(NSArray *)list { - return (list) ? [PigeonDocumentOption fromList:list] : nil; ++ (nullable InternalDocumentOption *)nullableFromList:(NSArray *)list { + return (list) ? [InternalDocumentOption fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ - (self.merge ?: [NSNull null]), - (self.mergeFields ?: [NSNull null]), + self.merge ?: [NSNull null], + self.mergeFields ?: [NSNull null], ]; } +- (BOOL)isEqual:(id)object { + if (self == object) { + return YES; + } + if (![object isKindOfClass:[self class]]) { + return NO; + } + InternalDocumentOption *other = (InternalDocumentOption *)object; + return FLTPigeonDeepEquals(self.merge, other.merge) && + FLTPigeonDeepEquals(self.mergeFields, other.mergeFields); +} + +- (NSUInteger)hash { + NSUInteger result = [self class].hash; + result = result * 31 + FLTPigeonDeepHash(self.merge); + result = result * 31 + FLTPigeonDeepHash(self.mergeFields); + return result; +} @end -@implementation PigeonTransactionCommand -+ (instancetype)makeWithType:(PigeonTransactionType)type +@implementation InternalTransactionCommand ++ (instancetype)makeWithType:(InternalTransactionType)type path:(NSString *)path data:(nullable NSDictionary *)data - option:(nullable PigeonDocumentOption *)option { - PigeonTransactionCommand *pigeonResult = [[PigeonTransactionCommand alloc] init]; + option:(nullable InternalDocumentOption *)option { + InternalTransactionCommand *pigeonResult = [[InternalTransactionCommand alloc] init]; pigeonResult.type = type; pigeonResult.path = path; pigeonResult.data = data; pigeonResult.option = option; return pigeonResult; } -+ (PigeonTransactionCommand *)fromList:(NSArray *)list { - PigeonTransactionCommand *pigeonResult = [[PigeonTransactionCommand alloc] init]; - pigeonResult.type = [GetNullableObjectAtIndex(list, 0) integerValue]; ++ (InternalTransactionCommand *)fromList:(NSArray *)list { + InternalTransactionCommand *pigeonResult = [[InternalTransactionCommand alloc] init]; + InternalTransactionTypeBox *boxedInternalTransactionType = GetNullableObjectAtIndex(list, 0); + pigeonResult.type = boxedInternalTransactionType.value; pigeonResult.path = GetNullableObjectAtIndex(list, 1); - NSAssert(pigeonResult.path != nil, @""); pigeonResult.data = GetNullableObjectAtIndex(list, 2); - pigeonResult.option = [PigeonDocumentOption nullableFromList:(GetNullableObjectAtIndex(list, 3))]; + pigeonResult.option = GetNullableObjectAtIndex(list, 3); return pigeonResult; } -+ (nullable PigeonTransactionCommand *)nullableFromList:(NSArray *)list { - return (list) ? [PigeonTransactionCommand fromList:list] : nil; ++ (nullable InternalTransactionCommand *)nullableFromList:(NSArray *)list { + return (list) ? [InternalTransactionCommand fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ - @(self.type), - (self.path ?: [NSNull null]), - (self.data ?: [NSNull null]), - (self.option ? [self.option toList] : [NSNull null]), + [[InternalTransactionTypeBox alloc] initWithValue:self.type], + self.path ?: [NSNull null], + self.data ?: [NSNull null], + self.option ?: [NSNull null], ]; } +- (BOOL)isEqual:(id)object { + if (self == object) { + return YES; + } + if (![object isKindOfClass:[self class]]) { + return NO; + } + InternalTransactionCommand *other = (InternalTransactionCommand *)object; + return self.type == other.type && FLTPigeonDeepEquals(self.path, other.path) && + FLTPigeonDeepEquals(self.data, other.data) && + FLTPigeonDeepEquals(self.option, other.option); +} + +- (NSUInteger)hash { + NSUInteger result = [self class].hash; + result = result * 31 + @(self.type).hash; + result = result * 31 + FLTPigeonDeepHash(self.path); + result = result * 31 + FLTPigeonDeepHash(self.data); + result = result * 31 + FLTPigeonDeepHash(self.option); + return result; +} @end @implementation DocumentReferenceRequest + (instancetype)makeWithPath:(NSString *)path data:(nullable NSDictionary *)data - option:(nullable PigeonDocumentOption *)option + option:(nullable InternalDocumentOption *)option source:(nullable SourceBox *)source serverTimestampBehavior:(nullable ServerTimestampBehaviorBox *)serverTimestampBehavior { DocumentReferenceRequest *pigeonResult = [[DocumentReferenceRequest alloc] init]; @@ -580,42 +867,53 @@ + (instancetype)makeWithPath:(NSString *)path pigeonResult.serverTimestampBehavior = serverTimestampBehavior; return pigeonResult; } -+ (DocumentReferenceRequest *)fromList:(NSArray *)list { ++ (DocumentReferenceRequest *)fromList:(NSArray *)list { DocumentReferenceRequest *pigeonResult = [[DocumentReferenceRequest alloc] init]; pigeonResult.path = GetNullableObjectAtIndex(list, 0); - NSAssert(pigeonResult.path != nil, @""); pigeonResult.data = GetNullableObjectAtIndex(list, 1); - pigeonResult.option = [PigeonDocumentOption nullableFromList:(GetNullableObjectAtIndex(list, 2))]; - NSNumber *sourceAsNumber = GetNullableObjectAtIndex(list, 3); - SourceBox *source = - sourceAsNumber == nil ? nil : [[SourceBox alloc] initWithValue:[sourceAsNumber integerValue]]; - pigeonResult.source = source; - NSNumber *serverTimestampBehaviorAsNumber = GetNullableObjectAtIndex(list, 4); - ServerTimestampBehaviorBox *serverTimestampBehavior = - serverTimestampBehaviorAsNumber == nil - ? nil - : [[ServerTimestampBehaviorBox alloc] - initWithValue:[serverTimestampBehaviorAsNumber integerValue]]; - pigeonResult.serverTimestampBehavior = serverTimestampBehavior; + pigeonResult.option = GetNullableObjectAtIndex(list, 2); + pigeonResult.source = GetNullableObjectAtIndex(list, 3); + pigeonResult.serverTimestampBehavior = GetNullableObjectAtIndex(list, 4); return pigeonResult; } -+ (nullable DocumentReferenceRequest *)nullableFromList:(NSArray *)list { ++ (nullable DocumentReferenceRequest *)nullableFromList:(NSArray *)list { return (list) ? [DocumentReferenceRequest fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ - (self.path ?: [NSNull null]), - (self.data ?: [NSNull null]), - (self.option ? [self.option toList] : [NSNull null]), - (self.source == nil ? [NSNull null] : [NSNumber numberWithInteger:self.source.value]), - (self.serverTimestampBehavior == nil - ? [NSNull null] - : [NSNumber numberWithInteger:self.serverTimestampBehavior.value]), + self.path ?: [NSNull null], + self.data ?: [NSNull null], + self.option ?: [NSNull null], + self.source ?: [NSNull null], + self.serverTimestampBehavior ?: [NSNull null], ]; } +- (BOOL)isEqual:(id)object { + if (self == object) { + return YES; + } + if (![object isKindOfClass:[self class]]) { + return NO; + } + DocumentReferenceRequest *other = (DocumentReferenceRequest *)object; + return FLTPigeonDeepEquals(self.path, other.path) && FLTPigeonDeepEquals(self.data, other.data) && + FLTPigeonDeepEquals(self.option, other.option) && + FLTPigeonDeepEquals(self.source, other.source) && + FLTPigeonDeepEquals(self.serverTimestampBehavior, other.serverTimestampBehavior); +} + +- (NSUInteger)hash { + NSUInteger result = [self class].hash; + result = result * 31 + FLTPigeonDeepHash(self.path); + result = result * 31 + FLTPigeonDeepHash(self.data); + result = result * 31 + FLTPigeonDeepHash(self.option); + result = result * 31 + FLTPigeonDeepHash(self.source); + result = result * 31 + FLTPigeonDeepHash(self.serverTimestampBehavior); + return result; +} @end -@implementation PigeonQueryParameters +@implementation InternalQueryParameters + (instancetype)makeWithWhere:(nullable NSArray *> *)where orderBy:(nullable NSArray *> *)orderBy limit:(nullable NSNumber *)limit @@ -625,7 +923,7 @@ + (instancetype)makeWithWhere:(nullable NSArray *> *)where endAt:(nullable NSArray *)endAt endBefore:(nullable NSArray *)endBefore filters:(nullable NSDictionary *)filters { - PigeonQueryParameters *pigeonResult = [[PigeonQueryParameters alloc] init]; + InternalQueryParameters *pigeonResult = [[InternalQueryParameters alloc] init]; pigeonResult.where = where; pigeonResult.orderBy = orderBy; pigeonResult.limit = limit; @@ -637,8 +935,8 @@ + (instancetype)makeWithWhere:(nullable NSArray *> *)where pigeonResult.filters = filters; return pigeonResult; } -+ (PigeonQueryParameters *)fromList:(NSArray *)list { - PigeonQueryParameters *pigeonResult = [[PigeonQueryParameters alloc] init]; ++ (InternalQueryParameters *)fromList:(NSArray *)list { + InternalQueryParameters *pigeonResult = [[InternalQueryParameters alloc] init]; pigeonResult.where = GetNullableObjectAtIndex(list, 0); pigeonResult.orderBy = GetNullableObjectAtIndex(list, 1); pigeonResult.limit = GetNullableObjectAtIndex(list, 2); @@ -650,22 +948,54 @@ + (PigeonQueryParameters *)fromList:(NSArray *)list { pigeonResult.filters = GetNullableObjectAtIndex(list, 8); return pigeonResult; } -+ (nullable PigeonQueryParameters *)nullableFromList:(NSArray *)list { - return (list) ? [PigeonQueryParameters fromList:list] : nil; ++ (nullable InternalQueryParameters *)nullableFromList:(NSArray *)list { + return (list) ? [InternalQueryParameters fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ - (self.where ?: [NSNull null]), - (self.orderBy ?: [NSNull null]), - (self.limit ?: [NSNull null]), - (self.limitToLast ?: [NSNull null]), - (self.startAt ?: [NSNull null]), - (self.startAfter ?: [NSNull null]), - (self.endAt ?: [NSNull null]), - (self.endBefore ?: [NSNull null]), - (self.filters ?: [NSNull null]), + self.where ?: [NSNull null], + self.orderBy ?: [NSNull null], + self.limit ?: [NSNull null], + self.limitToLast ?: [NSNull null], + self.startAt ?: [NSNull null], + self.startAfter ?: [NSNull null], + self.endAt ?: [NSNull null], + self.endBefore ?: [NSNull null], + self.filters ?: [NSNull null], ]; } +- (BOOL)isEqual:(id)object { + if (self == object) { + return YES; + } + if (![object isKindOfClass:[self class]]) { + return NO; + } + InternalQueryParameters *other = (InternalQueryParameters *)object; + return FLTPigeonDeepEquals(self.where, other.where) && + FLTPigeonDeepEquals(self.orderBy, other.orderBy) && + FLTPigeonDeepEquals(self.limit, other.limit) && + FLTPigeonDeepEquals(self.limitToLast, other.limitToLast) && + FLTPigeonDeepEquals(self.startAt, other.startAt) && + FLTPigeonDeepEquals(self.startAfter, other.startAfter) && + FLTPigeonDeepEquals(self.endAt, other.endAt) && + FLTPigeonDeepEquals(self.endBefore, other.endBefore) && + FLTPigeonDeepEquals(self.filters, other.filters); +} + +- (NSUInteger)hash { + NSUInteger result = [self class].hash; + result = result * 31 + FLTPigeonDeepHash(self.where); + result = result * 31 + FLTPigeonDeepHash(self.orderBy); + result = result * 31 + FLTPigeonDeepHash(self.limit); + result = result * 31 + FLTPigeonDeepHash(self.limitToLast); + result = result * 31 + FLTPigeonDeepHash(self.startAt); + result = result * 31 + FLTPigeonDeepHash(self.startAfter); + result = result * 31 + FLTPigeonDeepHash(self.endAt); + result = result * 31 + FLTPigeonDeepHash(self.endBefore); + result = result * 31 + FLTPigeonDeepHash(self.filters); + return result; +} @end @implementation AggregateQuery @@ -675,21 +1005,39 @@ + (instancetype)makeWithType:(AggregateType)type field:(nullable NSString *)fiel pigeonResult.field = field; return pigeonResult; } -+ (AggregateQuery *)fromList:(NSArray *)list { ++ (AggregateQuery *)fromList:(NSArray *)list { AggregateQuery *pigeonResult = [[AggregateQuery alloc] init]; - pigeonResult.type = [GetNullableObjectAtIndex(list, 0) integerValue]; + AggregateTypeBox *boxedAggregateType = GetNullableObjectAtIndex(list, 0); + pigeonResult.type = boxedAggregateType.value; pigeonResult.field = GetNullableObjectAtIndex(list, 1); return pigeonResult; } -+ (nullable AggregateQuery *)nullableFromList:(NSArray *)list { ++ (nullable AggregateQuery *)nullableFromList:(NSArray *)list { return (list) ? [AggregateQuery fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ - @(self.type), - (self.field ?: [NSNull null]), + [[AggregateTypeBox alloc] initWithValue:self.type], + self.field ?: [NSNull null], ]; } +- (BOOL)isEqual:(id)object { + if (self == object) { + return YES; + } + if (![object isKindOfClass:[self class]]) { + return NO; + } + AggregateQuery *other = (AggregateQuery *)object; + return self.type == other.type && FLTPigeonDeepEquals(self.field, other.field); +} + +- (NSUInteger)hash { + NSUInteger result = [self class].hash; + result = result * 31 + @(self.type).hash; + result = result * 31 + FLTPigeonDeepHash(self.field); + return result; +} @end @implementation AggregateQueryResponse @@ -702,23 +1050,43 @@ + (instancetype)makeWithType:(AggregateType)type pigeonResult.value = value; return pigeonResult; } -+ (AggregateQueryResponse *)fromList:(NSArray *)list { ++ (AggregateQueryResponse *)fromList:(NSArray *)list { AggregateQueryResponse *pigeonResult = [[AggregateQueryResponse alloc] init]; - pigeonResult.type = [GetNullableObjectAtIndex(list, 0) integerValue]; + AggregateTypeBox *boxedAggregateType = GetNullableObjectAtIndex(list, 0); + pigeonResult.type = boxedAggregateType.value; pigeonResult.field = GetNullableObjectAtIndex(list, 1); pigeonResult.value = GetNullableObjectAtIndex(list, 2); return pigeonResult; } -+ (nullable AggregateQueryResponse *)nullableFromList:(NSArray *)list { ++ (nullable AggregateQueryResponse *)nullableFromList:(NSArray *)list { return (list) ? [AggregateQueryResponse fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ - @(self.type), - (self.field ?: [NSNull null]), - (self.value ?: [NSNull null]), + [[AggregateTypeBox alloc] initWithValue:self.type], + self.field ?: [NSNull null], + self.value ?: [NSNull null], ]; } +- (BOOL)isEqual:(id)object { + if (self == object) { + return YES; + } + if (![object isKindOfClass:[self class]]) { + return NO; + } + AggregateQueryResponse *other = (AggregateQueryResponse *)object; + return self.type == other.type && FLTPigeonDeepEquals(self.field, other.field) && + FLTPigeonDeepEquals(self.value, other.value); +} + +- (NSUInteger)hash { + NSUInteger result = [self class].hash; + result = result * 31 + @(self.type).hash; + result = result * 31 + FLTPigeonDeepHash(self.field); + result = result * 31 + FLTPigeonDeepHash(self.value); + return result; +} @end @interface FirebaseFirestoreHostApiCodecReader : FLTFirebaseFirestoreReader @@ -726,36 +1094,89 @@ @interface FirebaseFirestoreHostApiCodecReader : FLTFirebaseFirestoreReader @implementation FirebaseFirestoreHostApiCodecReader - (nullable id)readValueOfType:(UInt8)type { switch (type) { - case 128: - return [AggregateQuery fromList:[self readValue]]; - case 129: - return [AggregateQueryResponse fromList:[self readValue]]; - case 130: - return [DocumentReferenceRequest fromList:[self readValue]]; - case 131: - return [FirestorePigeonFirebaseApp fromList:[self readValue]]; - case 132: - return [PigeonDocumentChange fromList:[self readValue]]; - case 133: - return [PigeonDocumentOption fromList:[self readValue]]; - case 134: - return [PigeonDocumentSnapshot fromList:[self readValue]]; - case 135: - return [PigeonFirebaseSettings fromList:[self readValue]]; - case 136: - return [PigeonGetOptions fromList:[self readValue]]; - case 137: - return [PigeonPipelineResult fromList:[self readValue]]; + case 129: { + NSNumber *enumAsNumber = [self readValue]; + return enumAsNumber == nil + ? nil + : [[DocumentChangeTypeBox alloc] initWithValue:[enumAsNumber integerValue]]; + } + case 130: { + NSNumber *enumAsNumber = [self readValue]; + return enumAsNumber == nil ? nil + : [[SourceBox alloc] initWithValue:[enumAsNumber integerValue]]; + } + case 131: { + NSNumber *enumAsNumber = [self readValue]; + return enumAsNumber == nil + ? nil + : [[ListenSourceBox alloc] initWithValue:[enumAsNumber integerValue]]; + } + case 132: { + NSNumber *enumAsNumber = [self readValue]; + return enumAsNumber == nil + ? nil + : [[ServerTimestampBehaviorBox alloc] initWithValue:[enumAsNumber integerValue]]; + } + case 133: { + NSNumber *enumAsNumber = [self readValue]; + return enumAsNumber == nil + ? nil + : [[AggregateSourceBox alloc] initWithValue:[enumAsNumber integerValue]]; + } + case 134: { + NSNumber *enumAsNumber = [self readValue]; + return enumAsNumber == nil ? nil + : [[PersistenceCacheIndexManagerRequestBox alloc] + initWithValue:[enumAsNumber integerValue]]; + } + case 135: { + NSNumber *enumAsNumber = [self readValue]; + return enumAsNumber == nil + ? nil + : [[InternalTransactionResultBox alloc] initWithValue:[enumAsNumber integerValue]]; + } + case 136: { + NSNumber *enumAsNumber = [self readValue]; + return enumAsNumber == nil + ? nil + : [[InternalTransactionTypeBox alloc] initWithValue:[enumAsNumber integerValue]]; + } + case 137: { + NSNumber *enumAsNumber = [self readValue]; + return enumAsNumber == nil + ? nil + : [[AggregateTypeBox alloc] initWithValue:[enumAsNumber integerValue]]; + } case 138: - return [PigeonPipelineSnapshot fromList:[self readValue]]; + return [InternalFirebaseSettings fromList:[self readValue]]; case 139: - return [PigeonQueryParameters fromList:[self readValue]]; + return [FirestorePigeonFirebaseApp fromList:[self readValue]]; case 140: - return [PigeonQuerySnapshot fromList:[self readValue]]; + return [InternalSnapshotMetadata fromList:[self readValue]]; case 141: - return [PigeonSnapshotMetadata fromList:[self readValue]]; + return [InternalDocumentSnapshot fromList:[self readValue]]; case 142: - return [PigeonTransactionCommand fromList:[self readValue]]; + return [InternalDocumentChange fromList:[self readValue]]; + case 143: + return [InternalQuerySnapshot fromList:[self readValue]]; + case 144: + return [InternalPipelineResult fromList:[self readValue]]; + case 145: + return [InternalPipelineSnapshot fromList:[self readValue]]; + case 146: + return [InternalGetOptions fromList:[self readValue]]; + case 147: + return [InternalDocumentOption fromList:[self readValue]]; + case 148: + return [InternalTransactionCommand fromList:[self readValue]]; + case 149: + return [DocumentReferenceRequest fromList:[self readValue]]; + case 150: + return [InternalQueryParameters fromList:[self readValue]]; + case 151: + return [AggregateQuery fromList:[self readValue]]; + case 152: + return [AggregateQueryResponse fromList:[self readValue]]; default: return [super readValueOfType:type]; } @@ -766,51 +1187,87 @@ @interface FirebaseFirestoreHostApiCodecWriter : FLTFirebaseFirestoreWriter @end @implementation FirebaseFirestoreHostApiCodecWriter - (void)writeValue:(id)value { - if ([value isKindOfClass:[AggregateQuery class]]) { - [self writeByte:128]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[AggregateQueryResponse class]]) { + if ([value isKindOfClass:[DocumentChangeTypeBox class]]) { + DocumentChangeTypeBox *box = (DocumentChangeTypeBox *)value; [self writeByte:129]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[DocumentReferenceRequest class]]) { + [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; + } else if ([value isKindOfClass:[SourceBox class]]) { + SourceBox *box = (SourceBox *)value; [self writeByte:130]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FirestorePigeonFirebaseApp class]]) { + [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; + } else if ([value isKindOfClass:[ListenSourceBox class]]) { + ListenSourceBox *box = (ListenSourceBox *)value; [self writeByte:131]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonDocumentChange class]]) { + [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; + } else if ([value isKindOfClass:[ServerTimestampBehaviorBox class]]) { + ServerTimestampBehaviorBox *box = (ServerTimestampBehaviorBox *)value; [self writeByte:132]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonDocumentOption class]]) { + [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; + } else if ([value isKindOfClass:[AggregateSourceBox class]]) { + AggregateSourceBox *box = (AggregateSourceBox *)value; [self writeByte:133]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonDocumentSnapshot class]]) { + [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; + } else if ([value isKindOfClass:[PersistenceCacheIndexManagerRequestBox class]]) { + PersistenceCacheIndexManagerRequestBox *box = (PersistenceCacheIndexManagerRequestBox *)value; [self writeByte:134]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonFirebaseSettings class]]) { + [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; + } else if ([value isKindOfClass:[InternalTransactionResultBox class]]) { + InternalTransactionResultBox *box = (InternalTransactionResultBox *)value; [self writeByte:135]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonGetOptions class]]) { + [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; + } else if ([value isKindOfClass:[InternalTransactionTypeBox class]]) { + InternalTransactionTypeBox *box = (InternalTransactionTypeBox *)value; [self writeByte:136]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonPipelineResult class]]) { + [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; + } else if ([value isKindOfClass:[AggregateTypeBox class]]) { + AggregateTypeBox *box = (AggregateTypeBox *)value; [self writeByte:137]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonPipelineSnapshot class]]) { + [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; + } else if ([value isKindOfClass:[InternalFirebaseSettings class]]) { [self writeByte:138]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonQueryParameters class]]) { + } else if ([value isKindOfClass:[FirestorePigeonFirebaseApp class]]) { [self writeByte:139]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonQuerySnapshot class]]) { + } else if ([value isKindOfClass:[InternalSnapshotMetadata class]]) { [self writeByte:140]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonSnapshotMetadata class]]) { + } else if ([value isKindOfClass:[InternalDocumentSnapshot class]]) { [self writeByte:141]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonTransactionCommand class]]) { + } else if ([value isKindOfClass:[InternalDocumentChange class]]) { [self writeByte:142]; [self writeValue:[value toList]]; + } else if ([value isKindOfClass:[InternalQuerySnapshot class]]) { + [self writeByte:143]; + [self writeValue:[value toList]]; + } else if ([value isKindOfClass:[InternalPipelineResult class]]) { + [self writeByte:144]; + [self writeValue:[value toList]]; + } else if ([value isKindOfClass:[InternalPipelineSnapshot class]]) { + [self writeByte:145]; + [self writeValue:[value toList]]; + } else if ([value isKindOfClass:[InternalGetOptions class]]) { + [self writeByte:146]; + [self writeValue:[value toList]]; + } else if ([value isKindOfClass:[InternalDocumentOption class]]) { + [self writeByte:147]; + [self writeValue:[value toList]]; + } else if ([value isKindOfClass:[InternalTransactionCommand class]]) { + [self writeByte:148]; + [self writeValue:[value toList]]; + } else if ([value isKindOfClass:[DocumentReferenceRequest class]]) { + [self writeByte:149]; + [self writeValue:[value toList]]; + } else if ([value isKindOfClass:[InternalQueryParameters class]]) { + [self writeByte:150]; + [self writeValue:[value toList]]; + } else if ([value isKindOfClass:[AggregateQuery class]]) { + [self writeByte:151]; + [self writeValue:[value toList]]; + } else if ([value isKindOfClass:[AggregateQueryResponse class]]) { + [self writeByte:152]; + [self writeValue:[value toList]]; } else { [super writeValue:value]; } @@ -828,7 +1285,7 @@ - (FlutterStandardReader *)readerWithData:(NSData *)data { } @end -NSObject *FirebaseFirestoreHostApiGetCodec(void) { +NSObject *GetFirebaseFirestoreHostApiCodec(void) { static FlutterStandardMessageCodec *sSharedObject = nil; static dispatch_once_t sPred = 0; dispatch_once(&sPred, ^{ @@ -838,22 +1295,32 @@ - (FlutterStandardReader *)readerWithData:(NSData *)data { }); return sSharedObject; } - -void FirebaseFirestoreHostApiSetup(id binaryMessenger, +void SetUpFirebaseFirestoreHostApi(id binaryMessenger, NSObject *api) { + SetUpFirebaseFirestoreHostApiWithSuffix(binaryMessenger, api, @""); +} + +void SetUpFirebaseFirestoreHostApiWithSuffix(id binaryMessenger, + NSObject *api, + NSString *messageChannelSuffix) { + messageChannelSuffix = messageChannelSuffix.length > 0 + ? [NSString stringWithFormat:@".%@", messageChannelSuffix] + : @""; { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.cloud_firestore_platform_interface." - @"FirebaseFirestoreHostApi.loadBundle" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.cloud_firestore_platform_" + @"interface.FirebaseFirestoreHostApi.loadBundle", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseFirestoreHostApiGetCodec()]; + codec:GetFirebaseFirestoreHostApiCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(loadBundleApp:bundle:completion:)], @"FirebaseFirestoreHostApi api (%@) doesn't respond to " @"@selector(loadBundleApp:bundle:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; FirestorePigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); FlutterStandardTypedData *arg_bundle = GetNullableObjectAtIndex(args, 1); [api loadBundleApp:arg_app @@ -868,24 +1335,27 @@ void FirebaseFirestoreHostApiSetup(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.cloud_firestore_platform_interface." - @"FirebaseFirestoreHostApi.namedQueryGet" + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.cloud_firestore_platform_" + @"interface.FirebaseFirestoreHostApi.namedQueryGet", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseFirestoreHostApiGetCodec()]; + codec:GetFirebaseFirestoreHostApiCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(namedQueryGetApp:name:options:completion:)], @"FirebaseFirestoreHostApi api (%@) doesn't respond to " @"@selector(namedQueryGetApp:name:options:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; FirestorePigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); NSString *arg_name = GetNullableObjectAtIndex(args, 1); - PigeonGetOptions *arg_options = GetNullableObjectAtIndex(args, 2); + InternalGetOptions *arg_options = GetNullableObjectAtIndex(args, 2); [api namedQueryGetApp:arg_app name:arg_name options:arg_options - completion:^(PigeonQuerySnapshot *_Nullable output, + completion:^(InternalQuerySnapshot *_Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; @@ -896,17 +1366,20 @@ void FirebaseFirestoreHostApiSetup(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.cloud_firestore_platform_interface." - @"FirebaseFirestoreHostApi.clearPersistence" + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.cloud_firestore_platform_" + @"interface.FirebaseFirestoreHostApi.clearPersistence", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseFirestoreHostApiGetCodec()]; + codec:GetFirebaseFirestoreHostApiCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(clearPersistenceApp:completion:)], @"FirebaseFirestoreHostApi api (%@) doesn't respond to " @"@selector(clearPersistenceApp:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; FirestorePigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); [api clearPersistenceApp:arg_app completion:^(FlutterError *_Nullable error) { @@ -919,17 +1392,20 @@ void FirebaseFirestoreHostApiSetup(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.cloud_firestore_platform_interface." - @"FirebaseFirestoreHostApi.disableNetwork" + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.cloud_firestore_platform_" + @"interface.FirebaseFirestoreHostApi.disableNetwork", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseFirestoreHostApiGetCodec()]; + codec:GetFirebaseFirestoreHostApiCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(disableNetworkApp:completion:)], @"FirebaseFirestoreHostApi api (%@) doesn't respond to " @"@selector(disableNetworkApp:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; FirestorePigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); [api disableNetworkApp:arg_app completion:^(FlutterError *_Nullable error) { @@ -942,17 +1418,20 @@ void FirebaseFirestoreHostApiSetup(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.cloud_firestore_platform_interface." - @"FirebaseFirestoreHostApi.enableNetwork" + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.cloud_firestore_platform_" + @"interface.FirebaseFirestoreHostApi.enableNetwork", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseFirestoreHostApiGetCodec()]; + codec:GetFirebaseFirestoreHostApiCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(enableNetworkApp:completion:)], @"FirebaseFirestoreHostApi api (%@) doesn't respond to " @"@selector(enableNetworkApp:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; FirestorePigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); [api enableNetworkApp:arg_app completion:^(FlutterError *_Nullable error) { @@ -965,17 +1444,19 @@ void FirebaseFirestoreHostApiSetup(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.cloud_firestore_platform_interface." - @"FirebaseFirestoreHostApi.terminate" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.cloud_firestore_platform_" + @"interface.FirebaseFirestoreHostApi.terminate", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseFirestoreHostApiGetCodec()]; + codec:GetFirebaseFirestoreHostApiCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(terminateApp:completion:)], @"FirebaseFirestoreHostApi api (%@) doesn't respond to " @"@selector(terminateApp:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; FirestorePigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); [api terminateApp:arg_app completion:^(FlutterError *_Nullable error) { @@ -988,17 +1469,20 @@ void FirebaseFirestoreHostApiSetup(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.cloud_firestore_platform_interface." - @"FirebaseFirestoreHostApi.waitForPendingWrites" + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.cloud_firestore_platform_interface." + @"FirebaseFirestoreHostApi.waitForPendingWrites", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseFirestoreHostApiGetCodec()]; + codec:GetFirebaseFirestoreHostApiCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(waitForPendingWritesApp:completion:)], @"FirebaseFirestoreHostApi api (%@) doesn't respond to " @"@selector(waitForPendingWritesApp:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; FirestorePigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); [api waitForPendingWritesApp:arg_app completion:^(FlutterError *_Nullable error) { @@ -1011,10 +1495,13 @@ void FirebaseFirestoreHostApiSetup(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.cloud_firestore_platform_interface." - @"FirebaseFirestoreHostApi.setIndexConfiguration" + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.cloud_firestore_platform_interface." + @"FirebaseFirestoreHostApi.setIndexConfiguration", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseFirestoreHostApiGetCodec()]; + codec:GetFirebaseFirestoreHostApiCodec()]; if (api) { NSCAssert( [api respondsToSelector:@selector( @@ -1023,7 +1510,7 @@ void FirebaseFirestoreHostApiSetup(id binaryMessenger, @"@selector(setIndexConfigurationApp:indexConfiguration:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; FirestorePigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); NSString *arg_indexConfiguration = GetNullableObjectAtIndex(args, 1); [api setIndexConfigurationApp:arg_app @@ -1038,18 +1525,21 @@ void FirebaseFirestoreHostApiSetup(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.cloud_firestore_platform_interface." - @"FirebaseFirestoreHostApi.setLoggingEnabled" + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.cloud_firestore_platform_interface." + @"FirebaseFirestoreHostApi.setLoggingEnabled", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseFirestoreHostApiGetCodec()]; + codec:GetFirebaseFirestoreHostApiCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(setLoggingEnabledLoggingEnabled:completion:)], @"FirebaseFirestoreHostApi api (%@) doesn't respond to " @"@selector(setLoggingEnabledLoggingEnabled:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSNumber *arg_loggingEnabled = GetNullableObjectAtIndex(args, 0); + NSArray *args = message; + BOOL arg_loggingEnabled = [GetNullableObjectAtIndex(args, 0) boolValue]; [api setLoggingEnabledLoggingEnabled:arg_loggingEnabled completion:^(FlutterError *_Nullable error) { callback(wrapResult(nil, error)); @@ -1061,17 +1551,20 @@ void FirebaseFirestoreHostApiSetup(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.cloud_firestore_platform_interface." - @"FirebaseFirestoreHostApi.snapshotsInSyncSetup" + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.cloud_firestore_platform_interface." + @"FirebaseFirestoreHostApi.snapshotsInSyncSetup", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseFirestoreHostApiGetCodec()]; + codec:GetFirebaseFirestoreHostApiCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(snapshotsInSyncSetupApp:completion:)], @"FirebaseFirestoreHostApi api (%@) doesn't respond to " @"@selector(snapshotsInSyncSetupApp:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; FirestorePigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); [api snapshotsInSyncSetupApp:arg_app completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { @@ -1084,10 +1577,13 @@ void FirebaseFirestoreHostApiSetup(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.cloud_firestore_platform_interface." - @"FirebaseFirestoreHostApi.transactionCreate" + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.cloud_firestore_platform_interface." + @"FirebaseFirestoreHostApi.transactionCreate", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseFirestoreHostApiGetCodec()]; + codec:GetFirebaseFirestoreHostApiCodec()]; if (api) { NSCAssert( [api respondsToSelector:@selector(transactionCreateApp:timeout:maxAttempts:completion:)], @@ -1095,10 +1591,10 @@ void FirebaseFirestoreHostApiSetup(id binaryMessenger, @"@selector(transactionCreateApp:timeout:maxAttempts:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; FirestorePigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); - NSNumber *arg_timeout = GetNullableObjectAtIndex(args, 1); - NSNumber *arg_maxAttempts = GetNullableObjectAtIndex(args, 2); + NSInteger arg_timeout = [GetNullableObjectAtIndex(args, 1) integerValue]; + NSInteger arg_maxAttempts = [GetNullableObjectAtIndex(args, 2) integerValue]; [api transactionCreateApp:arg_app timeout:arg_timeout maxAttempts:arg_maxAttempts @@ -1112,10 +1608,13 @@ void FirebaseFirestoreHostApiSetup(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.cloud_firestore_platform_interface." - @"FirebaseFirestoreHostApi.transactionStoreResult" + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.cloud_firestore_platform_interface." + @"FirebaseFirestoreHostApi.transactionStoreResult", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseFirestoreHostApiGetCodec()]; + codec:GetFirebaseFirestoreHostApiCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(transactionStoreResultTransactionId:resultType: commands:completion:)], @@ -1123,10 +1622,12 @@ void FirebaseFirestoreHostApiSetup(id binaryMessenger, @"@selector(transactionStoreResultTransactionId:resultType:commands:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; NSString *arg_transactionId = GetNullableObjectAtIndex(args, 0); - PigeonTransactionResult arg_resultType = [GetNullableObjectAtIndex(args, 1) integerValue]; - NSArray *arg_commands = GetNullableObjectAtIndex(args, 2); + InternalTransactionResultBox *boxedInternalTransactionResult = + GetNullableObjectAtIndex(args, 1); + InternalTransactionResult arg_resultType = boxedInternalTransactionResult.value; + NSArray *arg_commands = GetNullableObjectAtIndex(args, 2); [api transactionStoreResultTransactionId:arg_transactionId resultType:arg_resultType commands:arg_commands @@ -1140,10 +1641,13 @@ void FirebaseFirestoreHostApiSetup(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.cloud_firestore_platform_interface." - @"FirebaseFirestoreHostApi.transactionGet" + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.cloud_firestore_platform_" + @"interface.FirebaseFirestoreHostApi.transactionGet", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseFirestoreHostApiGetCodec()]; + codec:GetFirebaseFirestoreHostApiCodec()]; if (api) { NSCAssert( [api respondsToSelector:@selector(transactionGetApp:transactionId:path:completion:)], @@ -1151,14 +1655,14 @@ void FirebaseFirestoreHostApiSetup(id binaryMessenger, @"@selector(transactionGetApp:transactionId:path:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; FirestorePigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); NSString *arg_transactionId = GetNullableObjectAtIndex(args, 1); NSString *arg_path = GetNullableObjectAtIndex(args, 2); [api transactionGetApp:arg_app transactionId:arg_transactionId path:arg_path - completion:^(PigeonDocumentSnapshot *_Nullable output, + completion:^(InternalDocumentSnapshot *_Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; @@ -1169,17 +1673,20 @@ void FirebaseFirestoreHostApiSetup(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.cloud_firestore_platform_interface." - @"FirebaseFirestoreHostApi.documentReferenceSet" + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.cloud_firestore_platform_interface." + @"FirebaseFirestoreHostApi.documentReferenceSet", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseFirestoreHostApiGetCodec()]; + codec:GetFirebaseFirestoreHostApiCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(documentReferenceSetApp:request:completion:)], @"FirebaseFirestoreHostApi api (%@) doesn't respond to " @"@selector(documentReferenceSetApp:request:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; FirestorePigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); DocumentReferenceRequest *arg_request = GetNullableObjectAtIndex(args, 1); [api documentReferenceSetApp:arg_app @@ -1194,17 +1701,20 @@ void FirebaseFirestoreHostApiSetup(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.cloud_firestore_platform_interface." - @"FirebaseFirestoreHostApi.documentReferenceUpdate" + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.cloud_firestore_platform_interface." + @"FirebaseFirestoreHostApi.documentReferenceUpdate", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseFirestoreHostApiGetCodec()]; + codec:GetFirebaseFirestoreHostApiCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(documentReferenceUpdateApp:request:completion:)], @"FirebaseFirestoreHostApi api (%@) doesn't respond to " @"@selector(documentReferenceUpdateApp:request:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; FirestorePigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); DocumentReferenceRequest *arg_request = GetNullableObjectAtIndex(args, 1); [api documentReferenceUpdateApp:arg_app @@ -1219,22 +1729,25 @@ void FirebaseFirestoreHostApiSetup(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.cloud_firestore_platform_interface." - @"FirebaseFirestoreHostApi.documentReferenceGet" + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.cloud_firestore_platform_interface." + @"FirebaseFirestoreHostApi.documentReferenceGet", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseFirestoreHostApiGetCodec()]; + codec:GetFirebaseFirestoreHostApiCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(documentReferenceGetApp:request:completion:)], @"FirebaseFirestoreHostApi api (%@) doesn't respond to " @"@selector(documentReferenceGetApp:request:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; FirestorePigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); DocumentReferenceRequest *arg_request = GetNullableObjectAtIndex(args, 1); [api documentReferenceGetApp:arg_app request:arg_request - completion:^(PigeonDocumentSnapshot *_Nullable output, + completion:^(InternalDocumentSnapshot *_Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; @@ -1245,17 +1758,20 @@ void FirebaseFirestoreHostApiSetup(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.cloud_firestore_platform_interface." - @"FirebaseFirestoreHostApi.documentReferenceDelete" + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.cloud_firestore_platform_interface." + @"FirebaseFirestoreHostApi.documentReferenceDelete", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseFirestoreHostApiGetCodec()]; + codec:GetFirebaseFirestoreHostApiCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(documentReferenceDeleteApp:request:completion:)], @"FirebaseFirestoreHostApi api (%@) doesn't respond to " @"@selector(documentReferenceDeleteApp:request:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; FirestorePigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); DocumentReferenceRequest *arg_request = GetNullableObjectAtIndex(args, 1); [api documentReferenceDeleteApp:arg_app @@ -1270,10 +1786,12 @@ void FirebaseFirestoreHostApiSetup(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.cloud_firestore_platform_interface." - @"FirebaseFirestoreHostApi.queryGet" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.cloud_firestore_platform_" + @"interface.FirebaseFirestoreHostApi.queryGet", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseFirestoreHostApiGetCodec()]; + codec:GetFirebaseFirestoreHostApiCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(queryGetApp:path:isCollectionGroup:parameters: options:completion:)], @@ -1281,18 +1799,18 @@ void FirebaseFirestoreHostApiSetup(id binaryMessenger, @"@selector(queryGetApp:path:isCollectionGroup:parameters:options:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; FirestorePigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); NSString *arg_path = GetNullableObjectAtIndex(args, 1); - NSNumber *arg_isCollectionGroup = GetNullableObjectAtIndex(args, 2); - PigeonQueryParameters *arg_parameters = GetNullableObjectAtIndex(args, 3); - PigeonGetOptions *arg_options = GetNullableObjectAtIndex(args, 4); + BOOL arg_isCollectionGroup = [GetNullableObjectAtIndex(args, 2) boolValue]; + InternalQueryParameters *arg_parameters = GetNullableObjectAtIndex(args, 3); + InternalGetOptions *arg_options = GetNullableObjectAtIndex(args, 4); [api queryGetApp:arg_app path:arg_path isCollectionGroup:arg_isCollectionGroup parameters:arg_parameters options:arg_options - completion:^(PigeonQuerySnapshot *_Nullable output, + completion:^(InternalQuerySnapshot *_Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; @@ -1303,10 +1821,13 @@ void FirebaseFirestoreHostApiSetup(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.cloud_firestore_platform_interface." - @"FirebaseFirestoreHostApi.aggregateQuery" + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.cloud_firestore_platform_" + @"interface.FirebaseFirestoreHostApi.aggregateQuery", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseFirestoreHostApiGetCodec()]; + codec:GetFirebaseFirestoreHostApiCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(aggregateQueryApp:path:parameters:source:queries: isCollectionGroup:completion:)], @@ -1315,13 +1836,14 @@ void FirebaseFirestoreHostApiSetup(id binaryMessenger, @"completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; FirestorePigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); NSString *arg_path = GetNullableObjectAtIndex(args, 1); - PigeonQueryParameters *arg_parameters = GetNullableObjectAtIndex(args, 2); - AggregateSource arg_source = [GetNullableObjectAtIndex(args, 3) integerValue]; + InternalQueryParameters *arg_parameters = GetNullableObjectAtIndex(args, 2); + AggregateSourceBox *boxedAggregateSource = GetNullableObjectAtIndex(args, 3); + AggregateSource arg_source = boxedAggregateSource.value; NSArray *arg_queries = GetNullableObjectAtIndex(args, 4); - NSNumber *arg_isCollectionGroup = GetNullableObjectAtIndex(args, 5); + BOOL arg_isCollectionGroup = [GetNullableObjectAtIndex(args, 5) boolValue]; [api aggregateQueryApp:arg_app path:arg_path parameters:arg_parameters @@ -1339,19 +1861,22 @@ void FirebaseFirestoreHostApiSetup(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.cloud_firestore_platform_interface." - @"FirebaseFirestoreHostApi.writeBatchCommit" + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.cloud_firestore_platform_" + @"interface.FirebaseFirestoreHostApi.writeBatchCommit", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseFirestoreHostApiGetCodec()]; + codec:GetFirebaseFirestoreHostApiCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(writeBatchCommitApp:writes:completion:)], @"FirebaseFirestoreHostApi api (%@) doesn't respond to " @"@selector(writeBatchCommitApp:writes:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; FirestorePigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); - NSArray *arg_writes = GetNullableObjectAtIndex(args, 1); + NSArray *arg_writes = GetNullableObjectAtIndex(args, 1); [api writeBatchCommitApp:arg_app writes:arg_writes completion:^(FlutterError *_Nullable error) { @@ -1364,10 +1889,13 @@ void FirebaseFirestoreHostApiSetup(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.cloud_firestore_platform_interface." - @"FirebaseFirestoreHostApi.querySnapshot" + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.cloud_firestore_platform_" + @"interface.FirebaseFirestoreHostApi.querySnapshot", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseFirestoreHostApiGetCodec()]; + codec:GetFirebaseFirestoreHostApiCodec()]; if (api) { NSCAssert( [api respondsToSelector:@selector(querySnapshotApp:path:isCollectionGroup:parameters: @@ -1377,14 +1905,15 @@ void FirebaseFirestoreHostApiSetup(id binaryMessenger, @"includeMetadataChanges:source:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; FirestorePigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); NSString *arg_path = GetNullableObjectAtIndex(args, 1); - NSNumber *arg_isCollectionGroup = GetNullableObjectAtIndex(args, 2); - PigeonQueryParameters *arg_parameters = GetNullableObjectAtIndex(args, 3); - PigeonGetOptions *arg_options = GetNullableObjectAtIndex(args, 4); - NSNumber *arg_includeMetadataChanges = GetNullableObjectAtIndex(args, 5); - ListenSource arg_source = [GetNullableObjectAtIndex(args, 6) integerValue]; + BOOL arg_isCollectionGroup = [GetNullableObjectAtIndex(args, 2) boolValue]; + InternalQueryParameters *arg_parameters = GetNullableObjectAtIndex(args, 3); + InternalGetOptions *arg_options = GetNullableObjectAtIndex(args, 4); + BOOL arg_includeMetadataChanges = [GetNullableObjectAtIndex(args, 5) boolValue]; + ListenSourceBox *boxedListenSource = GetNullableObjectAtIndex(args, 6); + ListenSource arg_source = boxedListenSource.value; [api querySnapshotApp:arg_app path:arg_path isCollectionGroup:arg_isCollectionGroup @@ -1402,10 +1931,13 @@ void FirebaseFirestoreHostApiSetup(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.cloud_firestore_platform_interface." - @"FirebaseFirestoreHostApi.documentReferenceSnapshot" + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.cloud_firestore_platform_interface." + @"FirebaseFirestoreHostApi.documentReferenceSnapshot", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseFirestoreHostApiGetCodec()]; + codec:GetFirebaseFirestoreHostApiCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(documentReferenceSnapshotApp:parameters: includeMetadataChanges:source:completion:)], @@ -1414,11 +1946,12 @@ void FirebaseFirestoreHostApiSetup(id binaryMessenger, @"completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; FirestorePigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); DocumentReferenceRequest *arg_parameters = GetNullableObjectAtIndex(args, 1); - NSNumber *arg_includeMetadataChanges = GetNullableObjectAtIndex(args, 2); - ListenSource arg_source = [GetNullableObjectAtIndex(args, 3) integerValue]; + BOOL arg_includeMetadataChanges = [GetNullableObjectAtIndex(args, 2) boolValue]; + ListenSourceBox *boxedListenSource = GetNullableObjectAtIndex(args, 3); + ListenSource arg_source = boxedListenSource.value; [api documentReferenceSnapshotApp:arg_app parameters:arg_parameters includeMetadataChanges:arg_includeMetadataChanges @@ -1434,10 +1967,14 @@ void FirebaseFirestoreHostApiSetup(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.cloud_firestore_platform_interface." - @"FirebaseFirestoreHostApi.persistenceCacheIndexManagerRequest" + initWithName: + [NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.cloud_firestore_platform_interface." + @"FirebaseFirestoreHostApi.persistenceCacheIndexManagerRequest", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseFirestoreHostApiGetCodec()]; + codec:GetFirebaseFirestoreHostApiCodec()]; if (api) { NSCAssert( [api respondsToSelector:@selector( @@ -1446,10 +1983,12 @@ void FirebaseFirestoreHostApiSetup(id binaryMessenger, @"@selector(persistenceCacheIndexManagerRequestApp:request:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; FirestorePigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); + PersistenceCacheIndexManagerRequestBox *boxedPersistenceCacheIndexManagerRequest = + GetNullableObjectAtIndex(args, 1); PersistenceCacheIndexManagerRequest arg_request = - [GetNullableObjectAtIndex(args, 1) integerValue]; + boxedPersistenceCacheIndexManagerRequest.value; [api persistenceCacheIndexManagerRequestApp:arg_app request:arg_request completion:^(FlutterError *_Nullable error) { @@ -1462,24 +2001,27 @@ void FirebaseFirestoreHostApiSetup(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.cloud_firestore_platform_interface." - @"FirebaseFirestoreHostApi.executePipeline" + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.cloud_firestore_platform_" + @"interface.FirebaseFirestoreHostApi.executePipeline", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseFirestoreHostApiGetCodec()]; + codec:GetFirebaseFirestoreHostApiCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(executePipelineApp:stages:options:completion:)], @"FirebaseFirestoreHostApi api (%@) doesn't respond to " @"@selector(executePipelineApp:stages:options:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; FirestorePigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); NSArray *> *arg_stages = GetNullableObjectAtIndex(args, 1); NSDictionary *arg_options = GetNullableObjectAtIndex(args, 2); [api executePipelineApp:arg_app stages:arg_stages options:arg_options - completion:^(PigeonPipelineSnapshot *_Nullable output, + completion:^(InternalPipelineSnapshot *_Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; diff --git a/packages/cloud_firestore/cloud_firestore/ios/cloud_firestore/Sources/cloud_firestore/FirestorePigeonParser.m b/packages/cloud_firestore/cloud_firestore/ios/cloud_firestore/Sources/cloud_firestore/FirestorePigeonParser.m index 1103e92e4e7b..0178847b7426 100644 --- a/packages/cloud_firestore/cloud_firestore/ios/cloud_firestore/Sources/cloud_firestore/FirestorePigeonParser.m +++ b/packages/cloud_firestore/cloud_firestore/ios/cloud_firestore/Sources/cloud_firestore/FirestorePigeonParser.m @@ -60,7 +60,7 @@ + (FIRFilter *_Nonnull)filterFromJson:(NSDictionary *_Nullable)m @throw [NSException exceptionWithName:@"InvalidOperator" reason:@"Invalid operator" userInfo:nil]; } -+ (FIRQuery *_Nonnull)parseQueryWithParameters:(nonnull PigeonQueryParameters *)parameters ++ (FIRQuery *_Nonnull)parseQueryWithParameters:(nonnull InternalQueryParameters *)parameters firestore:(nonnull FIRFirestore *)firestore path:(nonnull NSString *)path isCollectionGroup:(Boolean)isCollectionGroup { @@ -218,17 +218,16 @@ + (FIRListenSource)parseListenSource:(ListenSource)source { } } -+ (PigeonSnapshotMetadata *_Nonnull)toPigeonSnapshotMetadata: ++ (InternalSnapshotMetadata *_Nonnull)toPigeonSnapshotMetadata: (FIRSnapshotMetadata *_Nonnull)snapshotMetadata { - return [PigeonSnapshotMetadata - makeWithHasPendingWrites:[NSNumber numberWithBool:snapshotMetadata.hasPendingWrites] - isFromCache:[NSNumber numberWithBool:snapshotMetadata.isFromCache]]; + return [InternalSnapshotMetadata makeWithHasPendingWrites:snapshotMetadata.hasPendingWrites + isFromCache:snapshotMetadata.isFromCache]; } -+ (PigeonDocumentSnapshot *_Nonnull) ++ (InternalDocumentSnapshot *_Nonnull) toPigeonDocumentSnapshot:(FIRDocumentSnapshot *_Nonnull)documentSnapshot serverTimestampBehavior:(FIRServerTimestampBehavior)serverTimestampBehavior { - return [PigeonDocumentSnapshot + return [InternalDocumentSnapshot makeWithPath:documentSnapshot.reference.path data:[documentSnapshot dataWithServerTimestampBehavior:serverTimestampBehavior] metadata:[FirestorePigeonParser toPigeonSnapshotMetadata:documentSnapshot.metadata]]; @@ -249,11 +248,11 @@ + (DocumentChangeType)toPigeonDocumentChangeType:(FIRDocumentChangeType)document } } -+ (PigeonDocumentChange *_Nonnull)toPigeonDocumentChange:(FIRDocumentChange *_Nonnull)documentChange - serverTimestampBehavior: - (FIRServerTimestampBehavior)serverTimestampBehavior { - NSNumber *oldIndex; - NSNumber *newIndex; ++ (InternalDocumentChange *_Nonnull) + toPigeonDocumentChange:(FIRDocumentChange *_Nonnull)documentChange + serverTimestampBehavior:(FIRServerTimestampBehavior)serverTimestampBehavior { + NSInteger oldIndex; + NSInteger newIndex; // Note the Firestore C++ SDK here returns a maxed UInt that is != NSUIntegerMax, so we make one // ourselves so we can convert to -1 for Dart. @@ -261,19 +260,19 @@ + (PigeonDocumentChange *_Nonnull)toPigeonDocumentChange:(FIRDocumentChange *_No if (documentChange.newIndex == NSNotFound || documentChange.newIndex == 4294967295 || documentChange.newIndex == MAX_VAL) { - newIndex = @([@(-1) intValue]); + newIndex = -1; } else { - newIndex = @([@(documentChange.newIndex) intValue]); + newIndex = (NSInteger)documentChange.newIndex; } if (documentChange.oldIndex == NSNotFound || documentChange.oldIndex == 4294967295 || documentChange.oldIndex == MAX_VAL) { - oldIndex = @([@(-1) intValue]); + oldIndex = -1; } else { - oldIndex = @([@(documentChange.oldIndex) intValue]); + oldIndex = (NSInteger)documentChange.oldIndex; } - return [PigeonDocumentChange + return [InternalDocumentChange makeWithType:[FirestorePigeonParser toPigeonDocumentChangeType:documentChange.type] document:[FirestorePigeonParser toPigeonDocumentSnapshot:documentChange.document serverTimestampBehavior:serverTimestampBehavior] @@ -281,7 +280,7 @@ + (PigeonDocumentChange *_Nonnull)toPigeonDocumentChange:(FIRDocumentChange *_No newIndex:newIndex]; } -+ (NSArray *_Nonnull) ++ (NSArray *_Nonnull) toPigeonDocumentChanges:(NSArray *_Nonnull)documentChanges serverTimestampBehavior:(FIRServerTimestampBehavior)serverTimestampBehavior { NSMutableArray *pigeonDocumentChanges = [NSMutableArray array]; @@ -293,16 +292,16 @@ + (PigeonDocumentChange *_Nonnull)toPigeonDocumentChange:(FIRDocumentChange *_No return pigeonDocumentChanges; } -+ (PigeonQuerySnapshot *_Nonnull)toPigeonQuerySnapshot:(FIRQuerySnapshot *_Nonnull)querySnaphot - serverTimestampBehavior: - (FIRServerTimestampBehavior)serverTimestampBehavior { ++ (InternalQuerySnapshot *_Nonnull)toPigeonQuerySnapshot:(FIRQuerySnapshot *_Nonnull)querySnaphot + serverTimestampBehavior: + (FIRServerTimestampBehavior)serverTimestampBehavior { NSMutableArray *documentSnapshots = [NSMutableArray array]; for (FIRDocumentSnapshot *documentSnapshot in querySnaphot.documents) { [documentSnapshots addObject:[FirestorePigeonParser toPigeonDocumentSnapshot:documentSnapshot serverTimestampBehavior:serverTimestampBehavior]]; } - return [PigeonQuerySnapshot + return [InternalQuerySnapshot makeWithDocuments:documentSnapshots documentChanges:[FirestorePigeonParser toPigeonDocumentChanges:querySnaphot.documentChanges serverTimestampBehavior:serverTimestampBehavior] diff --git a/packages/cloud_firestore/cloud_firestore/ios/cloud_firestore/Sources/cloud_firestore/include/cloud_firestore/Private/FLTTransactionStreamHandler.h b/packages/cloud_firestore/cloud_firestore/ios/cloud_firestore/Sources/cloud_firestore/include/cloud_firestore/Private/FLTTransactionStreamHandler.h index 213570d9887b..c40a148efa5d 100644 --- a/packages/cloud_firestore/cloud_firestore/ios/cloud_firestore/Sources/cloud_firestore/include/cloud_firestore/Private/FLTTransactionStreamHandler.h +++ b/packages/cloud_firestore/cloud_firestore/ios/cloud_firestore/Sources/cloud_firestore/include/cloud_firestore/Private/FLTTransactionStreamHandler.h @@ -25,17 +25,17 @@ NS_ASSUME_NONNULL_BEGIN @interface FLTTransactionStreamHandler : NSObject @property(nonatomic, strong) FIRFirestore *firestore; -@property(nonatomic, strong) NSNumber *timeout; -@property(nonatomic, strong) NSNumber *maxAttempts; +@property(nonatomic, assign) NSInteger timeout; +@property(nonatomic, assign) NSInteger maxAttempts; - (instancetype)initWithId:(NSString *)transactionId firestore:(FIRFirestore *)firestore - timeout:(nonnull NSNumber *)timeout - maxAttempts:(nonnull NSNumber *)maxAttempts + timeout:(NSInteger)timeout + maxAttempts:(NSInteger)maxAttempts started:(void (^)(FIRTransaction *))startedListener ended:(void (^)(void))endedListener; -- (void)receiveTransactionResponse:(PigeonTransactionResult)resultType - commands:(NSArray *)commands; +- (void)receiveTransactionResponse:(InternalTransactionResult)resultType + commands:(NSArray *)commands; @end diff --git a/packages/cloud_firestore/cloud_firestore/ios/cloud_firestore/Sources/cloud_firestore/include/cloud_firestore/Private/FirestorePigeonParser.h b/packages/cloud_firestore/cloud_firestore/ios/cloud_firestore/Sources/cloud_firestore/include/cloud_firestore/Private/FirestorePigeonParser.h index e197ef7592b0..5fa20d98759f 100644 --- a/packages/cloud_firestore/cloud_firestore/ios/cloud_firestore/Sources/cloud_firestore/include/cloud_firestore/Private/FirestorePigeonParser.h +++ b/packages/cloud_firestore/cloud_firestore/ios/cloud_firestore/Sources/cloud_firestore/include/cloud_firestore/Private/FirestorePigeonParser.h @@ -19,7 +19,7 @@ + (FIRFilter *_Nonnull)filterFromJson:(NSDictionary *_Nullable)map; -+ (FIRQuery *_Nonnull)parseQueryWithParameters:(nonnull PigeonQueryParameters *)parameters ++ (FIRQuery *_Nonnull)parseQueryWithParameters:(nonnull InternalQueryParameters *)parameters firestore:(nonnull FIRFirestore *)firestore path:(nonnull NSString *)path isCollectionGroup:(Boolean)isCollectionGroup; @@ -34,25 +34,25 @@ + (FIRListenSource)parseListenSource:(ListenSource)source; -+ (PigeonSnapshotMetadata *_Nonnull)toPigeonSnapshotMetadata: ++ (InternalSnapshotMetadata *_Nonnull)toPigeonSnapshotMetadata: (FIRSnapshotMetadata *_Nonnull)snapshotMetadata; -+ (PigeonDocumentSnapshot *_Nonnull) ++ (InternalDocumentSnapshot *_Nonnull) toPigeonDocumentSnapshot:(FIRDocumentSnapshot *_Nonnull)documentSnapshot serverTimestampBehavior:(FIRServerTimestampBehavior)serverTimestampBehavior; + (DocumentChangeType)toPigeonDocumentChangeType:(FIRDocumentChangeType)documentChangeType; -+ (PigeonDocumentChange *_Nonnull)toPigeonDocumentChange:(FIRDocumentChange *_Nonnull)documentChange - serverTimestampBehavior: - (FIRServerTimestampBehavior)serverTimestampBehavior; ++ (InternalDocumentChange *_Nonnull) + toPigeonDocumentChange:(FIRDocumentChange *_Nonnull)documentChange + serverTimestampBehavior:(FIRServerTimestampBehavior)serverTimestampBehavior; -+ (NSArray *_Nonnull) ++ (NSArray *_Nonnull) toPigeonDocumentChanges:(NSArray *_Nonnull)documentChanges serverTimestampBehavior:(FIRServerTimestampBehavior)serverTimestampBehavior; -+ (PigeonQuerySnapshot *_Nonnull)toPigeonQuerySnapshot:(FIRQuerySnapshot *_Nonnull)querySnaphot - serverTimestampBehavior: - (FIRServerTimestampBehavior)serverTimestampBehavior; ++ (InternalQuerySnapshot *_Nonnull)toPigeonQuerySnapshot:(FIRQuerySnapshot *_Nonnull)querySnaphot + serverTimestampBehavior: + (FIRServerTimestampBehavior)serverTimestampBehavior; @end diff --git a/packages/cloud_firestore/cloud_firestore/ios/cloud_firestore/Sources/cloud_firestore/include/cloud_firestore/Public/CustomPigeonHeaderFirestore.h b/packages/cloud_firestore/cloud_firestore/ios/cloud_firestore/Sources/cloud_firestore/include/cloud_firestore/Public/CustomPigeonHeaderFirestore.h index 3cfb88fa5cf9..7127b0061f58 100644 --- a/packages/cloud_firestore/cloud_firestore/ios/cloud_firestore/Sources/cloud_firestore/include/cloud_firestore/Public/CustomPigeonHeaderFirestore.h +++ b/packages/cloud_firestore/cloud_firestore/ios/cloud_firestore/Sources/cloud_firestore/include/cloud_firestore/Public/CustomPigeonHeaderFirestore.h @@ -3,14 +3,14 @@ // found in the LICENSE file. #import "FirestoreMessages.g.h" -@interface PigeonDocumentSnapshot (Map) +@interface InternalDocumentSnapshot (Map) - (NSDictionary *)toList; @end -@interface PigeonDocumentChange (Map) +@interface InternalDocumentChange (Map) - (NSDictionary *)toList; @end -@interface PigeonSnapshotMetadata (Map) +@interface InternalSnapshotMetadata (Map) - (NSDictionary *)toList; @end diff --git a/packages/cloud_firestore/cloud_firestore/ios/cloud_firestore/Sources/cloud_firestore/include/cloud_firestore/Public/FirestoreMessages.g.h b/packages/cloud_firestore/cloud_firestore/ios/cloud_firestore/Sources/cloud_firestore/include/cloud_firestore/Public/FirestoreMessages.g.h index f3955862ae04..7fd40daf7fcf 100644 --- a/packages/cloud_firestore/cloud_firestore/ios/cloud_firestore/Sources/cloud_firestore/include/cloud_firestore/Public/FirestoreMessages.g.h +++ b/packages/cloud_firestore/cloud_firestore/ios/cloud_firestore/Sources/cloud_firestore/include/cloud_firestore/Public/FirestoreMessages.g.h @@ -1,10 +1,10 @@ // Copyright 2023, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v11.0.1), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), do not edit directly. // See also: https://pub.dev/packages/pigeon -#import +@import Foundation; @protocol FlutterBinaryMessenger; @protocol FlutterMessageCodec; @@ -123,28 +123,28 @@ typedef NS_ENUM(NSUInteger, PersistenceCacheIndexManagerRequest) { - (instancetype)initWithValue:(PersistenceCacheIndexManagerRequest)value; @end -typedef NS_ENUM(NSUInteger, PigeonTransactionResult) { - PigeonTransactionResultSuccess = 0, - PigeonTransactionResultFailure = 1, +typedef NS_ENUM(NSUInteger, InternalTransactionResult) { + InternalTransactionResultSuccess = 0, + InternalTransactionResultFailure = 1, }; -/// Wrapper for PigeonTransactionResult to allow for nullability. -@interface PigeonTransactionResultBox : NSObject -@property(nonatomic, assign) PigeonTransactionResult value; -- (instancetype)initWithValue:(PigeonTransactionResult)value; +/// Wrapper for InternalTransactionResult to allow for nullability. +@interface InternalTransactionResultBox : NSObject +@property(nonatomic, assign) InternalTransactionResult value; +- (instancetype)initWithValue:(InternalTransactionResult)value; @end -typedef NS_ENUM(NSUInteger, PigeonTransactionType) { - PigeonTransactionTypeGet = 0, - PigeonTransactionTypeUpdate = 1, - PigeonTransactionTypeSet = 2, - PigeonTransactionTypeDeleteType = 3, +typedef NS_ENUM(NSUInteger, InternalTransactionType) { + InternalTransactionTypeGet = 0, + InternalTransactionTypeUpdate = 1, + InternalTransactionTypeSet = 2, + InternalTransactionTypeDeleteType = 3, }; -/// Wrapper for PigeonTransactionType to allow for nullability. -@interface PigeonTransactionTypeBox : NSObject -@property(nonatomic, assign) PigeonTransactionType value; -- (instancetype)initWithValue:(PigeonTransactionType)value; +/// Wrapper for InternalTransactionType to allow for nullability. +@interface InternalTransactionTypeBox : NSObject +@property(nonatomic, assign) InternalTransactionType value; +- (instancetype)initWithValue:(InternalTransactionType)value; @end typedef NS_ENUM(NSUInteger, AggregateType) { @@ -159,93 +159,92 @@ typedef NS_ENUM(NSUInteger, AggregateType) { - (instancetype)initWithValue:(AggregateType)value; @end -@class PigeonFirebaseSettings; +@class InternalFirebaseSettings; @class FirestorePigeonFirebaseApp; -@class PigeonSnapshotMetadata; -@class PigeonDocumentSnapshot; -@class PigeonDocumentChange; -@class PigeonQuerySnapshot; -@class PigeonPipelineResult; -@class PigeonPipelineSnapshot; -@class PigeonGetOptions; -@class PigeonDocumentOption; -@class PigeonTransactionCommand; +@class InternalSnapshotMetadata; +@class InternalDocumentSnapshot; +@class InternalDocumentChange; +@class InternalQuerySnapshot; +@class InternalPipelineResult; +@class InternalPipelineSnapshot; +@class InternalGetOptions; +@class InternalDocumentOption; +@class InternalTransactionCommand; @class DocumentReferenceRequest; -@class PigeonQueryParameters; +@class InternalQueryParameters; @class AggregateQuery; @class AggregateQueryResponse; -@interface PigeonFirebaseSettings : NSObject +@interface InternalFirebaseSettings : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; + (instancetype)makeWithPersistenceEnabled:(nullable NSNumber *)persistenceEnabled host:(nullable NSString *)host sslEnabled:(nullable NSNumber *)sslEnabled cacheSizeBytes:(nullable NSNumber *)cacheSizeBytes - ignoreUndefinedProperties:(NSNumber *)ignoreUndefinedProperties; + ignoreUndefinedProperties:(BOOL)ignoreUndefinedProperties; @property(nonatomic, strong, nullable) NSNumber *persistenceEnabled; @property(nonatomic, copy, nullable) NSString *host; @property(nonatomic, strong, nullable) NSNumber *sslEnabled; @property(nonatomic, strong, nullable) NSNumber *cacheSizeBytes; -@property(nonatomic, strong) NSNumber *ignoreUndefinedProperties; +@property(nonatomic, assign) BOOL ignoreUndefinedProperties; @end @interface FirestorePigeonFirebaseApp : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; + (instancetype)makeWithAppName:(NSString *)appName - settings:(PigeonFirebaseSettings *)settings + settings:(InternalFirebaseSettings *)settings databaseURL:(NSString *)databaseURL; @property(nonatomic, copy) NSString *appName; -@property(nonatomic, strong) PigeonFirebaseSettings *settings; +@property(nonatomic, strong) InternalFirebaseSettings *settings; @property(nonatomic, copy) NSString *databaseURL; @end -@interface PigeonSnapshotMetadata : NSObject +@interface InternalSnapshotMetadata : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithHasPendingWrites:(NSNumber *)hasPendingWrites - isFromCache:(NSNumber *)isFromCache; -@property(nonatomic, strong) NSNumber *hasPendingWrites; -@property(nonatomic, strong) NSNumber *isFromCache; ++ (instancetype)makeWithHasPendingWrites:(BOOL)hasPendingWrites isFromCache:(BOOL)isFromCache; +@property(nonatomic, assign) BOOL hasPendingWrites; +@property(nonatomic, assign) BOOL isFromCache; @end -@interface PigeonDocumentSnapshot : NSObject +@interface InternalDocumentSnapshot : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; + (instancetype)makeWithPath:(NSString *)path data:(nullable NSDictionary *)data - metadata:(PigeonSnapshotMetadata *)metadata; + metadata:(InternalSnapshotMetadata *)metadata; @property(nonatomic, copy) NSString *path; -@property(nonatomic, strong, nullable) NSDictionary *data; -@property(nonatomic, strong) PigeonSnapshotMetadata *metadata; +@property(nonatomic, copy, nullable) NSDictionary *data; +@property(nonatomic, strong) InternalSnapshotMetadata *metadata; @end -@interface PigeonDocumentChange : NSObject +@interface InternalDocumentChange : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; + (instancetype)makeWithType:(DocumentChangeType)type - document:(PigeonDocumentSnapshot *)document - oldIndex:(NSNumber *)oldIndex - newIndex:(NSNumber *)newIndex; + document:(InternalDocumentSnapshot *)document + oldIndex:(NSInteger)oldIndex + newIndex:(NSInteger)newIndex; @property(nonatomic, assign) DocumentChangeType type; -@property(nonatomic, strong) PigeonDocumentSnapshot *document; -@property(nonatomic, strong) NSNumber *oldIndex; -@property(nonatomic, strong) NSNumber *index; +@property(nonatomic, strong) InternalDocumentSnapshot *document; +@property(nonatomic, assign) NSInteger oldIndex; +@property(nonatomic, assign) NSInteger newIndex; @end -@interface PigeonQuerySnapshot : NSObject +@interface InternalQuerySnapshot : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithDocuments:(NSArray *)documents - documentChanges:(NSArray *)documentChanges - metadata:(PigeonSnapshotMetadata *)metadata; -@property(nonatomic, strong) NSArray *documents; -@property(nonatomic, strong) NSArray *documentChanges; -@property(nonatomic, strong) PigeonSnapshotMetadata *metadata; ++ (instancetype)makeWithDocuments:(NSArray *)documents + documentChanges:(NSArray *)documentChanges + metadata:(InternalSnapshotMetadata *)metadata; +@property(nonatomic, copy) NSArray *documents; +@property(nonatomic, copy) NSArray *documentChanges; +@property(nonatomic, strong) InternalSnapshotMetadata *metadata; @end -@interface PigeonPipelineResult : NSObject +@interface InternalPipelineResult : NSObject + (instancetype)makeWithDocumentPath:(nullable NSString *)documentPath createTime:(nullable NSNumber *)createTime updateTime:(nullable NSNumber *)updateTime @@ -254,19 +253,19 @@ typedef NS_ENUM(NSUInteger, AggregateType) { @property(nonatomic, strong, nullable) NSNumber *createTime; @property(nonatomic, strong, nullable) NSNumber *updateTime; /// All fields in the result (from PipelineResult.data() on Android). -@property(nonatomic, strong, nullable) NSDictionary *data; +@property(nonatomic, copy, nullable) NSDictionary *data; @end -@interface PigeonPipelineSnapshot : NSObject +@interface InternalPipelineSnapshot : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithResults:(NSArray *)results - executionTime:(NSNumber *)executionTime; -@property(nonatomic, strong) NSArray *results; -@property(nonatomic, strong) NSNumber *executionTime; ++ (instancetype)makeWithResults:(NSArray *)results + executionTime:(NSInteger)executionTime; +@property(nonatomic, copy) NSArray *results; +@property(nonatomic, assign) NSInteger executionTime; @end -@interface PigeonGetOptions : NSObject +@interface InternalGetOptions : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; + (instancetype)makeWithSource:(Source)source @@ -275,24 +274,24 @@ typedef NS_ENUM(NSUInteger, AggregateType) { @property(nonatomic, assign) ServerTimestampBehavior serverTimestampBehavior; @end -@interface PigeonDocumentOption : NSObject +@interface InternalDocumentOption : NSObject + (instancetype)makeWithMerge:(nullable NSNumber *)merge mergeFields:(nullable NSArray *> *)mergeFields; @property(nonatomic, strong, nullable) NSNumber *merge; -@property(nonatomic, strong, nullable) NSArray *> *mergeFields; +@property(nonatomic, copy, nullable) NSArray *> *mergeFields; @end -@interface PigeonTransactionCommand : NSObject +@interface InternalTransactionCommand : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithType:(PigeonTransactionType)type ++ (instancetype)makeWithType:(InternalTransactionType)type path:(NSString *)path data:(nullable NSDictionary *)data - option:(nullable PigeonDocumentOption *)option; -@property(nonatomic, assign) PigeonTransactionType type; + option:(nullable InternalDocumentOption *)option; +@property(nonatomic, assign) InternalTransactionType type; @property(nonatomic, copy) NSString *path; -@property(nonatomic, strong, nullable) NSDictionary *data; -@property(nonatomic, strong, nullable) PigeonDocumentOption *option; +@property(nonatomic, copy, nullable) NSDictionary *data; +@property(nonatomic, strong, nullable) InternalDocumentOption *option; @end @interface DocumentReferenceRequest : NSObject @@ -300,17 +299,17 @@ typedef NS_ENUM(NSUInteger, AggregateType) { - (instancetype)init NS_UNAVAILABLE; + (instancetype)makeWithPath:(NSString *)path data:(nullable NSDictionary *)data - option:(nullable PigeonDocumentOption *)option + option:(nullable InternalDocumentOption *)option source:(nullable SourceBox *)source serverTimestampBehavior:(nullable ServerTimestampBehaviorBox *)serverTimestampBehavior; @property(nonatomic, copy) NSString *path; -@property(nonatomic, strong, nullable) NSDictionary *data; -@property(nonatomic, strong, nullable) PigeonDocumentOption *option; +@property(nonatomic, copy, nullable) NSDictionary *data; +@property(nonatomic, strong, nullable) InternalDocumentOption *option; @property(nonatomic, strong, nullable) SourceBox *source; @property(nonatomic, strong, nullable) ServerTimestampBehaviorBox *serverTimestampBehavior; @end -@interface PigeonQueryParameters : NSObject +@interface InternalQueryParameters : NSObject + (instancetype)makeWithWhere:(nullable NSArray *> *)where orderBy:(nullable NSArray *> *)orderBy limit:(nullable NSNumber *)limit @@ -320,15 +319,15 @@ typedef NS_ENUM(NSUInteger, AggregateType) { endAt:(nullable NSArray *)endAt endBefore:(nullable NSArray *)endBefore filters:(nullable NSDictionary *)filters; -@property(nonatomic, strong, nullable) NSArray *> *where; -@property(nonatomic, strong, nullable) NSArray *> *orderBy; +@property(nonatomic, copy, nullable) NSArray *> *where; +@property(nonatomic, copy, nullable) NSArray *> *orderBy; @property(nonatomic, strong, nullable) NSNumber *limit; @property(nonatomic, strong, nullable) NSNumber *limitToLast; -@property(nonatomic, strong, nullable) NSArray *startAt; -@property(nonatomic, strong, nullable) NSArray *startAfter; -@property(nonatomic, strong, nullable) NSArray *endAt; -@property(nonatomic, strong, nullable) NSArray *endBefore; -@property(nonatomic, strong, nullable) NSDictionary *filters; +@property(nonatomic, copy, nullable) NSArray *startAt; +@property(nonatomic, copy, nullable) NSArray *startAfter; +@property(nonatomic, copy, nullable) NSArray *endAt; +@property(nonatomic, copy, nullable) NSArray *endBefore; +@property(nonatomic, copy, nullable) NSDictionary *filters; @end @interface AggregateQuery : NSObject @@ -350,8 +349,8 @@ typedef NS_ENUM(NSUInteger, AggregateType) { @property(nonatomic, strong, nullable) NSNumber *value; @end -/// The codec used by FirebaseFirestoreHostApi. -NSObject *FirebaseFirestoreHostApiGetCodec(void); +/// The codec used by all APIs. +NSObject *GetFirebaseFirestoreHostApiCodec(void); @protocol FirebaseFirestoreHostApi - (void)loadBundleApp:(FirestorePigeonFirebaseApp *)app @@ -359,9 +358,9 @@ NSObject *FirebaseFirestoreHostApiGetCodec(void); completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; - (void)namedQueryGetApp:(FirestorePigeonFirebaseApp *)app name:(NSString *)name - options:(PigeonGetOptions *)options + options:(InternalGetOptions *)options completion: - (void (^)(PigeonQuerySnapshot *_Nullable, FlutterError *_Nullable))completion; + (void (^)(InternalQuerySnapshot *_Nullable, FlutterError *_Nullable))completion; - (void)clearPersistenceApp:(FirestorePigeonFirebaseApp *)app completion:(void (^)(FlutterError *_Nullable))completion; - (void)disableNetworkApp:(FirestorePigeonFirebaseApp *)app @@ -375,23 +374,24 @@ NSObject *FirebaseFirestoreHostApiGetCodec(void); - (void)setIndexConfigurationApp:(FirestorePigeonFirebaseApp *)app indexConfiguration:(NSString *)indexConfiguration completion:(void (^)(FlutterError *_Nullable))completion; -- (void)setLoggingEnabledLoggingEnabled:(NSNumber *)loggingEnabled +- (void)setLoggingEnabledLoggingEnabled:(BOOL)loggingEnabled completion:(void (^)(FlutterError *_Nullable))completion; - (void)snapshotsInSyncSetupApp:(FirestorePigeonFirebaseApp *)app completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; - (void)transactionCreateApp:(FirestorePigeonFirebaseApp *)app - timeout:(NSNumber *)timeout - maxAttempts:(NSNumber *)maxAttempts + timeout:(NSInteger)timeout + maxAttempts:(NSInteger)maxAttempts completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; - (void)transactionStoreResultTransactionId:(NSString *)transactionId - resultType:(PigeonTransactionResult)resultType - commands:(nullable NSArray *)commands + resultType:(InternalTransactionResult)resultType + commands: + (nullable NSArray *)commands completion:(void (^)(FlutterError *_Nullable))completion; - (void)transactionGetApp:(FirestorePigeonFirebaseApp *)app transactionId:(NSString *)transactionId path:(NSString *)path - completion: - (void (^)(PigeonDocumentSnapshot *_Nullable, FlutterError *_Nullable))completion; + completion:(void (^)(InternalDocumentSnapshot *_Nullable, + FlutterError *_Nullable))completion; - (void)documentReferenceSetApp:(FirestorePigeonFirebaseApp *)app request:(DocumentReferenceRequest *)request completion:(void (^)(FlutterError *_Nullable))completion; @@ -400,39 +400,40 @@ NSObject *FirebaseFirestoreHostApiGetCodec(void); completion:(void (^)(FlutterError *_Nullable))completion; - (void)documentReferenceGetApp:(FirestorePigeonFirebaseApp *)app request:(DocumentReferenceRequest *)request - completion:(void (^)(PigeonDocumentSnapshot *_Nullable, + completion:(void (^)(InternalDocumentSnapshot *_Nullable, FlutterError *_Nullable))completion; - (void)documentReferenceDeleteApp:(FirestorePigeonFirebaseApp *)app request:(DocumentReferenceRequest *)request completion:(void (^)(FlutterError *_Nullable))completion; - (void)queryGetApp:(FirestorePigeonFirebaseApp *)app path:(NSString *)path - isCollectionGroup:(NSNumber *)isCollectionGroup - parameters:(PigeonQueryParameters *)parameters - options:(PigeonGetOptions *)options - completion:(void (^)(PigeonQuerySnapshot *_Nullable, FlutterError *_Nullable))completion; + isCollectionGroup:(BOOL)isCollectionGroup + parameters:(InternalQueryParameters *)parameters + options:(InternalGetOptions *)options + completion: + (void (^)(InternalQuerySnapshot *_Nullable, FlutterError *_Nullable))completion; - (void)aggregateQueryApp:(FirestorePigeonFirebaseApp *)app path:(NSString *)path - parameters:(PigeonQueryParameters *)parameters + parameters:(InternalQueryParameters *)parameters source:(AggregateSource)source queries:(NSArray *)queries - isCollectionGroup:(NSNumber *)isCollectionGroup + isCollectionGroup:(BOOL)isCollectionGroup completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; - (void)writeBatchCommitApp:(FirestorePigeonFirebaseApp *)app - writes:(NSArray *)writes + writes:(NSArray *)writes completion:(void (^)(FlutterError *_Nullable))completion; - (void)querySnapshotApp:(FirestorePigeonFirebaseApp *)app path:(NSString *)path - isCollectionGroup:(NSNumber *)isCollectionGroup - parameters:(PigeonQueryParameters *)parameters - options:(PigeonGetOptions *)options - includeMetadataChanges:(NSNumber *)includeMetadataChanges + isCollectionGroup:(BOOL)isCollectionGroup + parameters:(InternalQueryParameters *)parameters + options:(InternalGetOptions *)options + includeMetadataChanges:(BOOL)includeMetadataChanges source:(ListenSource)source completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; - (void)documentReferenceSnapshotApp:(FirestorePigeonFirebaseApp *)app parameters:(DocumentReferenceRequest *)parameters - includeMetadataChanges:(NSNumber *)includeMetadataChanges + includeMetadataChanges:(BOOL)includeMetadataChanges source:(ListenSource)source completion: (void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; @@ -442,11 +443,15 @@ NSObject *FirebaseFirestoreHostApiGetCodec(void); - (void)executePipelineApp:(FirestorePigeonFirebaseApp *)app stages:(NSArray *> *)stages options:(nullable NSDictionary *)options - completion:(void (^)(PigeonPipelineSnapshot *_Nullable, + completion:(void (^)(InternalPipelineSnapshot *_Nullable, FlutterError *_Nullable))completion; @end -extern void FirebaseFirestoreHostApiSetup(id binaryMessenger, +extern void SetUpFirebaseFirestoreHostApi(id binaryMessenger, NSObject *_Nullable api); +extern void SetUpFirebaseFirestoreHostApiWithSuffix( + id binaryMessenger, NSObject *_Nullable api, + NSString *messageChannelSuffix); + NS_ASSUME_NONNULL_END diff --git a/packages/cloud_firestore/cloud_firestore/test/test_firestore_message_codec.dart b/packages/cloud_firestore/cloud_firestore/test/test_firestore_message_codec.dart index 7a56ecd2b89a..c7ad874ffd2e 100644 --- a/packages/cloud_firestore/cloud_firestore/test/test_firestore_message_codec.dart +++ b/packages/cloud_firestore/cloud_firestore/test/test_firestore_message_codec.dart @@ -77,7 +77,7 @@ class TestFirestoreMessageCodec extends FirestoreMessageCodec { values['path'], FirestorePigeonFirebaseApp( appName: "['DEFAULT']", - settings: PigeonFirebaseSettings(ignoreUndefinedProperties: true), + settings: InternalFirebaseSettings(ignoreUndefinedProperties: true), databaseURL: '', ), ); diff --git a/packages/cloud_firestore/cloud_firestore/windows/cloud_firestore_plugin.cpp b/packages/cloud_firestore/cloud_firestore/windows/cloud_firestore_plugin.cpp index 4550d6b3acf0..597a60adbae1 100644 --- a/packages/cloud_firestore/cloud_firestore/windows/cloud_firestore_plugin.cpp +++ b/packages/cloud_firestore/cloud_firestore/windows/cloud_firestore_plugin.cpp @@ -291,12 +291,12 @@ FlutterError CloudFirestorePlugin::ParseError( firebase::firestore::Source GetSourceFromPigeon(const Source& pigeonSource) { switch (pigeonSource) { - case Source::serverAndCache: + case Source::kServerAndCache: default: return firebase::firestore::Source::kDefault; - case Source::server: + case Source::kServer: return firebase::firestore::Source::kServer; - case Source::cache: + case Source::kCache: return firebase::firestore::Source::kCache; } } @@ -305,13 +305,13 @@ firebase::firestore::DocumentSnapshot::ServerTimestampBehavior GetServerTimestampBehaviorFromPigeon( const ServerTimestampBehavior& pigeonServerTimestampBehavior) { switch (pigeonServerTimestampBehavior) { - case ServerTimestampBehavior::estimate: + case ServerTimestampBehavior::kEstimate: return firebase::firestore::DocumentSnapshot::ServerTimestampBehavior:: kEstimate; - case ServerTimestampBehavior::previous: + case ServerTimestampBehavior::kPrevious: return firebase::firestore::DocumentSnapshot::ServerTimestampBehavior:: kPrevious; - case ServerTimestampBehavior::none: + case ServerTimestampBehavior::kNone: default: return firebase::firestore::DocumentSnapshot::ServerTimestampBehavior:: kNone; @@ -382,27 +382,27 @@ flutter::EncodableMap ConvertToEncodableMap( return convertedMap; } -PigeonSnapshotMetadata ParseSnapshotMetadata( +InternalSnapshotMetadata ParseSnapshotMetadata( const firebase::firestore::SnapshotMetadata& metadata) { - PigeonSnapshotMetadata pigeonSnapshotMetadata = PigeonSnapshotMetadata( + InternalSnapshotMetadata pigeonSnapshotMetadata = InternalSnapshotMetadata( metadata.has_pending_writes(), metadata.is_from_cache()); return pigeonSnapshotMetadata; } -PigeonDocumentSnapshot ParseDocumentSnapshot( +InternalDocumentSnapshot ParseDocumentSnapshot( DocumentSnapshot document, DocumentSnapshot::ServerTimestampBehavior serverTimestampBehavior) { flutter::EncodableMap tempMap = ConvertToEncodableMap(document.GetData(serverTimestampBehavior)); if (tempMap.empty()) { - return PigeonDocumentSnapshot(document.reference().path(), nullptr, - ParseSnapshotMetadata(document.metadata())); + return InternalDocumentSnapshot(document.reference().path(), nullptr, + ParseSnapshotMetadata(document.metadata())); } - PigeonDocumentSnapshot pigeonDocumentSnapshot = - PigeonDocumentSnapshot(document.reference().path(), &tempMap, - ParseSnapshotMetadata(document.metadata())); + InternalDocumentSnapshot pigeonDocumentSnapshot = + InternalDocumentSnapshot(document.reference().path(), &tempMap, + ParseSnapshotMetadata(document.metadata())); return pigeonDocumentSnapshot; } @@ -422,20 +422,20 @@ DocumentChangeType ParseDocumentChangeType( const firebase::firestore::DocumentChange::Type& type) { switch (type) { case firebase::firestore::DocumentChange::Type::kAdded: - return DocumentChangeType::added; + return DocumentChangeType::kAdded; case firebase::firestore::DocumentChange::Type::kRemoved: - return DocumentChangeType::removed; + return DocumentChangeType::kRemoved; case firebase::firestore::DocumentChange::Type::kModified: - return DocumentChangeType::modified; + return DocumentChangeType::kModified; } throw std::invalid_argument("Invalid DocumentChangeType"); } -PigeonDocumentChange ParseDocumentChange( +InternalDocumentChange ParseDocumentChange( const firebase::firestore::DocumentChange& document_change, DocumentSnapshot::ServerTimestampBehavior serverTimestampBehavior) { - PigeonDocumentChange pigeonDocumentChange = PigeonDocumentChange( + InternalDocumentChange pigeonDocumentChange = InternalDocumentChange( ParseDocumentChangeType(document_change.type()), ParseDocumentSnapshot(document_change.document(), serverTimestampBehavior), @@ -454,10 +454,10 @@ flutter::EncodableList ParseDocumentChanges( return pigeonDocumentChanges; } -PigeonQuerySnapshot ParseQuerySnapshot( +InternalQuerySnapshot ParseQuerySnapshot( const firebase::firestore::QuerySnapshot* query_snapshot, DocumentSnapshot::ServerTimestampBehavior serverTimestampBehavior) { - PigeonQuerySnapshot pigeonQuerySnapshot = PigeonQuerySnapshot( + InternalQuerySnapshot pigeonQuerySnapshot = InternalQuerySnapshot( ParseDocumentSnapshots(query_snapshot->documents(), serverTimestampBehavior), ParseDocumentChanges(query_snapshot->DocumentChanges(), @@ -625,8 +625,8 @@ using firebase::firestore::QuerySnapshot; void CloudFirestorePlugin::NamedQueryGet( const FirestorePigeonFirebaseApp& app, const std::string& name, - const PigeonGetOptions& options, - std::function reply)> result) { + const InternalGetOptions& options, + std::function reply)> result) { Firestore* firestore = GetFirestoreFromPigeon(app); Future future = firestore->NamedQuery(name.c_str()); @@ -825,8 +825,8 @@ class TransactionStreamHandler transactionId_(transactionId) {} void ReceiveTransactionResponse( - PigeonTransactionResult resultType, - std::vector commands) { + InternalTransactionResult resultType, + std::vector commands) { std::lock_guard lock(commands_mutex_); resultType_ = resultType; commands_ = commands; @@ -867,9 +867,9 @@ class TransactionStreamHandler std::lock_guard command_lock(commands_mutex_); if (commands_.empty()) return Error::kErrorOk; - for (PigeonTransactionCommand& command : commands_) { + for (InternalTransactionCommand& command : commands_) { std::string path = command.path(); - PigeonTransactionType type = command.type(); + InternalTransactionType type = command.type(); if (path.empty() /* or some other invalid condition */) { std::cerr << "Path is invalid: " << path << std::endl; continue; // Skip this iteration. @@ -882,7 +882,7 @@ class TransactionStreamHandler << std::endl; // debug print switch (type) { - case PigeonTransactionType::set: + case InternalTransactionType::kSet: std::cout << "Transaction set" << path << std::endl; // Debug print. @@ -902,14 +902,14 @@ class TransactionStreamHandler } break; - case PigeonTransactionType::update: + case InternalTransactionType::kUpdate: std::cout << "Transaction update" << path << std::endl; // Debug print. transaction.Update( reference, ConvertToMapFieldPathValue(*command.data())); break; - case PigeonTransactionType::deleteType: + case InternalTransactionType::kDeleteType: std::cout << "Transaction delete" << path << std::endl; // Debug print. @@ -948,8 +948,8 @@ class TransactionStreamHandler long timeout_; int maxAttempts_; std::string transactionId_; - std::vector commands_; - PigeonTransactionResult resultType_; + std::vector commands_; + InternalTransactionResult resultType_; std::mutex mtx_; std::mutex commands_mutex_; std::condition_variable cv_; @@ -990,16 +990,16 @@ using flutter::CustomEncodableValue; void CloudFirestorePlugin::TransactionStoreResult( const std::string& transaction_id, - const PigeonTransactionResult& result_type, + const InternalTransactionResult& result_type, const flutter::EncodableList* commands, std::function reply)> result) { if (CloudFirestorePlugin::transaction_handlers_[transaction_id]) { TransactionStreamHandler& handler = *static_cast( CloudFirestorePlugin::transaction_handlers_[transaction_id].get()); - std::vector commandVector; + std::vector commandVector; for (const auto& element : *commands) { - const PigeonTransactionCommand& command = - std::any_cast( + const InternalTransactionCommand& command = + std::any_cast( std::get(element)); commandVector.push_back(command); } @@ -1015,7 +1015,7 @@ void CloudFirestorePlugin::TransactionStoreResult( void CloudFirestorePlugin::TransactionGet( const FirestorePigeonFirebaseApp& app, const std::string& transaction_id, const std::string& path, - std::function reply)> result) { + std::function reply)> result) { Firestore* firestore = GetFirestoreFromPigeon(app); DocumentReference reference = firestore->Document(path); @@ -1114,7 +1114,7 @@ void CloudFirestorePlugin::DocumentReferenceUpdate( void CloudFirestorePlugin::DocumentReferenceGet( const FirestorePigeonFirebaseApp& app, const DocumentReferenceRequest& request, - std::function reply)> result) { + std::function reply)> result) { Firestore* firestore = GetFirestoreFromPigeon(app); DocumentReference document_reference = firestore->Document(request.path()); @@ -1249,10 +1249,9 @@ firebase::firestore::Filter filterFromJson(const EncodableMap& map) { throw std::runtime_error("Invalid operator"); } -firebase::firestore::Query ParseQuery(firebase::firestore::Firestore* firestore, - const std::string& path, - bool isCollectionGroup, - const PigeonQueryParameters& parameters) { +firebase::firestore::Query ParseQuery( + firebase::firestore::Firestore* firestore, const std::string& path, + bool isCollectionGroup, const InternalQueryParameters& parameters) { try { firebase::firestore::Query query; @@ -1369,9 +1368,9 @@ firebase::firestore::Query ParseQuery(firebase::firestore::Firestore* firestore, void CloudFirestorePlugin::QueryGet( const FirestorePigeonFirebaseApp& app, const std::string& path, - bool is_collection_group, const PigeonQueryParameters& parameters, - const PigeonGetOptions& options, - std::function reply)> result) { + bool is_collection_group, const InternalQueryParameters& parameters, + const InternalGetOptions& options, + std::function reply)> result) { Firestore* firestore = GetFirestoreFromPigeon(app); Query query = ParseQuery(firestore, path, is_collection_group, parameters); @@ -1397,7 +1396,7 @@ void CloudFirestorePlugin::QueryGet( firebase::firestore::AggregateSource GetAggregateSourceFromPigeon( const AggregateSource& source) { switch (source) { - case AggregateSource::server: + case AggregateSource::kServer: default: return firebase::firestore::AggregateSource::kServer; } @@ -1405,7 +1404,7 @@ firebase::firestore::AggregateSource GetAggregateSourceFromPigeon( void CloudFirestorePlugin::AggregateQuery( const FirestorePigeonFirebaseApp& app, const std::string& path, - const PigeonQueryParameters& parameters, const AggregateSource& source, + const InternalQueryParameters& parameters, const AggregateSource& source, const flutter::EncodableList& queries, bool is_collection_group, std::function reply)> result) { Firestore* firestore = GetFirestoreFromPigeon(app); @@ -1420,13 +1419,13 @@ void CloudFirestorePlugin::AggregateQuery( std::get(queryRequest)); switch (queryRequestTyped.type()) { - case AggregateType::count: + case AggregateType::kCount: aggregate_query = query.Count(); break; - case AggregateType::sum: + case AggregateType::kSum: std::cout << "Sum is not supported on C++" << std::endl; break; - case AggregateType::average: + case AggregateType::kAverage: std::cout << "Average is not supported on C++" << std::endl; break; } @@ -1449,20 +1448,20 @@ void CloudFirestorePlugin::AggregateQuery( std::get(queryRequest)); switch (queryRequestTyped.type()) { - case AggregateType::count: { + case AggregateType::kCount: { double doubleValue = static_cast(aggregateQuerySnapshot->count()); - AggregateQueryResponse aggregateResponse(AggregateType::count, + AggregateQueryResponse aggregateResponse(AggregateType::kCount, nullptr, &doubleValue); aggregateResponses.push_back( CustomEncodableValue(aggregateResponse)); break; } - case AggregateType::sum: { + case AggregateType::kSum: { std::cout << "Sum is not supported on C++" << std::endl; break; } - case AggregateType::average: { + case AggregateType::kAverage: { std::cout << "Average is not supported on C++" << std::endl; break; } @@ -1484,11 +1483,11 @@ void CloudFirestorePlugin::WriteBatchCommit( firebase::firestore::WriteBatch batch = firestore->batch(); for (const auto& write : writes) { - const PigeonTransactionCommand& transaction = - std::any_cast( + const InternalTransactionCommand& transaction = + std::any_cast( std::get(write)); - PigeonTransactionType type = transaction.type(); + InternalTransactionType type = transaction.type(); std::string path = transaction.path(); auto data = transaction.data(); @@ -1496,14 +1495,14 @@ void CloudFirestorePlugin::WriteBatchCommit( firestore->Document(path); switch (type) { - case PigeonTransactionType::deleteType: + case InternalTransactionType::kDeleteType: batch.Delete(documentReference); break; - case PigeonTransactionType::update: + case InternalTransactionType::kUpdate: batch.Update(documentReference, ConvertToMapFieldPathValue(*data)); break; - case PigeonTransactionType::set: - const PigeonDocumentOption* options = transaction.option(); + case InternalTransactionType::kSet: + const InternalDocumentOption* options = transaction.option(); if (options->merge()) { batch.Set(documentReference, ConvertToMapFieldValue(*data), @@ -1624,11 +1623,11 @@ class QuerySnapshotStreamHandler void CloudFirestorePlugin::QuerySnapshot( const FirestorePigeonFirebaseApp& app, const std::string& path, - bool is_collection_group, const PigeonQueryParameters& parameters, - const PigeonGetOptions& options, bool include_metadata_changes, + bool is_collection_group, const InternalQueryParameters& parameters, + const InternalGetOptions& options, bool include_metadata_changes, const ListenSource& source, std::function reply)> result) { - if (source == ListenSource::cache) { + if (source == ListenSource::kCache) { result(FlutterError("Listening from cache isn't supported on Windows")); return; } @@ -1717,7 +1716,7 @@ void CloudFirestorePlugin::DocumentReferenceSnapshot( const DocumentReferenceRequest& parameters, bool include_metadata_changes, const ListenSource& source, std::function reply)> result) { - if (source == ListenSource::cache) { + if (source == ListenSource::kCache) { result(FlutterError("Listening from cache isn't supported on Windows")); return; } @@ -1745,4 +1744,12 @@ void CloudFirestorePlugin::PersistenceCacheIndexManagerRequest( result(FlutterError("Not implemented on Windows")); } +void CloudFirestorePlugin::ExecutePipeline( + const FirestorePigeonFirebaseApp& app, + const ::flutter::EncodableList& stages, + const ::flutter::EncodableMap* options, + std::function reply)> result) { + result(FlutterError("Not implemented on Windows")); +} + } // namespace cloud_firestore_windows diff --git a/packages/cloud_firestore/cloud_firestore/windows/cloud_firestore_plugin.h b/packages/cloud_firestore/cloud_firestore/windows/cloud_firestore_plugin.h index ee0dcb07e331..e99dac003c16 100644 --- a/packages/cloud_firestore/cloud_firestore/windows/cloud_firestore_plugin.h +++ b/packages/cloud_firestore/cloud_firestore/windows/cloud_firestore_plugin.h @@ -48,8 +48,9 @@ class CloudFirestorePlugin : public flutter::Plugin, std::function reply)> result) override; virtual void NamedQueryGet( const FirestorePigeonFirebaseApp& app, const std::string& name, - const PigeonGetOptions& options, - std::function reply)> result) override; + const InternalGetOptions& options, + std::function reply)> result) + override; virtual void ClearPersistence( const FirestorePigeonFirebaseApp& app, std::function reply)> result) override; @@ -81,13 +82,13 @@ class CloudFirestorePlugin : public flutter::Plugin, std::function reply)> result) override; virtual void TransactionStoreResult( const std::string& transaction_id, - const PigeonTransactionResult& result_type, + const InternalTransactionResult& result_type, const flutter::EncodableList* commands, std::function reply)> result) override; virtual void TransactionGet( const FirestorePigeonFirebaseApp& app, const std::string& transaction_id, const std::string& path, - std::function reply)> result) + std::function reply)> result) override; virtual void DocumentReferenceSet( const FirestorePigeonFirebaseApp& app, @@ -100,7 +101,7 @@ class CloudFirestorePlugin : public flutter::Plugin, virtual void DocumentReferenceGet( const FirestorePigeonFirebaseApp& app, const DocumentReferenceRequest& request, - std::function reply)> result) + std::function reply)> result) override; virtual void DocumentReferenceDelete( const FirestorePigeonFirebaseApp& app, @@ -108,12 +109,13 @@ class CloudFirestorePlugin : public flutter::Plugin, std::function reply)> result) override; virtual void QueryGet( const FirestorePigeonFirebaseApp& app, const std::string& path, - bool is_collection_group, const PigeonQueryParameters& parameters, - const PigeonGetOptions& options, - std::function reply)> result) override; + bool is_collection_group, const InternalQueryParameters& parameters, + const InternalGetOptions& options, + std::function reply)> result) + override; virtual void AggregateQuery( const FirestorePigeonFirebaseApp& app, const std::string& path, - const PigeonQueryParameters& parameters, const AggregateSource& source, + const InternalQueryParameters& parameters, const AggregateSource& source, const flutter::EncodableList& queries, bool is_collection_group, std::function reply)> result) override; @@ -123,8 +125,8 @@ class CloudFirestorePlugin : public flutter::Plugin, std::function reply)> result) override; virtual void QuerySnapshot( const FirestorePigeonFirebaseApp& app, const std::string& path, - bool is_collection_group, const PigeonQueryParameters& parameters, - const PigeonGetOptions& options, bool include_metadata_changes, + bool is_collection_group, const InternalQueryParameters& parameters, + const InternalGetOptions& options, bool include_metadata_changes, const ListenSource& source, std::function reply)> result) override; virtual void DocumentReferenceSnapshot( @@ -136,6 +138,12 @@ class CloudFirestorePlugin : public flutter::Plugin, const FirestorePigeonFirebaseApp& app, const PersistenceCacheIndexManagerRequestEnum& request, std::function reply)> result) override; + virtual void ExecutePipeline( + const FirestorePigeonFirebaseApp& app, + const ::flutter::EncodableList& stages, + const ::flutter::EncodableMap* options, + std::function reply)> result) + override; static flutter::BinaryMessenger* messenger_; static std::map< diff --git a/packages/cloud_firestore/cloud_firestore/windows/messages.g.cpp b/packages/cloud_firestore/cloud_firestore/windows/messages.g.cpp index bb9f58d5775d..9c3c6b9dceec 100644 --- a/packages/cloud_firestore/cloud_firestore/windows/messages.g.cpp +++ b/packages/cloud_firestore/cloud_firestore/windows/messages.g.cpp @@ -1,7 +1,7 @@ // Copyright 2023, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v11.0.1), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), do not edit directly. // See also: https://pub.dev/packages/pigeon #undef _HAS_EXCEPTIONS @@ -13,27 +13,242 @@ #include #include +#include +#include #include #include #include namespace cloud_firestore_windows { -using flutter::BasicMessageChannel; -using flutter::CustomEncodableValue; -using flutter::EncodableList; -using flutter::EncodableMap; -using flutter::EncodableValue; +using ::flutter::BasicMessageChannel; +using ::flutter::CustomEncodableValue; +using ::flutter::EncodableList; +using ::flutter::EncodableMap; +using ::flutter::EncodableValue; -// PigeonFirebaseSettings +FlutterError CreateConnectionError(const std::string channel_name) { + return FlutterError( + "channel-error", + "Unable to establish connection on channel: '" + channel_name + "'.", + EncodableValue("")); +} + +namespace { +template +bool PigeonInternalDeepEquals(const T& a, const T& b); + +bool PigeonInternalDeepEquals(const double& a, const double& b); + +template +bool PigeonInternalDeepEquals(const std::vector& a, const std::vector& b); + +template +bool PigeonInternalDeepEquals(const std::map& a, const std::map& b); + +template +bool PigeonInternalDeepEquals(const std::optional& a, + const std::optional& b); + +template +bool PigeonInternalDeepEquals(const std::unique_ptr& a, + const std::unique_ptr& b); + +bool PigeonInternalDeepEquals(const ::flutter::EncodableValue& a, + const ::flutter::EncodableValue& b); + +template +bool PigeonInternalDeepEquals(const T& a, const T& b) { + return a == b; +} + +template +bool PigeonInternalDeepEquals(const std::vector& a, + const std::vector& b) { + if (a.size() != b.size()) { + return false; + } + for (size_t i = 0; i < a.size(); ++i) { + if (!PigeonInternalDeepEquals(a[i], b[i])) { + return false; + } + } + return true; +} + +template +bool PigeonInternalDeepEquals(const std::map& a, + const std::map& b) { + if (a.size() != b.size()) { + return false; + } + for (const auto& kv : a) { + bool found = false; + for (const auto& b_kv : b) { + if (PigeonInternalDeepEquals(kv.first, b_kv.first)) { + if (PigeonInternalDeepEquals(kv.second, b_kv.second)) { + found = true; + break; + } else { + return false; + } + } + } + if (!found) { + return false; + } + } + return true; +} + +bool PigeonInternalDeepEquals(const double& a, const double& b) { + // Normalize -0.0 to 0.0 and handle NaN equality. + return (a == b) || (std::isnan(a) && std::isnan(b)); +} + +template +bool PigeonInternalDeepEquals(const std::optional& a, + const std::optional& b) { + if (!a && !b) { + return true; + } + if (!a || !b) { + return false; + } + return PigeonInternalDeepEquals(*a, *b); +} + +template +bool PigeonInternalDeepEquals(const std::unique_ptr& a, + const std::unique_ptr& b) { + if (a.get() == b.get()) { + return true; + } + if (!a || !b) { + return false; + } + return PigeonInternalDeepEquals(*a, *b); +} + +bool PigeonInternalDeepEquals(const ::flutter::EncodableValue& a, + const ::flutter::EncodableValue& b) { + if (a.index() != b.index()) { + return false; + } + if (const double* da = std::get_if(&a)) { + return PigeonInternalDeepEquals(*da, std::get(b)); + } else if (const ::flutter::EncodableList* la = + std::get_if<::flutter::EncodableList>(&a)) { + return PigeonInternalDeepEquals(*la, std::get<::flutter::EncodableList>(b)); + } else if (const ::flutter::EncodableMap* ma = + std::get_if<::flutter::EncodableMap>(&a)) { + return PigeonInternalDeepEquals(*ma, std::get<::flutter::EncodableMap>(b)); + } + return a == b; +} + +template +size_t PigeonInternalDeepHash(const T& v); + +size_t PigeonInternalDeepHash(const double& v); + +template +size_t PigeonInternalDeepHash(const std::vector& v); + +template +size_t PigeonInternalDeepHash(const std::map& v); + +template +size_t PigeonInternalDeepHash(const std::optional& v); + +template +size_t PigeonInternalDeepHash(const std::unique_ptr& v); + +size_t PigeonInternalDeepHash(const ::flutter::EncodableValue& v); + +template +size_t PigeonInternalDeepHash(const T& v) { + return std::hash()(v); +} + +template +size_t PigeonInternalDeepHash(const std::vector& v) { + size_t result = 1; + for (const auto& item : v) { + result = result * 31 + PigeonInternalDeepHash(item); + } + return result; +} + +template +size_t PigeonInternalDeepHash(const std::map& v) { + size_t result = 0; + for (const auto& kv : v) { + result += ((PigeonInternalDeepHash(kv.first) * 31) ^ + PigeonInternalDeepHash(kv.second)); + } + return result; +} + +size_t PigeonInternalDeepHash(const double& v) { + if (std::isnan(v)) { + // Normalize NaN to a consistent hash. + return std::hash()(std::numeric_limits::quiet_NaN()); + } + if (v == 0.0) { + // Normalize -0.0 to 0.0 so they have the same hash code. + return std::hash()(0.0); + } + return std::hash()(v); +} + +template +size_t PigeonInternalDeepHash(const std::optional& v) { + return v ? PigeonInternalDeepHash(*v) : 0; +} + +template +size_t PigeonInternalDeepHash(const std::unique_ptr& v) { + return v ? PigeonInternalDeepHash(*v) : 0; +} + +size_t PigeonInternalDeepHash(const ::flutter::EncodableValue& v) { + size_t result = v.index(); + if (const double* dv = std::get_if(&v)) { + result = result * 31 + PigeonInternalDeepHash(*dv); + } else if (const ::flutter::EncodableList* lv = + std::get_if<::flutter::EncodableList>(&v)) { + result = result * 31 + PigeonInternalDeepHash(*lv); + } else if (const ::flutter::EncodableMap* mv = + std::get_if<::flutter::EncodableMap>(&v)) { + result = result * 31 + PigeonInternalDeepHash(*mv); + } else { + std::visit( + [&result](const auto& val) { + using T = std::decay_t; + if constexpr (!std::is_same_v && + !std::is_same_v && + !std::is_same_v && + !std::is_same_v && + !std::is_same_v) { + result = result * 31 + PigeonInternalDeepHash(val); + } + }, + v); + } + return result; +} -PigeonFirebaseSettings::PigeonFirebaseSettings(bool ignore_undefined_properties) +} // namespace +// InternalFirebaseSettings + +InternalFirebaseSettings::InternalFirebaseSettings( + bool ignore_undefined_properties) : ignore_undefined_properties_(ignore_undefined_properties) {} -PigeonFirebaseSettings::PigeonFirebaseSettings(const bool* persistence_enabled, - const std::string* host, - const bool* ssl_enabled, - const int64_t* cache_size_bytes, - bool ignore_undefined_properties) +InternalFirebaseSettings::InternalFirebaseSettings( + const bool* persistence_enabled, const std::string* host, + const bool* ssl_enabled, const int64_t* cache_size_bytes, + bool ignore_undefined_properties) : persistence_enabled_(persistence_enabled ? std::optional(*persistence_enabled) : std::nullopt), @@ -45,65 +260,65 @@ PigeonFirebaseSettings::PigeonFirebaseSettings(const bool* persistence_enabled, : std::nullopt), ignore_undefined_properties_(ignore_undefined_properties) {} -const bool* PigeonFirebaseSettings::persistence_enabled() const { +const bool* InternalFirebaseSettings::persistence_enabled() const { return persistence_enabled_ ? &(*persistence_enabled_) : nullptr; } -void PigeonFirebaseSettings::set_persistence_enabled(const bool* value_arg) { +void InternalFirebaseSettings::set_persistence_enabled(const bool* value_arg) { persistence_enabled_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonFirebaseSettings::set_persistence_enabled(bool value_arg) { +void InternalFirebaseSettings::set_persistence_enabled(bool value_arg) { persistence_enabled_ = value_arg; } -const std::string* PigeonFirebaseSettings::host() const { +const std::string* InternalFirebaseSettings::host() const { return host_ ? &(*host_) : nullptr; } -void PigeonFirebaseSettings::set_host(const std::string_view* value_arg) { +void InternalFirebaseSettings::set_host(const std::string_view* value_arg) { host_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonFirebaseSettings::set_host(std::string_view value_arg) { +void InternalFirebaseSettings::set_host(std::string_view value_arg) { host_ = value_arg; } -const bool* PigeonFirebaseSettings::ssl_enabled() const { +const bool* InternalFirebaseSettings::ssl_enabled() const { return ssl_enabled_ ? &(*ssl_enabled_) : nullptr; } -void PigeonFirebaseSettings::set_ssl_enabled(const bool* value_arg) { +void InternalFirebaseSettings::set_ssl_enabled(const bool* value_arg) { ssl_enabled_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonFirebaseSettings::set_ssl_enabled(bool value_arg) { +void InternalFirebaseSettings::set_ssl_enabled(bool value_arg) { ssl_enabled_ = value_arg; } -const int64_t* PigeonFirebaseSettings::cache_size_bytes() const { +const int64_t* InternalFirebaseSettings::cache_size_bytes() const { return cache_size_bytes_ ? &(*cache_size_bytes_) : nullptr; } -void PigeonFirebaseSettings::set_cache_size_bytes(const int64_t* value_arg) { +void InternalFirebaseSettings::set_cache_size_bytes(const int64_t* value_arg) { cache_size_bytes_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonFirebaseSettings::set_cache_size_bytes(int64_t value_arg) { +void InternalFirebaseSettings::set_cache_size_bytes(int64_t value_arg) { cache_size_bytes_ = value_arg; } -bool PigeonFirebaseSettings::ignore_undefined_properties() const { +bool InternalFirebaseSettings::ignore_undefined_properties() const { return ignore_undefined_properties_; } -void PigeonFirebaseSettings::set_ignore_undefined_properties(bool value_arg) { +void InternalFirebaseSettings::set_ignore_undefined_properties(bool value_arg) { ignore_undefined_properties_ = value_arg; } -EncodableList PigeonFirebaseSettings::ToEncodableList() const { +EncodableList InternalFirebaseSettings::ToEncodableList() const { EncodableList list; list.reserve(5); list.push_back(persistence_enabled_ ? EncodableValue(*persistence_enabled_) @@ -117,9 +332,9 @@ EncodableList PigeonFirebaseSettings::ToEncodableList() const { return list; } -PigeonFirebaseSettings PigeonFirebaseSettings::FromEncodableList( +InternalFirebaseSettings InternalFirebaseSettings::FromEncodableList( const EncodableList& list) { - PigeonFirebaseSettings decoded(std::get(list[4])); + InternalFirebaseSettings decoded(std::get(list[4])); auto& encodable_persistence_enabled = list[0]; if (!encodable_persistence_enabled.IsNull()) { decoded.set_persistence_enabled( @@ -135,20 +350,64 @@ PigeonFirebaseSettings PigeonFirebaseSettings::FromEncodableList( } auto& encodable_cache_size_bytes = list[3]; if (!encodable_cache_size_bytes.IsNull()) { - decoded.set_cache_size_bytes(encodable_cache_size_bytes.LongValue()); + decoded.set_cache_size_bytes(std::get(encodable_cache_size_bytes)); } return decoded; } +bool InternalFirebaseSettings::operator==( + const InternalFirebaseSettings& other) const { + return PigeonInternalDeepEquals(persistence_enabled_, + other.persistence_enabled_) && + PigeonInternalDeepEquals(host_, other.host_) && + PigeonInternalDeepEquals(ssl_enabled_, other.ssl_enabled_) && + PigeonInternalDeepEquals(cache_size_bytes_, other.cache_size_bytes_) && + PigeonInternalDeepEquals(ignore_undefined_properties_, + other.ignore_undefined_properties_); +} + +bool InternalFirebaseSettings::operator!=( + const InternalFirebaseSettings& other) const { + return !(*this == other); +} + +size_t InternalFirebaseSettings::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(persistence_enabled_); + result = result * 31 + PigeonInternalDeepHash(host_); + result = result * 31 + PigeonInternalDeepHash(ssl_enabled_); + result = result * 31 + PigeonInternalDeepHash(cache_size_bytes_); + result = result * 31 + PigeonInternalDeepHash(ignore_undefined_properties_); + return result; +} + +size_t PigeonInternalDeepHash(const InternalFirebaseSettings& v) { + return v.Hash(); +} + // FirestorePigeonFirebaseApp FirestorePigeonFirebaseApp::FirestorePigeonFirebaseApp( - const std::string& app_name, const PigeonFirebaseSettings& settings, + const std::string& app_name, const InternalFirebaseSettings& settings, const std::string& database_u_r_l) : app_name_(app_name), - settings_(settings), + settings_(std::make_unique(settings)), database_u_r_l_(database_u_r_l) {} +FirestorePigeonFirebaseApp::FirestorePigeonFirebaseApp( + const FirestorePigeonFirebaseApp& other) + : app_name_(other.app_name_), + settings_(std::make_unique(*other.settings_)), + database_u_r_l_(other.database_u_r_l_) {} + +FirestorePigeonFirebaseApp& FirestorePigeonFirebaseApp::operator=( + const FirestorePigeonFirebaseApp& other) { + app_name_ = other.app_name_; + settings_ = std::make_unique(*other.settings_); + database_u_r_l_ = other.database_u_r_l_; + return *this; +} + const std::string& FirestorePigeonFirebaseApp::app_name() const { return app_name_; } @@ -157,13 +416,13 @@ void FirestorePigeonFirebaseApp::set_app_name(std::string_view value_arg) { app_name_ = value_arg; } -const PigeonFirebaseSettings& FirestorePigeonFirebaseApp::settings() const { - return settings_; +const InternalFirebaseSettings& FirestorePigeonFirebaseApp::settings() const { + return *settings_; } void FirestorePigeonFirebaseApp::set_settings( - const PigeonFirebaseSettings& value_arg) { - settings_ = value_arg; + const InternalFirebaseSettings& value_arg) { + settings_ = std::make_unique(value_arg); } const std::string& FirestorePigeonFirebaseApp::database_u_r_l() const { @@ -179,41 +438,66 @@ EncodableList FirestorePigeonFirebaseApp::ToEncodableList() const { EncodableList list; list.reserve(3); list.push_back(EncodableValue(app_name_)); - list.push_back(EncodableValue(settings_.ToEncodableList())); + list.push_back(CustomEncodableValue(*settings_)); list.push_back(EncodableValue(database_u_r_l_)); return list; } FirestorePigeonFirebaseApp FirestorePigeonFirebaseApp::FromEncodableList( const EncodableList& list) { - FirestorePigeonFirebaseApp decoded(std::get(list[0]), - PigeonFirebaseSettings::FromEncodableList( - std::get(list[1])), - std::get(list[2])); + FirestorePigeonFirebaseApp decoded( + std::get(list[0]), + std::any_cast( + std::get(list[1])), + std::get(list[2])); return decoded; } -// PigeonSnapshotMetadata +bool FirestorePigeonFirebaseApp::operator==( + const FirestorePigeonFirebaseApp& other) const { + return PigeonInternalDeepEquals(app_name_, other.app_name_) && + PigeonInternalDeepEquals(settings_, other.settings_) && + PigeonInternalDeepEquals(database_u_r_l_, other.database_u_r_l_); +} -PigeonSnapshotMetadata::PigeonSnapshotMetadata(bool has_pending_writes, - bool is_from_cache) +bool FirestorePigeonFirebaseApp::operator!=( + const FirestorePigeonFirebaseApp& other) const { + return !(*this == other); +} + +size_t FirestorePigeonFirebaseApp::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(app_name_); + result = result * 31 + PigeonInternalDeepHash(settings_); + result = result * 31 + PigeonInternalDeepHash(database_u_r_l_); + return result; +} + +size_t PigeonInternalDeepHash(const FirestorePigeonFirebaseApp& v) { + return v.Hash(); +} + +// InternalSnapshotMetadata + +InternalSnapshotMetadata::InternalSnapshotMetadata(bool has_pending_writes, + bool is_from_cache) : has_pending_writes_(has_pending_writes), is_from_cache_(is_from_cache) {} -bool PigeonSnapshotMetadata::has_pending_writes() const { +bool InternalSnapshotMetadata::has_pending_writes() const { return has_pending_writes_; } -void PigeonSnapshotMetadata::set_has_pending_writes(bool value_arg) { +void InternalSnapshotMetadata::set_has_pending_writes(bool value_arg) { has_pending_writes_ = value_arg; } -bool PigeonSnapshotMetadata::is_from_cache() const { return is_from_cache_; } +bool InternalSnapshotMetadata::is_from_cache() const { return is_from_cache_; } -void PigeonSnapshotMetadata::set_is_from_cache(bool value_arg) { +void InternalSnapshotMetadata::set_is_from_cache(bool value_arg) { is_from_cache_ = value_arg; } -EncodableList PigeonSnapshotMetadata::ToEncodableList() const { +EncodableList InternalSnapshotMetadata::ToEncodableList() const { EncodableList list; list.reserve(2); list.push_back(EncodableValue(has_pending_writes_)); @@ -221,67 +505,107 @@ EncodableList PigeonSnapshotMetadata::ToEncodableList() const { return list; } -PigeonSnapshotMetadata PigeonSnapshotMetadata::FromEncodableList( +InternalSnapshotMetadata InternalSnapshotMetadata::FromEncodableList( const EncodableList& list) { - PigeonSnapshotMetadata decoded(std::get(list[0]), - std::get(list[1])); + InternalSnapshotMetadata decoded(std::get(list[0]), + std::get(list[1])); return decoded; } -// PigeonDocumentSnapshot +bool InternalSnapshotMetadata::operator==( + const InternalSnapshotMetadata& other) const { + return PigeonInternalDeepEquals(has_pending_writes_, + other.has_pending_writes_) && + PigeonInternalDeepEquals(is_from_cache_, other.is_from_cache_); +} + +bool InternalSnapshotMetadata::operator!=( + const InternalSnapshotMetadata& other) const { + return !(*this == other); +} + +size_t InternalSnapshotMetadata::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(has_pending_writes_); + result = result * 31 + PigeonInternalDeepHash(is_from_cache_); + return result; +} + +size_t PigeonInternalDeepHash(const InternalSnapshotMetadata& v) { + return v.Hash(); +} + +// InternalDocumentSnapshot -PigeonDocumentSnapshot::PigeonDocumentSnapshot( - const std::string& path, const PigeonSnapshotMetadata& metadata) - : path_(path), metadata_(metadata) {} +InternalDocumentSnapshot::InternalDocumentSnapshot( + const std::string& path, const InternalSnapshotMetadata& metadata) + : path_(path), + metadata_(std::make_unique(metadata)) {} -PigeonDocumentSnapshot::PigeonDocumentSnapshot( +InternalDocumentSnapshot::InternalDocumentSnapshot( const std::string& path, const EncodableMap* data, - const PigeonSnapshotMetadata& metadata) + const InternalSnapshotMetadata& metadata) : path_(path), data_(data ? std::optional(*data) : std::nullopt), - metadata_(metadata) {} + metadata_(std::make_unique(metadata)) {} -const std::string& PigeonDocumentSnapshot::path() const { return path_; } +InternalDocumentSnapshot::InternalDocumentSnapshot( + const InternalDocumentSnapshot& other) + : path_(other.path_), + data_(other.data_ ? std::optional(*other.data_) + : std::nullopt), + metadata_(std::make_unique(*other.metadata_)) {} -void PigeonDocumentSnapshot::set_path(std::string_view value_arg) { +InternalDocumentSnapshot& InternalDocumentSnapshot::operator=( + const InternalDocumentSnapshot& other) { + path_ = other.path_; + data_ = other.data_; + metadata_ = std::make_unique(*other.metadata_); + return *this; +} + +const std::string& InternalDocumentSnapshot::path() const { return path_; } + +void InternalDocumentSnapshot::set_path(std::string_view value_arg) { path_ = value_arg; } -const EncodableMap* PigeonDocumentSnapshot::data() const { +const EncodableMap* InternalDocumentSnapshot::data() const { return data_ ? &(*data_) : nullptr; } -void PigeonDocumentSnapshot::set_data(const EncodableMap* value_arg) { +void InternalDocumentSnapshot::set_data(const EncodableMap* value_arg) { data_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonDocumentSnapshot::set_data(const EncodableMap& value_arg) { +void InternalDocumentSnapshot::set_data(const EncodableMap& value_arg) { data_ = value_arg; } -const PigeonSnapshotMetadata& PigeonDocumentSnapshot::metadata() const { - return metadata_; +const InternalSnapshotMetadata& InternalDocumentSnapshot::metadata() const { + return *metadata_; } -void PigeonDocumentSnapshot::set_metadata( - const PigeonSnapshotMetadata& value_arg) { - metadata_ = value_arg; +void InternalDocumentSnapshot::set_metadata( + const InternalSnapshotMetadata& value_arg) { + metadata_ = std::make_unique(value_arg); } -EncodableList PigeonDocumentSnapshot::ToEncodableList() const { +EncodableList InternalDocumentSnapshot::ToEncodableList() const { EncodableList list; list.reserve(3); list.push_back(EncodableValue(path_)); list.push_back(data_ ? EncodableValue(*data_) : EncodableValue()); - list.push_back(EncodableValue(metadata_.ToEncodableList())); + list.push_back(CustomEncodableValue(*metadata_)); return list; } -PigeonDocumentSnapshot PigeonDocumentSnapshot::FromEncodableList( +InternalDocumentSnapshot InternalDocumentSnapshot::FromEncodableList( const EncodableList& list) { - PigeonDocumentSnapshot decoded(std::get(list[0]), - PigeonSnapshotMetadata::FromEncodableList( - std::get(list[2]))); + InternalDocumentSnapshot decoded( + std::get(list[0]), + std::any_cast( + std::get(list[2]))); auto& encodable_data = list[1]; if (!encodable_data.IsNull()) { decoded.set_data(std::get(encodable_data)); @@ -289,187 +613,499 @@ PigeonDocumentSnapshot PigeonDocumentSnapshot::FromEncodableList( return decoded; } -// PigeonDocumentChange +bool InternalDocumentSnapshot::operator==( + const InternalDocumentSnapshot& other) const { + return PigeonInternalDeepEquals(path_, other.path_) && + PigeonInternalDeepEquals(data_, other.data_) && + PigeonInternalDeepEquals(metadata_, other.metadata_); +} + +bool InternalDocumentSnapshot::operator!=( + const InternalDocumentSnapshot& other) const { + return !(*this == other); +} + +size_t InternalDocumentSnapshot::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(path_); + result = result * 31 + PigeonInternalDeepHash(data_); + result = result * 31 + PigeonInternalDeepHash(metadata_); + return result; +} + +size_t PigeonInternalDeepHash(const InternalDocumentSnapshot& v) { + return v.Hash(); +} + +// InternalDocumentChange -PigeonDocumentChange::PigeonDocumentChange( - const DocumentChangeType& type, const PigeonDocumentSnapshot& document, +InternalDocumentChange::InternalDocumentChange( + const DocumentChangeType& type, const InternalDocumentSnapshot& document, int64_t old_index, int64_t new_index) : type_(type), - document_(document), + document_(std::make_unique(document)), old_index_(old_index), new_index_(new_index) {} -const DocumentChangeType& PigeonDocumentChange::type() const { return type_; } +InternalDocumentChange::InternalDocumentChange( + const InternalDocumentChange& other) + : type_(other.type_), + document_(std::make_unique(*other.document_)), + old_index_(other.old_index_), + new_index_(other.new_index_) {} -void PigeonDocumentChange::set_type(const DocumentChangeType& value_arg) { +InternalDocumentChange& InternalDocumentChange::operator=( + const InternalDocumentChange& other) { + type_ = other.type_; + document_ = std::make_unique(*other.document_); + old_index_ = other.old_index_; + new_index_ = other.new_index_; + return *this; +} + +const DocumentChangeType& InternalDocumentChange::type() const { return type_; } + +void InternalDocumentChange::set_type(const DocumentChangeType& value_arg) { type_ = value_arg; } -const PigeonDocumentSnapshot& PigeonDocumentChange::document() const { - return document_; +const InternalDocumentSnapshot& InternalDocumentChange::document() const { + return *document_; } -void PigeonDocumentChange::set_document( - const PigeonDocumentSnapshot& value_arg) { - document_ = value_arg; +void InternalDocumentChange::set_document( + const InternalDocumentSnapshot& value_arg) { + document_ = std::make_unique(value_arg); } -int64_t PigeonDocumentChange::old_index() const { return old_index_; } +int64_t InternalDocumentChange::old_index() const { return old_index_; } -void PigeonDocumentChange::set_old_index(int64_t value_arg) { +void InternalDocumentChange::set_old_index(int64_t value_arg) { old_index_ = value_arg; } -int64_t PigeonDocumentChange::new_index() const { return new_index_; } +int64_t InternalDocumentChange::new_index() const { return new_index_; } -void PigeonDocumentChange::set_new_index(int64_t value_arg) { +void InternalDocumentChange::set_new_index(int64_t value_arg) { new_index_ = value_arg; } -EncodableList PigeonDocumentChange::ToEncodableList() const { +EncodableList InternalDocumentChange::ToEncodableList() const { EncodableList list; list.reserve(4); - list.push_back(EncodableValue((int)type_)); - list.push_back(EncodableValue(document_.ToEncodableList())); + list.push_back(CustomEncodableValue(type_)); + list.push_back(CustomEncodableValue(*document_)); list.push_back(EncodableValue(old_index_)); list.push_back(EncodableValue(new_index_)); return list; } -PigeonDocumentChange PigeonDocumentChange::FromEncodableList( +InternalDocumentChange InternalDocumentChange::FromEncodableList( const EncodableList& list) { - PigeonDocumentChange decoded((DocumentChangeType)(std::get(list[0])), - PigeonDocumentSnapshot::FromEncodableList( - std::get(list[1])), - list[2].LongValue(), list[3].LongValue()); + InternalDocumentChange decoded(std::any_cast( + std::get(list[0])), + std::any_cast( + std::get(list[1])), + std::get(list[2]), + std::get(list[3])); return decoded; } -// PigeonQuerySnapshot +bool InternalDocumentChange::operator==( + const InternalDocumentChange& other) const { + return PigeonInternalDeepEquals(type_, other.type_) && + PigeonInternalDeepEquals(document_, other.document_) && + PigeonInternalDeepEquals(old_index_, other.old_index_) && + PigeonInternalDeepEquals(new_index_, other.new_index_); +} -PigeonQuerySnapshot::PigeonQuerySnapshot(const EncodableList& documents, - const EncodableList& document_changes, - const PigeonSnapshotMetadata& metadata) +bool InternalDocumentChange::operator!=( + const InternalDocumentChange& other) const { + return !(*this == other); +} + +size_t InternalDocumentChange::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(type_); + result = result * 31 + PigeonInternalDeepHash(document_); + result = result * 31 + PigeonInternalDeepHash(old_index_); + result = result * 31 + PigeonInternalDeepHash(new_index_); + return result; +} + +size_t PigeonInternalDeepHash(const InternalDocumentChange& v) { + return v.Hash(); +} + +// InternalQuerySnapshot + +InternalQuerySnapshot::InternalQuerySnapshot( + const EncodableList& documents, const EncodableList& document_changes, + const InternalSnapshotMetadata& metadata) : documents_(documents), document_changes_(document_changes), - metadata_(metadata) {} + metadata_(std::make_unique(metadata)) {} + +InternalQuerySnapshot::InternalQuerySnapshot(const InternalQuerySnapshot& other) + : documents_(other.documents_), + document_changes_(other.document_changes_), + metadata_(std::make_unique(*other.metadata_)) {} + +InternalQuerySnapshot& InternalQuerySnapshot::operator=( + const InternalQuerySnapshot& other) { + documents_ = other.documents_; + document_changes_ = other.document_changes_; + metadata_ = std::make_unique(*other.metadata_); + return *this; +} -const EncodableList& PigeonQuerySnapshot::documents() const { +const EncodableList& InternalQuerySnapshot::documents() const { return documents_; } -void PigeonQuerySnapshot::set_documents(const EncodableList& value_arg) { +void InternalQuerySnapshot::set_documents(const EncodableList& value_arg) { documents_ = value_arg; } -const EncodableList& PigeonQuerySnapshot::document_changes() const { +const EncodableList& InternalQuerySnapshot::document_changes() const { return document_changes_; } -void PigeonQuerySnapshot::set_document_changes(const EncodableList& value_arg) { +void InternalQuerySnapshot::set_document_changes( + const EncodableList& value_arg) { document_changes_ = value_arg; } -const PigeonSnapshotMetadata& PigeonQuerySnapshot::metadata() const { - return metadata_; +const InternalSnapshotMetadata& InternalQuerySnapshot::metadata() const { + return *metadata_; } -void PigeonQuerySnapshot::set_metadata( - const PigeonSnapshotMetadata& value_arg) { - metadata_ = value_arg; +void InternalQuerySnapshot::set_metadata( + const InternalSnapshotMetadata& value_arg) { + metadata_ = std::make_unique(value_arg); } -EncodableList PigeonQuerySnapshot::ToEncodableList() const { +EncodableList InternalQuerySnapshot::ToEncodableList() const { EncodableList list; list.reserve(3); list.push_back(EncodableValue(documents_)); list.push_back(EncodableValue(document_changes_)); - list.push_back(EncodableValue(metadata_.ToEncodableList())); + list.push_back(CustomEncodableValue(*metadata_)); return list; } -PigeonQuerySnapshot PigeonQuerySnapshot::FromEncodableList( +InternalQuerySnapshot InternalQuerySnapshot::FromEncodableList( const EncodableList& list) { - PigeonQuerySnapshot decoded(std::get(list[0]), - std::get(list[1]), - PigeonSnapshotMetadata::FromEncodableList( - std::get(list[2]))); + InternalQuerySnapshot decoded(std::get(list[0]), + std::get(list[1]), + std::any_cast( + std::get(list[2]))); return decoded; } -// PigeonGetOptions +bool InternalQuerySnapshot::operator==( + const InternalQuerySnapshot& other) const { + return PigeonInternalDeepEquals(documents_, other.documents_) && + PigeonInternalDeepEquals(document_changes_, other.document_changes_) && + PigeonInternalDeepEquals(metadata_, other.metadata_); +} + +bool InternalQuerySnapshot::operator!=( + const InternalQuerySnapshot& other) const { + return !(*this == other); +} + +size_t InternalQuerySnapshot::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(documents_); + result = result * 31 + PigeonInternalDeepHash(document_changes_); + result = result * 31 + PigeonInternalDeepHash(metadata_); + return result; +} + +size_t PigeonInternalDeepHash(const InternalQuerySnapshot& v) { + return v.Hash(); +} + +// InternalPipelineResult + +InternalPipelineResult::InternalPipelineResult() {} + +InternalPipelineResult::InternalPipelineResult(const std::string* document_path, + const int64_t* create_time, + const int64_t* update_time, + const EncodableMap* data) + : document_path_(document_path ? std::optional(*document_path) + : std::nullopt), + create_time_(create_time ? std::optional(*create_time) + : std::nullopt), + update_time_(update_time ? std::optional(*update_time) + : std::nullopt), + data_(data ? std::optional(*data) : std::nullopt) {} + +const std::string* InternalPipelineResult::document_path() const { + return document_path_ ? &(*document_path_) : nullptr; +} + +void InternalPipelineResult::set_document_path( + const std::string_view* value_arg) { + document_path_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void InternalPipelineResult::set_document_path(std::string_view value_arg) { + document_path_ = value_arg; +} + +const int64_t* InternalPipelineResult::create_time() const { + return create_time_ ? &(*create_time_) : nullptr; +} + +void InternalPipelineResult::set_create_time(const int64_t* value_arg) { + create_time_ = value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void InternalPipelineResult::set_create_time(int64_t value_arg) { + create_time_ = value_arg; +} + +const int64_t* InternalPipelineResult::update_time() const { + return update_time_ ? &(*update_time_) : nullptr; +} -PigeonGetOptions::PigeonGetOptions( +void InternalPipelineResult::set_update_time(const int64_t* value_arg) { + update_time_ = value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void InternalPipelineResult::set_update_time(int64_t value_arg) { + update_time_ = value_arg; +} + +const EncodableMap* InternalPipelineResult::data() const { + return data_ ? &(*data_) : nullptr; +} + +void InternalPipelineResult::set_data(const EncodableMap* value_arg) { + data_ = value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void InternalPipelineResult::set_data(const EncodableMap& value_arg) { + data_ = value_arg; +} + +EncodableList InternalPipelineResult::ToEncodableList() const { + EncodableList list; + list.reserve(4); + list.push_back(document_path_ ? EncodableValue(*document_path_) + : EncodableValue()); + list.push_back(create_time_ ? EncodableValue(*create_time_) + : EncodableValue()); + list.push_back(update_time_ ? EncodableValue(*update_time_) + : EncodableValue()); + list.push_back(data_ ? EncodableValue(*data_) : EncodableValue()); + return list; +} + +InternalPipelineResult InternalPipelineResult::FromEncodableList( + const EncodableList& list) { + InternalPipelineResult decoded; + auto& encodable_document_path = list[0]; + if (!encodable_document_path.IsNull()) { + decoded.set_document_path(std::get(encodable_document_path)); + } + auto& encodable_create_time = list[1]; + if (!encodable_create_time.IsNull()) { + decoded.set_create_time(std::get(encodable_create_time)); + } + auto& encodable_update_time = list[2]; + if (!encodable_update_time.IsNull()) { + decoded.set_update_time(std::get(encodable_update_time)); + } + auto& encodable_data = list[3]; + if (!encodable_data.IsNull()) { + decoded.set_data(std::get(encodable_data)); + } + return decoded; +} + +bool InternalPipelineResult::operator==( + const InternalPipelineResult& other) const { + return PigeonInternalDeepEquals(document_path_, other.document_path_) && + PigeonInternalDeepEquals(create_time_, other.create_time_) && + PigeonInternalDeepEquals(update_time_, other.update_time_) && + PigeonInternalDeepEquals(data_, other.data_); +} + +bool InternalPipelineResult::operator!=( + const InternalPipelineResult& other) const { + return !(*this == other); +} + +size_t InternalPipelineResult::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(document_path_); + result = result * 31 + PigeonInternalDeepHash(create_time_); + result = result * 31 + PigeonInternalDeepHash(update_time_); + result = result * 31 + PigeonInternalDeepHash(data_); + return result; +} + +size_t PigeonInternalDeepHash(const InternalPipelineResult& v) { + return v.Hash(); +} + +// InternalPipelineSnapshot + +InternalPipelineSnapshot::InternalPipelineSnapshot(const EncodableList& results, + int64_t execution_time) + : results_(results), execution_time_(execution_time) {} + +const EncodableList& InternalPipelineSnapshot::results() const { + return results_; +} + +void InternalPipelineSnapshot::set_results(const EncodableList& value_arg) { + results_ = value_arg; +} + +int64_t InternalPipelineSnapshot::execution_time() const { + return execution_time_; +} + +void InternalPipelineSnapshot::set_execution_time(int64_t value_arg) { + execution_time_ = value_arg; +} + +EncodableList InternalPipelineSnapshot::ToEncodableList() const { + EncodableList list; + list.reserve(2); + list.push_back(EncodableValue(results_)); + list.push_back(EncodableValue(execution_time_)); + return list; +} + +InternalPipelineSnapshot InternalPipelineSnapshot::FromEncodableList( + const EncodableList& list) { + InternalPipelineSnapshot decoded(std::get(list[0]), + std::get(list[1])); + return decoded; +} + +bool InternalPipelineSnapshot::operator==( + const InternalPipelineSnapshot& other) const { + return PigeonInternalDeepEquals(results_, other.results_) && + PigeonInternalDeepEquals(execution_time_, other.execution_time_); +} + +bool InternalPipelineSnapshot::operator!=( + const InternalPipelineSnapshot& other) const { + return !(*this == other); +} + +size_t InternalPipelineSnapshot::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(results_); + result = result * 31 + PigeonInternalDeepHash(execution_time_); + return result; +} + +size_t PigeonInternalDeepHash(const InternalPipelineSnapshot& v) { + return v.Hash(); +} + +// InternalGetOptions + +InternalGetOptions::InternalGetOptions( const Source& source, const ServerTimestampBehavior& server_timestamp_behavior) : source_(source), server_timestamp_behavior_(server_timestamp_behavior) {} -const Source& PigeonGetOptions::source() const { return source_; } +const Source& InternalGetOptions::source() const { return source_; } -void PigeonGetOptions::set_source(const Source& value_arg) { +void InternalGetOptions::set_source(const Source& value_arg) { source_ = value_arg; } -const ServerTimestampBehavior& PigeonGetOptions::server_timestamp_behavior() +const ServerTimestampBehavior& InternalGetOptions::server_timestamp_behavior() const { return server_timestamp_behavior_; } -void PigeonGetOptions::set_server_timestamp_behavior( +void InternalGetOptions::set_server_timestamp_behavior( const ServerTimestampBehavior& value_arg) { server_timestamp_behavior_ = value_arg; } -EncodableList PigeonGetOptions::ToEncodableList() const { +EncodableList InternalGetOptions::ToEncodableList() const { EncodableList list; list.reserve(2); - list.push_back(EncodableValue((int)source_)); - list.push_back(EncodableValue((int)server_timestamp_behavior_)); + list.push_back(CustomEncodableValue(source_)); + list.push_back(CustomEncodableValue(server_timestamp_behavior_)); return list; } -PigeonGetOptions PigeonGetOptions::FromEncodableList( +InternalGetOptions InternalGetOptions::FromEncodableList( const EncodableList& list) { - PigeonGetOptions decoded( - (Source)(std::get(list[0])), - (ServerTimestampBehavior)(std::get(list[1]))); + InternalGetOptions decoded( + std::any_cast(std::get(list[0])), + std::any_cast( + std::get(list[1]))); return decoded; } -// PigeonDocumentOption +bool InternalGetOptions::operator==(const InternalGetOptions& other) const { + return PigeonInternalDeepEquals(source_, other.source_) && + PigeonInternalDeepEquals(server_timestamp_behavior_, + other.server_timestamp_behavior_); +} + +bool InternalGetOptions::operator!=(const InternalGetOptions& other) const { + return !(*this == other); +} + +size_t InternalGetOptions::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(source_); + result = result * 31 + PigeonInternalDeepHash(server_timestamp_behavior_); + return result; +} + +size_t PigeonInternalDeepHash(const InternalGetOptions& v) { return v.Hash(); } + +// InternalDocumentOption -PigeonDocumentOption::PigeonDocumentOption() {} +InternalDocumentOption::InternalDocumentOption() {} -PigeonDocumentOption::PigeonDocumentOption(const bool* merge, - const EncodableList* merge_fields) +InternalDocumentOption::InternalDocumentOption( + const bool* merge, const EncodableList* merge_fields) : merge_(merge ? std::optional(*merge) : std::nullopt), merge_fields_(merge_fields ? std::optional(*merge_fields) : std::nullopt) {} -const bool* PigeonDocumentOption::merge() const { +const bool* InternalDocumentOption::merge() const { return merge_ ? &(*merge_) : nullptr; } -void PigeonDocumentOption::set_merge(const bool* value_arg) { +void InternalDocumentOption::set_merge(const bool* value_arg) { merge_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonDocumentOption::set_merge(bool value_arg) { merge_ = value_arg; } +void InternalDocumentOption::set_merge(bool value_arg) { merge_ = value_arg; } -const EncodableList* PigeonDocumentOption::merge_fields() const { +const EncodableList* InternalDocumentOption::merge_fields() const { return merge_fields_ ? &(*merge_fields_) : nullptr; } -void PigeonDocumentOption::set_merge_fields(const EncodableList* value_arg) { +void InternalDocumentOption::set_merge_fields(const EncodableList* value_arg) { merge_fields_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonDocumentOption::set_merge_fields(const EncodableList& value_arg) { +void InternalDocumentOption::set_merge_fields(const EncodableList& value_arg) { merge_fields_ = value_arg; } -EncodableList PigeonDocumentOption::ToEncodableList() const { +EncodableList InternalDocumentOption::ToEncodableList() const { EncodableList list; list.reserve(2); list.push_back(merge_ ? EncodableValue(*merge_) : EncodableValue()); @@ -478,9 +1114,9 @@ EncodableList PigeonDocumentOption::ToEncodableList() const { return list; } -PigeonDocumentOption PigeonDocumentOption::FromEncodableList( +InternalDocumentOption InternalDocumentOption::FromEncodableList( const EncodableList& list) { - PigeonDocumentOption decoded; + InternalDocumentOption decoded; auto& encodable_merge = list[0]; if (!encodable_merge.IsNull()) { decoded.set_merge(std::get(encodable_merge)); @@ -492,78 +1128,121 @@ PigeonDocumentOption PigeonDocumentOption::FromEncodableList( return decoded; } -// PigeonTransactionCommand +bool InternalDocumentOption::operator==( + const InternalDocumentOption& other) const { + return PigeonInternalDeepEquals(merge_, other.merge_) && + PigeonInternalDeepEquals(merge_fields_, other.merge_fields_); +} + +bool InternalDocumentOption::operator!=( + const InternalDocumentOption& other) const { + return !(*this == other); +} -PigeonTransactionCommand::PigeonTransactionCommand( - const PigeonTransactionType& type, const std::string& path) +size_t InternalDocumentOption::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(merge_); + result = result * 31 + PigeonInternalDeepHash(merge_fields_); + return result; +} + +size_t PigeonInternalDeepHash(const InternalDocumentOption& v) { + return v.Hash(); +} + +// InternalTransactionCommand + +InternalTransactionCommand::InternalTransactionCommand( + const InternalTransactionType& type, const std::string& path) : type_(type), path_(path) {} -PigeonTransactionCommand::PigeonTransactionCommand( - const PigeonTransactionType& type, const std::string& path, - const EncodableMap* data, const PigeonDocumentOption* option) +InternalTransactionCommand::InternalTransactionCommand( + const InternalTransactionType& type, const std::string& path, + const EncodableMap* data, const InternalDocumentOption* option) : type_(type), path_(path), data_(data ? std::optional(*data) : std::nullopt), - option_(option ? std::optional(*option) - : std::nullopt) {} - -const PigeonTransactionType& PigeonTransactionCommand::type() const { + option_(option ? std::make_unique(*option) + : nullptr) {} + +InternalTransactionCommand::InternalTransactionCommand( + const InternalTransactionCommand& other) + : type_(other.type_), + path_(other.path_), + data_(other.data_ ? std::optional(*other.data_) + : std::nullopt), + option_(other.option_ + ? std::make_unique(*other.option_) + : nullptr) {} + +InternalTransactionCommand& InternalTransactionCommand::operator=( + const InternalTransactionCommand& other) { + type_ = other.type_; + path_ = other.path_; + data_ = other.data_; + option_ = other.option_ + ? std::make_unique(*other.option_) + : nullptr; + return *this; +} + +const InternalTransactionType& InternalTransactionCommand::type() const { return type_; } -void PigeonTransactionCommand::set_type( - const PigeonTransactionType& value_arg) { +void InternalTransactionCommand::set_type( + const InternalTransactionType& value_arg) { type_ = value_arg; } -const std::string& PigeonTransactionCommand::path() const { return path_; } +const std::string& InternalTransactionCommand::path() const { return path_; } -void PigeonTransactionCommand::set_path(std::string_view value_arg) { +void InternalTransactionCommand::set_path(std::string_view value_arg) { path_ = value_arg; } -const EncodableMap* PigeonTransactionCommand::data() const { +const EncodableMap* InternalTransactionCommand::data() const { return data_ ? &(*data_) : nullptr; } -void PigeonTransactionCommand::set_data(const EncodableMap* value_arg) { +void InternalTransactionCommand::set_data(const EncodableMap* value_arg) { data_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonTransactionCommand::set_data(const EncodableMap& value_arg) { +void InternalTransactionCommand::set_data(const EncodableMap& value_arg) { data_ = value_arg; } -const PigeonDocumentOption* PigeonTransactionCommand::option() const { - return option_ ? &(*option_) : nullptr; +const InternalDocumentOption* InternalTransactionCommand::option() const { + return option_.get(); } -void PigeonTransactionCommand::set_option( - const PigeonDocumentOption* value_arg) { - option_ = value_arg ? std::optional(*value_arg) - : std::nullopt; +void InternalTransactionCommand::set_option( + const InternalDocumentOption* value_arg) { + option_ = value_arg ? std::make_unique(*value_arg) + : nullptr; } -void PigeonTransactionCommand::set_option( - const PigeonDocumentOption& value_arg) { - option_ = value_arg; +void InternalTransactionCommand::set_option( + const InternalDocumentOption& value_arg) { + option_ = std::make_unique(value_arg); } -EncodableList PigeonTransactionCommand::ToEncodableList() const { +EncodableList InternalTransactionCommand::ToEncodableList() const { EncodableList list; list.reserve(4); - list.push_back(EncodableValue((int)type_)); + list.push_back(CustomEncodableValue(type_)); list.push_back(EncodableValue(path_)); list.push_back(data_ ? EncodableValue(*data_) : EncodableValue()); - list.push_back(option_ ? EncodableValue(option_->ToEncodableList()) - : EncodableValue()); + list.push_back(option_ ? CustomEncodableValue(*option_) : EncodableValue()); return list; } -PigeonTransactionCommand PigeonTransactionCommand::FromEncodableList( +InternalTransactionCommand InternalTransactionCommand::FromEncodableList( const EncodableList& list) { - PigeonTransactionCommand decoded( - (PigeonTransactionType)(std::get(list[0])), + InternalTransactionCommand decoded( + std::any_cast( + std::get(list[0])), std::get(list[1])); auto& encodable_data = list[2]; if (!encodable_data.IsNull()) { @@ -571,12 +1250,38 @@ PigeonTransactionCommand PigeonTransactionCommand::FromEncodableList( } auto& encodable_option = list[3]; if (!encodable_option.IsNull()) { - decoded.set_option(PigeonDocumentOption::FromEncodableList( - std::get(encodable_option))); + decoded.set_option(std::any_cast( + std::get(encodable_option))); } return decoded; } +bool InternalTransactionCommand::operator==( + const InternalTransactionCommand& other) const { + return PigeonInternalDeepEquals(type_, other.type_) && + PigeonInternalDeepEquals(path_, other.path_) && + PigeonInternalDeepEquals(data_, other.data_) && + PigeonInternalDeepEquals(option_, other.option_); +} + +bool InternalTransactionCommand::operator!=( + const InternalTransactionCommand& other) const { + return !(*this == other); +} + +size_t InternalTransactionCommand::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(type_); + result = result * 31 + PigeonInternalDeepHash(path_); + result = result * 31 + PigeonInternalDeepHash(data_); + result = result * 31 + PigeonInternalDeepHash(option_); + return result; +} + +size_t PigeonInternalDeepHash(const InternalTransactionCommand& v) { + return v.Hash(); +} + // DocumentReferenceRequest DocumentReferenceRequest::DocumentReferenceRequest(const std::string& path) @@ -584,18 +1289,45 @@ DocumentReferenceRequest::DocumentReferenceRequest(const std::string& path) DocumentReferenceRequest::DocumentReferenceRequest( const std::string& path, const EncodableMap* data, - const PigeonDocumentOption* option, const Source* source, + const InternalDocumentOption* option, const Source* source, const ServerTimestampBehavior* server_timestamp_behavior) : path_(path), data_(data ? std::optional(*data) : std::nullopt), - option_(option ? std::optional(*option) - : std::nullopt), + option_(option ? std::make_unique(*option) + : nullptr), source_(source ? std::optional(*source) : std::nullopt), server_timestamp_behavior_(server_timestamp_behavior ? std::optional( *server_timestamp_behavior) : std::nullopt) {} +DocumentReferenceRequest::DocumentReferenceRequest( + const DocumentReferenceRequest& other) + : path_(other.path_), + data_(other.data_ ? std::optional(*other.data_) + : std::nullopt), + option_(other.option_ + ? std::make_unique(*other.option_) + : nullptr), + source_(other.source_ ? std::optional(*other.source_) + : std::nullopt), + server_timestamp_behavior_(other.server_timestamp_behavior_ + ? std::optional( + *other.server_timestamp_behavior_) + : std::nullopt) {} + +DocumentReferenceRequest& DocumentReferenceRequest::operator=( + const DocumentReferenceRequest& other) { + path_ = other.path_; + data_ = other.data_; + option_ = other.option_ + ? std::make_unique(*other.option_) + : nullptr; + source_ = other.source_; + server_timestamp_behavior_ = other.server_timestamp_behavior_; + return *this; +} + const std::string& DocumentReferenceRequest::path() const { return path_; } void DocumentReferenceRequest::set_path(std::string_view value_arg) { @@ -614,19 +1346,19 @@ void DocumentReferenceRequest::set_data(const EncodableMap& value_arg) { data_ = value_arg; } -const PigeonDocumentOption* DocumentReferenceRequest::option() const { - return option_ ? &(*option_) : nullptr; +const InternalDocumentOption* DocumentReferenceRequest::option() const { + return option_.get(); } void DocumentReferenceRequest::set_option( - const PigeonDocumentOption* value_arg) { - option_ = value_arg ? std::optional(*value_arg) - : std::nullopt; + const InternalDocumentOption* value_arg) { + option_ = value_arg ? std::make_unique(*value_arg) + : nullptr; } void DocumentReferenceRequest::set_option( - const PigeonDocumentOption& value_arg) { - option_ = value_arg; + const InternalDocumentOption& value_arg) { + option_ = std::make_unique(value_arg); } const Source* DocumentReferenceRequest::source() const { @@ -663,11 +1395,10 @@ EncodableList DocumentReferenceRequest::ToEncodableList() const { list.reserve(5); list.push_back(EncodableValue(path_)); list.push_back(data_ ? EncodableValue(*data_) : EncodableValue()); - list.push_back(option_ ? EncodableValue(option_->ToEncodableList()) - : EncodableValue()); - list.push_back(source_ ? EncodableValue((int)(*source_)) : EncodableValue()); + list.push_back(option_ ? CustomEncodableValue(*option_) : EncodableValue()); + list.push_back(source_ ? CustomEncodableValue(*source_) : EncodableValue()); list.push_back(server_timestamp_behavior_ - ? EncodableValue((int)(*server_timestamp_behavior_)) + ? CustomEncodableValue(*server_timestamp_behavior_) : EncodableValue()); return list; } @@ -681,27 +1412,58 @@ DocumentReferenceRequest DocumentReferenceRequest::FromEncodableList( } auto& encodable_option = list[2]; if (!encodable_option.IsNull()) { - decoded.set_option(PigeonDocumentOption::FromEncodableList( - std::get(encodable_option))); + decoded.set_option(std::any_cast( + std::get(encodable_option))); } auto& encodable_source = list[3]; if (!encodable_source.IsNull()) { - decoded.set_source((Source)(std::get(encodable_source))); + decoded.set_source(std::any_cast( + std::get(encodable_source))); } auto& encodable_server_timestamp_behavior = list[4]; if (!encodable_server_timestamp_behavior.IsNull()) { decoded.set_server_timestamp_behavior( - (ServerTimestampBehavior)(std::get( - encodable_server_timestamp_behavior))); + std::any_cast( + std::get( + encodable_server_timestamp_behavior))); } return decoded; } -// PigeonQueryParameters +bool DocumentReferenceRequest::operator==( + const DocumentReferenceRequest& other) const { + return PigeonInternalDeepEquals(path_, other.path_) && + PigeonInternalDeepEquals(data_, other.data_) && + PigeonInternalDeepEquals(option_, other.option_) && + PigeonInternalDeepEquals(source_, other.source_) && + PigeonInternalDeepEquals(server_timestamp_behavior_, + other.server_timestamp_behavior_); +} + +bool DocumentReferenceRequest::operator!=( + const DocumentReferenceRequest& other) const { + return !(*this == other); +} + +size_t DocumentReferenceRequest::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(path_); + result = result * 31 + PigeonInternalDeepHash(data_); + result = result * 31 + PigeonInternalDeepHash(option_); + result = result * 31 + PigeonInternalDeepHash(source_); + result = result * 31 + PigeonInternalDeepHash(server_timestamp_behavior_); + return result; +} + +size_t PigeonInternalDeepHash(const DocumentReferenceRequest& v) { + return v.Hash(); +} -PigeonQueryParameters::PigeonQueryParameters() {} +// InternalQueryParameters -PigeonQueryParameters::PigeonQueryParameters( +InternalQueryParameters::InternalQueryParameters() {} + +InternalQueryParameters::InternalQueryParameters( const EncodableList* where, const EncodableList* order_by, const int64_t* limit, const int64_t* limit_to_last, const EncodableList* start_at, const EncodableList* start_after, @@ -723,118 +1485,120 @@ PigeonQueryParameters::PigeonQueryParameters( filters_(filters ? std::optional(*filters) : std::nullopt) { } -const EncodableList* PigeonQueryParameters::where() const { +const EncodableList* InternalQueryParameters::where() const { return where_ ? &(*where_) : nullptr; } -void PigeonQueryParameters::set_where(const EncodableList* value_arg) { +void InternalQueryParameters::set_where(const EncodableList* value_arg) { where_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonQueryParameters::set_where(const EncodableList& value_arg) { +void InternalQueryParameters::set_where(const EncodableList& value_arg) { where_ = value_arg; } -const EncodableList* PigeonQueryParameters::order_by() const { +const EncodableList* InternalQueryParameters::order_by() const { return order_by_ ? &(*order_by_) : nullptr; } -void PigeonQueryParameters::set_order_by(const EncodableList* value_arg) { +void InternalQueryParameters::set_order_by(const EncodableList* value_arg) { order_by_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonQueryParameters::set_order_by(const EncodableList& value_arg) { +void InternalQueryParameters::set_order_by(const EncodableList& value_arg) { order_by_ = value_arg; } -const int64_t* PigeonQueryParameters::limit() const { +const int64_t* InternalQueryParameters::limit() const { return limit_ ? &(*limit_) : nullptr; } -void PigeonQueryParameters::set_limit(const int64_t* value_arg) { +void InternalQueryParameters::set_limit(const int64_t* value_arg) { limit_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonQueryParameters::set_limit(int64_t value_arg) { limit_ = value_arg; } +void InternalQueryParameters::set_limit(int64_t value_arg) { + limit_ = value_arg; +} -const int64_t* PigeonQueryParameters::limit_to_last() const { +const int64_t* InternalQueryParameters::limit_to_last() const { return limit_to_last_ ? &(*limit_to_last_) : nullptr; } -void PigeonQueryParameters::set_limit_to_last(const int64_t* value_arg) { +void InternalQueryParameters::set_limit_to_last(const int64_t* value_arg) { limit_to_last_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonQueryParameters::set_limit_to_last(int64_t value_arg) { +void InternalQueryParameters::set_limit_to_last(int64_t value_arg) { limit_to_last_ = value_arg; } -const EncodableList* PigeonQueryParameters::start_at() const { +const EncodableList* InternalQueryParameters::start_at() const { return start_at_ ? &(*start_at_) : nullptr; } -void PigeonQueryParameters::set_start_at(const EncodableList* value_arg) { +void InternalQueryParameters::set_start_at(const EncodableList* value_arg) { start_at_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonQueryParameters::set_start_at(const EncodableList& value_arg) { +void InternalQueryParameters::set_start_at(const EncodableList& value_arg) { start_at_ = value_arg; } -const EncodableList* PigeonQueryParameters::start_after() const { +const EncodableList* InternalQueryParameters::start_after() const { return start_after_ ? &(*start_after_) : nullptr; } -void PigeonQueryParameters::set_start_after(const EncodableList* value_arg) { +void InternalQueryParameters::set_start_after(const EncodableList* value_arg) { start_after_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonQueryParameters::set_start_after(const EncodableList& value_arg) { +void InternalQueryParameters::set_start_after(const EncodableList& value_arg) { start_after_ = value_arg; } -const EncodableList* PigeonQueryParameters::end_at() const { +const EncodableList* InternalQueryParameters::end_at() const { return end_at_ ? &(*end_at_) : nullptr; } -void PigeonQueryParameters::set_end_at(const EncodableList* value_arg) { +void InternalQueryParameters::set_end_at(const EncodableList* value_arg) { end_at_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonQueryParameters::set_end_at(const EncodableList& value_arg) { +void InternalQueryParameters::set_end_at(const EncodableList& value_arg) { end_at_ = value_arg; } -const EncodableList* PigeonQueryParameters::end_before() const { +const EncodableList* InternalQueryParameters::end_before() const { return end_before_ ? &(*end_before_) : nullptr; } -void PigeonQueryParameters::set_end_before(const EncodableList* value_arg) { +void InternalQueryParameters::set_end_before(const EncodableList* value_arg) { end_before_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonQueryParameters::set_end_before(const EncodableList& value_arg) { +void InternalQueryParameters::set_end_before(const EncodableList& value_arg) { end_before_ = value_arg; } -const EncodableMap* PigeonQueryParameters::filters() const { +const EncodableMap* InternalQueryParameters::filters() const { return filters_ ? &(*filters_) : nullptr; } -void PigeonQueryParameters::set_filters(const EncodableMap* value_arg) { +void InternalQueryParameters::set_filters(const EncodableMap* value_arg) { filters_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonQueryParameters::set_filters(const EncodableMap& value_arg) { +void InternalQueryParameters::set_filters(const EncodableMap& value_arg) { filters_ = value_arg; } -EncodableList PigeonQueryParameters::ToEncodableList() const { +EncodableList InternalQueryParameters::ToEncodableList() const { EncodableList list; list.reserve(9); list.push_back(where_ ? EncodableValue(*where_) : EncodableValue()); @@ -851,9 +1615,9 @@ EncodableList PigeonQueryParameters::ToEncodableList() const { return list; } -PigeonQueryParameters PigeonQueryParameters::FromEncodableList( +InternalQueryParameters InternalQueryParameters::FromEncodableList( const EncodableList& list) { - PigeonQueryParameters decoded; + InternalQueryParameters decoded; auto& encodable_where = list[0]; if (!encodable_where.IsNull()) { decoded.set_where(std::get(encodable_where)); @@ -864,11 +1628,11 @@ PigeonQueryParameters PigeonQueryParameters::FromEncodableList( } auto& encodable_limit = list[2]; if (!encodable_limit.IsNull()) { - decoded.set_limit(encodable_limit.LongValue()); + decoded.set_limit(std::get(encodable_limit)); } auto& encodable_limit_to_last = list[3]; if (!encodable_limit_to_last.IsNull()) { - decoded.set_limit_to_last(encodable_limit_to_last.LongValue()); + decoded.set_limit_to_last(std::get(encodable_limit_to_last)); } auto& encodable_start_at = list[4]; if (!encodable_start_at.IsNull()) { @@ -893,6 +1657,42 @@ PigeonQueryParameters PigeonQueryParameters::FromEncodableList( return decoded; } +bool InternalQueryParameters::operator==( + const InternalQueryParameters& other) const { + return PigeonInternalDeepEquals(where_, other.where_) && + PigeonInternalDeepEquals(order_by_, other.order_by_) && + PigeonInternalDeepEquals(limit_, other.limit_) && + PigeonInternalDeepEquals(limit_to_last_, other.limit_to_last_) && + PigeonInternalDeepEquals(start_at_, other.start_at_) && + PigeonInternalDeepEquals(start_after_, other.start_after_) && + PigeonInternalDeepEquals(end_at_, other.end_at_) && + PigeonInternalDeepEquals(end_before_, other.end_before_) && + PigeonInternalDeepEquals(filters_, other.filters_); +} + +bool InternalQueryParameters::operator!=( + const InternalQueryParameters& other) const { + return !(*this == other); +} + +size_t InternalQueryParameters::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(where_); + result = result * 31 + PigeonInternalDeepHash(order_by_); + result = result * 31 + PigeonInternalDeepHash(limit_); + result = result * 31 + PigeonInternalDeepHash(limit_to_last_); + result = result * 31 + PigeonInternalDeepHash(start_at_); + result = result * 31 + PigeonInternalDeepHash(start_after_); + result = result * 31 + PigeonInternalDeepHash(end_at_); + result = result * 31 + PigeonInternalDeepHash(end_before_); + result = result * 31 + PigeonInternalDeepHash(filters_); + return result; +} + +size_t PigeonInternalDeepHash(const InternalQueryParameters& v) { + return v.Hash(); +} + // AggregateQuery AggregateQuery::AggregateQuery(const AggregateType& type) : type_(type) {} @@ -923,13 +1723,14 @@ void AggregateQuery::set_field(std::string_view value_arg) { EncodableList AggregateQuery::ToEncodableList() const { EncodableList list; list.reserve(2); - list.push_back(EncodableValue((int)type_)); + list.push_back(CustomEncodableValue(type_)); list.push_back(field_ ? EncodableValue(*field_) : EncodableValue()); return list; } AggregateQuery AggregateQuery::FromEncodableList(const EncodableList& list) { - AggregateQuery decoded((AggregateType)(std::get(list[0]))); + AggregateQuery decoded(std::any_cast( + std::get(list[0]))); auto& encodable_field = list[1]; if (!encodable_field.IsNull()) { decoded.set_field(std::get(encodable_field)); @@ -937,6 +1738,24 @@ AggregateQuery AggregateQuery::FromEncodableList(const EncodableList& list) { return decoded; } +bool AggregateQuery::operator==(const AggregateQuery& other) const { + return PigeonInternalDeepEquals(type_, other.type_) && + PigeonInternalDeepEquals(field_, other.field_); +} + +bool AggregateQuery::operator!=(const AggregateQuery& other) const { + return !(*this == other); +} + +size_t AggregateQuery::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(type_); + result = result * 31 + PigeonInternalDeepHash(field_); + return result; +} + +size_t PigeonInternalDeepHash(const AggregateQuery& v) { return v.Hash(); } + // AggregateQueryResponse AggregateQueryResponse::AggregateQueryResponse(const AggregateType& type) @@ -980,7 +1799,7 @@ void AggregateQueryResponse::set_value(double value_arg) { value_ = value_arg; } EncodableList AggregateQueryResponse::ToEncodableList() const { EncodableList list; list.reserve(3); - list.push_back(EncodableValue((int)type_)); + list.push_back(CustomEncodableValue(type_)); list.push_back(field_ ? EncodableValue(*field_) : EncodableValue()); list.push_back(value_ ? EncodableValue(*value_) : EncodableValue()); return list; @@ -988,7 +1807,8 @@ EncodableList AggregateQueryResponse::ToEncodableList() const { AggregateQueryResponse AggregateQueryResponse::FromEncodableList( const EncodableList& list) { - AggregateQueryResponse decoded((AggregateType)(std::get(list[0]))); + AggregateQueryResponse decoded(std::any_cast( + std::get(list[0]))); auto& encodable_field = list[1]; if (!encodable_field.IsNull()) { decoded.set_field(std::get(encodable_field)); @@ -1000,189 +1820,407 @@ AggregateQueryResponse AggregateQueryResponse::FromEncodableList( return decoded; } +bool AggregateQueryResponse::operator==( + const AggregateQueryResponse& other) const { + return PigeonInternalDeepEquals(type_, other.type_) && + PigeonInternalDeepEquals(field_, other.field_) && + PigeonInternalDeepEquals(value_, other.value_); +} + +bool AggregateQueryResponse::operator!=( + const AggregateQueryResponse& other) const { + return !(*this == other); +} + +size_t AggregateQueryResponse::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(type_); + result = result * 31 + PigeonInternalDeepHash(field_); + result = result * 31 + PigeonInternalDeepHash(value_); + return result; +} + +size_t PigeonInternalDeepHash(const AggregateQueryResponse& v) { + return v.Hash(); +} + FirebaseFirestoreHostApiCodecSerializer:: FirebaseFirestoreHostApiCodecSerializer() {} EncodableValue FirebaseFirestoreHostApiCodecSerializer::ReadValueOfType( - uint8_t type, flutter::ByteStreamReader* stream) const { + uint8_t type, ::flutter::ByteStreamReader* stream) const { switch (type) { - case 128: - return CustomEncodableValue(AggregateQuery::FromEncodableList( + case 129: { + const auto& encodable_enum_arg = ReadValue(stream); + const int64_t enum_arg_value = + encodable_enum_arg.IsNull() ? 0 : encodable_enum_arg.LongValue(); + return encodable_enum_arg.IsNull() + ? EncodableValue() + : CustomEncodableValue( + static_cast(enum_arg_value)); + } + case 130: { + const auto& encodable_enum_arg = ReadValue(stream); + const int64_t enum_arg_value = + encodable_enum_arg.IsNull() ? 0 : encodable_enum_arg.LongValue(); + return encodable_enum_arg.IsNull() + ? EncodableValue() + : CustomEncodableValue(static_cast(enum_arg_value)); + } + case 131: { + const auto& encodable_enum_arg = ReadValue(stream); + const int64_t enum_arg_value = + encodable_enum_arg.IsNull() ? 0 : encodable_enum_arg.LongValue(); + return encodable_enum_arg.IsNull() + ? EncodableValue() + : CustomEncodableValue( + static_cast(enum_arg_value)); + } + case 132: { + const auto& encodable_enum_arg = ReadValue(stream); + const int64_t enum_arg_value = + encodable_enum_arg.IsNull() ? 0 : encodable_enum_arg.LongValue(); + return encodable_enum_arg.IsNull() + ? EncodableValue() + : CustomEncodableValue( + static_cast(enum_arg_value)); + } + case 133: { + const auto& encodable_enum_arg = ReadValue(stream); + const int64_t enum_arg_value = + encodable_enum_arg.IsNull() ? 0 : encodable_enum_arg.LongValue(); + return encodable_enum_arg.IsNull() + ? EncodableValue() + : CustomEncodableValue( + static_cast(enum_arg_value)); + } + case 134: { + const auto& encodable_enum_arg = ReadValue(stream); + const int64_t enum_arg_value = + encodable_enum_arg.IsNull() ? 0 : encodable_enum_arg.LongValue(); + return encodable_enum_arg.IsNull() + ? EncodableValue() + : CustomEncodableValue( + static_cast( + enum_arg_value)); + } + case 135: { + const auto& encodable_enum_arg = ReadValue(stream); + const int64_t enum_arg_value = + encodable_enum_arg.IsNull() ? 0 : encodable_enum_arg.LongValue(); + return encodable_enum_arg.IsNull() + ? EncodableValue() + : CustomEncodableValue( + static_cast(enum_arg_value)); + } + case 136: { + const auto& encodable_enum_arg = ReadValue(stream); + const int64_t enum_arg_value = + encodable_enum_arg.IsNull() ? 0 : encodable_enum_arg.LongValue(); + return encodable_enum_arg.IsNull() + ? EncodableValue() + : CustomEncodableValue( + static_cast(enum_arg_value)); + } + case 137: { + const auto& encodable_enum_arg = ReadValue(stream); + const int64_t enum_arg_value = + encodable_enum_arg.IsNull() ? 0 : encodable_enum_arg.LongValue(); + return encodable_enum_arg.IsNull() + ? EncodableValue() + : CustomEncodableValue( + static_cast(enum_arg_value)); + } + case 138: { + return CustomEncodableValue(InternalFirebaseSettings::FromEncodableList( std::get(ReadValue(stream)))); - case 129: - return CustomEncodableValue(AggregateQueryResponse::FromEncodableList( + } + case 139: { + return CustomEncodableValue(FirestorePigeonFirebaseApp::FromEncodableList( std::get(ReadValue(stream)))); - case 130: - return CustomEncodableValue(DocumentReferenceRequest::FromEncodableList( + } + case 140: { + return CustomEncodableValue(InternalSnapshotMetadata::FromEncodableList( std::get(ReadValue(stream)))); - case 131: - return CustomEncodableValue(FirestorePigeonFirebaseApp::FromEncodableList( + } + case 141: { + return CustomEncodableValue(InternalDocumentSnapshot::FromEncodableList( std::get(ReadValue(stream)))); - case 132: - return CustomEncodableValue(PigeonDocumentChange::FromEncodableList( + } + case 142: { + return CustomEncodableValue(InternalDocumentChange::FromEncodableList( std::get(ReadValue(stream)))); - case 133: - return CustomEncodableValue(PigeonDocumentOption::FromEncodableList( + } + case 143: { + return CustomEncodableValue(InternalQuerySnapshot::FromEncodableList( std::get(ReadValue(stream)))); - case 134: - return CustomEncodableValue(PigeonDocumentSnapshot::FromEncodableList( + } + case 144: { + return CustomEncodableValue(InternalPipelineResult::FromEncodableList( std::get(ReadValue(stream)))); - case 135: - return CustomEncodableValue(PigeonFirebaseSettings::FromEncodableList( + } + case 145: { + return CustomEncodableValue(InternalPipelineSnapshot::FromEncodableList( std::get(ReadValue(stream)))); - case 136: - return CustomEncodableValue(PigeonGetOptions::FromEncodableList( + } + case 146: { + return CustomEncodableValue(InternalGetOptions::FromEncodableList( std::get(ReadValue(stream)))); - case 137: - return CustomEncodableValue(PigeonQueryParameters::FromEncodableList( + } + case 147: { + return CustomEncodableValue(InternalDocumentOption::FromEncodableList( std::get(ReadValue(stream)))); - case 138: - return CustomEncodableValue(PigeonQuerySnapshot::FromEncodableList( + } + case 148: { + return CustomEncodableValue(InternalTransactionCommand::FromEncodableList( std::get(ReadValue(stream)))); - case 139: - return CustomEncodableValue(PigeonSnapshotMetadata::FromEncodableList( + } + case 149: { + return CustomEncodableValue(DocumentReferenceRequest::FromEncodableList( std::get(ReadValue(stream)))); - case 140: - return CustomEncodableValue(PigeonTransactionCommand::FromEncodableList( + } + case 150: { + return CustomEncodableValue(InternalQueryParameters::FromEncodableList( + std::get(ReadValue(stream)))); + } + case 151: { + return CustomEncodableValue(AggregateQuery::FromEncodableList( + std::get(ReadValue(stream)))); + } + case 152: { + return CustomEncodableValue(AggregateQueryResponse::FromEncodableList( std::get(ReadValue(stream)))); + } default: - return cloud_firestore_windows::FirestoreCodec::ReadValueOfType(type, - stream); + return ::cloud_firestore_windows::FirestoreCodec::ReadValueOfType(type, + stream); } } void FirebaseFirestoreHostApiCodecSerializer::WriteValue( - const EncodableValue& value, flutter::ByteStreamWriter* stream) const { + const EncodableValue& value, ::flutter::ByteStreamWriter* stream) const { if (const CustomEncodableValue* custom_value = std::get_if(&value)) { - if (custom_value->type() == typeid(AggregateQuery)) { - stream->WriteByte(128); - WriteValue( - EncodableValue( - std::any_cast(*custom_value).ToEncodableList()), - stream); - return; - } - if (custom_value->type() == typeid(AggregateQueryResponse)) { + if (custom_value->type() == typeid(DocumentChangeType)) { stream->WriteByte(129); - WriteValue( - EncodableValue(std::any_cast(*custom_value) - .ToEncodableList()), - stream); + WriteValue(EncodableValue(static_cast( + std::any_cast(*custom_value))), + stream); return; } - if (custom_value->type() == typeid(DocumentReferenceRequest)) { + if (custom_value->type() == typeid(Source)) { stream->WriteByte(130); + WriteValue(EncodableValue( + static_cast(std::any_cast(*custom_value))), + stream); + return; + } + if (custom_value->type() == typeid(ListenSource)) { + stream->WriteByte(131); + WriteValue(EncodableValue(static_cast( + std::any_cast(*custom_value))), + stream); + return; + } + if (custom_value->type() == typeid(ServerTimestampBehavior)) { + stream->WriteByte(132); + WriteValue(EncodableValue(static_cast( + std::any_cast(*custom_value))), + stream); + return; + } + if (custom_value->type() == typeid(AggregateSource)) { + stream->WriteByte(133); + WriteValue(EncodableValue(static_cast( + std::any_cast(*custom_value))), + stream); + return; + } + if (custom_value->type() == + typeid(PersistenceCacheIndexManagerRequestEnum)) { + stream->WriteByte(134); + WriteValue(EncodableValue(static_cast( + std::any_cast( + *custom_value))), + stream); + return; + } + if (custom_value->type() == typeid(InternalTransactionResult)) { + stream->WriteByte(135); + WriteValue(EncodableValue(static_cast( + std::any_cast(*custom_value))), + stream); + return; + } + if (custom_value->type() == typeid(InternalTransactionType)) { + stream->WriteByte(136); + WriteValue(EncodableValue(static_cast( + std::any_cast(*custom_value))), + stream); + return; + } + if (custom_value->type() == typeid(AggregateType)) { + stream->WriteByte(137); + WriteValue(EncodableValue(static_cast( + std::any_cast(*custom_value))), + stream); + return; + } + if (custom_value->type() == typeid(InternalFirebaseSettings)) { + stream->WriteByte(138); WriteValue( - EncodableValue(std::any_cast(*custom_value) + EncodableValue(std::any_cast(*custom_value) .ToEncodableList()), stream); return; } if (custom_value->type() == typeid(FirestorePigeonFirebaseApp)) { - stream->WriteByte(131); + stream->WriteByte(139); WriteValue(EncodableValue( std::any_cast(*custom_value) .ToEncodableList()), stream); return; } - if (custom_value->type() == typeid(PigeonDocumentChange)) { - stream->WriteByte(132); + if (custom_value->type() == typeid(InternalSnapshotMetadata)) { + stream->WriteByte(140); WriteValue( - EncodableValue(std::any_cast(*custom_value) + EncodableValue(std::any_cast(*custom_value) .ToEncodableList()), stream); return; } - if (custom_value->type() == typeid(PigeonDocumentOption)) { - stream->WriteByte(133); + if (custom_value->type() == typeid(InternalDocumentSnapshot)) { + stream->WriteByte(141); WriteValue( - EncodableValue(std::any_cast(*custom_value) + EncodableValue(std::any_cast(*custom_value) .ToEncodableList()), stream); return; } - if (custom_value->type() == typeid(PigeonDocumentSnapshot)) { - stream->WriteByte(134); + if (custom_value->type() == typeid(InternalDocumentChange)) { + stream->WriteByte(142); WriteValue( - EncodableValue(std::any_cast(*custom_value) + EncodableValue(std::any_cast(*custom_value) .ToEncodableList()), stream); return; } - if (custom_value->type() == typeid(PigeonFirebaseSettings)) { - stream->WriteByte(135); + if (custom_value->type() == typeid(InternalQuerySnapshot)) { + stream->WriteByte(143); WriteValue( - EncodableValue(std::any_cast(*custom_value) + EncodableValue(std::any_cast(*custom_value) .ToEncodableList()), stream); return; } - if (custom_value->type() == typeid(PigeonGetOptions)) { - stream->WriteByte(136); + if (custom_value->type() == typeid(InternalPipelineResult)) { + stream->WriteByte(144); WriteValue( - EncodableValue( - std::any_cast(*custom_value).ToEncodableList()), + EncodableValue(std::any_cast(*custom_value) + .ToEncodableList()), stream); return; } - if (custom_value->type() == typeid(PigeonQueryParameters)) { - stream->WriteByte(137); + if (custom_value->type() == typeid(InternalPipelineSnapshot)) { + stream->WriteByte(145); WriteValue( - EncodableValue(std::any_cast(*custom_value) + EncodableValue(std::any_cast(*custom_value) .ToEncodableList()), stream); return; } - if (custom_value->type() == typeid(PigeonQuerySnapshot)) { - stream->WriteByte(138); + if (custom_value->type() == typeid(InternalGetOptions)) { + stream->WriteByte(146); + WriteValue(EncodableValue(std::any_cast(*custom_value) + .ToEncodableList()), + stream); + return; + } + if (custom_value->type() == typeid(InternalDocumentOption)) { + stream->WriteByte(147); WriteValue( - EncodableValue(std::any_cast(*custom_value) + EncodableValue(std::any_cast(*custom_value) .ToEncodableList()), stream); return; } - if (custom_value->type() == typeid(PigeonSnapshotMetadata)) { - stream->WriteByte(139); + if (custom_value->type() == typeid(InternalTransactionCommand)) { + stream->WriteByte(148); + WriteValue(EncodableValue( + std::any_cast(*custom_value) + .ToEncodableList()), + stream); + return; + } + if (custom_value->type() == typeid(DocumentReferenceRequest)) { + stream->WriteByte(149); WriteValue( - EncodableValue(std::any_cast(*custom_value) + EncodableValue(std::any_cast(*custom_value) .ToEncodableList()), stream); return; } - if (custom_value->type() == typeid(PigeonTransactionCommand)) { - stream->WriteByte(140); + if (custom_value->type() == typeid(InternalQueryParameters)) { + stream->WriteByte(150); + WriteValue( + EncodableValue(std::any_cast(*custom_value) + .ToEncodableList()), + stream); + return; + } + if (custom_value->type() == typeid(AggregateQuery)) { + stream->WriteByte(151); + WriteValue( + EncodableValue( + std::any_cast(*custom_value).ToEncodableList()), + stream); + return; + } + if (custom_value->type() == typeid(AggregateQueryResponse)) { + stream->WriteByte(152); WriteValue( - EncodableValue(std::any_cast(*custom_value) + EncodableValue(std::any_cast(*custom_value) .ToEncodableList()), stream); return; } } - cloud_firestore_windows::FirestoreCodec::WriteValue(value, stream); + ::cloud_firestore_windows::FirestoreCodec::WriteValue(value, stream); } /// The codec used by FirebaseFirestoreHostApi. -const flutter::StandardMessageCodec& FirebaseFirestoreHostApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance( +const ::flutter::StandardMessageCodec& FirebaseFirestoreHostApi::GetCodec() { + return ::flutter::StandardMessageCodec::GetInstance( &FirebaseFirestoreHostApiCodecSerializer::GetInstance()); } // Sets up an instance of `FirebaseFirestoreHostApi` to handle messages through // the `binary_messenger`. -void FirebaseFirestoreHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, - FirebaseFirestoreHostApi* api) { +void FirebaseFirestoreHostApi::SetUp( + ::flutter::BinaryMessenger* binary_messenger, + FirebaseFirestoreHostApi* api) { + FirebaseFirestoreHostApi::SetUp(binary_messenger, api, ""); +} + +void FirebaseFirestoreHostApi::SetUp( + ::flutter::BinaryMessenger* binary_messenger, FirebaseFirestoreHostApi* api, + const std::string& message_channel_suffix) { + const std::string prepended_suffix = + message_channel_suffix.length() > 0 + ? std::string(".") + message_channel_suffix + : ""; { - auto channel = std::make_unique>( + BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.cloud_firestore_platform_interface." - "FirebaseFirestoreHostApi.loadBundle", + "FirebaseFirestoreHostApi.loadBundle" + + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( + channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -1216,19 +2254,20 @@ void FirebaseFirestoreHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, } }); } else { - channel->SetMessageHandler(nullptr); + channel.SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( + BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.cloud_firestore_platform_interface." - "FirebaseFirestoreHostApi.namedQueryGet", + "FirebaseFirestoreHostApi.namedQueryGet" + + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( + channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -1250,11 +2289,12 @@ void FirebaseFirestoreHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, reply(WrapError("options_arg unexpectedly null.")); return; } - const auto& options_arg = std::any_cast( - std::get(encodable_options_arg)); + const auto& options_arg = + std::any_cast( + std::get(encodable_options_arg)); api->NamedQueryGet( app_arg, name_arg, options_arg, - [reply](ErrorOr&& output) { + [reply](ErrorOr&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; @@ -1269,19 +2309,20 @@ void FirebaseFirestoreHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, } }); } else { - channel->SetMessageHandler(nullptr); + channel.SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( + BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.cloud_firestore_platform_interface." - "FirebaseFirestoreHostApi.clearPersistence", + "FirebaseFirestoreHostApi.clearPersistence" + + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( + channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -1307,19 +2348,20 @@ void FirebaseFirestoreHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, } }); } else { - channel->SetMessageHandler(nullptr); + channel.SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( + BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.cloud_firestore_platform_interface." - "FirebaseFirestoreHostApi.disableNetwork", + "FirebaseFirestoreHostApi.disableNetwork" + + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( + channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -1345,19 +2387,20 @@ void FirebaseFirestoreHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, } }); } else { - channel->SetMessageHandler(nullptr); + channel.SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( + BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.cloud_firestore_platform_interface." - "FirebaseFirestoreHostApi.enableNetwork", + "FirebaseFirestoreHostApi.enableNetwork" + + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( + channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -1383,19 +2426,20 @@ void FirebaseFirestoreHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, } }); } else { - channel->SetMessageHandler(nullptr); + channel.SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( + BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.cloud_firestore_platform_interface." - "FirebaseFirestoreHostApi.terminate", + "FirebaseFirestoreHostApi.terminate" + + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( + channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -1421,19 +2465,20 @@ void FirebaseFirestoreHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, } }); } else { - channel->SetMessageHandler(nullptr); + channel.SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( + BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.cloud_firestore_platform_interface." - "FirebaseFirestoreHostApi.waitForPendingWrites", + "FirebaseFirestoreHostApi.waitForPendingWrites" + + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( + channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -1459,19 +2504,20 @@ void FirebaseFirestoreHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, } }); } else { - channel->SetMessageHandler(nullptr); + channel.SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( + BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.cloud_firestore_platform_interface." - "FirebaseFirestoreHostApi.setIndexConfiguration", + "FirebaseFirestoreHostApi.setIndexConfiguration" + + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( + channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -1505,19 +2551,20 @@ void FirebaseFirestoreHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, } }); } else { - channel->SetMessageHandler(nullptr); + channel.SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( + BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.cloud_firestore_platform_interface." - "FirebaseFirestoreHostApi.setLoggingEnabled", + "FirebaseFirestoreHostApi.setLoggingEnabled" + + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( + channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_logging_enabled_arg = args.at(0); @@ -1543,19 +2590,20 @@ void FirebaseFirestoreHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, } }); } else { - channel->SetMessageHandler(nullptr); + channel.SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( + BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.cloud_firestore_platform_interface." - "FirebaseFirestoreHostApi.snapshotsInSyncSetup", + "FirebaseFirestoreHostApi.snapshotsInSyncSetup" + + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( + channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -1582,19 +2630,20 @@ void FirebaseFirestoreHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, } }); } else { - channel->SetMessageHandler(nullptr); + channel.SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( + BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.cloud_firestore_platform_interface." - "FirebaseFirestoreHostApi.transactionCreate", + "FirebaseFirestoreHostApi.transactionCreate" + + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( + channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -1635,19 +2684,20 @@ void FirebaseFirestoreHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, } }); } else { - channel->SetMessageHandler(nullptr); + channel.SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( + BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.cloud_firestore_platform_interface." - "FirebaseFirestoreHostApi.transactionStoreResult", + "FirebaseFirestoreHostApi.transactionStoreResult" + + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( + channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_transaction_id_arg = args.at(0); @@ -1662,9 +2712,10 @@ void FirebaseFirestoreHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, reply(WrapError("result_type_arg unexpectedly null.")); return; } - const PigeonTransactionResult& result_type_arg = - (PigeonTransactionResult) - encodable_result_type_arg.LongValue(); + const auto& result_type_arg = + std::any_cast( + std::get( + encodable_result_type_arg)); const auto& encodable_commands_arg = args.at(2); const auto* commands_arg = std::get_if(&encodable_commands_arg); @@ -1684,19 +2735,20 @@ void FirebaseFirestoreHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, } }); } else { - channel->SetMessageHandler(nullptr); + channel.SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( + BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.cloud_firestore_platform_interface." - "FirebaseFirestoreHostApi.transactionGet", + "FirebaseFirestoreHostApi.transactionGet" + + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( + channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -1722,7 +2774,7 @@ void FirebaseFirestoreHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, const auto& path_arg = std::get(encodable_path_arg); api->TransactionGet( app_arg, transaction_id_arg, path_arg, - [reply](ErrorOr&& output) { + [reply](ErrorOr&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; @@ -1737,19 +2789,20 @@ void FirebaseFirestoreHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, } }); } else { - channel->SetMessageHandler(nullptr); + channel.SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( + BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.cloud_firestore_platform_interface." - "FirebaseFirestoreHostApi.documentReferenceSet", + "FirebaseFirestoreHostApi.documentReferenceSet" + + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( + channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -1784,19 +2837,20 @@ void FirebaseFirestoreHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, } }); } else { - channel->SetMessageHandler(nullptr); + channel.SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( + BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.cloud_firestore_platform_interface." - "FirebaseFirestoreHostApi.documentReferenceUpdate", + "FirebaseFirestoreHostApi.documentReferenceUpdate" + + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( + channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -1831,19 +2885,20 @@ void FirebaseFirestoreHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, } }); } else { - channel->SetMessageHandler(nullptr); + channel.SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( + BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.cloud_firestore_platform_interface." - "FirebaseFirestoreHostApi.documentReferenceGet", + "FirebaseFirestoreHostApi.documentReferenceGet" + + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( + channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -1864,7 +2919,7 @@ void FirebaseFirestoreHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, std::get(encodable_request_arg)); api->DocumentReferenceGet( app_arg, request_arg, - [reply](ErrorOr&& output) { + [reply](ErrorOr&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; @@ -1879,19 +2934,20 @@ void FirebaseFirestoreHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, } }); } else { - channel->SetMessageHandler(nullptr); + channel.SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( + BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.cloud_firestore_platform_interface." - "FirebaseFirestoreHostApi.documentReferenceDelete", + "FirebaseFirestoreHostApi.documentReferenceDelete" + + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( + channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -1926,19 +2982,20 @@ void FirebaseFirestoreHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, } }); } else { - channel->SetMessageHandler(nullptr); + channel.SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( + BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.cloud_firestore_platform_interface." - "FirebaseFirestoreHostApi.queryGet", + "FirebaseFirestoreHostApi.queryGet" + + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( + channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -1968,45 +3025,47 @@ void FirebaseFirestoreHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, return; } const auto& parameters_arg = - std::any_cast( + std::any_cast( std::get(encodable_parameters_arg)); const auto& encodable_options_arg = args.at(4); if (encodable_options_arg.IsNull()) { reply(WrapError("options_arg unexpectedly null.")); return; } - const auto& options_arg = std::any_cast( - std::get(encodable_options_arg)); - api->QueryGet( - app_arg, path_arg, is_collection_group_arg, parameters_arg, - options_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - CustomEncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - }); + const auto& options_arg = + std::any_cast( + std::get(encodable_options_arg)); + api->QueryGet(app_arg, path_arg, is_collection_group_arg, + parameters_arg, options_arg, + [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(CustomEncodableValue( + std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); } catch (const std::exception& exception) { reply(WrapError(exception.what())); } }); } else { - channel->SetMessageHandler(nullptr); + channel.SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( + BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.cloud_firestore_platform_interface." - "FirebaseFirestoreHostApi.aggregateQuery", + "FirebaseFirestoreHostApi.aggregateQuery" + + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( + channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -2029,15 +3088,15 @@ void FirebaseFirestoreHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, return; } const auto& parameters_arg = - std::any_cast( + std::any_cast( std::get(encodable_parameters_arg)); const auto& encodable_source_arg = args.at(3); if (encodable_source_arg.IsNull()) { reply(WrapError("source_arg unexpectedly null.")); return; } - const AggregateSource& source_arg = - (AggregateSource)encodable_source_arg.LongValue(); + const auto& source_arg = std::any_cast( + std::get(encodable_source_arg)); const auto& encodable_queries_arg = args.at(4); if (encodable_queries_arg.IsNull()) { reply(WrapError("queries_arg unexpectedly null.")); @@ -2069,19 +3128,20 @@ void FirebaseFirestoreHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, } }); } else { - channel->SetMessageHandler(nullptr); + channel.SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( + BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.cloud_firestore_platform_interface." - "FirebaseFirestoreHostApi.writeBatchCommit", + "FirebaseFirestoreHostApi.writeBatchCommit" + + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( + channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -2115,19 +3175,20 @@ void FirebaseFirestoreHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, } }); } else { - channel->SetMessageHandler(nullptr); + channel.SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( + BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.cloud_firestore_platform_interface." - "FirebaseFirestoreHostApi.querySnapshot", + "FirebaseFirestoreHostApi.querySnapshot" + + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( + channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -2157,15 +3218,16 @@ void FirebaseFirestoreHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, return; } const auto& parameters_arg = - std::any_cast( + std::any_cast( std::get(encodable_parameters_arg)); const auto& encodable_options_arg = args.at(4); if (encodable_options_arg.IsNull()) { reply(WrapError("options_arg unexpectedly null.")); return; } - const auto& options_arg = std::any_cast( - std::get(encodable_options_arg)); + const auto& options_arg = + std::any_cast( + std::get(encodable_options_arg)); const auto& encodable_include_metadata_changes_arg = args.at(5); if (encodable_include_metadata_changes_arg.IsNull()) { reply(WrapError( @@ -2179,8 +3241,8 @@ void FirebaseFirestoreHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, reply(WrapError("source_arg unexpectedly null.")); return; } - const ListenSource& source_arg = - (ListenSource)encodable_source_arg.LongValue(); + const auto& source_arg = std::any_cast( + std::get(encodable_source_arg)); api->QuerySnapshot( app_arg, path_arg, is_collection_group_arg, parameters_arg, options_arg, include_metadata_changes_arg, source_arg, @@ -2199,19 +3261,20 @@ void FirebaseFirestoreHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, } }); } else { - channel->SetMessageHandler(nullptr); + channel.SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( + BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.cloud_firestore_platform_interface." - "FirebaseFirestoreHostApi.documentReferenceSnapshot", + "FirebaseFirestoreHostApi.documentReferenceSnapshot" + + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( + channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -2243,8 +3306,8 @@ void FirebaseFirestoreHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, reply(WrapError("source_arg unexpectedly null.")); return; } - const ListenSource& source_arg = - (ListenSource)encodable_source_arg.LongValue(); + const auto& source_arg = std::any_cast( + std::get(encodable_source_arg)); api->DocumentReferenceSnapshot( app_arg, parameters_arg, include_metadata_changes_arg, source_arg, [reply](ErrorOr&& output) { @@ -2262,19 +3325,20 @@ void FirebaseFirestoreHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, } }); } else { - channel->SetMessageHandler(nullptr); + channel.SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( + BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.cloud_firestore_platform_interface." - "FirebaseFirestoreHostApi.persistenceCacheIndexManagerRequest", + "FirebaseFirestoreHostApi.persistenceCacheIndexManagerRequest" + + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( + channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -2290,9 +3354,9 @@ void FirebaseFirestoreHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, reply(WrapError("request_arg unexpectedly null.")); return; } - const PersistenceCacheIndexManagerRequestEnum& request_arg = - (PersistenceCacheIndexManagerRequestEnum) - encodable_request_arg.LongValue(); + const auto& request_arg = + std::any_cast( + std::get(encodable_request_arg)); api->PersistenceCacheIndexManagerRequest( app_arg, request_arg, [reply](std::optional&& output) { @@ -2309,7 +3373,58 @@ void FirebaseFirestoreHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, } }); } else { - channel->SetMessageHandler(nullptr); + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.cloud_firestore_platform_interface." + "FirebaseFirestoreHostApi.executePipeline" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const ::flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_app_arg = args.at(0); + if (encodable_app_arg.IsNull()) { + reply(WrapError("app_arg unexpectedly null.")); + return; + } + const auto& app_arg = + std::any_cast( + std::get(encodable_app_arg)); + const auto& encodable_stages_arg = args.at(1); + if (encodable_stages_arg.IsNull()) { + reply(WrapError("stages_arg unexpectedly null.")); + return; + } + const auto& stages_arg = + std::get(encodable_stages_arg); + const auto& encodable_options_arg = args.at(2); + const auto* options_arg = + std::get_if(&encodable_options_arg); + api->ExecutePipeline( + app_arg, stages_arg, options_arg, + [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + CustomEncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); } } } diff --git a/packages/cloud_firestore/cloud_firestore/windows/messages.g.h b/packages/cloud_firestore/cloud_firestore/windows/messages.g.h index 8aecb887facc..fcc6a5e80a11 100644 --- a/packages/cloud_firestore/cloud_firestore/windows/messages.g.h +++ b/packages/cloud_firestore/cloud_firestore/windows/messages.g.h @@ -1,7 +1,7 @@ // Copyright 2023, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v11.0.1), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), do not edit directly. // See also: https://pub.dev/packages/pigeon #ifndef PIGEON_MESSAGES_G_H_ @@ -27,17 +27,17 @@ class FlutterError { explicit FlutterError(const std::string& code, const std::string& message) : code_(code), message_(message) {} explicit FlutterError(const std::string& code, const std::string& message, - const flutter::EncodableValue& details) + const ::flutter::EncodableValue& details) : code_(code), message_(message), details_(details) {} const std::string& code() const { return code_; } const std::string& message() const { return message_; } - const flutter::EncodableValue& details() const { return details_; } + const ::flutter::EncodableValue& details() const { return details_; } private: std::string code_; std::string message_; - flutter::EncodableValue details_; + ::flutter::EncodableValue details_; }; template @@ -64,12 +64,12 @@ class ErrorOr { enum class DocumentChangeType { // Indicates a new document was added to the set of documents matching the // query. - added = 0, + kAdded = 0, // Indicates a document within the query was modified. - modified = 1, + kModified = 1, // Indicates a document within the query was removed (either deleted or no // longer matches the query. - removed = 2 + kRemoved = 2 }; // An enumeration of firestore source types. @@ -77,7 +77,7 @@ enum class Source { // Causes Firestore to try to retrieve an up-to-date (server-retrieved) // snapshot, but fall back to // returning cached data if the server can't be reached. - serverAndCache = 0, + kServerAndCache = 0, // Causes Firestore to avoid the cache, generating an error if the server // cannot be reached. Note // that the cache will still be updated if the server request succeeds. Also @@ -85,7 +85,7 @@ enum class Source { // latency-compensation still takes effect, so any pending write operations // will be visible in the // returned data (merged into the server-provided data). - server = 1, + kServer = 1, // Causes Firestore to immediately return a value from the cache, ignoring the // server completely // (implying that the returned value may be stale with respect to the value on @@ -93,7 +93,7 @@ enum class Source { // there is no data in the cache to satisfy the `get` call, // [DocumentReference.get] will throw a [FirebaseException] and // [Query.get] will return an empty [QuerySnapshotPlatform] with no documents. - cache = 2 + kCache = 2 }; // The listener retrieves data and listens to updates from the local Firestore @@ -108,63 +108,63 @@ enum class ListenSource { // cache and retrieve up-to-date snapshots from the Firestore server. // Snapshot events will be triggered on local mutations and server side // updates. - defaultSource = 0, + kDefaultSource = 0, // The listener retrieves data and listens to updates from the local Firestore // cache only. // If the cache is empty, an empty snapshot will be returned. // Snapshot events will be triggered on cache updates, like local mutations or // load bundles. - cache = 1 + kCache = 1 }; enum class ServerTimestampBehavior { // Return null for [FieldValue.serverTimestamp()] values that have not yet - none = 0, + kNone = 0, // Return local estimates for [FieldValue.serverTimestamp()] values that have // not yet been set to their final value. - estimate = 1, + kEstimate = 1, // Return the previous value for [FieldValue.serverTimestamp()] values that // have not yet been set to their final value. - previous = 2 + kPrevious = 2 }; // [AggregateSource] represents the source of data for an [AggregateQuery]. enum class AggregateSource { // Indicates that the data should be retrieved from the server. - server = 0 + kServer = 0 }; -// [PersistenceCacheIndexManagerRequest] represents the request types for the -// persistence cache index manager. +// [PersistenceCacheIndexManagerRequestEnum] represents the request types for +// the persistence cache index manager. enum class PersistenceCacheIndexManagerRequestEnum { - enableIndexAutoCreation = 0, - disableIndexAutoCreation = 1, - deleteAllIndexes = 2 + kEnableIndexAutoCreation = 0, + kDisableIndexAutoCreation = 1, + kDeleteAllIndexes = 2 }; -enum class PigeonTransactionResult { success = 0, failure = 1 }; +enum class InternalTransactionResult { kSuccess = 0, kFailure = 1 }; -enum class PigeonTransactionType { - get = 0, - update = 1, - set = 2, - deleteType = 3 +enum class InternalTransactionType { + kGet = 0, + kUpdate = 1, + kSet = 2, + kDeleteType = 3 }; -enum class AggregateType { count = 0, sum = 1, average = 2 }; +enum class AggregateType { kCount = 0, kSum = 1, kAverage = 2 }; // Generated class from Pigeon that represents data sent in messages. -class PigeonFirebaseSettings { +class InternalFirebaseSettings { public: // Constructs an object setting all non-nullable fields. - explicit PigeonFirebaseSettings(bool ignore_undefined_properties); + explicit InternalFirebaseSettings(bool ignore_undefined_properties); // Constructs an object setting all fields. - explicit PigeonFirebaseSettings(const bool* persistence_enabled, - const std::string* host, - const bool* ssl_enabled, - const int64_t* cache_size_bytes, - bool ignore_undefined_properties); + explicit InternalFirebaseSettings(const bool* persistence_enabled, + const std::string* host, + const bool* ssl_enabled, + const int64_t* cache_size_bytes, + bool ignore_undefined_properties); const bool* persistence_enabled() const; void set_persistence_enabled(const bool* value_arg); @@ -185,10 +185,22 @@ class PigeonFirebaseSettings { bool ignore_undefined_properties() const; void set_ignore_undefined_properties(bool value_arg); + bool operator==(const InternalFirebaseSettings& other) const; + bool operator!=(const InternalFirebaseSettings& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + + private: + static InternalFirebaseSettings FromEncodableList( + const ::flutter::EncodableList& list); + + public: + public: + ::flutter::EncodableList ToEncodableList() const; + + private: private: - static PigeonFirebaseSettings FromEncodableList( - const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; friend class FirestorePigeonFirebaseApp; friend class FirebaseFirestoreHostApi; friend class FirebaseFirestoreHostApiCodecSerializer; @@ -204,34 +216,54 @@ class FirestorePigeonFirebaseApp { public: // Constructs an object setting all fields. explicit FirestorePigeonFirebaseApp(const std::string& app_name, - const PigeonFirebaseSettings& settings, + const InternalFirebaseSettings& settings, const std::string& database_u_r_l); + ~FirestorePigeonFirebaseApp() = default; + FirestorePigeonFirebaseApp(const FirestorePigeonFirebaseApp& other); + FirestorePigeonFirebaseApp& operator=( + const FirestorePigeonFirebaseApp& other); + FirestorePigeonFirebaseApp(FirestorePigeonFirebaseApp&& other) = default; + FirestorePigeonFirebaseApp& operator=( + FirestorePigeonFirebaseApp&& other) noexcept = default; const std::string& app_name() const; void set_app_name(std::string_view value_arg); - const PigeonFirebaseSettings& settings() const; - void set_settings(const PigeonFirebaseSettings& value_arg); + const InternalFirebaseSettings& settings() const; + void set_settings(const InternalFirebaseSettings& value_arg); const std::string& database_u_r_l() const; void set_database_u_r_l(std::string_view value_arg); + bool operator==(const FirestorePigeonFirebaseApp& other) const; + bool operator!=(const FirestorePigeonFirebaseApp& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + private: static FirestorePigeonFirebaseApp FromEncodableList( - const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; + const ::flutter::EncodableList& list); + + public: + public: + ::flutter::EncodableList ToEncodableList() const; + + private: + private: friend class FirebaseFirestoreHostApi; friend class FirebaseFirestoreHostApiCodecSerializer; std::string app_name_; - PigeonFirebaseSettings settings_; + std::unique_ptr settings_; std::string database_u_r_l_; }; // Generated class from Pigeon that represents data sent in messages. -class PigeonSnapshotMetadata { +class InternalSnapshotMetadata { public: // Constructs an object setting all fields. - explicit PigeonSnapshotMetadata(bool has_pending_writes, bool is_from_cache); + explicit InternalSnapshotMetadata(bool has_pending_writes, + bool is_from_cache); bool has_pending_writes() const; void set_has_pending_writes(bool value_arg); @@ -239,13 +271,24 @@ class PigeonSnapshotMetadata { bool is_from_cache() const; void set_is_from_cache(bool value_arg); - static PigeonSnapshotMetadata FromEncodableList( - const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; + bool operator==(const InternalSnapshotMetadata& other) const; + bool operator!=(const InternalSnapshotMetadata& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + static InternalSnapshotMetadata FromEncodableList( + const ::flutter::EncodableList& list); + + public: + public: + ::flutter::EncodableList ToEncodableList() const; + + private: + private: private: - friend class PigeonDocumentSnapshot; - friend class PigeonQuerySnapshot; + friend class InternalDocumentSnapshot; + friend class InternalQuerySnapshot; friend class FirebaseFirestoreHostApi; friend class FirebaseFirestoreHostApiCodecSerializer; bool has_pending_writes_; @@ -253,53 +296,76 @@ class PigeonSnapshotMetadata { }; // Generated class from Pigeon that represents data sent in messages. -class PigeonDocumentSnapshot { +class InternalDocumentSnapshot { public: // Constructs an object setting all non-nullable fields. - explicit PigeonDocumentSnapshot(const std::string& path, - const PigeonSnapshotMetadata& metadata); + explicit InternalDocumentSnapshot(const std::string& path, + const InternalSnapshotMetadata& metadata); // Constructs an object setting all fields. - explicit PigeonDocumentSnapshot(const std::string& path, - const flutter::EncodableMap* data, - const PigeonSnapshotMetadata& metadata); - + explicit InternalDocumentSnapshot(const std::string& path, + const ::flutter::EncodableMap* data, + const InternalSnapshotMetadata& metadata); + + ~InternalDocumentSnapshot() = default; + InternalDocumentSnapshot(const InternalDocumentSnapshot& other); + InternalDocumentSnapshot& operator=(const InternalDocumentSnapshot& other); + InternalDocumentSnapshot(InternalDocumentSnapshot&& other) = default; + InternalDocumentSnapshot& operator=( + InternalDocumentSnapshot&& other) noexcept = default; const std::string& path() const; void set_path(std::string_view value_arg); - const flutter::EncodableMap* data() const; - void set_data(const flutter::EncodableMap* value_arg); - void set_data(const flutter::EncodableMap& value_arg); + const ::flutter::EncodableMap* data() const; + void set_data(const ::flutter::EncodableMap* value_arg); + void set_data(const ::flutter::EncodableMap& value_arg); + + const InternalSnapshotMetadata& metadata() const; + void set_metadata(const InternalSnapshotMetadata& value_arg); - const PigeonSnapshotMetadata& metadata() const; - void set_metadata(const PigeonSnapshotMetadata& value_arg); + bool operator==(const InternalDocumentSnapshot& other) const; + bool operator!=(const InternalDocumentSnapshot& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; - static PigeonDocumentSnapshot FromEncodableList( - const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; + static InternalDocumentSnapshot FromEncodableList( + const ::flutter::EncodableList& list); + public: + public: + ::flutter::EncodableList ToEncodableList() const; + + private: private: - friend class PigeonDocumentChange; + private: + friend class InternalDocumentChange; friend class FirebaseFirestoreHostApi; friend class FirebaseFirestoreHostApiCodecSerializer; std::string path_; - std::optional data_; - PigeonSnapshotMetadata metadata_; + std::optional<::flutter::EncodableMap> data_; + std::unique_ptr metadata_; }; // Generated class from Pigeon that represents data sent in messages. -class PigeonDocumentChange { +class InternalDocumentChange { public: // Constructs an object setting all fields. - explicit PigeonDocumentChange(const DocumentChangeType& type, - const PigeonDocumentSnapshot& document, - int64_t old_index, int64_t new_index); - + explicit InternalDocumentChange(const DocumentChangeType& type, + const InternalDocumentSnapshot& document, + int64_t old_index, int64_t new_index); + + ~InternalDocumentChange() = default; + InternalDocumentChange(const InternalDocumentChange& other); + InternalDocumentChange& operator=(const InternalDocumentChange& other); + InternalDocumentChange(InternalDocumentChange&& other) = default; + InternalDocumentChange& operator=(InternalDocumentChange&& other) noexcept = + default; const DocumentChangeType& type() const; void set_type(const DocumentChangeType& value_arg); - const PigeonDocumentSnapshot& document() const; - void set_document(const PigeonDocumentSnapshot& value_arg); + const InternalDocumentSnapshot& document() const; + void set_document(const InternalDocumentSnapshot& value_arg); int64_t old_index() const; void set_old_index(int64_t value_arg); @@ -307,52 +373,170 @@ class PigeonDocumentChange { int64_t new_index() const; void set_new_index(int64_t value_arg); - static PigeonDocumentChange FromEncodableList( - const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; + bool operator==(const InternalDocumentChange& other) const; + bool operator!=(const InternalDocumentChange& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + + static InternalDocumentChange FromEncodableList( + const ::flutter::EncodableList& list); + + public: + public: + ::flutter::EncodableList ToEncodableList() const; + private: + private: private: friend class FirebaseFirestoreHostApi; friend class FirebaseFirestoreHostApiCodecSerializer; DocumentChangeType type_; - PigeonDocumentSnapshot document_; + std::unique_ptr document_; int64_t old_index_; int64_t new_index_; }; // Generated class from Pigeon that represents data sent in messages. -class PigeonQuerySnapshot { +class InternalQuerySnapshot { public: // Constructs an object setting all fields. - explicit PigeonQuerySnapshot(const flutter::EncodableList& documents, - const flutter::EncodableList& document_changes, - const PigeonSnapshotMetadata& metadata); + explicit InternalQuerySnapshot( + const ::flutter::EncodableList& documents, + const ::flutter::EncodableList& document_changes, + const InternalSnapshotMetadata& metadata); + + ~InternalQuerySnapshot() = default; + InternalQuerySnapshot(const InternalQuerySnapshot& other); + InternalQuerySnapshot& operator=(const InternalQuerySnapshot& other); + InternalQuerySnapshot(InternalQuerySnapshot&& other) = default; + InternalQuerySnapshot& operator=(InternalQuerySnapshot&& other) noexcept = + default; + const ::flutter::EncodableList& documents() const; + void set_documents(const ::flutter::EncodableList& value_arg); + + const ::flutter::EncodableList& document_changes() const; + void set_document_changes(const ::flutter::EncodableList& value_arg); + + const InternalSnapshotMetadata& metadata() const; + void set_metadata(const InternalSnapshotMetadata& value_arg); + + bool operator==(const InternalQuerySnapshot& other) const; + bool operator!=(const InternalQuerySnapshot& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + + private: + static InternalQuerySnapshot FromEncodableList( + const ::flutter::EncodableList& list); - const flutter::EncodableList& documents() const; - void set_documents(const flutter::EncodableList& value_arg); + public: + public: + ::flutter::EncodableList ToEncodableList() const; - const flutter::EncodableList& document_changes() const; - void set_document_changes(const flutter::EncodableList& value_arg); + private: + private: + friend class FirebaseFirestoreHostApi; + friend class FirebaseFirestoreHostApiCodecSerializer; + ::flutter::EncodableList documents_; + ::flutter::EncodableList document_changes_; + std::unique_ptr metadata_; +}; - const PigeonSnapshotMetadata& metadata() const; - void set_metadata(const PigeonSnapshotMetadata& value_arg); +// Generated class from Pigeon that represents data sent in messages. +class InternalPipelineResult { + public: + // Constructs an object setting all non-nullable fields. + InternalPipelineResult(); + + // Constructs an object setting all fields. + explicit InternalPipelineResult(const std::string* document_path, + const int64_t* create_time, + const int64_t* update_time, + const ::flutter::EncodableMap* data); + + const std::string* document_path() const; + void set_document_path(const std::string_view* value_arg); + void set_document_path(std::string_view value_arg); + + const int64_t* create_time() const; + void set_create_time(const int64_t* value_arg); + void set_create_time(int64_t value_arg); + + const int64_t* update_time() const; + void set_update_time(const int64_t* value_arg); + void set_update_time(int64_t value_arg); + + // All fields in the result (from PipelineResult.data() on Android). + const ::flutter::EncodableMap* data() const; + void set_data(const ::flutter::EncodableMap* value_arg); + void set_data(const ::flutter::EncodableMap& value_arg); + + bool operator==(const InternalPipelineResult& other) const; + bool operator!=(const InternalPipelineResult& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + + private: + static InternalPipelineResult FromEncodableList( + const ::flutter::EncodableList& list); + + public: + public: + ::flutter::EncodableList ToEncodableList() const; private: - static PigeonQuerySnapshot FromEncodableList( - const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; + private: friend class FirebaseFirestoreHostApi; friend class FirebaseFirestoreHostApiCodecSerializer; - flutter::EncodableList documents_; - flutter::EncodableList document_changes_; - PigeonSnapshotMetadata metadata_; + std::optional document_path_; + std::optional create_time_; + std::optional update_time_; + std::optional<::flutter::EncodableMap> data_; }; // Generated class from Pigeon that represents data sent in messages. -class PigeonGetOptions { +class InternalPipelineSnapshot { public: // Constructs an object setting all fields. - explicit PigeonGetOptions( + explicit InternalPipelineSnapshot(const ::flutter::EncodableList& results, + int64_t execution_time); + + const ::flutter::EncodableList& results() const; + void set_results(const ::flutter::EncodableList& value_arg); + + int64_t execution_time() const; + void set_execution_time(int64_t value_arg); + + bool operator==(const InternalPipelineSnapshot& other) const; + bool operator!=(const InternalPipelineSnapshot& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + + private: + static InternalPipelineSnapshot FromEncodableList( + const ::flutter::EncodableList& list); + + public: + public: + ::flutter::EncodableList ToEncodableList() const; + + private: + private: + friend class FirebaseFirestoreHostApi; + friend class FirebaseFirestoreHostApiCodecSerializer; + ::flutter::EncodableList results_; + int64_t execution_time_; +}; + +// Generated class from Pigeon that represents data sent in messages. +class InternalGetOptions { + public: + // Constructs an object setting all fields. + explicit InternalGetOptions( const Source& source, const ServerTimestampBehavior& server_timestamp_behavior); @@ -362,9 +546,22 @@ class PigeonGetOptions { const ServerTimestampBehavior& server_timestamp_behavior() const; void set_server_timestamp_behavior(const ServerTimestampBehavior& value_arg); + bool operator==(const InternalGetOptions& other) const; + bool operator!=(const InternalGetOptions& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + + private: + static InternalGetOptions FromEncodableList( + const ::flutter::EncodableList& list); + + public: + public: + ::flutter::EncodableList ToEncodableList() const; + + private: private: - static PigeonGetOptions FromEncodableList(const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; friend class FirebaseFirestoreHostApi; friend class FirebaseFirestoreHostApiCodecSerializer; Source source_; @@ -372,72 +569,103 @@ class PigeonGetOptions { }; // Generated class from Pigeon that represents data sent in messages. -class PigeonDocumentOption { +class InternalDocumentOption { public: // Constructs an object setting all non-nullable fields. - PigeonDocumentOption(); + InternalDocumentOption(); // Constructs an object setting all fields. - explicit PigeonDocumentOption(const bool* merge, - const flutter::EncodableList* merge_fields); + explicit InternalDocumentOption(const bool* merge, + const ::flutter::EncodableList* merge_fields); const bool* merge() const; void set_merge(const bool* value_arg); void set_merge(bool value_arg); - const flutter::EncodableList* merge_fields() const; - void set_merge_fields(const flutter::EncodableList* value_arg); - void set_merge_fields(const flutter::EncodableList& value_arg); + const ::flutter::EncodableList* merge_fields() const; + void set_merge_fields(const ::flutter::EncodableList* value_arg); + void set_merge_fields(const ::flutter::EncodableList& value_arg); + + bool operator==(const InternalDocumentOption& other) const; + bool operator!=(const InternalDocumentOption& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + + private: + static InternalDocumentOption FromEncodableList( + const ::flutter::EncodableList& list); + + public: + public: + ::flutter::EncodableList ToEncodableList() const; private: - static PigeonDocumentOption FromEncodableList( - const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; - friend class PigeonTransactionCommand; + private: + friend class InternalTransactionCommand; friend class DocumentReferenceRequest; friend class FirebaseFirestoreHostApi; friend class FirebaseFirestoreHostApiCodecSerializer; std::optional merge_; - std::optional merge_fields_; + std::optional<::flutter::EncodableList> merge_fields_; }; // Generated class from Pigeon that represents data sent in messages. -class PigeonTransactionCommand { +class InternalTransactionCommand { public: // Constructs an object setting all non-nullable fields. - explicit PigeonTransactionCommand(const PigeonTransactionType& type, - const std::string& path); + explicit InternalTransactionCommand(const InternalTransactionType& type, + const std::string& path); // Constructs an object setting all fields. - explicit PigeonTransactionCommand(const PigeonTransactionType& type, - const std::string& path, - const flutter::EncodableMap* data, - const PigeonDocumentOption* option); - - const PigeonTransactionType& type() const; - void set_type(const PigeonTransactionType& value_arg); + explicit InternalTransactionCommand(const InternalTransactionType& type, + const std::string& path, + const ::flutter::EncodableMap* data, + const InternalDocumentOption* option); + + ~InternalTransactionCommand() = default; + InternalTransactionCommand(const InternalTransactionCommand& other); + InternalTransactionCommand& operator=( + const InternalTransactionCommand& other); + InternalTransactionCommand(InternalTransactionCommand&& other) = default; + InternalTransactionCommand& operator=( + InternalTransactionCommand&& other) noexcept = default; + const InternalTransactionType& type() const; + void set_type(const InternalTransactionType& value_arg); const std::string& path() const; void set_path(std::string_view value_arg); - const flutter::EncodableMap* data() const; - void set_data(const flutter::EncodableMap* value_arg); - void set_data(const flutter::EncodableMap& value_arg); + const ::flutter::EncodableMap* data() const; + void set_data(const ::flutter::EncodableMap* value_arg); + void set_data(const ::flutter::EncodableMap& value_arg); + + const InternalDocumentOption* option() const; + void set_option(const InternalDocumentOption* value_arg); + void set_option(const InternalDocumentOption& value_arg); - const PigeonDocumentOption* option() const; - void set_option(const PigeonDocumentOption* value_arg); - void set_option(const PigeonDocumentOption& value_arg); + bool operator==(const InternalTransactionCommand& other) const; + bool operator!=(const InternalTransactionCommand& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + + private: + static InternalTransactionCommand FromEncodableList( + const ::flutter::EncodableList& list); + + public: + public: + ::flutter::EncodableList ToEncodableList() const; private: - static PigeonTransactionCommand FromEncodableList( - const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; + private: friend class FirebaseFirestoreHostApi; friend class FirebaseFirestoreHostApiCodecSerializer; - PigeonTransactionType type_; + InternalTransactionType type_; std::string path_; - std::optional data_; - std::optional option_; + std::optional<::flutter::EncodableMap> data_; + std::unique_ptr option_; }; // Generated class from Pigeon that represents data sent in messages. @@ -448,20 +676,26 @@ class DocumentReferenceRequest { // Constructs an object setting all fields. explicit DocumentReferenceRequest( - const std::string& path, const flutter::EncodableMap* data, - const PigeonDocumentOption* option, const Source* source, + const std::string& path, const ::flutter::EncodableMap* data, + const InternalDocumentOption* option, const Source* source, const ServerTimestampBehavior* server_timestamp_behavior); + ~DocumentReferenceRequest() = default; + DocumentReferenceRequest(const DocumentReferenceRequest& other); + DocumentReferenceRequest& operator=(const DocumentReferenceRequest& other); + DocumentReferenceRequest(DocumentReferenceRequest&& other) = default; + DocumentReferenceRequest& operator=( + DocumentReferenceRequest&& other) noexcept = default; const std::string& path() const; void set_path(std::string_view value_arg); - const flutter::EncodableMap* data() const; - void set_data(const flutter::EncodableMap* value_arg); - void set_data(const flutter::EncodableMap& value_arg); + const ::flutter::EncodableMap* data() const; + void set_data(const ::flutter::EncodableMap* value_arg); + void set_data(const ::flutter::EncodableMap& value_arg); - const PigeonDocumentOption* option() const; - void set_option(const PigeonDocumentOption* value_arg); - void set_option(const PigeonDocumentOption& value_arg); + const InternalDocumentOption* option() const; + void set_option(const InternalDocumentOption* value_arg); + void set_option(const InternalDocumentOption& value_arg); const Source* source() const; void set_source(const Source* value_arg); @@ -471,43 +705,55 @@ class DocumentReferenceRequest { void set_server_timestamp_behavior(const ServerTimestampBehavior* value_arg); void set_server_timestamp_behavior(const ServerTimestampBehavior& value_arg); + bool operator==(const DocumentReferenceRequest& other) const; + bool operator!=(const DocumentReferenceRequest& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + private: static DocumentReferenceRequest FromEncodableList( - const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; + const ::flutter::EncodableList& list); + + public: + public: + ::flutter::EncodableList ToEncodableList() const; + + private: + private: friend class FirebaseFirestoreHostApi; friend class FirebaseFirestoreHostApiCodecSerializer; std::string path_; - std::optional data_; - std::optional option_; + std::optional<::flutter::EncodableMap> data_; + std::unique_ptr option_; std::optional source_; std::optional server_timestamp_behavior_; }; // Generated class from Pigeon that represents data sent in messages. -class PigeonQueryParameters { +class InternalQueryParameters { public: // Constructs an object setting all non-nullable fields. - PigeonQueryParameters(); + InternalQueryParameters(); // Constructs an object setting all fields. - explicit PigeonQueryParameters(const flutter::EncodableList* where, - const flutter::EncodableList* order_by, - const int64_t* limit, - const int64_t* limit_to_last, - const flutter::EncodableList* start_at, - const flutter::EncodableList* start_after, - const flutter::EncodableList* end_at, - const flutter::EncodableList* end_before, - const flutter::EncodableMap* filters); - - const flutter::EncodableList* where() const; - void set_where(const flutter::EncodableList* value_arg); - void set_where(const flutter::EncodableList& value_arg); - - const flutter::EncodableList* order_by() const; - void set_order_by(const flutter::EncodableList* value_arg); - void set_order_by(const flutter::EncodableList& value_arg); + explicit InternalQueryParameters(const ::flutter::EncodableList* where, + const ::flutter::EncodableList* order_by, + const int64_t* limit, + const int64_t* limit_to_last, + const ::flutter::EncodableList* start_at, + const ::flutter::EncodableList* start_after, + const ::flutter::EncodableList* end_at, + const ::flutter::EncodableList* end_before, + const ::flutter::EncodableMap* filters); + + const ::flutter::EncodableList* where() const; + void set_where(const ::flutter::EncodableList* value_arg); + void set_where(const ::flutter::EncodableList& value_arg); + + const ::flutter::EncodableList* order_by() const; + void set_order_by(const ::flutter::EncodableList* value_arg); + void set_order_by(const ::flutter::EncodableList& value_arg); const int64_t* limit() const; void set_limit(const int64_t* value_arg); @@ -517,41 +763,53 @@ class PigeonQueryParameters { void set_limit_to_last(const int64_t* value_arg); void set_limit_to_last(int64_t value_arg); - const flutter::EncodableList* start_at() const; - void set_start_at(const flutter::EncodableList* value_arg); - void set_start_at(const flutter::EncodableList& value_arg); + const ::flutter::EncodableList* start_at() const; + void set_start_at(const ::flutter::EncodableList* value_arg); + void set_start_at(const ::flutter::EncodableList& value_arg); - const flutter::EncodableList* start_after() const; - void set_start_after(const flutter::EncodableList* value_arg); - void set_start_after(const flutter::EncodableList& value_arg); + const ::flutter::EncodableList* start_after() const; + void set_start_after(const ::flutter::EncodableList* value_arg); + void set_start_after(const ::flutter::EncodableList& value_arg); - const flutter::EncodableList* end_at() const; - void set_end_at(const flutter::EncodableList* value_arg); - void set_end_at(const flutter::EncodableList& value_arg); + const ::flutter::EncodableList* end_at() const; + void set_end_at(const ::flutter::EncodableList* value_arg); + void set_end_at(const ::flutter::EncodableList& value_arg); - const flutter::EncodableList* end_before() const; - void set_end_before(const flutter::EncodableList* value_arg); - void set_end_before(const flutter::EncodableList& value_arg); + const ::flutter::EncodableList* end_before() const; + void set_end_before(const ::flutter::EncodableList* value_arg); + void set_end_before(const ::flutter::EncodableList& value_arg); - const flutter::EncodableMap* filters() const; - void set_filters(const flutter::EncodableMap* value_arg); - void set_filters(const flutter::EncodableMap& value_arg); + const ::flutter::EncodableMap* filters() const; + void set_filters(const ::flutter::EncodableMap* value_arg); + void set_filters(const ::flutter::EncodableMap& value_arg); + bool operator==(const InternalQueryParameters& other) const; + bool operator!=(const InternalQueryParameters& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + + private: + static InternalQueryParameters FromEncodableList( + const ::flutter::EncodableList& list); + + public: + public: + ::flutter::EncodableList ToEncodableList() const; + + private: private: - static PigeonQueryParameters FromEncodableList( - const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; friend class FirebaseFirestoreHostApi; friend class FirebaseFirestoreHostApiCodecSerializer; - std::optional where_; - std::optional order_by_; + std::optional<::flutter::EncodableList> where_; + std::optional<::flutter::EncodableList> order_by_; std::optional limit_; std::optional limit_to_last_; - std::optional start_at_; - std::optional start_after_; - std::optional end_at_; - std::optional end_before_; - std::optional filters_; + std::optional<::flutter::EncodableList> start_at_; + std::optional<::flutter::EncodableList> start_after_; + std::optional<::flutter::EncodableList> end_at_; + std::optional<::flutter::EncodableList> end_before_; + std::optional<::flutter::EncodableMap> filters_; }; // Generated class from Pigeon that represents data sent in messages. @@ -570,9 +828,21 @@ class AggregateQuery { void set_field(const std::string_view* value_arg); void set_field(std::string_view value_arg); + bool operator==(const AggregateQuery& other) const; + bool operator!=(const AggregateQuery& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + + private: + static AggregateQuery FromEncodableList(const ::flutter::EncodableList& list); + + public: + public: + ::flutter::EncodableList ToEncodableList() const; + + private: private: - static AggregateQuery FromEncodableList(const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; friend class FirebaseFirestoreHostApi; friend class FirebaseFirestoreHostApiCodecSerializer; AggregateType type_; @@ -601,10 +871,22 @@ class AggregateQueryResponse { void set_value(const double* value_arg); void set_value(double value_arg); + bool operator==(const AggregateQueryResponse& other) const; + bool operator!=(const AggregateQueryResponse& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + private: static AggregateQueryResponse FromEncodableList( - const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; + const ::flutter::EncodableList& list); + + public: + public: + ::flutter::EncodableList ToEncodableList() const; + + private: + private: friend class FirebaseFirestoreHostApi; friend class FirebaseFirestoreHostApiCodecSerializer; AggregateType type_; @@ -621,12 +903,12 @@ class FirebaseFirestoreHostApiCodecSerializer return sInstance; } - void WriteValue(const flutter::EncodableValue& value, - flutter::ByteStreamWriter* stream) const override; + void WriteValue(const ::flutter::EncodableValue& value, + ::flutter::ByteStreamWriter* stream) const override; protected: - flutter::EncodableValue ReadValueOfType( - uint8_t type, flutter::ByteStreamReader* stream) const override; + ::flutter::EncodableValue ReadValueOfType( + uint8_t type, ::flutter::ByteStreamReader* stream) const override; }; // Generated interface from Pigeon that represents a handler of messages from @@ -641,8 +923,8 @@ class FirebaseFirestoreHostApi { std::function reply)> result) = 0; virtual void NamedQueryGet( const FirestorePigeonFirebaseApp& app, const std::string& name, - const PigeonGetOptions& options, - std::function reply)> result) = 0; + const InternalGetOptions& options, + std::function reply)> result) = 0; virtual void ClearPersistence( const FirestorePigeonFirebaseApp& app, std::function reply)> result) = 0; @@ -674,13 +956,13 @@ class FirebaseFirestoreHostApi { std::function reply)> result) = 0; virtual void TransactionStoreResult( const std::string& transaction_id, - const PigeonTransactionResult& result_type, - const flutter::EncodableList* commands, + const InternalTransactionResult& result_type, + const ::flutter::EncodableList* commands, std::function reply)> result) = 0; virtual void TransactionGet( const FirestorePigeonFirebaseApp& app, const std::string& transaction_id, const std::string& path, - std::function reply)> result) = 0; + std::function reply)> result) = 0; virtual void DocumentReferenceSet( const FirestorePigeonFirebaseApp& app, const DocumentReferenceRequest& request, @@ -692,29 +974,29 @@ class FirebaseFirestoreHostApi { virtual void DocumentReferenceGet( const FirestorePigeonFirebaseApp& app, const DocumentReferenceRequest& request, - std::function reply)> result) = 0; + std::function reply)> result) = 0; virtual void DocumentReferenceDelete( const FirestorePigeonFirebaseApp& app, const DocumentReferenceRequest& request, std::function reply)> result) = 0; virtual void QueryGet( const FirestorePigeonFirebaseApp& app, const std::string& path, - bool is_collection_group, const PigeonQueryParameters& parameters, - const PigeonGetOptions& options, - std::function reply)> result) = 0; + bool is_collection_group, const InternalQueryParameters& parameters, + const InternalGetOptions& options, + std::function reply)> result) = 0; virtual void AggregateQuery( const FirestorePigeonFirebaseApp& app, const std::string& path, - const PigeonQueryParameters& parameters, const AggregateSource& source, - const flutter::EncodableList& queries, bool is_collection_group, - std::function reply)> result) = 0; + const InternalQueryParameters& parameters, const AggregateSource& source, + const ::flutter::EncodableList& queries, bool is_collection_group, + std::function reply)> result) = 0; virtual void WriteBatchCommit( const FirestorePigeonFirebaseApp& app, - const flutter::EncodableList& writes, + const ::flutter::EncodableList& writes, std::function reply)> result) = 0; virtual void QuerySnapshot( const FirestorePigeonFirebaseApp& app, const std::string& path, - bool is_collection_group, const PigeonQueryParameters& parameters, - const PigeonGetOptions& options, bool include_metadata_changes, + bool is_collection_group, const InternalQueryParameters& parameters, + const InternalGetOptions& options, bool include_metadata_changes, const ListenSource& source, std::function reply)> result) = 0; virtual void DocumentReferenceSnapshot( @@ -726,15 +1008,23 @@ class FirebaseFirestoreHostApi { const FirestorePigeonFirebaseApp& app, const PersistenceCacheIndexManagerRequestEnum& request, std::function reply)> result) = 0; + virtual void ExecutePipeline( + const FirestorePigeonFirebaseApp& app, + const ::flutter::EncodableList& stages, + const ::flutter::EncodableMap* options, + std::function reply)> result) = 0; // The codec used by FirebaseFirestoreHostApi. - static const flutter::StandardMessageCodec& GetCodec(); + static const ::flutter::StandardMessageCodec& GetCodec(); // Sets up an instance of `FirebaseFirestoreHostApi` to handle messages // through the `binary_messenger`. - static void SetUp(flutter::BinaryMessenger* binary_messenger, + static void SetUp(::flutter::BinaryMessenger* binary_messenger, FirebaseFirestoreHostApi* api); - static flutter::EncodableValue WrapError(std::string_view error_message); - static flutter::EncodableValue WrapError(const FlutterError& error); + static void SetUp(::flutter::BinaryMessenger* binary_messenger, + FirebaseFirestoreHostApi* api, + const std::string& message_channel_suffix); + static ::flutter::EncodableValue WrapError(std::string_view error_message); + static ::flutter::EncodableValue WrapError(const FlutterError& error); protected: FirebaseFirestoreHostApi() = default; diff --git a/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/method_channel/method_channel_aggregate_query.dart b/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/method_channel/method_channel_aggregate_query.dart index ad54b1f6c018..ac3193875c3d 100644 --- a/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/method_channel/method_channel_aggregate_query.dart +++ b/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/method_channel/method_channel_aggregate_query.dart @@ -18,7 +18,7 @@ class MethodChannelAggregateQuery extends AggregateQueryPlatform { final FirestorePigeonFirebaseApp _pigeonApp; final String _path; - final PigeonQueryParameters _pigeonParameters; + final InternalQueryParameters _pigeonParameters; final bool _isCollectionGroupQuery; final List _aggregateQueries; diff --git a/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/method_channel/method_channel_document_change.dart b/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/method_channel/method_channel_document_change.dart index 3d03a9d3edfa..0469941a7a35 100644 --- a/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/method_channel/method_channel_document_change.dart +++ b/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/method_channel/method_channel_document_change.dart @@ -9,8 +9,8 @@ import 'package:cloud_firestore_platform_interface/cloud_firestore_platform_inte /// communicate with Firebase plugins. class MethodChannelDocumentChange extends DocumentChangePlatform { /// Creates a [MethodChannelDocumentChange] from the given [data] - MethodChannelDocumentChange( - FirebaseFirestorePlatform firestore, PigeonDocumentChange documentChange) + MethodChannelDocumentChange(FirebaseFirestorePlatform firestore, + InternalDocumentChange documentChange) : super( documentChange.type, documentChange.oldIndex, diff --git a/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/method_channel/method_channel_document_reference.dart b/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/method_channel/method_channel_document_reference.dart index 4927de5c72e6..e957d4c63fbb 100644 --- a/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/method_channel/method_channel_document_reference.dart +++ b/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/method_channel/method_channel_document_reference.dart @@ -37,7 +37,7 @@ class MethodChannelDocumentReference extends DocumentReferencePlatform { DocumentReferenceRequest( path: _pointer.path, data: data, - option: PigeonDocumentOption( + option: InternalDocumentOption( merge: options?.merge, mergeFields: options?.mergeFields?.map((e) => e.components).toList(), @@ -137,8 +137,10 @@ class MethodChannelDocumentReference extends DocumentReferencePlatform { ) .listen( (snapshot) { - final PigeonDocumentSnapshot result = - PigeonDocumentSnapshot.decode(snapshot); + // With Pigeon 26, the native side emits the generated Pigeon class + // directly through the Pigeon-aware codec, so we receive a fully + // decoded `InternalDocumentSnapshot` here (no manual decode required). + final result = snapshot as InternalDocumentSnapshot; controller.add( DocumentSnapshotPlatform( firestore, diff --git a/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/method_channel/method_channel_firestore.dart b/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/method_channel/method_channel_firestore.dart index 889ea4c5351b..33aefcfb42c0 100644 --- a/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/method_channel/method_channel_firestore.dart +++ b/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/method_channel/method_channel_firestore.dart @@ -21,7 +21,6 @@ import 'method_channel_query.dart'; import 'method_channel_transaction.dart'; import 'method_channel_write_batch.dart'; import 'utils/exception.dart'; -import 'utils/firestore_message_codec.dart'; /// The entry point for accessing a Firestore. /// @@ -39,7 +38,7 @@ class MethodChannelFirebaseFirestore extends FirebaseFirestorePlatform { static EventChannel querySnapshotChannel(String id) { return EventChannel( 'plugins.flutter.io/firebase_firestore/query/$id', - const StandardMethodCodec(FirestoreMessageCodec()), + const StandardMethodCodec(PigeonCodec()), ); } @@ -47,7 +46,7 @@ class MethodChannelFirebaseFirestore extends FirebaseFirestorePlatform { static EventChannel documentSnapshotChannel(String id) { return EventChannel( 'plugins.flutter.io/firebase_firestore/document/$id', - const StandardMethodCodec(FirestoreMessageCodec()), + const StandardMethodCodec(PigeonCodec()), ); } @@ -55,7 +54,7 @@ class MethodChannelFirebaseFirestore extends FirebaseFirestorePlatform { static EventChannel snapshotsInSyncChannel(String id) { return EventChannel( 'plugins.flutter.io/firebase_firestore/snapshotsInSync/$id', - const StandardMethodCodec(FirestoreMessageCodec()), + const StandardMethodCodec(PigeonCodec()), ); } @@ -63,7 +62,7 @@ class MethodChannelFirebaseFirestore extends FirebaseFirestorePlatform { static EventChannel loadBundleChannel(String id) { return EventChannel( 'plugins.flutter.io/firebase_firestore/loadBundle/$id', - const StandardMethodCodec(FirestoreMessageCodec()), + const StandardMethodCodec(PigeonCodec()), ); } @@ -72,7 +71,7 @@ class MethodChannelFirebaseFirestore extends FirebaseFirestorePlatform { late final FirestorePigeonFirebaseApp pigeonApp = FirestorePigeonFirebaseApp( appName: appInstance!.name, databaseURL: databaseId, - settings: PigeonFirebaseSettings( + settings: InternalFirebaseSettings( persistenceEnabled: settings.persistenceEnabled, host: settings.host, sslEnabled: settings.sslEnabled, @@ -107,7 +106,7 @@ class MethodChannelFirebaseFirestore extends FirebaseFirestorePlatform { final data = await pigeonChannel.namedQueryGet( pigeonApp, name, - PigeonGetOptions( + InternalGetOptions( source: options.source, serverTimestampBehavior: options.serverTimestampBehavior, ), @@ -233,7 +232,7 @@ class MethodChannelFirebaseFirestore extends FirebaseFirestorePlatform { final eventChannel = EventChannel( 'plugins.flutter.io/firebase_firestore/transaction/$transactionId', - const StandardMethodCodec(FirestoreMessageCodec()), + const StandardMethodCodec(PigeonCodec()), ); final snapshotStreamSubscription = @@ -276,7 +275,7 @@ class MethodChannelFirebaseFirestore extends FirebaseFirestorePlatform { // transaction await pigeonChannel.transactionStoreResult( transactionId, - PigeonTransactionResult.failure, + InternalTransactionResult.failure, null, ); @@ -290,7 +289,7 @@ class MethodChannelFirebaseFirestore extends FirebaseFirestorePlatform { // Send the transaction commands to Dart. await pigeonChannel.transactionStoreResult( transactionId, - PigeonTransactionResult.success, + InternalTransactionResult.success, transaction.commands, ); }, @@ -374,7 +373,8 @@ class MethodChannelFirebaseFirestore extends FirebaseFirestorePlatform { MapEntry.new, ); - final PigeonPipelineSnapshot result = await pigeonChannel.executePipeline( + final InternalPipelineSnapshot result = + await pigeonChannel.executePipeline( pigeonApp, pigeonStages, pigeonOptions, diff --git a/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/method_channel/method_channel_pipeline_snapshot.dart b/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/method_channel/method_channel_pipeline_snapshot.dart index c5f351ef88ed..a0b3a73d5bb3 100644 --- a/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/method_channel/method_channel_pipeline_snapshot.dart +++ b/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/method_channel/method_channel_pipeline_snapshot.dart @@ -16,9 +16,9 @@ class MethodChannelPipelineSnapshot extends PipelineSnapshotPlatform { MethodChannelPipelineSnapshot( FirebaseFirestorePlatform firestore, FirestorePigeonFirebaseApp pigeonApp, - PigeonPipelineSnapshot pigeonSnapshot, + InternalPipelineSnapshot pigeonSnapshot, ) : _results = pigeonSnapshot.results - .whereType() + .whereType() .map((result) => MethodChannelPipelineResult( firestore, pigeonApp, diff --git a/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/method_channel/method_channel_query.dart b/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/method_channel/method_channel_query.dart index 6ae2ec548688..12604b472d7c 100644 --- a/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/method_channel/method_channel_query.dart +++ b/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/method_channel/method_channel_query.dart @@ -43,8 +43,8 @@ class MethodChannelQuery extends QueryPlatform { return _pointer.path; } - PigeonQueryParameters get _pigeonParameters { - return PigeonQueryParameters( + InternalQueryParameters get _pigeonParameters { + return InternalQueryParameters( where: parameters['where'], orderBy: parameters['orderBy'], limit: parameters['limit'], @@ -114,13 +114,13 @@ class MethodChannelQuery extends QueryPlatform { Future get( [GetOptions options = const GetOptions()]) async { try { - final PigeonQuerySnapshot result = + final InternalQuerySnapshot result = await MethodChannelFirebaseFirestore.pigeonChannel.queryGet( pigeonApp, _pointer.path, isCollectionGroupQuery, _pigeonParameters, - PigeonGetOptions( + InternalGetOptions( source: options.source, serverTimestampBehavior: options.serverTimestampBehavior, ), @@ -170,7 +170,7 @@ class MethodChannelQuery extends QueryPlatform { _pointer.path, isCollectionGroupQuery, _pigeonParameters, - PigeonGetOptions( + InternalGetOptions( source: Source.serverAndCache, serverTimestampBehavior: serverTimestampBehavior, ), @@ -185,21 +185,10 @@ class MethodChannelQuery extends QueryPlatform { ) .listen( (snapshot) { - final snapshotList = snapshot as List; - // We force the types here of list because they are not automatically - // decoded by the pigeon generated code. - final List documents = - (snapshotList[0]! as List) - .map((e) => PigeonDocumentSnapshot.decode(e)) - .toList() - .cast(); - final List changes = - (snapshotList[1]! as List) - .map((e) => PigeonDocumentChange.decode(e)) - .toList() - .cast(); - final PigeonQuerySnapshot result = PigeonQuerySnapshot.decode( - [documents, changes, snapshotList[2]]); + // With Pigeon 26, the native side emits the generated Pigeon class + // directly through the Pigeon-aware codec, so we receive a fully + // decoded `InternalQuerySnapshot` here (no manual decode required). + final result = snapshot as InternalQuerySnapshot; controller.add(MethodChannelQuerySnapshot(firestore, result)); }, onError: controller.addError, diff --git a/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/method_channel/method_channel_query_snapshot.dart b/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/method_channel/method_channel_query_snapshot.dart index 204915caa160..72c61bd9e0db 100644 --- a/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/method_channel/method_channel_query_snapshot.dart +++ b/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/method_channel/method_channel_query_snapshot.dart @@ -12,7 +12,7 @@ import 'method_channel_document_change.dart'; class MethodChannelQuerySnapshot extends QuerySnapshotPlatform { /// Creates a [MethodChannelQuerySnapshot] from the given [data] MethodChannelQuerySnapshot( - FirebaseFirestorePlatform firestore, PigeonQuerySnapshot data) + FirebaseFirestorePlatform firestore, InternalQuerySnapshot data) : super( data.documents .map((document) { diff --git a/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/method_channel/method_channel_transaction.dart b/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/method_channel/method_channel_transaction.dart index 19b85bb93474..a4e75ad3d377 100644 --- a/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/method_channel/method_channel_transaction.dart +++ b/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/method_channel/method_channel_transaction.dart @@ -31,11 +31,11 @@ class MethodChannelTransaction extends TransactionPlatform { app: Firebase.app(appName), databaseId: databaseId); } - List _commands = []; + List _commands = []; /// Returns all transaction commands for the current instance. @override - List get commands { + List get commands { return _commands; } @@ -63,8 +63,8 @@ class MethodChannelTransaction extends TransactionPlatform { @override MethodChannelTransaction delete(String documentPath) { - _commands.add(PigeonTransactionCommand( - type: PigeonTransactionType.deleteType, + _commands.add(InternalTransactionCommand( + type: InternalTransactionType.deleteType, path: documentPath, )); @@ -76,8 +76,8 @@ class MethodChannelTransaction extends TransactionPlatform { String documentPath, Map data, ) { - _commands.add(PigeonTransactionCommand( - type: PigeonTransactionType.update, + _commands.add(InternalTransactionCommand( + type: InternalTransactionType.update, path: documentPath, data: data, )); @@ -88,11 +88,11 @@ class MethodChannelTransaction extends TransactionPlatform { @override MethodChannelTransaction set(String documentPath, Map data, [SetOptions? options]) { - _commands.add(PigeonTransactionCommand( - type: PigeonTransactionType.set, + _commands.add(InternalTransactionCommand( + type: InternalTransactionType.set, path: documentPath, data: data, - option: PigeonDocumentOption( + option: InternalDocumentOption( merge: options?.merge, mergeFields: options?.mergeFields?.map((e) => e.components).toList(), ))); diff --git a/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/method_channel/method_channel_write_batch.dart b/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/method_channel/method_channel_write_batch.dart index bbdcbf3e678c..efd1de89fe6e 100644 --- a/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/method_channel/method_channel_write_batch.dart +++ b/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/method_channel/method_channel_write_batch.dart @@ -24,7 +24,7 @@ class MethodChannelWriteBatch extends WriteBatchPlatform { final FirestorePigeonFirebaseApp pigeonApp; /// Keeps track of all batch writes in order. - List _writes = []; + List _writes = []; /// The committed state of this batch. /// @@ -52,9 +52,9 @@ class MethodChannelWriteBatch extends WriteBatchPlatform { @override void delete(String documentPath) { _assertNotCommitted(); - _writes.add(PigeonTransactionCommand( + _writes.add(InternalTransactionCommand( path: documentPath, - type: PigeonTransactionType.deleteType, + type: InternalTransactionType.deleteType, )); } @@ -62,11 +62,11 @@ class MethodChannelWriteBatch extends WriteBatchPlatform { void set(String documentPath, Map data, [SetOptions? options]) { _assertNotCommitted(); - _writes.add(PigeonTransactionCommand( + _writes.add(InternalTransactionCommand( path: documentPath, - type: PigeonTransactionType.set, + type: InternalTransactionType.set, data: data, - option: PigeonDocumentOption( + option: InternalDocumentOption( merge: options?.merge, mergeFields: options?.mergeFields?.map((e) => e.components).toList(), ), @@ -79,9 +79,9 @@ class MethodChannelWriteBatch extends WriteBatchPlatform { Map data, ) { _assertNotCommitted(); - _writes.add(PigeonTransactionCommand( + _writes.add(InternalTransactionCommand( path: documentPath, - type: PigeonTransactionType.update, + type: InternalTransactionType.update, data: data, )); } diff --git a/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/pigeon/messages.pigeon.dart b/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/pigeon/messages.pigeon.dart index 662ed9358d9f..352fbf28fbed 100644 --- a/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/pigeon/messages.pigeon.dart +++ b/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/pigeon/messages.pigeon.dart @@ -1,16 +1,115 @@ // Copyright 2023, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v11.0.1), do not edit directly. +// Autogenerated from Pigeon (v26.3.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 +// ignore_for_file: unused_import, unused_shown_name +// ignore_for_file: type=lint import 'dart:async'; -import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; +import 'dart:typed_data' show Float64List, Int32List, Int64List; import 'package:cloud_firestore_platform_interface/src/method_channel/utils/firestore_message_codec.dart'; -import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer; import 'package:flutter/services.dart'; +import 'package:meta/meta.dart' show immutable, protected, visibleForTesting; + +Object? _extractReplyValueOrThrow( + List? replyList, + String channelName, { + required bool isNullValid, +}) { + if (replyList == null) { + throw PlatformException( + code: 'channel-error', + message: 'Unable to establish connection on channel: "$channelName".', + ); + } else if (replyList.length > 1) { + throw PlatformException( + code: replyList[0]! as String, + message: replyList[1] as String?, + details: replyList[2], + ); + } else if (!isNullValid && (replyList.isNotEmpty && replyList[0] == null)) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } + return replyList.firstOrNull; +} + +List wrapResponse( + {Object? result, PlatformException? error, bool empty = false}) { + if (empty) { + return []; + } + if (error == null) { + return [result]; + } + return [error.code, error.message, error.details]; +} + +bool _deepEquals(Object? a, Object? b) { + if (identical(a, b)) { + return true; + } + if (a is double && b is double) { + if (a.isNaN && b.isNaN) { + return true; + } + return a == b; + } + if (a is List && b is List) { + return a.length == b.length && + a.indexed + .every(((int, dynamic) item) => _deepEquals(item.$2, b[item.$1])); + } + if (a is Map && b is Map) { + if (a.length != b.length) { + return false; + } + for (final MapEntry entryA in a.entries) { + bool found = false; + for (final MapEntry entryB in b.entries) { + if (_deepEquals(entryA.key, entryB.key)) { + if (_deepEquals(entryA.value, entryB.value)) { + found = true; + break; + } else { + return false; + } + } + } + if (!found) { + return false; + } + } + return true; + } + return a == b; +} + +int _deepHash(Object? value) { + if (value is List) { + return Object.hashAll(value.map(_deepHash)); + } + if (value is Map) { + int result = 0; + for (final MapEntry entry in value.entries) { + result += (_deepHash(entry.key) * 31) ^ _deepHash(entry.value); + } + return result; + } + if (value is double && value.isNaN) { + // Normalize NaN to a consistent hash. + return 0x7FF8000000000000.hashCode; + } + if (value is double && value == 0.0) { + // Normalize -0.0 to 0.0 so they have the same hash code. + return 0.0.hashCode; + } + return value.hashCode; +} /// An enumeration of document change types. enum DocumentChangeType { @@ -86,12 +185,12 @@ enum PersistenceCacheIndexManagerRequest { deleteAllIndexes, } -enum PigeonTransactionResult { +enum InternalTransactionResult { success, failure, } -enum PigeonTransactionType { +enum InternalTransactionType { get, update, set, @@ -104,8 +203,8 @@ enum AggregateType { average, } -class PigeonFirebaseSettings { - PigeonFirebaseSettings({ +class InternalFirebaseSettings { + InternalFirebaseSettings({ this.persistenceEnabled, this.host, this.sslEnabled, @@ -123,7 +222,7 @@ class PigeonFirebaseSettings { bool ignoreUndefinedProperties; - Object encode() { + List _toList() { return [ persistenceEnabled, host, @@ -133,9 +232,13 @@ class PigeonFirebaseSettings { ]; } - static PigeonFirebaseSettings decode(Object result) { + Object encode() { + return _toList(); + } + + static InternalFirebaseSettings decode(Object result) { result as List; - return PigeonFirebaseSettings( + return InternalFirebaseSettings( persistenceEnabled: result[0] as bool?, host: result[1] as String?, sslEnabled: result[2] as bool?, @@ -143,6 +246,27 @@ class PigeonFirebaseSettings { ignoreUndefinedProperties: result[4]! as bool, ); } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + bool operator ==(Object other) { + if (other is! InternalFirebaseSettings || + other.runtimeType != runtimeType) { + return false; + } + if (identical(this, other)) { + return true; + } + return _deepEquals(persistenceEnabled, other.persistenceEnabled) && + _deepEquals(host, other.host) && + _deepEquals(sslEnabled, other.sslEnabled) && + _deepEquals(cacheSizeBytes, other.cacheSizeBytes) && + _deepEquals(ignoreUndefinedProperties, other.ignoreUndefinedProperties); + } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class FirestorePigeonFirebaseApp { @@ -154,30 +278,53 @@ class FirestorePigeonFirebaseApp { String appName; - PigeonFirebaseSettings settings; + InternalFirebaseSettings settings; String databaseURL; - Object encode() { + List _toList() { return [ appName, - settings.encode(), + settings, databaseURL, ]; } + Object encode() { + return _toList(); + } + static FirestorePigeonFirebaseApp decode(Object result) { result as List; return FirestorePigeonFirebaseApp( appName: result[0]! as String, - settings: PigeonFirebaseSettings.decode(result[1]! as List), + settings: result[1]! as InternalFirebaseSettings, databaseURL: result[2]! as String, ); } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + bool operator ==(Object other) { + if (other is! FirestorePigeonFirebaseApp || + other.runtimeType != runtimeType) { + return false; + } + if (identical(this, other)) { + return true; + } + return _deepEquals(appName, other.appName) && + _deepEquals(settings, other.settings) && + _deepEquals(databaseURL, other.databaseURL); + } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + int get hashCode => _deepHash([runtimeType, ..._toList()]); } -class PigeonSnapshotMetadata { - PigeonSnapshotMetadata({ +class InternalSnapshotMetadata { + InternalSnapshotMetadata({ required this.hasPendingWrites, required this.isFromCache, }); @@ -186,24 +333,46 @@ class PigeonSnapshotMetadata { bool isFromCache; - Object encode() { + List _toList() { return [ hasPendingWrites, isFromCache, ]; } - static PigeonSnapshotMetadata decode(Object result) { + Object encode() { + return _toList(); + } + + static InternalSnapshotMetadata decode(Object result) { result as List; - return PigeonSnapshotMetadata( + return InternalSnapshotMetadata( hasPendingWrites: result[0]! as bool, isFromCache: result[1]! as bool, ); } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + bool operator ==(Object other) { + if (other is! InternalSnapshotMetadata || + other.runtimeType != runtimeType) { + return false; + } + if (identical(this, other)) { + return true; + } + return _deepEquals(hasPendingWrites, other.hasPendingWrites) && + _deepEquals(isFromCache, other.isFromCache); + } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + int get hashCode => _deepHash([runtimeType, ..._toList()]); } -class PigeonDocumentSnapshot { - PigeonDocumentSnapshot({ +class InternalDocumentSnapshot { + InternalDocumentSnapshot({ required this.path, this.data, required this.metadata, @@ -213,28 +382,51 @@ class PigeonDocumentSnapshot { Map? data; - PigeonSnapshotMetadata metadata; + InternalSnapshotMetadata metadata; - Object encode() { + List _toList() { return [ path, data, - metadata.encode(), + metadata, ]; } - static PigeonDocumentSnapshot decode(Object result) { + Object encode() { + return _toList(); + } + + static InternalDocumentSnapshot decode(Object result) { result as List; - return PigeonDocumentSnapshot( + return InternalDocumentSnapshot( path: result[0]! as String, data: (result[1] as Map?)?.cast(), - metadata: PigeonSnapshotMetadata.decode(result[2]! as List), + metadata: result[2]! as InternalSnapshotMetadata, ); } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + bool operator ==(Object other) { + if (other is! InternalDocumentSnapshot || + other.runtimeType != runtimeType) { + return false; + } + if (identical(this, other)) { + return true; + } + return _deepEquals(path, other.path) && + _deepEquals(data, other.data) && + _deepEquals(metadata, other.metadata); + } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + int get hashCode => _deepHash([runtimeType, ..._toList()]); } -class PigeonDocumentChange { - PigeonDocumentChange({ +class InternalDocumentChange { + InternalDocumentChange({ required this.type, required this.document, required this.oldIndex, @@ -243,66 +435,112 @@ class PigeonDocumentChange { DocumentChangeType type; - PigeonDocumentSnapshot document; + InternalDocumentSnapshot document; int oldIndex; int newIndex; - Object encode() { + List _toList() { return [ - type.index, - document.encode(), + type, + document, oldIndex, newIndex, ]; } - static PigeonDocumentChange decode(Object result) { + Object encode() { + return _toList(); + } + + static InternalDocumentChange decode(Object result) { result as List; - return PigeonDocumentChange( - type: DocumentChangeType.values[result[0]! as int], - document: PigeonDocumentSnapshot.decode(result[1]! as List), + return InternalDocumentChange( + type: result[0]! as DocumentChangeType, + document: result[1]! as InternalDocumentSnapshot, oldIndex: result[2]! as int, newIndex: result[3]! as int, ); } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + bool operator ==(Object other) { + if (other is! InternalDocumentChange || other.runtimeType != runtimeType) { + return false; + } + if (identical(this, other)) { + return true; + } + return _deepEquals(type, other.type) && + _deepEquals(document, other.document) && + _deepEquals(oldIndex, other.oldIndex) && + _deepEquals(newIndex, other.newIndex); + } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + int get hashCode => _deepHash([runtimeType, ..._toList()]); } -class PigeonQuerySnapshot { - PigeonQuerySnapshot({ +class InternalQuerySnapshot { + InternalQuerySnapshot({ required this.documents, required this.documentChanges, required this.metadata, }); - List documents; + List documents; - List documentChanges; + List documentChanges; - PigeonSnapshotMetadata metadata; + InternalSnapshotMetadata metadata; - Object encode() { + List _toList() { return [ documents, documentChanges, - metadata.encode(), + metadata, ]; } - static PigeonQuerySnapshot decode(Object result) { + Object encode() { + return _toList(); + } + + static InternalQuerySnapshot decode(Object result) { result as List; - return PigeonQuerySnapshot( - documents: (result[0] as List?)!.cast(), + return InternalQuerySnapshot( + documents: + (result[0]! as List).cast(), documentChanges: - (result[1] as List?)!.cast(), - metadata: PigeonSnapshotMetadata.decode(result[2]! as List), + (result[1]! as List).cast(), + metadata: result[2]! as InternalSnapshotMetadata, ); } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + bool operator ==(Object other) { + if (other is! InternalQuerySnapshot || other.runtimeType != runtimeType) { + return false; + } + if (identical(this, other)) { + return true; + } + return _deepEquals(documents, other.documents) && + _deepEquals(documentChanges, other.documentChanges) && + _deepEquals(metadata, other.metadata); + } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + int get hashCode => _deepHash([runtimeType, ..._toList()]); } -class PigeonPipelineResult { - PigeonPipelineResult({ +class InternalPipelineResult { + InternalPipelineResult({ this.documentPath, this.createTime, this.updateTime, @@ -318,7 +556,7 @@ class PigeonPipelineResult { /// All fields in the result (from PipelineResult.data() on Android). Map? data; - Object encode() { + List _toList() { return [ documentPath, createTime, @@ -327,45 +565,90 @@ class PigeonPipelineResult { ]; } - static PigeonPipelineResult decode(Object result) { + Object encode() { + return _toList(); + } + + static InternalPipelineResult decode(Object result) { result as List; - return PigeonPipelineResult( + return InternalPipelineResult( documentPath: result[0] as String?, createTime: result[1] as int?, updateTime: result[2] as int?, data: (result[3] as Map?)?.cast(), ); } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + bool operator ==(Object other) { + if (other is! InternalPipelineResult || other.runtimeType != runtimeType) { + return false; + } + if (identical(this, other)) { + return true; + } + return _deepEquals(documentPath, other.documentPath) && + _deepEquals(createTime, other.createTime) && + _deepEquals(updateTime, other.updateTime) && + _deepEquals(data, other.data); + } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + int get hashCode => _deepHash([runtimeType, ..._toList()]); } -class PigeonPipelineSnapshot { - PigeonPipelineSnapshot({ +class InternalPipelineSnapshot { + InternalPipelineSnapshot({ required this.results, required this.executionTime, }); - List results; + List results; int executionTime; - Object encode() { + List _toList() { return [ results, executionTime, ]; } - static PigeonPipelineSnapshot decode(Object result) { + Object encode() { + return _toList(); + } + + static InternalPipelineSnapshot decode(Object result) { result as List; - return PigeonPipelineSnapshot( - results: (result[0] as List?)!.cast(), + return InternalPipelineSnapshot( + results: (result[0]! as List).cast(), executionTime: result[1]! as int, ); } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + bool operator ==(Object other) { + if (other is! InternalPipelineSnapshot || + other.runtimeType != runtimeType) { + return false; + } + if (identical(this, other)) { + return true; + } + return _deepEquals(results, other.results) && + _deepEquals(executionTime, other.executionTime); + } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + int get hashCode => _deepHash([runtimeType, ..._toList()]); } -class PigeonGetOptions { - PigeonGetOptions({ +class InternalGetOptions { + InternalGetOptions({ required this.source, required this.serverTimestampBehavior, }); @@ -374,25 +657,45 @@ class PigeonGetOptions { ServerTimestampBehavior serverTimestampBehavior; - Object encode() { + List _toList() { return [ - source.index, - serverTimestampBehavior.index, + source, + serverTimestampBehavior, ]; } - static PigeonGetOptions decode(Object result) { + Object encode() { + return _toList(); + } + + static InternalGetOptions decode(Object result) { result as List; - return PigeonGetOptions( - source: Source.values[result[0]! as int], - serverTimestampBehavior: - ServerTimestampBehavior.values[result[1]! as int], + return InternalGetOptions( + source: result[0]! as Source, + serverTimestampBehavior: result[1]! as ServerTimestampBehavior, ); } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + bool operator ==(Object other) { + if (other is! InternalGetOptions || other.runtimeType != runtimeType) { + return false; + } + if (identical(this, other)) { + return true; + } + return _deepEquals(source, other.source) && + _deepEquals(serverTimestampBehavior, other.serverTimestampBehavior); + } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + int get hashCode => _deepHash([runtimeType, ..._toList()]); } -class PigeonDocumentOption { - PigeonDocumentOption({ +class InternalDocumentOption { + InternalDocumentOption({ this.merge, this.mergeFields, }); @@ -401,58 +704,101 @@ class PigeonDocumentOption { List?>? mergeFields; - Object encode() { + List _toList() { return [ merge, mergeFields, ]; } - static PigeonDocumentOption decode(Object result) { + Object encode() { + return _toList(); + } + + static InternalDocumentOption decode(Object result) { result as List; - return PigeonDocumentOption( + return InternalDocumentOption( merge: result[0] as bool?, mergeFields: (result[1] as List?)?.cast?>(), ); } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + bool operator ==(Object other) { + if (other is! InternalDocumentOption || other.runtimeType != runtimeType) { + return false; + } + if (identical(this, other)) { + return true; + } + return _deepEquals(merge, other.merge) && + _deepEquals(mergeFields, other.mergeFields); + } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + int get hashCode => _deepHash([runtimeType, ..._toList()]); } -class PigeonTransactionCommand { - PigeonTransactionCommand({ +class InternalTransactionCommand { + InternalTransactionCommand({ required this.type, required this.path, this.data, this.option, }); - PigeonTransactionType type; + InternalTransactionType type; String path; Map? data; - PigeonDocumentOption? option; + InternalDocumentOption? option; - Object encode() { + List _toList() { return [ - type.index, + type, path, data, - option?.encode(), + option, ]; } - static PigeonTransactionCommand decode(Object result) { + Object encode() { + return _toList(); + } + + static InternalTransactionCommand decode(Object result) { result as List; - return PigeonTransactionCommand( - type: PigeonTransactionType.values[result[0]! as int], + return InternalTransactionCommand( + type: result[0]! as InternalTransactionType, path: result[1]! as String, - data: (result[2] as Map?)?.cast(), - option: result[3] != null - ? PigeonDocumentOption.decode(result[3]! as List) - : null, + data: result[2] as Map?, + option: result[3] as InternalDocumentOption?, ); } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + bool operator ==(Object other) { + if (other is! InternalTransactionCommand || + other.runtimeType != runtimeType) { + return false; + } + if (identical(this, other)) { + return true; + } + return _deepEquals(type, other.type) && + _deepEquals(path, other.path) && + _deepEquals(data, other.data) && + _deepEquals(option, other.option); + } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class DocumentReferenceRequest { @@ -468,40 +814,61 @@ class DocumentReferenceRequest { Map? data; - PigeonDocumentOption? option; + InternalDocumentOption? option; Source? source; ServerTimestampBehavior? serverTimestampBehavior; - Object encode() { + List _toList() { return [ path, data, - option?.encode(), - source?.index, - serverTimestampBehavior?.index, + option, + source, + serverTimestampBehavior, ]; } + Object encode() { + return _toList(); + } + static DocumentReferenceRequest decode(Object result) { result as List; return DocumentReferenceRequest( path: result[0]! as String, - data: (result[1] as Map?)?.cast(), - option: result[2] != null - ? PigeonDocumentOption.decode(result[2]! as List) - : null, - source: result[3] != null ? Source.values[result[3]! as int] : null, - serverTimestampBehavior: result[4] != null - ? ServerTimestampBehavior.values[result[4]! as int] - : null, + data: result[1] as Map?, + option: result[2] as InternalDocumentOption?, + source: result[3] as Source?, + serverTimestampBehavior: result[4] as ServerTimestampBehavior?, ); } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + bool operator ==(Object other) { + if (other is! DocumentReferenceRequest || + other.runtimeType != runtimeType) { + return false; + } + if (identical(this, other)) { + return true; + } + return _deepEquals(path, other.path) && + _deepEquals(data, other.data) && + _deepEquals(option, other.option) && + _deepEquals(source, other.source) && + _deepEquals(serverTimestampBehavior, other.serverTimestampBehavior); + } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + int get hashCode => _deepHash([runtimeType, ..._toList()]); } -class PigeonQueryParameters { - PigeonQueryParameters({ +class InternalQueryParameters { + InternalQueryParameters({ this.where, this.orderBy, this.limit, @@ -531,7 +898,7 @@ class PigeonQueryParameters { Map? filters; - Object encode() { + List _toList() { return [ where, orderBy, @@ -545,20 +912,48 @@ class PigeonQueryParameters { ]; } - static PigeonQueryParameters decode(Object result) { + Object encode() { + return _toList(); + } + + static InternalQueryParameters decode(Object result) { result as List; - return PigeonQueryParameters( + return InternalQueryParameters( where: (result[0] as List?)?.cast?>(), orderBy: (result[1] as List?)?.cast?>(), limit: result[2] as int?, limitToLast: result[3] as int?, - startAt: (result[4] as List?)?.cast(), - startAfter: (result[5] as List?)?.cast(), - endAt: (result[6] as List?)?.cast(), - endBefore: (result[7] as List?)?.cast(), + startAt: result[4] as List?, + startAfter: result[5] as List?, + endAt: result[6] as List?, + endBefore: result[7] as List?, filters: (result[8] as Map?)?.cast(), ); } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + bool operator ==(Object other) { + if (other is! InternalQueryParameters || other.runtimeType != runtimeType) { + return false; + } + if (identical(this, other)) { + return true; + } + return _deepEquals(where, other.where) && + _deepEquals(orderBy, other.orderBy) && + _deepEquals(limit, other.limit) && + _deepEquals(limitToLast, other.limitToLast) && + _deepEquals(startAt, other.startAt) && + _deepEquals(startAfter, other.startAfter) && + _deepEquals(endAt, other.endAt) && + _deepEquals(endBefore, other.endBefore) && + _deepEquals(filters, other.filters); + } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class AggregateQuery { @@ -571,20 +966,40 @@ class AggregateQuery { String? field; - Object encode() { + List _toList() { return [ - type.index, + type, field, ]; } + Object encode() { + return _toList(); + } + static AggregateQuery decode(Object result) { result as List; return AggregateQuery( - type: AggregateType.values[result[0]! as int], + type: result[0]! as AggregateType, field: result[1] as String?, ); } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + bool operator ==(Object other) { + if (other is! AggregateQuery || other.runtimeType != runtimeType) { + return false; + } + if (identical(this, other)) { + return true; + } + return _deepEquals(type, other.type) && _deepEquals(field, other.field); + } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class AggregateQueryResponse { @@ -600,73 +1015,125 @@ class AggregateQueryResponse { double? value; - Object encode() { + List _toList() { return [ - type.index, + type, field, value, ]; } + Object encode() { + return _toList(); + } + static AggregateQueryResponse decode(Object result) { result as List; return AggregateQueryResponse( - type: AggregateType.values[result[0]! as int], + type: result[0]! as AggregateType, field: result[1] as String?, value: result[2] as double?, ); } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + bool operator ==(Object other) { + if (other is! AggregateQueryResponse || other.runtimeType != runtimeType) { + return false; + } + if (identical(this, other)) { + return true; + } + return _deepEquals(type, other.type) && + _deepEquals(field, other.field) && + _deepEquals(value, other.value); + } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + int get hashCode => _deepHash([runtimeType, ..._toList()]); } -class _FirebaseFirestoreHostApiCodec extends FirestoreMessageCodec { - const _FirebaseFirestoreHostApiCodec(); +class PigeonCodec extends FirestoreMessageCodec { + const PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is AggregateQuery) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else if (value is AggregateQueryResponse) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is DocumentChangeType) { buffer.putUint8(129); - writeValue(buffer, value.encode()); - } else if (value is DocumentReferenceRequest) { + writeValue(buffer, value.index); + } else if (value is Source) { buffer.putUint8(130); - writeValue(buffer, value.encode()); - } else if (value is FirestorePigeonFirebaseApp) { + writeValue(buffer, value.index); + } else if (value is ListenSource) { buffer.putUint8(131); - writeValue(buffer, value.encode()); - } else if (value is PigeonDocumentChange) { + writeValue(buffer, value.index); + } else if (value is ServerTimestampBehavior) { buffer.putUint8(132); - writeValue(buffer, value.encode()); - } else if (value is PigeonDocumentOption) { + writeValue(buffer, value.index); + } else if (value is AggregateSource) { buffer.putUint8(133); - writeValue(buffer, value.encode()); - } else if (value is PigeonDocumentSnapshot) { + writeValue(buffer, value.index); + } else if (value is PersistenceCacheIndexManagerRequest) { buffer.putUint8(134); - writeValue(buffer, value.encode()); - } else if (value is PigeonFirebaseSettings) { + writeValue(buffer, value.index); + } else if (value is InternalTransactionResult) { buffer.putUint8(135); - writeValue(buffer, value.encode()); - } else if (value is PigeonGetOptions) { + writeValue(buffer, value.index); + } else if (value is InternalTransactionType) { buffer.putUint8(136); - writeValue(buffer, value.encode()); - } else if (value is PigeonPipelineResult) { + writeValue(buffer, value.index); + } else if (value is AggregateType) { buffer.putUint8(137); - writeValue(buffer, value.encode()); - } else if (value is PigeonPipelineSnapshot) { + writeValue(buffer, value.index); + } else if (value is InternalFirebaseSettings) { buffer.putUint8(138); writeValue(buffer, value.encode()); - } else if (value is PigeonQueryParameters) { + } else if (value is FirestorePigeonFirebaseApp) { buffer.putUint8(139); writeValue(buffer, value.encode()); - } else if (value is PigeonQuerySnapshot) { + } else if (value is InternalSnapshotMetadata) { buffer.putUint8(140); writeValue(buffer, value.encode()); - } else if (value is PigeonSnapshotMetadata) { + } else if (value is InternalDocumentSnapshot) { buffer.putUint8(141); writeValue(buffer, value.encode()); - } else if (value is PigeonTransactionCommand) { + } else if (value is InternalDocumentChange) { buffer.putUint8(142); writeValue(buffer, value.encode()); + } else if (value is InternalQuerySnapshot) { + buffer.putUint8(143); + writeValue(buffer, value.encode()); + } else if (value is InternalPipelineResult) { + buffer.putUint8(144); + writeValue(buffer, value.encode()); + } else if (value is InternalPipelineSnapshot) { + buffer.putUint8(145); + writeValue(buffer, value.encode()); + } else if (value is InternalGetOptions) { + buffer.putUint8(146); + writeValue(buffer, value.encode()); + } else if (value is InternalDocumentOption) { + buffer.putUint8(147); + writeValue(buffer, value.encode()); + } else if (value is InternalTransactionCommand) { + buffer.putUint8(148); + writeValue(buffer, value.encode()); + } else if (value is DocumentReferenceRequest) { + buffer.putUint8(149); + writeValue(buffer, value.encode()); + } else if (value is InternalQueryParameters) { + buffer.putUint8(150); + writeValue(buffer, value.encode()); + } else if (value is AggregateQuery) { + buffer.putUint8(151); + writeValue(buffer, value.encode()); + } else if (value is AggregateQueryResponse) { + buffer.putUint8(152); + writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); } @@ -675,36 +1142,65 @@ class _FirebaseFirestoreHostApiCodec extends FirestoreMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: - return AggregateQuery.decode(readValue(buffer)!); case 129: - return AggregateQueryResponse.decode(readValue(buffer)!); + final value = readValue(buffer) as int?; + return value == null ? null : DocumentChangeType.values[value]; case 130: - return DocumentReferenceRequest.decode(readValue(buffer)!); + final value = readValue(buffer) as int?; + return value == null ? null : Source.values[value]; case 131: - return FirestorePigeonFirebaseApp.decode(readValue(buffer)!); + final value = readValue(buffer) as int?; + return value == null ? null : ListenSource.values[value]; case 132: - return PigeonDocumentChange.decode(readValue(buffer)!); + final value = readValue(buffer) as int?; + return value == null ? null : ServerTimestampBehavior.values[value]; case 133: - return PigeonDocumentOption.decode(readValue(buffer)!); + final value = readValue(buffer) as int?; + return value == null ? null : AggregateSource.values[value]; case 134: - return PigeonDocumentSnapshot.decode(readValue(buffer)!); + final value = readValue(buffer) as int?; + return value == null + ? null + : PersistenceCacheIndexManagerRequest.values[value]; case 135: - return PigeonFirebaseSettings.decode(readValue(buffer)!); + final value = readValue(buffer) as int?; + return value == null ? null : InternalTransactionResult.values[value]; case 136: - return PigeonGetOptions.decode(readValue(buffer)!); + final value = readValue(buffer) as int?; + return value == null ? null : InternalTransactionType.values[value]; case 137: - return PigeonPipelineResult.decode(readValue(buffer)!); + final value = readValue(buffer) as int?; + return value == null ? null : AggregateType.values[value]; case 138: - return PigeonPipelineSnapshot.decode(readValue(buffer)!); + return InternalFirebaseSettings.decode(readValue(buffer)!); case 139: - return PigeonQueryParameters.decode(readValue(buffer)!); + return FirestorePigeonFirebaseApp.decode(readValue(buffer)!); case 140: - return PigeonQuerySnapshot.decode(readValue(buffer)!); + return InternalSnapshotMetadata.decode(readValue(buffer)!); case 141: - return PigeonSnapshotMetadata.decode(readValue(buffer)!); + return InternalDocumentSnapshot.decode(readValue(buffer)!); case 142: - return PigeonTransactionCommand.decode(readValue(buffer)!); + return InternalDocumentChange.decode(readValue(buffer)!); + case 143: + return InternalQuerySnapshot.decode(readValue(buffer)!); + case 144: + return InternalPipelineResult.decode(readValue(buffer)!); + case 145: + return InternalPipelineSnapshot.decode(readValue(buffer)!); + case 146: + return InternalGetOptions.decode(readValue(buffer)!); + case 147: + return InternalDocumentOption.decode(readValue(buffer)!); + case 148: + return InternalTransactionCommand.decode(readValue(buffer)!); + case 149: + return DocumentReferenceRequest.decode(readValue(buffer)!); + case 150: + return InternalQueryParameters.decode(readValue(buffer)!); + case 151: + return AggregateQuery.decode(readValue(buffer)!); + case 152: + return AggregateQueryResponse.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); } @@ -715,737 +1211,530 @@ class FirebaseFirestoreHostApi { /// Constructor for [FirebaseFirestoreHostApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - FirebaseFirestoreHostApi({BinaryMessenger? binaryMessenger}) - : _binaryMessenger = binaryMessenger; - final BinaryMessenger? _binaryMessenger; + FirebaseFirestoreHostApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + : pigeonVar_binaryMessenger = binaryMessenger, + pigeonVar_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final BinaryMessenger? pigeonVar_binaryMessenger; + + static const MessageCodec pigeonChannelCodec = PigeonCodec(); - static const MessageCodec codec = _FirebaseFirestoreHostApiCodec(); + final String pigeonVar_messageChannelSuffix; Future loadBundle( - FirestorePigeonFirebaseApp arg_app, - Uint8List arg_bundle, - ) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.loadBundle', - codec, - binaryMessenger: _binaryMessenger, - ); - final List? replyList = - await channel.send([arg_app, arg_bundle]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else if (replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (replyList[0] as String?)!; - } + FirestorePigeonFirebaseApp app, Uint8List bundle) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.loadBundle$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, bundle]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as String; } - Future namedQueryGet( - FirestorePigeonFirebaseApp arg_app, - String arg_name, - PigeonGetOptions arg_options, - ) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.namedQueryGet', - codec, - binaryMessenger: _binaryMessenger, - ); - final List? replyList = await channel - .send([arg_app, arg_name, arg_options]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else if (replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (replyList[0] as PigeonQuerySnapshot?)!; - } + Future namedQueryGet(FirestorePigeonFirebaseApp app, + String name, InternalGetOptions options) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.namedQueryGet$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, name, options]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as InternalQuerySnapshot; } - Future clearPersistence(FirestorePigeonFirebaseApp arg_app) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.clearPersistence', - codec, - binaryMessenger: _binaryMessenger, - ); - final List? replyList = - await channel.send([arg_app]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else { - return; - } + Future clearPersistence(FirestorePigeonFirebaseApp app) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.clearPersistence$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } - Future disableNetwork(FirestorePigeonFirebaseApp arg_app) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.disableNetwork', - codec, - binaryMessenger: _binaryMessenger, - ); - final List? replyList = - await channel.send([arg_app]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else { - return; - } + Future disableNetwork(FirestorePigeonFirebaseApp app) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.disableNetwork$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } - Future enableNetwork(FirestorePigeonFirebaseApp arg_app) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.enableNetwork', - codec, - binaryMessenger: _binaryMessenger, - ); - final List? replyList = - await channel.send([arg_app]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else { - return; - } + Future enableNetwork(FirestorePigeonFirebaseApp app) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.enableNetwork$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } - Future terminate(FirestorePigeonFirebaseApp arg_app) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.terminate', - codec, - binaryMessenger: _binaryMessenger, - ); - final List? replyList = - await channel.send([arg_app]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else { - return; - } + Future terminate(FirestorePigeonFirebaseApp app) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.terminate$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } - Future waitForPendingWrites(FirestorePigeonFirebaseApp arg_app) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.waitForPendingWrites', - codec, - binaryMessenger: _binaryMessenger, - ); - final List? replyList = - await channel.send([arg_app]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else { - return; - } + Future waitForPendingWrites(FirestorePigeonFirebaseApp app) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.waitForPendingWrites$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future setIndexConfiguration( - FirestorePigeonFirebaseApp arg_app, - String arg_indexConfiguration, - ) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.setIndexConfiguration', - codec, - binaryMessenger: _binaryMessenger, - ); - final List? replyList = await channel - .send([arg_app, arg_indexConfiguration]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else { - return; - } + FirestorePigeonFirebaseApp app, String indexConfiguration) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.setIndexConfiguration$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, indexConfiguration]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } - Future setLoggingEnabled(bool arg_loggingEnabled) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.setLoggingEnabled', - codec, - binaryMessenger: _binaryMessenger, - ); - final List? replyList = - await channel.send([arg_loggingEnabled]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else { - return; - } + Future setLoggingEnabled(bool loggingEnabled) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.setLoggingEnabled$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([loggingEnabled]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } - Future snapshotsInSyncSetup( - FirestorePigeonFirebaseApp arg_app, - ) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.snapshotsInSyncSetup', - codec, - binaryMessenger: _binaryMessenger, - ); - final List? replyList = - await channel.send([arg_app]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else if (replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (replyList[0] as String?)!; - } + Future snapshotsInSyncSetup(FirestorePigeonFirebaseApp app) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.snapshotsInSyncSetup$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as String; } Future transactionCreate( - FirestorePigeonFirebaseApp arg_app, - int arg_timeout, - int arg_maxAttempts, - ) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.transactionCreate', - codec, - binaryMessenger: _binaryMessenger, - ); - final List? replyList = - await channel.send([arg_app, arg_timeout, arg_maxAttempts]) - as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else if (replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (replyList[0] as String?)!; - } + FirestorePigeonFirebaseApp app, int timeout, int maxAttempts) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.transactionCreate$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, timeout, maxAttempts]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as String; } Future transactionStoreResult( - String arg_transactionId, - PigeonTransactionResult arg_resultType, - List? arg_commands, - ) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.transactionStoreResult', - codec, - binaryMessenger: _binaryMessenger, - ); - final List? replyList = await channel.send( - [arg_transactionId, arg_resultType.index, arg_commands], - ) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else { - return; - } + String transactionId, + InternalTransactionResult resultType, + List? commands) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.transactionStoreResult$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([transactionId, resultType, commands]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } - Future transactionGet( - FirestorePigeonFirebaseApp arg_app, - String arg_transactionId, - String arg_path, - ) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.transactionGet', - codec, - binaryMessenger: _binaryMessenger, - ); - final List? replyList = - await channel.send([arg_app, arg_transactionId, arg_path]) - as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else if (replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (replyList[0] as PigeonDocumentSnapshot?)!; - } + Future transactionGet( + FirestorePigeonFirebaseApp app, String transactionId, String path) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.transactionGet$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, transactionId, path]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as InternalDocumentSnapshot; } Future documentReferenceSet( - FirestorePigeonFirebaseApp arg_app, - DocumentReferenceRequest arg_request, - ) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceSet', - codec, - binaryMessenger: _binaryMessenger, - ); - final List? replyList = - await channel.send([arg_app, arg_request]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else { - return; - } + FirestorePigeonFirebaseApp app, DocumentReferenceRequest request) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceSet$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, request]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future documentReferenceUpdate( - FirestorePigeonFirebaseApp arg_app, - DocumentReferenceRequest arg_request, - ) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceUpdate', - codec, - binaryMessenger: _binaryMessenger, - ); - final List? replyList = - await channel.send([arg_app, arg_request]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else { - return; - } + FirestorePigeonFirebaseApp app, DocumentReferenceRequest request) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceUpdate$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, request]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } - Future documentReferenceGet( - FirestorePigeonFirebaseApp arg_app, - DocumentReferenceRequest arg_request, - ) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceGet', - codec, - binaryMessenger: _binaryMessenger, - ); - final List? replyList = - await channel.send([arg_app, arg_request]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else if (replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (replyList[0] as PigeonDocumentSnapshot?)!; - } + Future documentReferenceGet( + FirestorePigeonFirebaseApp app, DocumentReferenceRequest request) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceGet$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, request]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as InternalDocumentSnapshot; } Future documentReferenceDelete( - FirestorePigeonFirebaseApp arg_app, - DocumentReferenceRequest arg_request, - ) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceDelete', - codec, - binaryMessenger: _binaryMessenger, - ); - final List? replyList = - await channel.send([arg_app, arg_request]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else { - return; - } + FirestorePigeonFirebaseApp app, DocumentReferenceRequest request) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceDelete$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, request]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } - Future queryGet( - FirestorePigeonFirebaseApp arg_app, - String arg_path, - bool arg_isCollectionGroup, - PigeonQueryParameters arg_parameters, - PigeonGetOptions arg_options, - ) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.queryGet', - codec, - binaryMessenger: _binaryMessenger, - ); - final List? replyList = await channel.send([ - arg_app, - arg_path, - arg_isCollectionGroup, - arg_parameters, - arg_options, - ]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else if (replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (replyList[0] as PigeonQuerySnapshot?)!; - } + Future queryGet( + FirestorePigeonFirebaseApp app, + String path, + bool isCollectionGroup, + InternalQueryParameters parameters, + InternalGetOptions options) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.queryGet$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = pigeonVar_channel + .send([app, path, isCollectionGroup, parameters, options]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as InternalQuerySnapshot; } Future> aggregateQuery( - FirestorePigeonFirebaseApp arg_app, - String arg_path, - PigeonQueryParameters arg_parameters, - AggregateSource arg_source, - List arg_queries, - bool arg_isCollectionGroup, - ) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.aggregateQuery', - codec, - binaryMessenger: _binaryMessenger, - ); - final List? replyList = await channel.send([ - arg_app, - arg_path, - arg_parameters, - arg_source.index, - arg_queries, - arg_isCollectionGroup, - ]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else if (replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (replyList[0] as List?)!.cast(); - } + FirestorePigeonFirebaseApp app, + String path, + InternalQueryParameters parameters, + AggregateSource source, + List queries, + bool isCollectionGroup) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.aggregateQuery$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = pigeonVar_channel.send( + [app, path, parameters, source, queries, isCollectionGroup]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return (pigeonVar_replyValue! as List) + .cast(); } - Future writeBatchCommit( - FirestorePigeonFirebaseApp arg_app, - List arg_writes, - ) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.writeBatchCommit', - codec, - binaryMessenger: _binaryMessenger, - ); - final List? replyList = - await channel.send([arg_app, arg_writes]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else { - return; - } + Future writeBatchCommit(FirestorePigeonFirebaseApp app, + List writes) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.writeBatchCommit$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, writes]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future querySnapshot( - FirestorePigeonFirebaseApp arg_app, - String arg_path, - bool arg_isCollectionGroup, - PigeonQueryParameters arg_parameters, - PigeonGetOptions arg_options, - bool arg_includeMetadataChanges, - ListenSource arg_source, - ) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.querySnapshot', - codec, - binaryMessenger: _binaryMessenger, - ); - final List? replyList = await channel.send([ - arg_app, - arg_path, - arg_isCollectionGroup, - arg_parameters, - arg_options, - arg_includeMetadataChanges, - arg_source.index, - ]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else if (replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (replyList[0] as String?)!; - } + FirestorePigeonFirebaseApp app, + String path, + bool isCollectionGroup, + InternalQueryParameters parameters, + InternalGetOptions options, + bool includeMetadataChanges, + ListenSource source) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.querySnapshot$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([ + app, + path, + isCollectionGroup, + parameters, + options, + includeMetadataChanges, + source + ]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as String; } Future documentReferenceSnapshot( - FirestorePigeonFirebaseApp arg_app, - DocumentReferenceRequest arg_parameters, - bool arg_includeMetadataChanges, - ListenSource arg_source, - ) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceSnapshot', - codec, - binaryMessenger: _binaryMessenger, - ); - final List? replyList = await channel.send([ - arg_app, - arg_parameters, - arg_includeMetadataChanges, - arg_source.index, - ]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else if (replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (replyList[0] as String?)!; - } + FirestorePigeonFirebaseApp app, + DocumentReferenceRequest parameters, + bool includeMetadataChanges, + ListenSource source) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceSnapshot$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = pigeonVar_channel + .send([app, parameters, includeMetadataChanges, source]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as String; } Future persistenceCacheIndexManagerRequest( - FirestorePigeonFirebaseApp arg_app, - PersistenceCacheIndexManagerRequest arg_request, - ) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.persistenceCacheIndexManagerRequest', - codec, - binaryMessenger: _binaryMessenger, - ); - final List? replyList = await channel - .send([arg_app, arg_request.index]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else { - return; - } + FirestorePigeonFirebaseApp app, + PersistenceCacheIndexManagerRequest request) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.persistenceCacheIndexManagerRequest$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, request]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } - Future executePipeline( - FirestorePigeonFirebaseApp arg_app, - List?> arg_stages, - Map? arg_options, - ) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.executePipeline', - codec, - binaryMessenger: _binaryMessenger, - ); - final List? replyList = await channel - .send([arg_app, arg_stages, arg_options]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else if (replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (replyList[0] as PigeonPipelineSnapshot?)!; - } + Future executePipeline( + FirestorePigeonFirebaseApp app, + List?> stages, + Map? options) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.executePipeline$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, stages, options]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as InternalPipelineSnapshot; } } diff --git a/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/platform_interface/platform_interface_document_snapshot.dart b/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/platform_interface/platform_interface_document_snapshot.dart index 05f7ada727e8..3fce79a77f10 100644 --- a/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/platform_interface/platform_interface_document_snapshot.dart +++ b/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/platform_interface/platform_interface_document_snapshot.dart @@ -38,7 +38,7 @@ class DocumentSnapshotPlatform extends PlatformInterface { final Map? _data; - final PigeonSnapshotMetadata _metadata; + final InternalSnapshotMetadata _metadata; /// The database ID of the snapshot's document. String get id => _pointer.id; diff --git a/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/platform_interface/platform_interface_transaction.dart b/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/platform_interface/platform_interface_transaction.dart index e6648db2aea2..64ae9fef837e 100644 --- a/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/platform_interface/platform_interface_transaction.dart +++ b/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/platform_interface/platform_interface_transaction.dart @@ -31,7 +31,7 @@ abstract class TransactionPlatform extends PlatformInterface { } /// Returns all transaction commands for the current instance. - List get commands { + List get commands { throw UnimplementedError('commands is not implemented'); } diff --git a/packages/cloud_firestore/cloud_firestore_platform_interface/pigeons/generate_pigeon.sh b/packages/cloud_firestore/cloud_firestore_platform_interface/pigeons/generate_pigeon.sh index e8950e42ef53..0bf9dabad9d7 100755 --- a/packages/cloud_firestore/cloud_firestore_platform_interface/pigeons/generate_pigeon.sh +++ b/packages/cloud_firestore/cloud_firestore_platform_interface/pigeons/generate_pigeon.sh @@ -1,4 +1,5 @@ # Objective of this script is to fix some files generated by Pigeon because Pigeon does not support Custom Codecs. +# These transformations are tuned for Pigeon 26.x. If you bump Pigeon, re-verify every sed/perl below. echo "Generate Pigeon Files." (cd .. && dart run pigeon --input ./pigeons/messages.dart) @@ -9,8 +10,13 @@ echo "Formatting complete." # # Fix Java files FILE_NAME="../../cloud_firestore/android/src/main/java/io/flutter/plugins/firebase/firestore/GeneratedAndroidFirebaseFirestore.java" +# Expose toList() so plugin code can serialize generated classes outside of the pigeon codec. sed -i '' 's/ArrayList toList() {/public ArrayList toList() {/' "$FILE_NAME" -sed -i '' 's/private static class FirebaseFirestoreHostApiCodec extends StandardMessageCodec {/private static class FirebaseFirestoreHostApiCodec extends FlutterFirebaseFirestoreMessageCodec {/' "$FILE_NAME" +# Pigeon 26 emits a single `PigeonCodec` per file (was `FirebaseFirestoreHostApiCodec` in older versions). +# Swap its base class to the custom Firestore codec so Firestore types are encoded/decoded, and +# expose it publicly so the plugin can reuse it on EventChannel/MethodChannel instances (those +# must serialize Pigeon-generated types like `InternalDocumentSnapshot` emitted via stream handlers). +sed -i '' 's/private static class PigeonCodec extends StandardMessageCodec {/public static class PigeonCodec extends FlutterFirebaseFirestoreMessageCodec {/' "$FILE_NAME" echo "Android modification complete." @@ -20,15 +26,20 @@ sed -i '' '/#import "FirestoreMessages.g.h"/a\ #import "FLTFirebaseFirestoreReader.h"\ #import "FLTFirebaseFirestoreWriter.h" ' $FILE_NAME -sed -i '' 's/pigeonResult.newIndex = newIndex;/pigeonResult.index = newIndex;/' $FILE_NAME -sed -i '' -e 's/pigeonResult.newIndex = GetNullableObjectAtIndex(list, 3);/pigeonResult.index = GetNullableObjectAtIndex(list, 3);/' -e 's/NSAssert(pigeonResult.newIndex != nil, @"");/NSAssert(pigeonResult.index != nil, @"");/' $FILE_NAME -sed -i '' 's/(self\.newIndex \?: \[NSNull null\]),/(self.index ?: [NSNull null]),/' $FILE_NAME +# Pigeon 26 generates ObjC codec classes with a `nullPigeonCodec*` prefix when no +# ObjcOptions prefix is configured. Rename them to stable, readable names first. +sed -i '' 's/nullFirestoreMessagesPigeonCodecReaderWriter/FirebaseFirestoreHostApiCodecReaderWriter/g' $FILE_NAME +sed -i '' 's/nullFirestoreMessagesPigeonCodecReader/FirebaseFirestoreHostApiCodecReader/g' $FILE_NAME +sed -i '' 's/nullFirestoreMessagesPigeonCodecWriter/FirebaseFirestoreHostApiCodecWriter/g' $FILE_NAME +# Rename the public codec getter from `nullGetFirestoreMessagesCodec` so the plugin can reuse +# it on EventChannels without an awkward `null` prefix. +sed -i '' 's/nullGetFirestoreMessagesCodec/GetFirebaseFirestoreHostApiCodec/g' $FILE_NAME +sed -i '' 's/nullGetFirestoreMessagesCodec/GetFirebaseFirestoreHostApiCodec/g' ../../cloud_firestore/ios/cloud_firestore/Sources/cloud_firestore/include/cloud_firestore/Public/FirestoreMessages.g.h +# Reparent the reader/writer onto our custom Firestore reader/writer so Firestore-specific +# types (Timestamp, GeoPoint, FieldValue, DocumentReference, FieldPath, ...) round-trip. sed -i '' 's/@interface FirebaseFirestoreHostApiCodecReader : FlutterStandardReader/@interface FirebaseFirestoreHostApiCodecReader : FLTFirebaseFirestoreReader/' $FILE_NAME sed -i '' 's/@interface FirebaseFirestoreHostApiCodecWriter : FlutterStandardWriter/@interface FirebaseFirestoreHostApiCodecWriter : FLTFirebaseFirestoreWriter/' $FILE_NAME -FILE_NAME="../../cloud_firestore/ios/cloud_firestore/Sources/cloud_firestore/include/cloud_firestore/Public/FirestoreMessages.g.h" -sed -i '' 's/@property(nonatomic, strong) NSNumber \*newIndex;/@property(nonatomic, strong) NSNumber \*index;/' $FILE_NAME - echo "iOS modification complete." # Fix Windows files @@ -36,25 +47,49 @@ FILE_NAME="../../cloud_firestore/windows/messages.g.h" sed -i '' '/#include /a\ #include "firestore_codec.h" ' $FILE_NAME -perl -i -0777 -pe 's|private:\n(\s+static PigeonSnapshotMetadata FromEncodableList\(\n\s+const flutter::EncodableList& list\);\n\s+flutter::EncodableList ToEncodableList\(\) const;)|\1\n\n private:|gs' $FILE_NAME -perl -0777 -i -pe 's/private:\n(\x20{2}static PigeonDocumentSnapshot FromEncodableList\(\n\x20{6}const flutter::EncodableList& list\);\n\x20{2}flutter::EncodableList ToEncodableList\(\) const;)/\1\n\n private:/gs' $FILE_NAME -perl -0777 -i -pe 's/private:\n(\x20{2}static PigeonDocumentChange FromEncodableList\(\n\x20{6}const flutter::EncodableList& list\);\n\x20{2}flutter::EncodableList ToEncodableList\(\) const;)/\1\n\n private:/gs' $FILE_NAME +# Make FromEncodableList / ToEncodableList accessible from plugin code (they're used directly +# to serialize stream events). Pigeon 26 qualifies EncodableList with a leading `::`, hence the +# `::flutter::EncodableList` pattern below. +perl -i -0777 -pe 's|private:\n(\s+static InternalSnapshotMetadata FromEncodableList\(\n\s+const ::flutter::EncodableList& list\);\n\s+::flutter::EncodableList ToEncodableList\(\) const;)|\1\n\n private:|gs' $FILE_NAME +perl -0777 -i -pe 's/private:\n(\x20{2}static InternalDocumentSnapshot FromEncodableList\(\n\x20{6}const ::flutter::EncodableList& list\);\n\x20{2}::flutter::EncodableList ToEncodableList\(\) const;)/\1\n\n private:/gs' $FILE_NAME +perl -0777 -i -pe 's/private:\n(\x20{2}static InternalDocumentChange FromEncodableList\(\n\x20{6}const ::flutter::EncodableList& list\);\n\x20{2}::flutter::EncodableList ToEncodableList\(\) const;)/\1\n\n private:/gs' $FILE_NAME -sed -i '' 's/: public flutter::StandardCodecSerializer {/: public cloud_firestore_windows::FirestoreCodec {/' $FILE_NAME +# Pigeon 26 renamed the generated C++ codec class to `PigeonInternalCodecSerializer`. The Windows +# plugin code historically references `FirebaseFirestoreHostApiCodecSerializer`, so keep that +# stable name and reparent the class onto our custom Firestore codec. +sed -i '' 's/PigeonInternalCodecSerializer/FirebaseFirestoreHostApiCodecSerializer/g' $FILE_NAME +sed -i '' 's|: public ::flutter::StandardCodecSerializer {|: public cloud_firestore_windows::FirestoreCodec {|' $FILE_NAME FILE_NAME="../../cloud_firestore/windows/messages.g.cpp" -sed -i '' 's/flutter::StandardCodecSerializer::WriteValue(value, stream);/cloud_firestore_windows::FirestoreCodec::WriteValue(value, stream);/' $FILE_NAME -sed -i '' 's/return flutter::StandardCodecSerializer::ReadValueOfType(type, stream);/return cloud_firestore_windows::FirestoreCodec::ReadValueOfType(type, stream);/' $FILE_NAME +sed -i '' 's/PigeonInternalCodecSerializer/FirebaseFirestoreHostApiCodecSerializer/g' $FILE_NAME +sed -i '' 's|::flutter::StandardCodecSerializer::WriteValue(value, stream)|::cloud_firestore_windows::FirestoreCodec::WriteValue(value, stream)|' $FILE_NAME +sed -i '' 's|::flutter::StandardCodecSerializer::ReadValueOfType(type, stream)|::cloud_firestore_windows::FirestoreCodec::ReadValueOfType(type, stream)|' $FILE_NAME + +# Pigeon 26 no longer auto-renames a C++ enum whose identifier collides with a method in the same +# scope. The `PersistenceCacheIndexManagerRequest` enum collides with the host API method of the +# same name, which fails to compile on MSVC. Rename every *usage* of the enum type (but keep the +# method name intact) by first renaming the identifier globally and then restoring call/method +# sites that are followed by `(`. +for FILE_NAME in "../../cloud_firestore/windows/messages.g.h" "../../cloud_firestore/windows/messages.g.cpp"; do + sed -i '' 's/PersistenceCacheIndexManagerRequest/PersistenceCacheIndexManagerRequestEnum/g' $FILE_NAME + sed -i '' 's/PersistenceCacheIndexManagerRequestEnum(/PersistenceCacheIndexManagerRequest(/g' $FILE_NAME +done echo "Windows modification complete." # Fix Dart files FILE_NAME="../lib/src/pigeon/messages.pigeon.dart" -sed -i '' '/import '\''package:flutter\/foundation\.dart'\'' show ReadBuffer, WriteBuffer;/i\ +# Pigeon 26 no longer imports flutter/foundation.dart, so anchor on flutter/services.dart instead. +sed -i '' '/import '\''package:flutter\/services\.dart'\'';/i\ import '\''package:cloud_firestore_platform_interface/src/method_channel/utils/firestore_message_codec.dart'\''; ' $FILE_NAME -sed -i '' 's/class _FirebaseFirestoreHostApiCodec extends StandardMessageCodec {/class _FirebaseFirestoreHostApiCodec extends FirestoreMessageCodec {/' $FILE_NAME -(cd .. && dart fix --apply > /dev/null) +# Pigeon 26 renamed the private codec to `_PigeonCodec`. Swap its base class to our custom one +# and expose it publicly (as `PigeonCodec`) so the plugin's EventChannels can reuse it to decode +# Pigeon-generated types like `InternalDocumentSnapshot` emitted via stream handlers. +sed -i '' 's/class _PigeonCodec extends StandardMessageCodec {/class PigeonCodec extends FirestoreMessageCodec {/' $FILE_NAME +sed -i '' 's/const _PigeonCodec();/const PigeonCodec();/' $FILE_NAME +sed -i '' 's/pigeonChannelCodec = _PigeonCodec();/pigeonChannelCodec = PigeonCodec();/' $FILE_NAME +(cd .. && dart fix --apply > /dev/null) FILE_NAME="../test/pigeon/test_api.dart" sed -i '' -E 's/import '\''dart:typed_data'\'' show Float64List, Int32List, Int64List, Uint8List;/import '\''dart:typed_data'\'' show Uint8List;/' $FILE_NAME diff --git a/packages/cloud_firestore/cloud_firestore_platform_interface/pigeons/messages.dart b/packages/cloud_firestore/cloud_firestore_platform_interface/pigeons/messages.dart index a84c58f7af56..27a61ef98f0d 100644 --- a/packages/cloud_firestore/cloud_firestore_platform_interface/pigeons/messages.dart +++ b/packages/cloud_firestore/cloud_firestore_platform_interface/pigeons/messages.dart @@ -26,8 +26,8 @@ import 'package:pigeon/pigeon.dart'; copyrightHeader: 'pigeons/copyright.txt', ), ) -class PigeonFirebaseSettings { - const PigeonFirebaseSettings({ +class InternalFirebaseSettings { + const InternalFirebaseSettings({ required this.persistenceEnabled, required this.host, required this.sslEnabled, @@ -52,12 +52,12 @@ class FirestorePigeonFirebaseApp { }); final String appName; - final PigeonFirebaseSettings settings; + final InternalFirebaseSettings settings; final String databaseURL; } -class PigeonSnapshotMetadata { - const PigeonSnapshotMetadata({ +class InternalSnapshotMetadata { + const InternalSnapshotMetadata({ required this.hasPendingWrites, required this.isFromCache, }); @@ -66,8 +66,8 @@ class PigeonSnapshotMetadata { final bool isFromCache; } -class PigeonDocumentSnapshot { - const PigeonDocumentSnapshot({ +class InternalDocumentSnapshot { + const InternalDocumentSnapshot({ required this.path, required this.data, required this.metadata, @@ -75,7 +75,7 @@ class PigeonDocumentSnapshot { final String path; final Map? data; - final PigeonSnapshotMetadata metadata; + final InternalSnapshotMetadata metadata; } /// An enumeration of document change types. @@ -92,8 +92,8 @@ enum DocumentChangeType { removed, } -class PigeonDocumentChange { - const PigeonDocumentChange({ +class InternalDocumentChange { + const InternalDocumentChange({ required this.type, required this.document, required this.oldIndex, @@ -101,25 +101,25 @@ class PigeonDocumentChange { }); final DocumentChangeType type; - final PigeonDocumentSnapshot document; + final InternalDocumentSnapshot document; final int oldIndex; final int newIndex; } -class PigeonQuerySnapshot { - const PigeonQuerySnapshot({ +class InternalQuerySnapshot { + const InternalQuerySnapshot({ required this.documents, required this.documentChanges, required this.metadata, }); - final List documents; - final List documentChanges; - final PigeonSnapshotMetadata metadata; + final List documents; + final List documentChanges; + final InternalSnapshotMetadata metadata; } -class PigeonPipelineResult { - const PigeonPipelineResult({ +class InternalPipelineResult { + const InternalPipelineResult({ this.documentPath, this.createTime, this.updateTime, @@ -133,13 +133,13 @@ class PigeonPipelineResult { final Map? data; } -class PigeonPipelineSnapshot { - const PigeonPipelineSnapshot({ +class InternalPipelineSnapshot { + const InternalPipelineSnapshot({ required this.results, required this.executionTime, }); - final List results; + final List results; final int executionTime; // Timestamp in milliseconds since epoch } @@ -203,8 +203,8 @@ enum PersistenceCacheIndexManagerRequest { deleteAllIndexes } -class PigeonGetOptions { - const PigeonGetOptions({ +class InternalGetOptions { + const InternalGetOptions({ required this.source, required this.serverTimestampBehavior, }); @@ -213,12 +213,12 @@ class PigeonGetOptions { final ServerTimestampBehavior serverTimestampBehavior; } -enum PigeonTransactionResult { +enum InternalTransactionResult { success, failure, } -enum PigeonTransactionType { +enum InternalTransactionType { get, update, set, @@ -226,8 +226,8 @@ enum PigeonTransactionType { deleteType, } -class PigeonDocumentOption { - const PigeonDocumentOption({ +class InternalDocumentOption { + const InternalDocumentOption({ required this.merge, required this.mergeFields, }); @@ -236,18 +236,18 @@ class PigeonDocumentOption { final List?>? mergeFields; } -class PigeonTransactionCommand { - const PigeonTransactionCommand({ +class InternalTransactionCommand { + const InternalTransactionCommand({ required this.type, required this.path, required this.data, this.option, }); - final PigeonTransactionType type; + final InternalTransactionType type; final String path; final Map? data; - final PigeonDocumentOption? option; + final InternalDocumentOption? option; } class DocumentReferenceRequest { @@ -260,13 +260,13 @@ class DocumentReferenceRequest { }); final String path; final Map? data; - final PigeonDocumentOption? option; + final InternalDocumentOption? option; final Source? source; final ServerTimestampBehavior? serverTimestampBehavior; } -class PigeonQueryParameters { - const PigeonQueryParameters({ +class InternalQueryParameters { + const InternalQueryParameters({ this.where, this.orderBy, this.limit, @@ -326,10 +326,10 @@ abstract class FirebaseFirestoreHostApi { ); @async - PigeonQuerySnapshot namedQueryGet( + InternalQuerySnapshot namedQueryGet( FirestorePigeonFirebaseApp app, String name, - PigeonGetOptions options, + InternalGetOptions options, ); @async @@ -383,12 +383,12 @@ abstract class FirebaseFirestoreHostApi { @async void transactionStoreResult( String transactionId, - PigeonTransactionResult resultType, - List? commands, + InternalTransactionResult resultType, + List? commands, ); @async - PigeonDocumentSnapshot transactionGet( + InternalDocumentSnapshot transactionGet( FirestorePigeonFirebaseApp app, String transactionId, String path, @@ -407,7 +407,7 @@ abstract class FirebaseFirestoreHostApi { ); @async - PigeonDocumentSnapshot documentReferenceGet( + InternalDocumentSnapshot documentReferenceGet( FirestorePigeonFirebaseApp app, DocumentReferenceRequest request, ); @@ -419,19 +419,19 @@ abstract class FirebaseFirestoreHostApi { ); @async - PigeonQuerySnapshot queryGet( + InternalQuerySnapshot queryGet( FirestorePigeonFirebaseApp app, String path, bool isCollectionGroup, - PigeonQueryParameters parameters, - PigeonGetOptions options, + InternalQueryParameters parameters, + InternalGetOptions options, ); @async List aggregateQuery( FirestorePigeonFirebaseApp app, String path, - PigeonQueryParameters parameters, + InternalQueryParameters parameters, AggregateSource source, List queries, bool isCollectionGroup, @@ -440,7 +440,7 @@ abstract class FirebaseFirestoreHostApi { @async void writeBatchCommit( FirestorePigeonFirebaseApp app, - List writes, + List writes, ); @async @@ -448,8 +448,8 @@ abstract class FirebaseFirestoreHostApi { FirestorePigeonFirebaseApp app, String path, bool isCollectionGroup, - PigeonQueryParameters parameters, - PigeonGetOptions options, + InternalQueryParameters parameters, + InternalGetOptions options, bool includeMetadataChanges, ListenSource source, ); @@ -469,7 +469,7 @@ abstract class FirebaseFirestoreHostApi { ); @async - PigeonPipelineSnapshot executePipeline( + InternalPipelineSnapshot executePipeline( FirestorePigeonFirebaseApp app, List?> stages, Map? options, diff --git a/packages/cloud_firestore/cloud_firestore_platform_interface/pubspec.yaml b/packages/cloud_firestore/cloud_firestore_platform_interface/pubspec.yaml index 72dd614e2e7c..c73118f38741 100644 --- a/packages/cloud_firestore/cloud_firestore_platform_interface/pubspec.yaml +++ b/packages/cloud_firestore/cloud_firestore_platform_interface/pubspec.yaml @@ -22,7 +22,7 @@ dev_dependencies: flutter_test: sdk: flutter mockito: ^5.0.0 - pigeon: 11.0.1 + pigeon: 26.3.4 watcher: ^1.1.0 dependency_overrides: diff --git a/packages/cloud_firestore/cloud_firestore_platform_interface/test/pigeon/test_api.dart b/packages/cloud_firestore/cloud_firestore_platform_interface/test/pigeon/test_api.dart index e9ed58eafc5c..726d510a1f69 100644 --- a/packages/cloud_firestore/cloud_firestore_platform_interface/test/pigeon/test_api.dart +++ b/packages/cloud_firestore/cloud_firestore_platform_interface/test/pigeon/test_api.dart @@ -1,9 +1,9 @@ // Copyright 2023, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v11.0.1), do not edit directly. +// Autogenerated from Pigeon (v26.3.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, unnecessary_import +// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, unnecessary_import, no_leading_underscores_for_local_identifiers, omit_obvious_local_variable_types // ignore_for_file: avoid_relative_lib_imports import 'dart:async'; import 'dart:typed_data' show Uint8List; @@ -13,55 +13,85 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:cloud_firestore_platform_interface/src/pigeon/messages.pigeon.dart'; -class _TestFirebaseFirestoreHostApiCodec extends StandardMessageCodec { - const _TestFirebaseFirestoreHostApiCodec(); +class _PigeonCodec extends StandardMessageCodec { + const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is AggregateQuery) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else if (value is AggregateQueryResponse) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is DocumentChangeType) { buffer.putUint8(129); - writeValue(buffer, value.encode()); - } else if (value is DocumentReferenceRequest) { + writeValue(buffer, value.index); + } else if (value is Source) { buffer.putUint8(130); - writeValue(buffer, value.encode()); - } else if (value is FirestorePigeonFirebaseApp) { + writeValue(buffer, value.index); + } else if (value is ListenSource) { buffer.putUint8(131); - writeValue(buffer, value.encode()); - } else if (value is PigeonDocumentChange) { + writeValue(buffer, value.index); + } else if (value is ServerTimestampBehavior) { buffer.putUint8(132); - writeValue(buffer, value.encode()); - } else if (value is PigeonDocumentOption) { + writeValue(buffer, value.index); + } else if (value is AggregateSource) { buffer.putUint8(133); - writeValue(buffer, value.encode()); - } else if (value is PigeonDocumentSnapshot) { + writeValue(buffer, value.index); + } else if (value is PersistenceCacheIndexManagerRequest) { buffer.putUint8(134); - writeValue(buffer, value.encode()); - } else if (value is PigeonFirebaseSettings) { + writeValue(buffer, value.index); + } else if (value is InternalTransactionResult) { buffer.putUint8(135); - writeValue(buffer, value.encode()); - } else if (value is PigeonGetOptions) { + writeValue(buffer, value.index); + } else if (value is InternalTransactionType) { buffer.putUint8(136); - writeValue(buffer, value.encode()); - } else if (value is PigeonPipelineResult) { + writeValue(buffer, value.index); + } else if (value is AggregateType) { buffer.putUint8(137); - writeValue(buffer, value.encode()); - } else if (value is PigeonPipelineSnapshot) { + writeValue(buffer, value.index); + } else if (value is InternalFirebaseSettings) { buffer.putUint8(138); writeValue(buffer, value.encode()); - } else if (value is PigeonQueryParameters) { + } else if (value is FirestorePigeonFirebaseApp) { buffer.putUint8(139); writeValue(buffer, value.encode()); - } else if (value is PigeonQuerySnapshot) { + } else if (value is InternalSnapshotMetadata) { buffer.putUint8(140); writeValue(buffer, value.encode()); - } else if (value is PigeonSnapshotMetadata) { + } else if (value is InternalDocumentSnapshot) { buffer.putUint8(141); writeValue(buffer, value.encode()); - } else if (value is PigeonTransactionCommand) { + } else if (value is InternalDocumentChange) { buffer.putUint8(142); writeValue(buffer, value.encode()); + } else if (value is InternalQuerySnapshot) { + buffer.putUint8(143); + writeValue(buffer, value.encode()); + } else if (value is InternalPipelineResult) { + buffer.putUint8(144); + writeValue(buffer, value.encode()); + } else if (value is InternalPipelineSnapshot) { + buffer.putUint8(145); + writeValue(buffer, value.encode()); + } else if (value is InternalGetOptions) { + buffer.putUint8(146); + writeValue(buffer, value.encode()); + } else if (value is InternalDocumentOption) { + buffer.putUint8(147); + writeValue(buffer, value.encode()); + } else if (value is InternalTransactionCommand) { + buffer.putUint8(148); + writeValue(buffer, value.encode()); + } else if (value is DocumentReferenceRequest) { + buffer.putUint8(149); + writeValue(buffer, value.encode()); + } else if (value is InternalQueryParameters) { + buffer.putUint8(150); + writeValue(buffer, value.encode()); + } else if (value is AggregateQuery) { + buffer.putUint8(151); + writeValue(buffer, value.encode()); + } else if (value is AggregateQueryResponse) { + buffer.putUint8(152); + writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); } @@ -70,36 +100,65 @@ class _TestFirebaseFirestoreHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: - return AggregateQuery.decode(readValue(buffer)!); case 129: - return AggregateQueryResponse.decode(readValue(buffer)!); + final value = readValue(buffer) as int?; + return value == null ? null : DocumentChangeType.values[value]; case 130: - return DocumentReferenceRequest.decode(readValue(buffer)!); + final value = readValue(buffer) as int?; + return value == null ? null : Source.values[value]; case 131: - return FirestorePigeonFirebaseApp.decode(readValue(buffer)!); + final value = readValue(buffer) as int?; + return value == null ? null : ListenSource.values[value]; case 132: - return PigeonDocumentChange.decode(readValue(buffer)!); + final value = readValue(buffer) as int?; + return value == null ? null : ServerTimestampBehavior.values[value]; case 133: - return PigeonDocumentOption.decode(readValue(buffer)!); + final value = readValue(buffer) as int?; + return value == null ? null : AggregateSource.values[value]; case 134: - return PigeonDocumentSnapshot.decode(readValue(buffer)!); + final value = readValue(buffer) as int?; + return value == null + ? null + : PersistenceCacheIndexManagerRequest.values[value]; case 135: - return PigeonFirebaseSettings.decode(readValue(buffer)!); + final value = readValue(buffer) as int?; + return value == null ? null : InternalTransactionResult.values[value]; case 136: - return PigeonGetOptions.decode(readValue(buffer)!); + final value = readValue(buffer) as int?; + return value == null ? null : InternalTransactionType.values[value]; case 137: - return PigeonPipelineResult.decode(readValue(buffer)!); + final value = readValue(buffer) as int?; + return value == null ? null : AggregateType.values[value]; case 138: - return PigeonPipelineSnapshot.decode(readValue(buffer)!); + return InternalFirebaseSettings.decode(readValue(buffer)!); case 139: - return PigeonQueryParameters.decode(readValue(buffer)!); + return FirestorePigeonFirebaseApp.decode(readValue(buffer)!); case 140: - return PigeonQuerySnapshot.decode(readValue(buffer)!); + return InternalSnapshotMetadata.decode(readValue(buffer)!); case 141: - return PigeonSnapshotMetadata.decode(readValue(buffer)!); + return InternalDocumentSnapshot.decode(readValue(buffer)!); case 142: - return PigeonTransactionCommand.decode(readValue(buffer)!); + return InternalDocumentChange.decode(readValue(buffer)!); + case 143: + return InternalQuerySnapshot.decode(readValue(buffer)!); + case 144: + return InternalPipelineResult.decode(readValue(buffer)!); + case 145: + return InternalPipelineSnapshot.decode(readValue(buffer)!); + case 146: + return InternalGetOptions.decode(readValue(buffer)!); + case 147: + return InternalDocumentOption.decode(readValue(buffer)!); + case 148: + return InternalTransactionCommand.decode(readValue(buffer)!); + case 149: + return DocumentReferenceRequest.decode(readValue(buffer)!); + case 150: + return InternalQueryParameters.decode(readValue(buffer)!); + case 151: + return AggregateQuery.decode(readValue(buffer)!); + case 152: + return AggregateQueryResponse.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); } @@ -109,15 +168,14 @@ class _TestFirebaseFirestoreHostApiCodec extends StandardMessageCodec { abstract class TestFirebaseFirestoreHostApi { static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec codec = - _TestFirebaseFirestoreHostApiCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); Future loadBundle(FirestorePigeonFirebaseApp app, Uint8List bundle); - Future namedQueryGet( + Future namedQueryGet( FirestorePigeonFirebaseApp app, String name, - PigeonGetOptions options, + InternalGetOptions options, ); Future clearPersistence(FirestorePigeonFirebaseApp app); @@ -147,11 +205,11 @@ abstract class TestFirebaseFirestoreHostApi { Future transactionStoreResult( String transactionId, - PigeonTransactionResult resultType, - List? commands, + InternalTransactionResult resultType, + List? commands, ); - Future transactionGet( + Future transactionGet( FirestorePigeonFirebaseApp app, String transactionId, String path, @@ -167,7 +225,7 @@ abstract class TestFirebaseFirestoreHostApi { DocumentReferenceRequest request, ); - Future documentReferenceGet( + Future documentReferenceGet( FirestorePigeonFirebaseApp app, DocumentReferenceRequest request, ); @@ -177,18 +235,18 @@ abstract class TestFirebaseFirestoreHostApi { DocumentReferenceRequest request, ); - Future queryGet( + Future queryGet( FirestorePigeonFirebaseApp app, String path, bool isCollectionGroup, - PigeonQueryParameters parameters, - PigeonGetOptions options, + InternalQueryParameters parameters, + InternalGetOptions options, ); Future> aggregateQuery( FirestorePigeonFirebaseApp app, String path, - PigeonQueryParameters parameters, + InternalQueryParameters parameters, AggregateSource source, List queries, bool isCollectionGroup, @@ -196,15 +254,15 @@ abstract class TestFirebaseFirestoreHostApi { Future writeBatchCommit( FirestorePigeonFirebaseApp app, - List writes, + List writes, ); Future querySnapshot( FirestorePigeonFirebaseApp app, String path, bool isCollectionGroup, - PigeonQueryParameters parameters, - PigeonGetOptions options, + InternalQueryParameters parameters, + InternalGetOptions options, bool includeMetadataChanges, ListenSource source, ); @@ -221,938 +279,800 @@ abstract class TestFirebaseFirestoreHostApi { PersistenceCacheIndexManagerRequest request, ); - Future executePipeline( + Future executePipeline( FirestorePigeonFirebaseApp app, List?> stages, Map? options, ); - static void setup( + static void setUp( TestFirebaseFirestoreHostApi? api, { BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.loadBundle', - codec, + final pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.loadBundle$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger, ); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.loadBundle was null.', - ); - final List args = (message as List?)!; - final FirestorePigeonFirebaseApp? arg_app = - (args[0] as FirestorePigeonFirebaseApp?); - assert( - arg_app != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.loadBundle was null, expected non-null FirestorePigeonFirebaseApp.', - ); - final Uint8List? arg_bundle = (args[1] as Uint8List?); - assert( - arg_bundle != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.loadBundle was null, expected non-null Uint8List.', - ); - final String output = await api.loadBundle(arg_app!, arg_bundle!); - return [output]; + final List args = message! as List; + final FirestorePigeonFirebaseApp arg_app = + args[0]! as FirestorePigeonFirebaseApp; + final Uint8List arg_bundle = args[1]! as Uint8List; + try { + final String output = await api.loadBundle(arg_app, arg_bundle); + return [output]; + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString()), + ); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.namedQueryGet', - codec, + final pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.namedQueryGet$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger, ); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.namedQueryGet was null.', - ); - final List args = (message as List?)!; - final FirestorePigeonFirebaseApp? arg_app = - (args[0] as FirestorePigeonFirebaseApp?); - assert( - arg_app != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.namedQueryGet was null, expected non-null FirestorePigeonFirebaseApp.', - ); - final String? arg_name = (args[1] as String?); - assert( - arg_name != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.namedQueryGet was null, expected non-null String.', - ); - final PigeonGetOptions? arg_options = (args[2] as PigeonGetOptions?); - assert( - arg_options != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.namedQueryGet was null, expected non-null PigeonGetOptions.', - ); - final PigeonQuerySnapshot output = - await api.namedQueryGet(arg_app!, arg_name!, arg_options!); - return [output]; + final List args = message! as List; + final FirestorePigeonFirebaseApp arg_app = + args[0]! as FirestorePigeonFirebaseApp; + final String arg_name = args[1]! as String; + final InternalGetOptions arg_options = args[2]! as InternalGetOptions; + try { + final InternalQuerySnapshot output = + await api.namedQueryGet(arg_app, arg_name, arg_options); + return [output]; + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString()), + ); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.clearPersistence', - codec, + final pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.clearPersistence$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger, ); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.clearPersistence was null.', - ); - final List args = (message as List?)!; - final FirestorePigeonFirebaseApp? arg_app = - (args[0] as FirestorePigeonFirebaseApp?); - assert( - arg_app != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.clearPersistence was null, expected non-null FirestorePigeonFirebaseApp.', - ); - await api.clearPersistence(arg_app!); - return []; + final List args = message! as List; + final FirestorePigeonFirebaseApp arg_app = + args[0]! as FirestorePigeonFirebaseApp; + try { + await api.clearPersistence(arg_app); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString()), + ); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.disableNetwork', - codec, + final pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.disableNetwork$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger, ); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.disableNetwork was null.', - ); - final List args = (message as List?)!; - final FirestorePigeonFirebaseApp? arg_app = - (args[0] as FirestorePigeonFirebaseApp?); - assert( - arg_app != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.disableNetwork was null, expected non-null FirestorePigeonFirebaseApp.', - ); - await api.disableNetwork(arg_app!); - return []; + final List args = message! as List; + final FirestorePigeonFirebaseApp arg_app = + args[0]! as FirestorePigeonFirebaseApp; + try { + await api.disableNetwork(arg_app); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString()), + ); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.enableNetwork', - codec, + final pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.enableNetwork$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger, ); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.enableNetwork was null.', - ); - final List args = (message as List?)!; - final FirestorePigeonFirebaseApp? arg_app = - (args[0] as FirestorePigeonFirebaseApp?); - assert( - arg_app != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.enableNetwork was null, expected non-null FirestorePigeonFirebaseApp.', - ); - await api.enableNetwork(arg_app!); - return []; + final List args = message! as List; + final FirestorePigeonFirebaseApp arg_app = + args[0]! as FirestorePigeonFirebaseApp; + try { + await api.enableNetwork(arg_app); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString()), + ); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.terminate', - codec, + final pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.terminate$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger, ); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.terminate was null.', - ); - final List args = (message as List?)!; - final FirestorePigeonFirebaseApp? arg_app = - (args[0] as FirestorePigeonFirebaseApp?); - assert( - arg_app != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.terminate was null, expected non-null FirestorePigeonFirebaseApp.', - ); - await api.terminate(arg_app!); - return []; + final List args = message! as List; + final FirestorePigeonFirebaseApp arg_app = + args[0]! as FirestorePigeonFirebaseApp; + try { + await api.terminate(arg_app); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString()), + ); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.waitForPendingWrites', - codec, + final pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.waitForPendingWrites$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger, ); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.waitForPendingWrites was null.', - ); - final List args = (message as List?)!; - final FirestorePigeonFirebaseApp? arg_app = - (args[0] as FirestorePigeonFirebaseApp?); - assert( - arg_app != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.waitForPendingWrites was null, expected non-null FirestorePigeonFirebaseApp.', - ); - await api.waitForPendingWrites(arg_app!); - return []; + final List args = message! as List; + final FirestorePigeonFirebaseApp arg_app = + args[0]! as FirestorePigeonFirebaseApp; + try { + await api.waitForPendingWrites(arg_app); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString()), + ); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.setIndexConfiguration', - codec, + final pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.setIndexConfiguration$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger, ); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.setIndexConfiguration was null.', - ); - final List args = (message as List?)!; - final FirestorePigeonFirebaseApp? arg_app = - (args[0] as FirestorePigeonFirebaseApp?); - assert( - arg_app != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.setIndexConfiguration was null, expected non-null FirestorePigeonFirebaseApp.', - ); - final String? arg_indexConfiguration = (args[1] as String?); - assert( - arg_indexConfiguration != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.setIndexConfiguration was null, expected non-null String.', - ); - await api.setIndexConfiguration(arg_app!, arg_indexConfiguration!); - return []; + final List args = message! as List; + final FirestorePigeonFirebaseApp arg_app = + args[0]! as FirestorePigeonFirebaseApp; + final String arg_indexConfiguration = args[1]! as String; + try { + await api.setIndexConfiguration(arg_app, arg_indexConfiguration); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString()), + ); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.setLoggingEnabled', - codec, + final pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.setLoggingEnabled$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger, ); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.setLoggingEnabled was null.', - ); - final List args = (message as List?)!; - final bool? arg_loggingEnabled = (args[0] as bool?); - assert( - arg_loggingEnabled != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.setLoggingEnabled was null, expected non-null bool.', - ); - await api.setLoggingEnabled(arg_loggingEnabled!); - return []; + final List args = message! as List; + final bool arg_loggingEnabled = args[0]! as bool; + try { + await api.setLoggingEnabled(arg_loggingEnabled); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString()), + ); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.snapshotsInSyncSetup', - codec, + final pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.snapshotsInSyncSetup$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger, ); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.snapshotsInSyncSetup was null.', - ); - final List args = (message as List?)!; - final FirestorePigeonFirebaseApp? arg_app = - (args[0] as FirestorePigeonFirebaseApp?); - assert( - arg_app != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.snapshotsInSyncSetup was null, expected non-null FirestorePigeonFirebaseApp.', - ); - final String output = await api.snapshotsInSyncSetup(arg_app!); - return [output]; + final List args = message! as List; + final FirestorePigeonFirebaseApp arg_app = + args[0]! as FirestorePigeonFirebaseApp; + try { + final String output = await api.snapshotsInSyncSetup(arg_app); + return [output]; + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString()), + ); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.transactionCreate', - codec, + final pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.transactionCreate$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger, ); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.transactionCreate was null.', - ); - final List args = (message as List?)!; - final FirestorePigeonFirebaseApp? arg_app = - (args[0] as FirestorePigeonFirebaseApp?); - assert( - arg_app != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.transactionCreate was null, expected non-null FirestorePigeonFirebaseApp.', - ); - final int? arg_timeout = (args[1] as int?); - assert( - arg_timeout != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.transactionCreate was null, expected non-null int.', - ); - final int? arg_maxAttempts = (args[2] as int?); - assert( - arg_maxAttempts != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.transactionCreate was null, expected non-null int.', - ); - final String output = await api.transactionCreate( - arg_app!, - arg_timeout!, - arg_maxAttempts!, - ); - return [output]; + final List args = message! as List; + final FirestorePigeonFirebaseApp arg_app = + args[0]! as FirestorePigeonFirebaseApp; + final int arg_timeout = args[1]! as int; + final int arg_maxAttempts = args[2]! as int; + try { + final String output = await api.transactionCreate( + arg_app, + arg_timeout, + arg_maxAttempts, + ); + return [output]; + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString()), + ); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.transactionStoreResult', - codec, + final pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.transactionStoreResult$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger, ); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.transactionStoreResult was null.', - ); - final List args = (message as List?)!; - final String? arg_transactionId = (args[0] as String?); - assert( - arg_transactionId != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.transactionStoreResult was null, expected non-null String.', - ); - final PigeonTransactionResult? arg_resultType = args[1] == null - ? null - : PigeonTransactionResult.values[args[1]! as int]; - assert( - arg_resultType != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.transactionStoreResult was null, expected non-null PigeonTransactionResult.', - ); - final List? arg_commands = - (args[2] as List?)?.cast(); - await api.transactionStoreResult( - arg_transactionId!, - arg_resultType!, - arg_commands, - ); - return []; + final List args = message! as List; + final String arg_transactionId = args[0]! as String; + final InternalTransactionResult arg_resultType = + args[1]! as InternalTransactionResult; + final List? arg_commands = + (args[2] as List?)?.cast(); + try { + await api.transactionStoreResult( + arg_transactionId, + arg_resultType, + arg_commands, + ); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString()), + ); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.transactionGet', - codec, + final pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.transactionGet$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger, ); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.transactionGet was null.', - ); - final List args = (message as List?)!; - final FirestorePigeonFirebaseApp? arg_app = - (args[0] as FirestorePigeonFirebaseApp?); - assert( - arg_app != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.transactionGet was null, expected non-null FirestorePigeonFirebaseApp.', - ); - final String? arg_transactionId = (args[1] as String?); - assert( - arg_transactionId != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.transactionGet was null, expected non-null String.', - ); - final String? arg_path = (args[2] as String?); - assert( - arg_path != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.transactionGet was null, expected non-null String.', - ); - final PigeonDocumentSnapshot output = - await api.transactionGet(arg_app!, arg_transactionId!, arg_path!); - return [output]; + final List args = message! as List; + final FirestorePigeonFirebaseApp arg_app = + args[0]! as FirestorePigeonFirebaseApp; + final String arg_transactionId = args[1]! as String; + final String arg_path = args[2]! as String; + try { + final InternalDocumentSnapshot output = + await api.transactionGet(arg_app, arg_transactionId, arg_path); + return [output]; + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString()), + ); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceSet', - codec, + final pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceSet$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger, ); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceSet was null.', - ); - final List args = (message as List?)!; - final FirestorePigeonFirebaseApp? arg_app = - (args[0] as FirestorePigeonFirebaseApp?); - assert( - arg_app != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceSet was null, expected non-null FirestorePigeonFirebaseApp.', - ); - final DocumentReferenceRequest? arg_request = - (args[1] as DocumentReferenceRequest?); - assert( - arg_request != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceSet was null, expected non-null DocumentReferenceRequest.', - ); - await api.documentReferenceSet(arg_app!, arg_request!); - return []; + final List args = message! as List; + final FirestorePigeonFirebaseApp arg_app = + args[0]! as FirestorePigeonFirebaseApp; + final DocumentReferenceRequest arg_request = + args[1]! as DocumentReferenceRequest; + try { + await api.documentReferenceSet(arg_app, arg_request); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString()), + ); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceUpdate', - codec, + final pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceUpdate$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger, ); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceUpdate was null.', - ); - final List args = (message as List?)!; - final FirestorePigeonFirebaseApp? arg_app = - (args[0] as FirestorePigeonFirebaseApp?); - assert( - arg_app != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceUpdate was null, expected non-null FirestorePigeonFirebaseApp.', - ); - final DocumentReferenceRequest? arg_request = - (args[1] as DocumentReferenceRequest?); - assert( - arg_request != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceUpdate was null, expected non-null DocumentReferenceRequest.', - ); - await api.documentReferenceUpdate(arg_app!, arg_request!); - return []; + final List args = message! as List; + final FirestorePigeonFirebaseApp arg_app = + args[0]! as FirestorePigeonFirebaseApp; + final DocumentReferenceRequest arg_request = + args[1]! as DocumentReferenceRequest; + try { + await api.documentReferenceUpdate(arg_app, arg_request); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString()), + ); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceGet', - codec, + final pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceGet$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger, ); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceGet was null.', - ); - final List args = (message as List?)!; - final FirestorePigeonFirebaseApp? arg_app = - (args[0] as FirestorePigeonFirebaseApp?); - assert( - arg_app != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceGet was null, expected non-null FirestorePigeonFirebaseApp.', - ); - final DocumentReferenceRequest? arg_request = - (args[1] as DocumentReferenceRequest?); - assert( - arg_request != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceGet was null, expected non-null DocumentReferenceRequest.', - ); - final PigeonDocumentSnapshot output = - await api.documentReferenceGet(arg_app!, arg_request!); - return [output]; + final List args = message! as List; + final FirestorePigeonFirebaseApp arg_app = + args[0]! as FirestorePigeonFirebaseApp; + final DocumentReferenceRequest arg_request = + args[1]! as DocumentReferenceRequest; + try { + final InternalDocumentSnapshot output = + await api.documentReferenceGet(arg_app, arg_request); + return [output]; + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString()), + ); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceDelete', - codec, + final pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceDelete$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger, ); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceDelete was null.', - ); - final List args = (message as List?)!; - final FirestorePigeonFirebaseApp? arg_app = - (args[0] as FirestorePigeonFirebaseApp?); - assert( - arg_app != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceDelete was null, expected non-null FirestorePigeonFirebaseApp.', - ); - final DocumentReferenceRequest? arg_request = - (args[1] as DocumentReferenceRequest?); - assert( - arg_request != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceDelete was null, expected non-null DocumentReferenceRequest.', - ); - await api.documentReferenceDelete(arg_app!, arg_request!); - return []; + final List args = message! as List; + final FirestorePigeonFirebaseApp arg_app = + args[0]! as FirestorePigeonFirebaseApp; + final DocumentReferenceRequest arg_request = + args[1]! as DocumentReferenceRequest; + try { + await api.documentReferenceDelete(arg_app, arg_request); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString()), + ); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.queryGet', - codec, + final pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.queryGet$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger, ); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.queryGet was null.', - ); - final List args = (message as List?)!; - final FirestorePigeonFirebaseApp? arg_app = - (args[0] as FirestorePigeonFirebaseApp?); - assert( - arg_app != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.queryGet was null, expected non-null FirestorePigeonFirebaseApp.', - ); - final String? arg_path = (args[1] as String?); - assert( - arg_path != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.queryGet was null, expected non-null String.', - ); - final bool? arg_isCollectionGroup = (args[2] as bool?); - assert( - arg_isCollectionGroup != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.queryGet was null, expected non-null bool.', - ); - final PigeonQueryParameters? arg_parameters = - (args[3] as PigeonQueryParameters?); - assert( - arg_parameters != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.queryGet was null, expected non-null PigeonQueryParameters.', - ); - final PigeonGetOptions? arg_options = (args[4] as PigeonGetOptions?); - assert( - arg_options != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.queryGet was null, expected non-null PigeonGetOptions.', - ); - final PigeonQuerySnapshot output = await api.queryGet( - arg_app!, - arg_path!, - arg_isCollectionGroup!, - arg_parameters!, - arg_options!, - ); - return [output]; + final List args = message! as List; + final FirestorePigeonFirebaseApp arg_app = + args[0]! as FirestorePigeonFirebaseApp; + final String arg_path = args[1]! as String; + final bool arg_isCollectionGroup = args[2]! as bool; + final InternalQueryParameters arg_parameters = + args[3]! as InternalQueryParameters; + final InternalGetOptions arg_options = args[4]! as InternalGetOptions; + try { + final InternalQuerySnapshot output = await api.queryGet( + arg_app, + arg_path, + arg_isCollectionGroup, + arg_parameters, + arg_options, + ); + return [output]; + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString()), + ); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.aggregateQuery', - codec, + final pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.aggregateQuery$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger, ); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.aggregateQuery was null.', - ); - final List args = (message as List?)!; - final FirestorePigeonFirebaseApp? arg_app = - (args[0] as FirestorePigeonFirebaseApp?); - assert( - arg_app != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.aggregateQuery was null, expected non-null FirestorePigeonFirebaseApp.', - ); - final String? arg_path = (args[1] as String?); - assert( - arg_path != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.aggregateQuery was null, expected non-null String.', - ); - final PigeonQueryParameters? arg_parameters = - (args[2] as PigeonQueryParameters?); - assert( - arg_parameters != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.aggregateQuery was null, expected non-null PigeonQueryParameters.', - ); - final AggregateSource? arg_source = - args[3] == null ? null : AggregateSource.values[args[3]! as int]; - assert( - arg_source != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.aggregateQuery was null, expected non-null AggregateSource.', - ); - final List? arg_queries = - (args[4] as List?)?.cast(); - assert( - arg_queries != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.aggregateQuery was null, expected non-null List.', - ); - final bool? arg_isCollectionGroup = (args[5] as bool?); - assert( - arg_isCollectionGroup != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.aggregateQuery was null, expected non-null bool.', - ); - final List output = await api.aggregateQuery( - arg_app!, - arg_path!, - arg_parameters!, - arg_source!, - arg_queries!, - arg_isCollectionGroup!, - ); - return [output]; + final List args = message! as List; + final FirestorePigeonFirebaseApp arg_app = + args[0]! as FirestorePigeonFirebaseApp; + final String arg_path = args[1]! as String; + final InternalQueryParameters arg_parameters = + args[2]! as InternalQueryParameters; + final AggregateSource arg_source = args[3]! as AggregateSource; + final List arg_queries = + (args[4]! as List).cast(); + final bool arg_isCollectionGroup = args[5]! as bool; + try { + final List output = + await api.aggregateQuery( + arg_app, + arg_path, + arg_parameters, + arg_source, + arg_queries, + arg_isCollectionGroup, + ); + return [output]; + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString()), + ); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.writeBatchCommit', - codec, + final pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.writeBatchCommit$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger, ); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.writeBatchCommit was null.', - ); - final List args = (message as List?)!; - final FirestorePigeonFirebaseApp? arg_app = - (args[0] as FirestorePigeonFirebaseApp?); - assert( - arg_app != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.writeBatchCommit was null, expected non-null FirestorePigeonFirebaseApp.', - ); - final List? arg_writes = - (args[1] as List?)?.cast(); - assert( - arg_writes != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.writeBatchCommit was null, expected non-null List.', - ); - await api.writeBatchCommit(arg_app!, arg_writes!); - return []; + final List args = message! as List; + final FirestorePigeonFirebaseApp arg_app = + args[0]! as FirestorePigeonFirebaseApp; + final List arg_writes = + (args[1]! as List).cast(); + try { + await api.writeBatchCommit(arg_app, arg_writes); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString()), + ); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.querySnapshot', - codec, + final pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.querySnapshot$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger, ); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.querySnapshot was null.', - ); - final List args = (message as List?)!; - final FirestorePigeonFirebaseApp? arg_app = - (args[0] as FirestorePigeonFirebaseApp?); - assert( - arg_app != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.querySnapshot was null, expected non-null FirestorePigeonFirebaseApp.', - ); - final String? arg_path = (args[1] as String?); - assert( - arg_path != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.querySnapshot was null, expected non-null String.', - ); - final bool? arg_isCollectionGroup = (args[2] as bool?); - assert( - arg_isCollectionGroup != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.querySnapshot was null, expected non-null bool.', - ); - final PigeonQueryParameters? arg_parameters = - (args[3] as PigeonQueryParameters?); - assert( - arg_parameters != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.querySnapshot was null, expected non-null PigeonQueryParameters.', - ); - final PigeonGetOptions? arg_options = (args[4] as PigeonGetOptions?); - assert( - arg_options != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.querySnapshot was null, expected non-null PigeonGetOptions.', - ); - final bool? arg_includeMetadataChanges = (args[5] as bool?); - assert( - arg_includeMetadataChanges != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.querySnapshot was null, expected non-null bool.', - ); - final ListenSource? arg_source = - args[6] == null ? null : ListenSource.values[args[6]! as int]; - assert( - arg_source != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.querySnapshot was null, expected non-null ListenSource.', - ); - final String output = await api.querySnapshot( - arg_app!, - arg_path!, - arg_isCollectionGroup!, - arg_parameters!, - arg_options!, - arg_includeMetadataChanges!, - arg_source!, - ); - return [output]; + final List args = message! as List; + final FirestorePigeonFirebaseApp arg_app = + args[0]! as FirestorePigeonFirebaseApp; + final String arg_path = args[1]! as String; + final bool arg_isCollectionGroup = args[2]! as bool; + final InternalQueryParameters arg_parameters = + args[3]! as InternalQueryParameters; + final InternalGetOptions arg_options = args[4]! as InternalGetOptions; + final bool arg_includeMetadataChanges = args[5]! as bool; + final ListenSource arg_source = args[6]! as ListenSource; + try { + final String output = await api.querySnapshot( + arg_app, + arg_path, + arg_isCollectionGroup, + arg_parameters, + arg_options, + arg_includeMetadataChanges, + arg_source, + ); + return [output]; + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString()), + ); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceSnapshot', - codec, + final pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceSnapshot$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger, ); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceSnapshot was null.', - ); - final List args = (message as List?)!; - final FirestorePigeonFirebaseApp? arg_app = - (args[0] as FirestorePigeonFirebaseApp?); - assert( - arg_app != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceSnapshot was null, expected non-null FirestorePigeonFirebaseApp.', - ); - final DocumentReferenceRequest? arg_parameters = - (args[1] as DocumentReferenceRequest?); - assert( - arg_parameters != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceSnapshot was null, expected non-null DocumentReferenceRequest.', - ); - final bool? arg_includeMetadataChanges = (args[2] as bool?); - assert( - arg_includeMetadataChanges != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceSnapshot was null, expected non-null bool.', - ); - final ListenSource? arg_source = - args[3] == null ? null : ListenSource.values[args[3]! as int]; - assert( - arg_source != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.documentReferenceSnapshot was null, expected non-null ListenSource.', - ); - final String output = await api.documentReferenceSnapshot( - arg_app!, - arg_parameters!, - arg_includeMetadataChanges!, - arg_source!, - ); - return [output]; + final List args = message! as List; + final FirestorePigeonFirebaseApp arg_app = + args[0]! as FirestorePigeonFirebaseApp; + final DocumentReferenceRequest arg_parameters = + args[1]! as DocumentReferenceRequest; + final bool arg_includeMetadataChanges = args[2]! as bool; + final ListenSource arg_source = args[3]! as ListenSource; + try { + final String output = await api.documentReferenceSnapshot( + arg_app, + arg_parameters, + arg_includeMetadataChanges, + arg_source, + ); + return [output]; + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString()), + ); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.persistenceCacheIndexManagerRequest', - codec, + final pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.persistenceCacheIndexManagerRequest$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger, ); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.persistenceCacheIndexManagerRequest was null.', - ); - final List args = (message as List?)!; - final FirestorePigeonFirebaseApp? arg_app = - (args[0] as FirestorePigeonFirebaseApp?); - assert( - arg_app != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.persistenceCacheIndexManagerRequest was null, expected non-null FirestorePigeonFirebaseApp.', - ); - final PersistenceCacheIndexManagerRequest? arg_request = - args[1] == null - ? null - : PersistenceCacheIndexManagerRequest.values[args[1]! as int]; - assert( - arg_request != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.persistenceCacheIndexManagerRequest was null, expected non-null PersistenceCacheIndexManagerRequest.', - ); - await api.persistenceCacheIndexManagerRequest(arg_app!, arg_request!); - return []; + final List args = message! as List; + final FirestorePigeonFirebaseApp arg_app = + args[0]! as FirestorePigeonFirebaseApp; + final PersistenceCacheIndexManagerRequest arg_request = + args[1]! as PersistenceCacheIndexManagerRequest; + try { + await api.persistenceCacheIndexManagerRequest(arg_app, arg_request); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString()), + ); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.executePipeline', - codec, + final pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.executePipeline$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger, ); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.executePipeline was null.', - ); - final List args = (message as List?)!; - final FirestorePigeonFirebaseApp? arg_app = - (args[0] as FirestorePigeonFirebaseApp?); - assert( - arg_app != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.executePipeline was null, expected non-null FirestorePigeonFirebaseApp.', - ); - final List?>? arg_stages = - (args[1] as List?)?.cast?>(); - assert( - arg_stages != null, - 'Argument for dev.flutter.pigeon.cloud_firestore_platform_interface.FirebaseFirestoreHostApi.executePipeline was null, expected non-null List?>.', - ); + final List args = message! as List; + final FirestorePigeonFirebaseApp arg_app = + args[0]! as FirestorePigeonFirebaseApp; + final List?> arg_stages = + (args[1]! as List).cast?>(); final Map? arg_options = (args[2] as Map?)?.cast(); - final PigeonPipelineSnapshot output = - await api.executePipeline(arg_app!, arg_stages!, arg_options); - return [output]; + try { + final InternalPipelineSnapshot output = + await api.executePipeline(arg_app, arg_stages, arg_options); + return [output]; + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString()), + ); + } }); } } diff --git a/packages/cloud_firestore/cloud_firestore_platform_interface/test/utils/test_firestore_message_codec.dart b/packages/cloud_firestore/cloud_firestore_platform_interface/test/utils/test_firestore_message_codec.dart index 12b7b5bb1c27..d17c62a8ecf1 100644 --- a/packages/cloud_firestore/cloud_firestore_platform_interface/test/utils/test_firestore_message_codec.dart +++ b/packages/cloud_firestore/cloud_firestore_platform_interface/test/utils/test_firestore_message_codec.dart @@ -73,7 +73,7 @@ class TestFirestoreMessageCodec extends FirestoreMessageCodec { values['path'], FirestorePigeonFirebaseApp( appName: 'test', - settings: PigeonFirebaseSettings( + settings: InternalFirebaseSettings( ignoreUndefinedProperties: false, ), databaseURL: '', diff --git a/packages/cloud_firestore/cloud_firestore_web/lib/src/utils/web_utils.dart b/packages/cloud_firestore/cloud_firestore_web/lib/src/utils/web_utils.dart index 43d3b07cb1a8..c92ef6b73fb8 100644 --- a/packages/cloud_firestore/cloud_firestore_web/lib/src/utils/web_utils.dart +++ b/packages/cloud_firestore/cloud_firestore_web/lib/src/utils/web_utils.dart @@ -67,7 +67,7 @@ DocumentSnapshotPlatform convertWebDocumentSnapshot( )), firestore, ), - PigeonSnapshotMetadata( + InternalSnapshotMetadata( hasPendingWrites: webSnapshot.metadata.hasPendingWrites.toDart, isFromCache: webSnapshot.metadata.fromCache.toDart, ), diff --git a/packages/cloud_functions/analysis_options.yaml b/packages/cloud_functions/analysis_options.yaml index 1597da232319..b8c16f67fb33 100644 --- a/packages/cloud_functions/analysis_options.yaml +++ b/packages/cloud_functions/analysis_options.yaml @@ -7,4 +7,5 @@ include: ../../analysis_options.yaml analyzer: exclude: - cloud_functions_platform_interface/lib/src/pigeon/messages.pigeon.dart - - cloud_functions_platform_interface/test/pigeon/test_api.dart \ No newline at end of file + - cloud_functions_platform_interface/test/pigeon/test_api.dart + - cloud_functions_platform_interface/pigeons/messages.dart \ No newline at end of file diff --git a/packages/cloud_functions/cloud_functions/android/src/main/kotlin/io/flutter/plugins/firebase/functions/GeneratedAndroidCloudFunctions.g.kt b/packages/cloud_functions/cloud_functions/android/src/main/kotlin/io/flutter/plugins/firebase/functions/GeneratedAndroidCloudFunctions.g.kt index ed7f4b3c90fc..7b5c2181da86 100644 --- a/packages/cloud_functions/cloud_functions/android/src/main/kotlin/io/flutter/plugins/firebase/functions/GeneratedAndroidCloudFunctions.g.kt +++ b/packages/cloud_functions/cloud_functions/android/src/main/kotlin/io/flutter/plugins/firebase/functions/GeneratedAndroidCloudFunctions.g.kt @@ -1,7 +1,7 @@ // Copyright 2025, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v25.3.2), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), do not edit directly. // See also: https://pub.dev/packages/pigeon @file:Suppress("UNCHECKED_CAST", "ArrayInDataClass") @@ -49,7 +49,7 @@ class FlutterError ( val code: String, override val message: String? = null, val details: Any? = null -) : Throwable() +) : RuntimeException() private open class GeneratedAndroidCloudFunctionsPigeonCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return super.readValueOfType(type, buffer) diff --git a/packages/cloud_functions/cloud_functions/ios/cloud_functions/Sources/cloud_functions/CloudFunctionsMessages.g.swift b/packages/cloud_functions/cloud_functions/ios/cloud_functions/Sources/cloud_functions/CloudFunctionsMessages.g.swift index a24439b9a7c3..fca2234a4060 100644 --- a/packages/cloud_functions/cloud_functions/ios/cloud_functions/Sources/cloud_functions/CloudFunctionsMessages.g.swift +++ b/packages/cloud_functions/cloud_functions/ios/cloud_functions/Sources/cloud_functions/CloudFunctionsMessages.g.swift @@ -1,7 +1,7 @@ // Copyright 2025, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v25.3.2), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), do not edit directly. // See also: https://pub.dev/packages/pigeon import Foundation @@ -52,7 +52,7 @@ private func wrapError(_ error: Any) -> [Any?] { } return [ "\(error)", - "\(type(of: error))", + "\(Swift.type(of: error))", "Stacktrace: \(Thread.callStackSymbols)", ] } diff --git a/packages/cloud_functions/cloud_functions/windows/messages.g.cpp b/packages/cloud_functions/cloud_functions/windows/messages.g.cpp index 31724f26c541..50ab69ead469 100644 --- a/packages/cloud_functions/cloud_functions/windows/messages.g.cpp +++ b/packages/cloud_functions/cloud_functions/windows/messages.g.cpp @@ -1,7 +1,7 @@ // Copyright 2025, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v25.3.2), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), do not edit directly. // See also: https://pub.dev/packages/pigeon #undef _HAS_EXCEPTIONS @@ -13,16 +13,18 @@ #include #include +#include +#include #include #include #include namespace cloud_functions_windows { -using flutter::BasicMessageChannel; -using flutter::CustomEncodableValue; -using flutter::EncodableList; -using flutter::EncodableMap; -using flutter::EncodableValue; +using ::flutter::BasicMessageChannel; +using ::flutter::CustomEncodableValue; +using ::flutter::EncodableList; +using ::flutter::EncodableMap; +using ::flutter::EncodableValue; FlutterError CreateConnectionError(const std::string channel_name) { return FlutterError( @@ -31,32 +33,239 @@ FlutterError CreateConnectionError(const std::string channel_name) { EncodableValue("")); } +namespace { +template +bool PigeonInternalDeepEquals(const T& a, const T& b); + +bool PigeonInternalDeepEquals(const double& a, const double& b); + +template +bool PigeonInternalDeepEquals(const std::vector& a, const std::vector& b); + +template +bool PigeonInternalDeepEquals(const std::map& a, const std::map& b); + +template +bool PigeonInternalDeepEquals(const std::optional& a, + const std::optional& b); + +template +bool PigeonInternalDeepEquals(const std::unique_ptr& a, + const std::unique_ptr& b); + +bool PigeonInternalDeepEquals(const ::flutter::EncodableValue& a, + const ::flutter::EncodableValue& b); + +template +bool PigeonInternalDeepEquals(const T& a, const T& b) { + return a == b; +} + +template +bool PigeonInternalDeepEquals(const std::vector& a, + const std::vector& b) { + if (a.size() != b.size()) { + return false; + } + for (size_t i = 0; i < a.size(); ++i) { + if (!PigeonInternalDeepEquals(a[i], b[i])) { + return false; + } + } + return true; +} + +template +bool PigeonInternalDeepEquals(const std::map& a, + const std::map& b) { + if (a.size() != b.size()) { + return false; + } + for (const auto& kv : a) { + bool found = false; + for (const auto& b_kv : b) { + if (PigeonInternalDeepEquals(kv.first, b_kv.first)) { + if (PigeonInternalDeepEquals(kv.second, b_kv.second)) { + found = true; + break; + } else { + return false; + } + } + } + if (!found) { + return false; + } + } + return true; +} + +bool PigeonInternalDeepEquals(const double& a, const double& b) { + // Normalize -0.0 to 0.0 and handle NaN equality. + return (a == b) || (std::isnan(a) && std::isnan(b)); +} + +template +bool PigeonInternalDeepEquals(const std::optional& a, + const std::optional& b) { + if (!a && !b) { + return true; + } + if (!a || !b) { + return false; + } + return PigeonInternalDeepEquals(*a, *b); +} + +template +bool PigeonInternalDeepEquals(const std::unique_ptr& a, + const std::unique_ptr& b) { + if (a.get() == b.get()) { + return true; + } + if (!a || !b) { + return false; + } + return PigeonInternalDeepEquals(*a, *b); +} + +bool PigeonInternalDeepEquals(const ::flutter::EncodableValue& a, + const ::flutter::EncodableValue& b) { + if (a.index() != b.index()) { + return false; + } + if (const double* da = std::get_if(&a)) { + return PigeonInternalDeepEquals(*da, std::get(b)); + } else if (const ::flutter::EncodableList* la = + std::get_if<::flutter::EncodableList>(&a)) { + return PigeonInternalDeepEquals(*la, std::get<::flutter::EncodableList>(b)); + } else if (const ::flutter::EncodableMap* ma = + std::get_if<::flutter::EncodableMap>(&a)) { + return PigeonInternalDeepEquals(*ma, std::get<::flutter::EncodableMap>(b)); + } + return a == b; +} + +template +size_t PigeonInternalDeepHash(const T& v); + +size_t PigeonInternalDeepHash(const double& v); + +template +size_t PigeonInternalDeepHash(const std::vector& v); + +template +size_t PigeonInternalDeepHash(const std::map& v); + +template +size_t PigeonInternalDeepHash(const std::optional& v); + +template +size_t PigeonInternalDeepHash(const std::unique_ptr& v); + +size_t PigeonInternalDeepHash(const ::flutter::EncodableValue& v); + +template +size_t PigeonInternalDeepHash(const T& v) { + return std::hash()(v); +} + +template +size_t PigeonInternalDeepHash(const std::vector& v) { + size_t result = 1; + for (const auto& item : v) { + result = result * 31 + PigeonInternalDeepHash(item); + } + return result; +} + +template +size_t PigeonInternalDeepHash(const std::map& v) { + size_t result = 0; + for (const auto& kv : v) { + result += ((PigeonInternalDeepHash(kv.first) * 31) ^ + PigeonInternalDeepHash(kv.second)); + } + return result; +} + +size_t PigeonInternalDeepHash(const double& v) { + if (std::isnan(v)) { + // Normalize NaN to a consistent hash. + return std::hash()(std::numeric_limits::quiet_NaN()); + } + if (v == 0.0) { + // Normalize -0.0 to 0.0 so they have the same hash code. + return std::hash()(0.0); + } + return std::hash()(v); +} + +template +size_t PigeonInternalDeepHash(const std::optional& v) { + return v ? PigeonInternalDeepHash(*v) : 0; +} + +template +size_t PigeonInternalDeepHash(const std::unique_ptr& v) { + return v ? PigeonInternalDeepHash(*v) : 0; +} + +size_t PigeonInternalDeepHash(const ::flutter::EncodableValue& v) { + size_t result = v.index(); + if (const double* dv = std::get_if(&v)) { + result = result * 31 + PigeonInternalDeepHash(*dv); + } else if (const ::flutter::EncodableList* lv = + std::get_if<::flutter::EncodableList>(&v)) { + result = result * 31 + PigeonInternalDeepHash(*lv); + } else if (const ::flutter::EncodableMap* mv = + std::get_if<::flutter::EncodableMap>(&v)) { + result = result * 31 + PigeonInternalDeepHash(*mv); + } else { + std::visit( + [&result](const auto& val) { + using T = std::decay_t; + if constexpr (!std::is_same_v && + !std::is_same_v && + !std::is_same_v && + !std::is_same_v && + !std::is_same_v) { + result = result * 31 + PigeonInternalDeepHash(val); + } + }, + v); + } + return result; +} + +} // namespace + PigeonInternalCodecSerializer::PigeonInternalCodecSerializer() {} EncodableValue PigeonInternalCodecSerializer::ReadValueOfType( - uint8_t type, flutter::ByteStreamReader* stream) const { - return flutter::StandardCodecSerializer::ReadValueOfType(type, stream); + uint8_t type, ::flutter::ByteStreamReader* stream) const { + return ::flutter::StandardCodecSerializer::ReadValueOfType(type, stream); } void PigeonInternalCodecSerializer::WriteValue( - const EncodableValue& value, flutter::ByteStreamWriter* stream) const { - flutter::StandardCodecSerializer::WriteValue(value, stream); + const EncodableValue& value, ::flutter::ByteStreamWriter* stream) const { + ::flutter::StandardCodecSerializer::WriteValue(value, stream); } /// The codec used by CloudFunctionsHostApi. -const flutter::StandardMessageCodec& CloudFunctionsHostApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance( +const ::flutter::StandardMessageCodec& CloudFunctionsHostApi::GetCodec() { + return ::flutter::StandardMessageCodec::GetInstance( &PigeonInternalCodecSerializer::GetInstance()); } // Sets up an instance of `CloudFunctionsHostApi` to handle messages through the // `binary_messenger`. -void CloudFunctionsHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, +void CloudFunctionsHostApi::SetUp(::flutter::BinaryMessenger* binary_messenger, CloudFunctionsHostApi* api) { CloudFunctionsHostApi::SetUp(binary_messenger, api, ""); } -void CloudFunctionsHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, +void CloudFunctionsHostApi::SetUp(::flutter::BinaryMessenger* binary_messenger, CloudFunctionsHostApi* api, const std::string& message_channel_suffix) { const std::string prepended_suffix = @@ -72,7 +281,7 @@ void CloudFunctionsHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_arguments_arg = args.at(0); @@ -117,7 +326,7 @@ void CloudFunctionsHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_arguments_arg = args.at(0); diff --git a/packages/cloud_functions/cloud_functions/windows/messages.g.h b/packages/cloud_functions/cloud_functions/windows/messages.g.h index 7648ad06af7f..6f537decbd12 100644 --- a/packages/cloud_functions/cloud_functions/windows/messages.g.h +++ b/packages/cloud_functions/cloud_functions/windows/messages.g.h @@ -1,7 +1,7 @@ // Copyright 2025, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v25.3.2), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), do not edit directly. // See also: https://pub.dev/packages/pigeon #ifndef PIGEON_MESSAGES_G_H_ @@ -25,17 +25,17 @@ class FlutterError { explicit FlutterError(const std::string& code, const std::string& message) : code_(code), message_(message) {} explicit FlutterError(const std::string& code, const std::string& message, - const flutter::EncodableValue& details) + const ::flutter::EncodableValue& details) : code_(code), message_(message), details_(details) {} const std::string& code() const { return code_; } const std::string& message() const { return message_; } - const flutter::EncodableValue& details() const { return details_; } + const ::flutter::EncodableValue& details() const { return details_; } private: std::string code_; std::string message_; - flutter::EncodableValue details_; + ::flutter::EncodableValue details_; }; template @@ -58,7 +58,8 @@ class ErrorOr { std::variant v_; }; -class PigeonInternalCodecSerializer : public flutter::StandardCodecSerializer { +class PigeonInternalCodecSerializer + : public ::flutter::StandardCodecSerializer { public: PigeonInternalCodecSerializer(); inline static PigeonInternalCodecSerializer& GetInstance() { @@ -66,12 +67,12 @@ class PigeonInternalCodecSerializer : public flutter::StandardCodecSerializer { return sInstance; } - void WriteValue(const flutter::EncodableValue& value, - flutter::ByteStreamWriter* stream) const override; + void WriteValue(const ::flutter::EncodableValue& value, + ::flutter::ByteStreamWriter* stream) const override; protected: - flutter::EncodableValue ReadValueOfType( - uint8_t type, flutter::ByteStreamReader* stream) const override; + ::flutter::EncodableValue ReadValueOfType( + uint8_t type, ::flutter::ByteStreamReader* stream) const override; }; // Generated interface from Pigeon that represents a handler of messages from @@ -82,24 +83,25 @@ class CloudFunctionsHostApi { CloudFunctionsHostApi& operator=(const CloudFunctionsHostApi&) = delete; virtual ~CloudFunctionsHostApi() {} virtual void Call( - const flutter::EncodableMap& arguments, - std::function> reply)> + const ::flutter::EncodableMap& arguments, + std::function< + void(ErrorOr> reply)> result) = 0; virtual void RegisterEventChannel( - const flutter::EncodableMap& arguments, + const ::flutter::EncodableMap& arguments, std::function reply)> result) = 0; // The codec used by CloudFunctionsHostApi. - static const flutter::StandardMessageCodec& GetCodec(); + static const ::flutter::StandardMessageCodec& GetCodec(); // Sets up an instance of `CloudFunctionsHostApi` to handle messages through // the `binary_messenger`. - static void SetUp(flutter::BinaryMessenger* binary_messenger, + static void SetUp(::flutter::BinaryMessenger* binary_messenger, CloudFunctionsHostApi* api); - static void SetUp(flutter::BinaryMessenger* binary_messenger, + static void SetUp(::flutter::BinaryMessenger* binary_messenger, CloudFunctionsHostApi* api, const std::string& message_channel_suffix); - static flutter::EncodableValue WrapError(std::string_view error_message); - static flutter::EncodableValue WrapError(const FlutterError& error); + static ::flutter::EncodableValue WrapError(std::string_view error_message); + static ::flutter::EncodableValue WrapError(const FlutterError& error); protected: CloudFunctionsHostApi() = default; diff --git a/packages/cloud_functions/cloud_functions_platform_interface/lib/src/pigeon/messages.pigeon.dart b/packages/cloud_functions/cloud_functions_platform_interface/lib/src/pigeon/messages.pigeon.dart index 5249dd1cd031..ed2a18de54a0 100644 --- a/packages/cloud_functions/cloud_functions_platform_interface/lib/src/pigeon/messages.pigeon.dart +++ b/packages/cloud_functions/cloud_functions_platform_interface/lib/src/pigeon/messages.pigeon.dart @@ -1,21 +1,40 @@ // Copyright 2025, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v25.3.2), do not edit directly. +// Autogenerated from Pigeon (v26.3.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, no_leading_underscores_for_local_identifiers +// ignore_for_file: unused_import, unused_shown_name +// ignore_for_file: type=lint import 'dart:async'; -import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; +import 'dart:typed_data' show Float64List, Int32List, Int64List; -import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer; import 'package:flutter/services.dart'; +import 'package:meta/meta.dart' show immutable, protected, visibleForTesting; -PlatformException _createConnectionError(String channelName) { - return PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel: "$channelName".', - ); +Object? _extractReplyValueOrThrow( + List? replyList, + String channelName, { + required bool isNullValid, +}) { + if (replyList == null) { + throw PlatformException( + code: 'channel-error', + message: 'Unable to establish connection on channel: "$channelName".', + ); + } else if (replyList.length > 1) { + throw PlatformException( + code: replyList[0]! as String, + message: replyList[1] as String?, + details: replyList[2], + ); + } else if (!isNullValid && (replyList.isNotEmpty && replyList[0] == null)) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } + return replyList.firstOrNull; } List wrapResponse( @@ -66,54 +85,41 @@ class CloudFunctionsHostApi { final String pigeonVar_messageChannelSuffix; Future call(Map arguments) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.cloud_functions_platform_interface.CloudFunctionsHostApi.call$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([arguments]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return pigeonVar_replyList[0]; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); + return pigeonVar_replyValue; } Future registerEventChannel(Map arguments) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.cloud_functions_platform_interface.CloudFunctionsHostApi.registerEventChannel$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([arguments]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } } diff --git a/packages/cloud_functions/cloud_functions_platform_interface/pubspec.yaml b/packages/cloud_functions/cloud_functions_platform_interface/pubspec.yaml index 0e1e096a2c5c..4be0404452de 100644 --- a/packages/cloud_functions/cloud_functions_platform_interface/pubspec.yaml +++ b/packages/cloud_functions/cloud_functions_platform_interface/pubspec.yaml @@ -23,4 +23,4 @@ dev_dependencies: flutter_test: sdk: flutter mockito: ^5.0.0 - pigeon: 25.3.2 + pigeon: 26.3.4 diff --git a/packages/cloud_functions/cloud_functions_platform_interface/test/pigeon/test_api.dart b/packages/cloud_functions/cloud_functions_platform_interface/test/pigeon/test_api.dart index 085dfc1a66de..3583ef25e17d 100644 --- a/packages/cloud_functions/cloud_functions_platform_interface/test/pigeon/test_api.dart +++ b/packages/cloud_functions/cloud_functions_platform_interface/test/pigeon/test_api.dart @@ -1,9 +1,9 @@ // Copyright 2025, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v25.3.2), do not edit directly. +// Autogenerated from Pigeon (v26.3.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, unnecessary_import, no_leading_underscores_for_local_identifiers +// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, unnecessary_import, no_leading_underscores_for_local_identifiers, omit_obvious_local_variable_types // ignore_for_file: avoid_relative_lib_imports import 'dart:async'; import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; @@ -51,9 +51,7 @@ abstract class TestCloudFunctionsHostApi { messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.cloud_functions_platform_interface.CloudFunctionsHostApi.call$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -64,15 +62,11 @@ abstract class TestCloudFunctionsHostApi { _testBinaryMessengerBinding!.defaultBinaryMessenger .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.cloud_functions_platform_interface.CloudFunctionsHostApi.call was null.'); - final List args = (message as List?)!; - final Map? arg_arguments = - (args[0] as Map?)?.cast(); - assert(arg_arguments != null, - 'Argument for dev.flutter.pigeon.cloud_functions_platform_interface.CloudFunctionsHostApi.call was null, expected non-null Map.'); + final List args = message! as List; + final Map arg_arguments = + (args[0]! as Map).cast(); try { - final Object? output = await api.call(arg_arguments!); + final Object? output = await api.call(arg_arguments); return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); @@ -84,9 +78,7 @@ abstract class TestCloudFunctionsHostApi { } } { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.cloud_functions_platform_interface.CloudFunctionsHostApi.registerEventChannel$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -97,15 +89,11 @@ abstract class TestCloudFunctionsHostApi { _testBinaryMessengerBinding!.defaultBinaryMessenger .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.cloud_functions_platform_interface.CloudFunctionsHostApi.registerEventChannel was null.'); - final List args = (message as List?)!; - final Map? arg_arguments = - (args[0] as Map?)?.cast(); - assert(arg_arguments != null, - 'Argument for dev.flutter.pigeon.cloud_functions_platform_interface.CloudFunctionsHostApi.registerEventChannel was null, expected non-null Map.'); + final List args = message! as List; + final Map arg_arguments = + (args[0]! as Map).cast(); try { - await api.registerEventChannel(arg_arguments!); + await api.registerEventChannel(arg_arguments); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); diff --git a/packages/firebase_analytics/analysis_options.yaml b/packages/firebase_analytics/analysis_options.yaml index 478fde4d9c56..f67ba3d72398 100644 --- a/packages/firebase_analytics/analysis_options.yaml +++ b/packages/firebase_analytics/analysis_options.yaml @@ -8,3 +8,4 @@ analyzer: exclude: - firebase_analytics_platform_interface/lib/src/pigeon/messages.pigeon.dart - firebase_analytics_platform_interface/test/pigeon/test_api.dart + - firebase_analytics_platform_interface/pigeons/messages.dart diff --git a/packages/firebase_analytics/firebase_analytics/android/src/main/kotlin/io/flutter/plugins/firebase/analytics/GeneratedAndroidFirebaseAnalytics.g.kt b/packages/firebase_analytics/firebase_analytics/android/src/main/kotlin/io/flutter/plugins/firebase/analytics/GeneratedAndroidFirebaseAnalytics.g.kt index fdfc88dc8f42..e2dd133d1e21 100644 --- a/packages/firebase_analytics/firebase_analytics/android/src/main/kotlin/io/flutter/plugins/firebase/analytics/GeneratedAndroidFirebaseAnalytics.g.kt +++ b/packages/firebase_analytics/firebase_analytics/android/src/main/kotlin/io/flutter/plugins/firebase/analytics/GeneratedAndroidFirebaseAnalytics.g.kt @@ -1,7 +1,7 @@ // Copyright 2025, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v25.3.2), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), do not edit directly. // See also: https://pub.dev/packages/pigeon @file:Suppress("UNCHECKED_CAST", "ArrayInDataClass") @@ -37,36 +37,150 @@ private object GeneratedAndroidFirebaseAnalyticsPigeonUtils { ) } } + fun doubleEquals(a: Double, b: Double): Boolean { + // Normalize -0.0 to 0.0 and handle NaN equality. + return (if (a == 0.0) 0.0 else a) == (if (b == 0.0) 0.0 else b) || (a.isNaN() && b.isNaN()) + } + + fun floatEquals(a: Float, b: Float): Boolean { + // Normalize -0.0 to 0.0 and handle NaN equality. + return (if (a == 0.0f) 0.0f else a) == (if (b == 0.0f) 0.0f else b) || (a.isNaN() && b.isNaN()) + } + + fun doubleHash(d: Double): Int { + // Normalize -0.0 to 0.0 and handle NaN to ensure consistent hash codes. + val normalized = if (d == 0.0) 0.0 else d + val bits = java.lang.Double.doubleToLongBits(normalized) + return (bits xor (bits ushr 32)).toInt() + } + + fun floatHash(f: Float): Int { + // Normalize -0.0 to 0.0 and handle NaN to ensure consistent hash codes. + val normalized = if (f == 0.0f) 0.0f else f + return java.lang.Float.floatToIntBits(normalized) + } + fun deepEquals(a: Any?, b: Any?): Boolean { + if (a === b) { + return true + } + if (a == null || b == null) { + return false + } if (a is ByteArray && b is ByteArray) { - return a.contentEquals(b) + return a.contentEquals(b) } if (a is IntArray && b is IntArray) { - return a.contentEquals(b) + return a.contentEquals(b) } if (a is LongArray && b is LongArray) { - return a.contentEquals(b) + return a.contentEquals(b) } if (a is DoubleArray && b is DoubleArray) { - return a.contentEquals(b) + if (a.size != b.size) return false + for (i in a.indices) { + if (!doubleEquals(a[i], b[i])) return false + } + return true + } + if (a is FloatArray && b is FloatArray) { + if (a.size != b.size) return false + for (i in a.indices) { + if (!floatEquals(a[i], b[i])) return false + } + return true } if (a is Array<*> && b is Array<*>) { - return a.size == b.size && - a.indices.all{ deepEquals(a[it], b[it]) } + if (a.size != b.size) return false + for (i in a.indices) { + if (!deepEquals(a[i], b[i])) return false + } + return true } if (a is List<*> && b is List<*>) { - return a.size == b.size && - a.indices.all{ deepEquals(a[it], b[it]) } + if (a.size != b.size) return false + val iterA = a.iterator() + val iterB = b.iterator() + while (iterA.hasNext() && iterB.hasNext()) { + if (!deepEquals(iterA.next(), iterB.next())) return false + } + return true } if (a is Map<*, *> && b is Map<*, *>) { - return a.size == b.size && a.all { - (b as Map).containsKey(it.key) && - deepEquals(it.value, b[it.key]) + if (a.size != b.size) return false + for (entry in a) { + val key = entry.key + var found = false + for (bEntry in b) { + if (deepEquals(key, bEntry.key)) { + if (deepEquals(entry.value, bEntry.value)) { + found = true + break + } else { + return false + } + } + } + if (!found) return false } + return true + } + if (a is Double && b is Double) { + return doubleEquals(a, b) + } + if (a is Float && b is Float) { + return floatEquals(a, b) } return a == b } - + + fun deepHash(value: Any?): Int { + return when (value) { + null -> 0 + is ByteArray -> value.contentHashCode() + is IntArray -> value.contentHashCode() + is LongArray -> value.contentHashCode() + is DoubleArray -> { + var result = 1 + for (item in value) { + result = 31 * result + doubleHash(item) + } + result + } + is FloatArray -> { + var result = 1 + for (item in value) { + result = 31 * result + floatHash(item) + } + result + } + is Array<*> -> { + var result = 1 + for (item in value) { + result = 31 * result + deepHash(item) + } + result + } + is List<*> -> { + var result = 1 + for (item in value) { + result = 31 * result + deepHash(item) + } + result + } + is Map<*, *> -> { + var result = 0 + for (entry in value) { + result += ((deepHash(entry.key) * 31) xor deepHash(entry.value)) + } + result + } + is Double -> doubleHash(value) + is Float -> floatHash(value) + else -> value.hashCode() + } + } + } /** @@ -79,7 +193,7 @@ class FlutterError ( val code: String, override val message: String? = null, val details: Any? = null -) : Throwable() +) : RuntimeException() /** Generated class from Pigeon that represents data sent in messages. */ data class AnalyticsEvent ( @@ -101,15 +215,22 @@ data class AnalyticsEvent ( ) } override fun equals(other: Any?): Boolean { - if (other !is AnalyticsEvent) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeneratedAndroidFirebaseAnalyticsPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as AnalyticsEvent + return GeneratedAndroidFirebaseAnalyticsPigeonUtils.deepEquals(this.name, other.name) && GeneratedAndroidFirebaseAnalyticsPigeonUtils.deepEquals(this.parameters, other.parameters) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeneratedAndroidFirebaseAnalyticsPigeonUtils.deepHash(this.name) + result = 31 * result + GeneratedAndroidFirebaseAnalyticsPigeonUtils.deepHash(this.parameters) + return result + } } private open class GeneratedAndroidFirebaseAnalyticsPigeonCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { diff --git a/packages/firebase_analytics/firebase_analytics/ios/firebase_analytics/Sources/firebase_analytics/FirebaseAnalyticsMessages.g.swift b/packages/firebase_analytics/firebase_analytics/ios/firebase_analytics/Sources/firebase_analytics/FirebaseAnalyticsMessages.g.swift index d8b175ba6e20..e0f11296f10a 100644 --- a/packages/firebase_analytics/firebase_analytics/ios/firebase_analytics/Sources/firebase_analytics/FirebaseAnalyticsMessages.g.swift +++ b/packages/firebase_analytics/firebase_analytics/ios/firebase_analytics/Sources/firebase_analytics/FirebaseAnalyticsMessages.g.swift @@ -1,7 +1,7 @@ // Copyright 2025, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v25.3.2), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), do not edit directly. // See also: https://pub.dev/packages/pigeon import Foundation @@ -52,7 +52,7 @@ private func wrapError(_ error: Any) -> [Any?] { } return [ "\(error)", - "\(type(of: error))", + "\(Swift.type(of: error))", "Stacktrace: \(Thread.callStackSymbols)", ] } @@ -66,6 +66,19 @@ private func nilOrValue(_ value: Any?) -> T? { return value as! T? } +private func doubleEqualsFirebaseAnalyticsMessages(_ lhs: Double, _ rhs: Double) -> Bool { + (lhs.isNaN && rhs.isNaN) || lhs == rhs +} + +private func doubleHashFirebaseAnalyticsMessages(_ value: Double, _ hasher: inout Hasher) { + if value.isNaN { + hasher.combine(0x7FF8_0000_0000_0000) + } else { + // Normalize -0.0 to 0.0 + hasher.combine(value == 0 ? 0 : value) + } +} + func deepEqualsFirebaseAnalyticsMessages(_ lhs: Any?, _ rhs: Any?) -> Bool { let cleanLhs = nilOrValue(lhs) as Any? let cleanRhs = nilOrValue(rhs) as Any? @@ -76,59 +89,90 @@ func deepEqualsFirebaseAnalyticsMessages(_ lhs: Any?, _ rhs: Any?) -> Bool { case (nil, _), (_, nil): return false - case is (Void, Void): + case let (lhs as AnyObject, rhs as AnyObject) where lhs === rhs: return true - case let (cleanLhsHashable, cleanRhsHashable) as (AnyHashable, AnyHashable): - return cleanLhsHashable == cleanRhsHashable + case is (Void, Void): + return true - case let (cleanLhsArray, cleanRhsArray) as ([Any?], [Any?]): - guard cleanLhsArray.count == cleanRhsArray.count else { return false } - for (index, element) in cleanLhsArray.enumerated() { - if !deepEqualsFirebaseAnalyticsMessages(element, cleanRhsArray[index]) { + case let (lhsArray, rhsArray) as ([Any?], [Any?]): + guard lhsArray.count == rhsArray.count else { return false } + for (index, element) in lhsArray.enumerated() { + if !deepEqualsFirebaseAnalyticsMessages(element, rhsArray[index]) { return false } } return true - case let (cleanLhsDictionary, cleanRhsDictionary) as ([AnyHashable: Any?], [AnyHashable: Any?]): - guard cleanLhsDictionary.count == cleanRhsDictionary.count else { return false } - for (key, cleanLhsValue) in cleanLhsDictionary { - guard cleanRhsDictionary.index(forKey: key) != nil else { return false } - if !deepEqualsFirebaseAnalyticsMessages(cleanLhsValue, cleanRhsDictionary[key]!) { + case let (lhsArray, rhsArray) as ([Double], [Double]): + guard lhsArray.count == rhsArray.count else { return false } + for (index, element) in lhsArray.enumerated() { + if !doubleEqualsFirebaseAnalyticsMessages(element, rhsArray[index]) { return false } } return true + case let (lhsDictionary, rhsDictionary) as ([AnyHashable: Any?], [AnyHashable: Any?]): + guard lhsDictionary.count == rhsDictionary.count else { return false } + for (lhsKey, lhsValue) in lhsDictionary { + var found = false + for (rhsKey, rhsValue) in rhsDictionary { + if deepEqualsFirebaseAnalyticsMessages(lhsKey, rhsKey) { + if deepEqualsFirebaseAnalyticsMessages(lhsValue, rhsValue) { + found = true + break + } else { + return false + } + } + } + if !found { return false } + } + return true + + case let (lhs as Double, rhs as Double): + return doubleEqualsFirebaseAnalyticsMessages(lhs, rhs) + + case let (lhsHashable, rhsHashable) as (AnyHashable, AnyHashable): + return lhsHashable == rhsHashable + default: - // Any other type shouldn't be able to be used with pigeon. File an issue if you find this to be - // untrue. return false } } func deepHashFirebaseAnalyticsMessages(value: Any?, hasher: inout Hasher) { - if let valueList = value as? [AnyHashable] { - for item in valueList { - deepHashFirebaseAnalyticsMessages(value: item, hasher: &hasher) - } - return - } - - if let valueDict = value as? [AnyHashable: AnyHashable] { - for key in valueDict.keys { - hasher.combine(key) - deepHashFirebaseAnalyticsMessages(value: valueDict[key]!, hasher: &hasher) + let cleanValue = nilOrValue(value) as Any? + if let cleanValue { + if let doubleValue = cleanValue as? Double { + doubleHashFirebaseAnalyticsMessages(doubleValue, &hasher) + } else if let valueList = cleanValue as? [Any?] { + for item in valueList { + deepHashFirebaseAnalyticsMessages(value: item, hasher: &hasher) + } + } else if let valueList = cleanValue as? [Double] { + for item in valueList { + doubleHashFirebaseAnalyticsMessages(item, &hasher) + } + } else if let valueDict = cleanValue as? [AnyHashable: Any?] { + var result = 0 + for (key, value) in valueDict { + var entryKeyHasher = Hasher() + deepHashFirebaseAnalyticsMessages(value: key, hasher: &entryKeyHasher) + var entryValueHasher = Hasher() + deepHashFirebaseAnalyticsMessages(value: value, hasher: &entryValueHasher) + result = result &+ ((entryKeyHasher.finalize() &* 31) ^ entryValueHasher.finalize()) + } + hasher.combine(result) + } else if let hashableValue = cleanValue as? AnyHashable { + hasher.combine(hashableValue) + } else { + hasher.combine(String(describing: cleanValue)) } - return - } - - if let hashableValue = value as? AnyHashable { - hasher.combine(hashableValue.hashValue) + } else { + hasher.combine(0) } - - return hasher.combine(String(describing: value)) } /// Generated class from Pigeon that represents data sent in messages. @@ -155,11 +199,20 @@ struct AnalyticsEvent: Hashable { } static func == (lhs: AnalyticsEvent, rhs: AnalyticsEvent) -> Bool { - deepEqualsFirebaseAnalyticsMessages(lhs.toList(), rhs.toList()) + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return deepEqualsFirebaseAnalyticsMessages(lhs.name, rhs.name) && + deepEqualsFirebaseAnalyticsMessages( + lhs.parameters, + rhs.parameters + ) } func hash(into hasher: inout Hasher) { - deepHashFirebaseAnalyticsMessages(value: toList(), hasher: &hasher) + hasher.combine("AnalyticsEvent") + deepHashFirebaseAnalyticsMessages(value: name, hasher: &hasher) + deepHashFirebaseAnalyticsMessages(value: parameters, hasher: &hasher) } } diff --git a/packages/firebase_analytics/firebase_analytics/windows/messages.g.cpp b/packages/firebase_analytics/firebase_analytics/windows/messages.g.cpp index 14a92edf1452..8da8a92f2b39 100644 --- a/packages/firebase_analytics/firebase_analytics/windows/messages.g.cpp +++ b/packages/firebase_analytics/firebase_analytics/windows/messages.g.cpp @@ -1,7 +1,7 @@ // Copyright 2025, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v25.3.2), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), do not edit directly. // See also: https://pub.dev/packages/pigeon #undef _HAS_EXCEPTIONS @@ -13,16 +13,18 @@ #include #include +#include +#include #include #include #include namespace firebase_analytics_windows { -using flutter::BasicMessageChannel; -using flutter::CustomEncodableValue; -using flutter::EncodableList; -using flutter::EncodableMap; -using flutter::EncodableValue; +using ::flutter::BasicMessageChannel; +using ::flutter::CustomEncodableValue; +using ::flutter::EncodableList; +using ::flutter::EncodableMap; +using ::flutter::EncodableValue; FlutterError CreateConnectionError(const std::string channel_name) { return FlutterError( @@ -31,6 +33,212 @@ FlutterError CreateConnectionError(const std::string channel_name) { EncodableValue("")); } +namespace { +template +bool PigeonInternalDeepEquals(const T& a, const T& b); + +bool PigeonInternalDeepEquals(const double& a, const double& b); + +template +bool PigeonInternalDeepEquals(const std::vector& a, const std::vector& b); + +template +bool PigeonInternalDeepEquals(const std::map& a, const std::map& b); + +template +bool PigeonInternalDeepEquals(const std::optional& a, + const std::optional& b); + +template +bool PigeonInternalDeepEquals(const std::unique_ptr& a, + const std::unique_ptr& b); + +bool PigeonInternalDeepEquals(const ::flutter::EncodableValue& a, + const ::flutter::EncodableValue& b); + +template +bool PigeonInternalDeepEquals(const T& a, const T& b) { + return a == b; +} + +template +bool PigeonInternalDeepEquals(const std::vector& a, + const std::vector& b) { + if (a.size() != b.size()) { + return false; + } + for (size_t i = 0; i < a.size(); ++i) { + if (!PigeonInternalDeepEquals(a[i], b[i])) { + return false; + } + } + return true; +} + +template +bool PigeonInternalDeepEquals(const std::map& a, + const std::map& b) { + if (a.size() != b.size()) { + return false; + } + for (const auto& kv : a) { + bool found = false; + for (const auto& b_kv : b) { + if (PigeonInternalDeepEquals(kv.first, b_kv.first)) { + if (PigeonInternalDeepEquals(kv.second, b_kv.second)) { + found = true; + break; + } else { + return false; + } + } + } + if (!found) { + return false; + } + } + return true; +} + +bool PigeonInternalDeepEquals(const double& a, const double& b) { + // Normalize -0.0 to 0.0 and handle NaN equality. + return (a == b) || (std::isnan(a) && std::isnan(b)); +} + +template +bool PigeonInternalDeepEquals(const std::optional& a, + const std::optional& b) { + if (!a && !b) { + return true; + } + if (!a || !b) { + return false; + } + return PigeonInternalDeepEquals(*a, *b); +} + +template +bool PigeonInternalDeepEquals(const std::unique_ptr& a, + const std::unique_ptr& b) { + if (a.get() == b.get()) { + return true; + } + if (!a || !b) { + return false; + } + return PigeonInternalDeepEquals(*a, *b); +} + +bool PigeonInternalDeepEquals(const ::flutter::EncodableValue& a, + const ::flutter::EncodableValue& b) { + if (a.index() != b.index()) { + return false; + } + if (const double* da = std::get_if(&a)) { + return PigeonInternalDeepEquals(*da, std::get(b)); + } else if (const ::flutter::EncodableList* la = + std::get_if<::flutter::EncodableList>(&a)) { + return PigeonInternalDeepEquals(*la, std::get<::flutter::EncodableList>(b)); + } else if (const ::flutter::EncodableMap* ma = + std::get_if<::flutter::EncodableMap>(&a)) { + return PigeonInternalDeepEquals(*ma, std::get<::flutter::EncodableMap>(b)); + } + return a == b; +} + +template +size_t PigeonInternalDeepHash(const T& v); + +size_t PigeonInternalDeepHash(const double& v); + +template +size_t PigeonInternalDeepHash(const std::vector& v); + +template +size_t PigeonInternalDeepHash(const std::map& v); + +template +size_t PigeonInternalDeepHash(const std::optional& v); + +template +size_t PigeonInternalDeepHash(const std::unique_ptr& v); + +size_t PigeonInternalDeepHash(const ::flutter::EncodableValue& v); + +template +size_t PigeonInternalDeepHash(const T& v) { + return std::hash()(v); +} + +template +size_t PigeonInternalDeepHash(const std::vector& v) { + size_t result = 1; + for (const auto& item : v) { + result = result * 31 + PigeonInternalDeepHash(item); + } + return result; +} + +template +size_t PigeonInternalDeepHash(const std::map& v) { + size_t result = 0; + for (const auto& kv : v) { + result += ((PigeonInternalDeepHash(kv.first) * 31) ^ + PigeonInternalDeepHash(kv.second)); + } + return result; +} + +size_t PigeonInternalDeepHash(const double& v) { + if (std::isnan(v)) { + // Normalize NaN to a consistent hash. + return std::hash()(std::numeric_limits::quiet_NaN()); + } + if (v == 0.0) { + // Normalize -0.0 to 0.0 so they have the same hash code. + return std::hash()(0.0); + } + return std::hash()(v); +} + +template +size_t PigeonInternalDeepHash(const std::optional& v) { + return v ? PigeonInternalDeepHash(*v) : 0; +} + +template +size_t PigeonInternalDeepHash(const std::unique_ptr& v) { + return v ? PigeonInternalDeepHash(*v) : 0; +} + +size_t PigeonInternalDeepHash(const ::flutter::EncodableValue& v) { + size_t result = v.index(); + if (const double* dv = std::get_if(&v)) { + result = result * 31 + PigeonInternalDeepHash(*dv); + } else if (const ::flutter::EncodableList* lv = + std::get_if<::flutter::EncodableList>(&v)) { + result = result * 31 + PigeonInternalDeepHash(*lv); + } else if (const ::flutter::EncodableMap* mv = + std::get_if<::flutter::EncodableMap>(&v)) { + result = result * 31 + PigeonInternalDeepHash(*mv); + } else { + std::visit( + [&result](const auto& val) { + using T = std::decay_t; + if constexpr (!std::is_same_v && + !std::is_same_v && + !std::is_same_v && + !std::is_same_v && + !std::is_same_v) { + result = result * 31 + PigeonInternalDeepHash(val); + } + }, + v); + } + return result; +} + +} // namespace // AnalyticsEvent AnalyticsEvent::AnalyticsEvent(const std::string& name) : name_(name) {} @@ -75,22 +283,40 @@ AnalyticsEvent AnalyticsEvent::FromEncodableList(const EncodableList& list) { return decoded; } +bool AnalyticsEvent::operator==(const AnalyticsEvent& other) const { + return PigeonInternalDeepEquals(name_, other.name_) && + PigeonInternalDeepEquals(parameters_, other.parameters_); +} + +bool AnalyticsEvent::operator!=(const AnalyticsEvent& other) const { + return !(*this == other); +} + +size_t AnalyticsEvent::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(name_); + result = result * 31 + PigeonInternalDeepHash(parameters_); + return result; +} + +size_t PigeonInternalDeepHash(const AnalyticsEvent& v) { return v.Hash(); } + PigeonInternalCodecSerializer::PigeonInternalCodecSerializer() {} EncodableValue PigeonInternalCodecSerializer::ReadValueOfType( - uint8_t type, flutter::ByteStreamReader* stream) const { + uint8_t type, ::flutter::ByteStreamReader* stream) const { switch (type) { case 129: { return CustomEncodableValue(AnalyticsEvent::FromEncodableList( std::get(ReadValue(stream)))); } default: - return flutter::StandardCodecSerializer::ReadValueOfType(type, stream); + return ::flutter::StandardCodecSerializer::ReadValueOfType(type, stream); } } void PigeonInternalCodecSerializer::WriteValue( - const EncodableValue& value, flutter::ByteStreamWriter* stream) const { + const EncodableValue& value, ::flutter::ByteStreamWriter* stream) const { if (const CustomEncodableValue* custom_value = std::get_if(&value)) { if (custom_value->type() == typeid(AnalyticsEvent)) { @@ -102,24 +328,25 @@ void PigeonInternalCodecSerializer::WriteValue( return; } } - flutter::StandardCodecSerializer::WriteValue(value, stream); + ::flutter::StandardCodecSerializer::WriteValue(value, stream); } /// The codec used by FirebaseAnalyticsHostApi. -const flutter::StandardMessageCodec& FirebaseAnalyticsHostApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance( +const ::flutter::StandardMessageCodec& FirebaseAnalyticsHostApi::GetCodec() { + return ::flutter::StandardMessageCodec::GetInstance( &PigeonInternalCodecSerializer::GetInstance()); } // Sets up an instance of `FirebaseAnalyticsHostApi` to handle messages through // the `binary_messenger`. -void FirebaseAnalyticsHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, - FirebaseAnalyticsHostApi* api) { +void FirebaseAnalyticsHostApi::SetUp( + ::flutter::BinaryMessenger* binary_messenger, + FirebaseAnalyticsHostApi* api) { FirebaseAnalyticsHostApi::SetUp(binary_messenger, api, ""); } void FirebaseAnalyticsHostApi::SetUp( - flutter::BinaryMessenger* binary_messenger, FirebaseAnalyticsHostApi* api, + ::flutter::BinaryMessenger* binary_messenger, FirebaseAnalyticsHostApi* api, const std::string& message_channel_suffix) { const std::string prepended_suffix = message_channel_suffix.length() > 0 @@ -135,7 +362,7 @@ void FirebaseAnalyticsHostApi::SetUp( if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_event_arg = args.at(0); @@ -173,7 +400,7 @@ void FirebaseAnalyticsHostApi::SetUp( if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_user_id_arg = args.at(0); @@ -207,7 +434,7 @@ void FirebaseAnalyticsHostApi::SetUp( if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_name_arg = args.at(0); @@ -248,7 +475,7 @@ void FirebaseAnalyticsHostApi::SetUp( if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_enabled_arg = args.at(0); @@ -285,7 +512,7 @@ void FirebaseAnalyticsHostApi::SetUp( if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { api->ResetAnalyticsData( [reply](std::optional&& output) { @@ -315,7 +542,7 @@ void FirebaseAnalyticsHostApi::SetUp( if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_timeout_arg = args.at(0); @@ -352,7 +579,7 @@ void FirebaseAnalyticsHostApi::SetUp( if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_consent_arg = args.at(0); @@ -390,7 +617,7 @@ void FirebaseAnalyticsHostApi::SetUp( if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_parameters_arg = args.at(0); @@ -425,7 +652,7 @@ void FirebaseAnalyticsHostApi::SetUp( if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { api->GetAppInstanceId( [reply](ErrorOr>&& output) { @@ -461,7 +688,7 @@ void FirebaseAnalyticsHostApi::SetUp( if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { api->GetSessionId( [reply](ErrorOr>&& output) { @@ -497,7 +724,7 @@ void FirebaseAnalyticsHostApi::SetUp( if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_arguments_arg = args.at(0); @@ -535,7 +762,7 @@ void FirebaseAnalyticsHostApi::SetUp( if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_transaction_id_arg = args.at(0); diff --git a/packages/firebase_analytics/firebase_analytics/windows/messages.g.h b/packages/firebase_analytics/firebase_analytics/windows/messages.g.h index b755d9ef6045..7c22489d9c28 100644 --- a/packages/firebase_analytics/firebase_analytics/windows/messages.g.h +++ b/packages/firebase_analytics/firebase_analytics/windows/messages.g.h @@ -1,7 +1,7 @@ // Copyright 2025, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v25.3.2), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), do not edit directly. // See also: https://pub.dev/packages/pigeon #ifndef PIGEON_MESSAGES_G_H_ @@ -25,17 +25,17 @@ class FlutterError { explicit FlutterError(const std::string& code, const std::string& message) : code_(code), message_(message) {} explicit FlutterError(const std::string& code, const std::string& message, - const flutter::EncodableValue& details) + const ::flutter::EncodableValue& details) : code_(code), message_(message), details_(details) {} const std::string& code() const { return code_; } const std::string& message() const { return message_; } - const flutter::EncodableValue& details() const { return details_; } + const ::flutter::EncodableValue& details() const { return details_; } private: std::string code_; std::string message_; - flutter::EncodableValue details_; + ::flutter::EncodableValue details_; }; template @@ -66,25 +66,38 @@ class AnalyticsEvent { // Constructs an object setting all fields. explicit AnalyticsEvent(const std::string& name, - const flutter::EncodableMap* parameters); + const ::flutter::EncodableMap* parameters); const std::string& name() const; void set_name(std::string_view value_arg); - const flutter::EncodableMap* parameters() const; - void set_parameters(const flutter::EncodableMap* value_arg); - void set_parameters(const flutter::EncodableMap& value_arg); + const ::flutter::EncodableMap* parameters() const; + void set_parameters(const ::flutter::EncodableMap* value_arg); + void set_parameters(const ::flutter::EncodableMap& value_arg); + bool operator==(const AnalyticsEvent& other) const; + bool operator!=(const AnalyticsEvent& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + + private: + static AnalyticsEvent FromEncodableList(const ::flutter::EncodableList& list); + + public: + public: + ::flutter::EncodableList ToEncodableList() const; + + private: private: - static AnalyticsEvent FromEncodableList(const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; friend class FirebaseAnalyticsHostApi; friend class PigeonInternalCodecSerializer; std::string name_; - std::optional parameters_; + std::optional<::flutter::EncodableMap> parameters_; }; -class PigeonInternalCodecSerializer : public flutter::StandardCodecSerializer { +class PigeonInternalCodecSerializer + : public ::flutter::StandardCodecSerializer { public: PigeonInternalCodecSerializer(); inline static PigeonInternalCodecSerializer& GetInstance() { @@ -92,12 +105,12 @@ class PigeonInternalCodecSerializer : public flutter::StandardCodecSerializer { return sInstance; } - void WriteValue(const flutter::EncodableValue& value, - flutter::ByteStreamWriter* stream) const override; + void WriteValue(const ::flutter::EncodableValue& value, + ::flutter::ByteStreamWriter* stream) const override; protected: - flutter::EncodableValue ReadValueOfType( - uint8_t type, flutter::ByteStreamReader* stream) const override; + ::flutter::EncodableValue ReadValueOfType( + uint8_t type, ::flutter::ByteStreamReader* stream) const override; }; // Generated interface from Pigeon that represents a handler of messages from @@ -108,7 +121,7 @@ class FirebaseAnalyticsHostApi { FirebaseAnalyticsHostApi& operator=(const FirebaseAnalyticsHostApi&) = delete; virtual ~FirebaseAnalyticsHostApi() {} virtual void LogEvent( - const flutter::EncodableMap& event, + const ::flutter::EncodableMap& event, std::function reply)> result) = 0; virtual void SetUserId( const std::string* user_id, @@ -125,10 +138,10 @@ class FirebaseAnalyticsHostApi { int64_t timeout, std::function reply)> result) = 0; virtual void SetConsent( - const flutter::EncodableMap& consent, + const ::flutter::EncodableMap& consent, std::function reply)> result) = 0; virtual void SetDefaultEventParameters( - const flutter::EncodableMap* parameters, + const ::flutter::EncodableMap* parameters, std::function reply)> result) = 0; virtual void GetAppInstanceId( std::function> reply)> @@ -136,23 +149,23 @@ class FirebaseAnalyticsHostApi { virtual void GetSessionId( std::function> reply)> result) = 0; virtual void InitiateOnDeviceConversionMeasurement( - const flutter::EncodableMap& arguments, + const ::flutter::EncodableMap& arguments, std::function reply)> result) = 0; virtual void LogTransaction( const std::string& transaction_id, std::function reply)> result) = 0; // The codec used by FirebaseAnalyticsHostApi. - static const flutter::StandardMessageCodec& GetCodec(); + static const ::flutter::StandardMessageCodec& GetCodec(); // Sets up an instance of `FirebaseAnalyticsHostApi` to handle messages // through the `binary_messenger`. - static void SetUp(flutter::BinaryMessenger* binary_messenger, + static void SetUp(::flutter::BinaryMessenger* binary_messenger, FirebaseAnalyticsHostApi* api); - static void SetUp(flutter::BinaryMessenger* binary_messenger, + static void SetUp(::flutter::BinaryMessenger* binary_messenger, FirebaseAnalyticsHostApi* api, const std::string& message_channel_suffix); - static flutter::EncodableValue WrapError(std::string_view error_message); - static flutter::EncodableValue WrapError(const FlutterError& error); + static ::flutter::EncodableValue WrapError(std::string_view error_message); + static ::flutter::EncodableValue WrapError(const FlutterError& error); protected: FirebaseAnalyticsHostApi() = default; diff --git a/packages/firebase_analytics/firebase_analytics_platform_interface/lib/src/pigeon/messages.pigeon.dart b/packages/firebase_analytics/firebase_analytics_platform_interface/lib/src/pigeon/messages.pigeon.dart index 003dd773639e..b61f5de91985 100644 --- a/packages/firebase_analytics/firebase_analytics_platform_interface/lib/src/pigeon/messages.pigeon.dart +++ b/packages/firebase_analytics/firebase_analytics_platform_interface/lib/src/pigeon/messages.pigeon.dart @@ -1,21 +1,40 @@ // Copyright 2025, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v25.3.2), do not edit directly. +// Autogenerated from Pigeon (v26.3.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, no_leading_underscores_for_local_identifiers +// ignore_for_file: unused_import, unused_shown_name +// ignore_for_file: type=lint import 'dart:async'; -import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; +import 'dart:typed_data' show Float64List, Int32List, Int64List; -import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer; import 'package:flutter/services.dart'; +import 'package:meta/meta.dart' show immutable, protected, visibleForTesting; -PlatformException _createConnectionError(String channelName) { - return PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel: "$channelName".', - ); +Object? _extractReplyValueOrThrow( + List? replyList, + String channelName, { + required bool isNullValid, +}) { + if (replyList == null) { + throw PlatformException( + code: 'channel-error', + message: 'Unable to establish connection on channel: "$channelName".', + ); + } else if (replyList.length > 1) { + throw PlatformException( + code: replyList[0]! as String, + message: replyList[1] as String?, + details: replyList[2], + ); + } else if (!isNullValid && (replyList.isNotEmpty && replyList[0] == null)) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } + return replyList.firstOrNull; } List wrapResponse( @@ -30,20 +49,67 @@ List wrapResponse( } bool _deepEquals(Object? a, Object? b) { + if (identical(a, b)) { + return true; + } + if (a is double && b is double) { + if (a.isNaN && b.isNaN) { + return true; + } + return a == b; + } if (a is List && b is List) { return a.length == b.length && a.indexed .every(((int, dynamic) item) => _deepEquals(item.$2, b[item.$1])); } if (a is Map && b is Map) { - return a.length == b.length && - a.entries.every((MapEntry entry) => - (b as Map).containsKey(entry.key) && - _deepEquals(entry.value, b[entry.key])); + if (a.length != b.length) { + return false; + } + for (final MapEntry entryA in a.entries) { + bool found = false; + for (final MapEntry entryB in b.entries) { + if (_deepEquals(entryA.key, entryB.key)) { + if (_deepEquals(entryA.value, entryB.value)) { + found = true; + break; + } else { + return false; + } + } + } + if (!found) { + return false; + } + } + return true; } return a == b; } +int _deepHash(Object? value) { + if (value is List) { + return Object.hashAll(value.map(_deepHash)); + } + if (value is Map) { + int result = 0; + for (final MapEntry entry in value.entries) { + result += (_deepHash(entry.key) * 31) ^ _deepHash(entry.value); + } + return result; + } + if (value is double && value.isNaN) { + // Normalize NaN to a consistent hash. + return 0x7FF8000000000000.hashCode; + } + if (value is double && value == 0.0) { + // Normalize -0.0 to 0.0 so they have the same hash code. + return 0.0.hashCode; + } + return value.hashCode; +} + class AnalyticsEvent { AnalyticsEvent({ required this.name, @@ -83,12 +149,13 @@ class AnalyticsEvent { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(name, other.name) && + _deepEquals(parameters, other.parameters); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()); + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class _PigeonCodec extends StandardMessageCodec { @@ -133,313 +200,231 @@ class FirebaseAnalyticsHostApi { final String pigeonVar_messageChannelSuffix; Future logEvent(Map event) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_analytics_platform_interface.FirebaseAnalyticsHostApi.logEvent$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([event]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future setUserId(String? userId) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_analytics_platform_interface.FirebaseAnalyticsHostApi.setUserId$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([userId]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future setUserProperty(String name, String? value) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_analytics_platform_interface.FirebaseAnalyticsHostApi.setUserProperty$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([name, value]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future setAnalyticsCollectionEnabled(bool enabled) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_analytics_platform_interface.FirebaseAnalyticsHostApi.setAnalyticsCollectionEnabled$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([enabled]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future resetAnalyticsData() async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_analytics_platform_interface.FirebaseAnalyticsHostApi.resetAnalyticsData$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future setSessionTimeoutDuration(int timeout) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_analytics_platform_interface.FirebaseAnalyticsHostApi.setSessionTimeoutDuration$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([timeout]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future setConsent(Map consent) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_analytics_platform_interface.FirebaseAnalyticsHostApi.setConsent$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([consent]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future setDefaultEventParameters( Map? parameters) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_analytics_platform_interface.FirebaseAnalyticsHostApi.setDefaultEventParameters$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([parameters]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future getAppInstanceId() async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_analytics_platform_interface.FirebaseAnalyticsHostApi.getAppInstanceId$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return (pigeonVar_replyList[0] as String?); - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); + return pigeonVar_replyValue as String?; } Future getSessionId() async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_analytics_platform_interface.FirebaseAnalyticsHostApi.getSessionId$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return (pigeonVar_replyList[0] as int?); - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); + return pigeonVar_replyValue as int?; } Future initiateOnDeviceConversionMeasurement( Map arguments) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_analytics_platform_interface.FirebaseAnalyticsHostApi.initiateOnDeviceConversionMeasurement$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([arguments]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future logTransaction(String transactionId) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_analytics_platform_interface.FirebaseAnalyticsHostApi.logTransaction$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([transactionId]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } } diff --git a/packages/firebase_analytics/firebase_analytics_platform_interface/pubspec.yaml b/packages/firebase_analytics/firebase_analytics_platform_interface/pubspec.yaml index ad780d100a1d..d21a75f0cb4e 100644 --- a/packages/firebase_analytics/firebase_analytics_platform_interface/pubspec.yaml +++ b/packages/firebase_analytics/firebase_analytics_platform_interface/pubspec.yaml @@ -20,4 +20,4 @@ dev_dependencies: firebase_core_platform_interface: ^6.0.3 flutter_test: sdk: flutter - pigeon: 25.3.2 + pigeon: 26.3.4 diff --git a/packages/firebase_analytics/firebase_analytics_platform_interface/test/pigeon/test_api.dart b/packages/firebase_analytics/firebase_analytics_platform_interface/test/pigeon/test_api.dart index 591cce9f19e2..830f97b9696d 100644 --- a/packages/firebase_analytics/firebase_analytics_platform_interface/test/pigeon/test_api.dart +++ b/packages/firebase_analytics/firebase_analytics_platform_interface/test/pigeon/test_api.dart @@ -1,9 +1,9 @@ // Copyright 2025, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v25.3.2), do not edit directly. +// Autogenerated from Pigeon (v26.3.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, unnecessary_import, no_leading_underscores_for_local_identifiers +// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, unnecessary_import, no_leading_underscores_for_local_identifiers, omit_obvious_local_variable_types // ignore_for_file: avoid_relative_lib_imports import 'dart:async'; import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; @@ -77,9 +77,7 @@ abstract class TestFirebaseAnalyticsHostApi { messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_analytics_platform_interface.FirebaseAnalyticsHostApi.logEvent$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -90,15 +88,11 @@ abstract class TestFirebaseAnalyticsHostApi { _testBinaryMessengerBinding!.defaultBinaryMessenger .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_analytics_platform_interface.FirebaseAnalyticsHostApi.logEvent was null.'); - final List args = (message as List?)!; - final Map? arg_event = - (args[0] as Map?)?.cast(); - assert(arg_event != null, - 'Argument for dev.flutter.pigeon.firebase_analytics_platform_interface.FirebaseAnalyticsHostApi.logEvent was null, expected non-null Map.'); + final List args = message! as List; + final Map arg_event = + (args[0]! as Map).cast(); try { - await api.logEvent(arg_event!); + await api.logEvent(arg_event); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -110,9 +104,7 @@ abstract class TestFirebaseAnalyticsHostApi { } } { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_analytics_platform_interface.FirebaseAnalyticsHostApi.setUserId$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -123,10 +115,8 @@ abstract class TestFirebaseAnalyticsHostApi { _testBinaryMessengerBinding!.defaultBinaryMessenger .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_analytics_platform_interface.FirebaseAnalyticsHostApi.setUserId was null.'); - final List args = (message as List?)!; - final String? arg_userId = (args[0] as String?); + final List args = message! as List; + final String? arg_userId = args[0] as String?; try { await api.setUserId(arg_userId); return wrapResponse(empty: true); @@ -140,9 +130,7 @@ abstract class TestFirebaseAnalyticsHostApi { } } { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_analytics_platform_interface.FirebaseAnalyticsHostApi.setUserProperty$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -153,15 +141,11 @@ abstract class TestFirebaseAnalyticsHostApi { _testBinaryMessengerBinding!.defaultBinaryMessenger .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_analytics_platform_interface.FirebaseAnalyticsHostApi.setUserProperty was null.'); - final List args = (message as List?)!; - final String? arg_name = (args[0] as String?); - assert(arg_name != null, - 'Argument for dev.flutter.pigeon.firebase_analytics_platform_interface.FirebaseAnalyticsHostApi.setUserProperty was null, expected non-null String.'); - final String? arg_value = (args[1] as String?); + final List args = message! as List; + final String arg_name = args[0]! as String; + final String? arg_value = args[1] as String?; try { - await api.setUserProperty(arg_name!, arg_value); + await api.setUserProperty(arg_name, arg_value); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -173,9 +157,7 @@ abstract class TestFirebaseAnalyticsHostApi { } } { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_analytics_platform_interface.FirebaseAnalyticsHostApi.setAnalyticsCollectionEnabled$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -186,14 +168,10 @@ abstract class TestFirebaseAnalyticsHostApi { _testBinaryMessengerBinding!.defaultBinaryMessenger .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_analytics_platform_interface.FirebaseAnalyticsHostApi.setAnalyticsCollectionEnabled was null.'); - final List args = (message as List?)!; - final bool? arg_enabled = (args[0] as bool?); - assert(arg_enabled != null, - 'Argument for dev.flutter.pigeon.firebase_analytics_platform_interface.FirebaseAnalyticsHostApi.setAnalyticsCollectionEnabled was null, expected non-null bool.'); + final List args = message! as List; + final bool arg_enabled = args[0]! as bool; try { - await api.setAnalyticsCollectionEnabled(arg_enabled!); + await api.setAnalyticsCollectionEnabled(arg_enabled); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -205,9 +183,7 @@ abstract class TestFirebaseAnalyticsHostApi { } } { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_analytics_platform_interface.FirebaseAnalyticsHostApi.resetAnalyticsData$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -231,9 +207,7 @@ abstract class TestFirebaseAnalyticsHostApi { } } { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_analytics_platform_interface.FirebaseAnalyticsHostApi.setSessionTimeoutDuration$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -244,14 +218,10 @@ abstract class TestFirebaseAnalyticsHostApi { _testBinaryMessengerBinding!.defaultBinaryMessenger .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_analytics_platform_interface.FirebaseAnalyticsHostApi.setSessionTimeoutDuration was null.'); - final List args = (message as List?)!; - final int? arg_timeout = (args[0] as int?); - assert(arg_timeout != null, - 'Argument for dev.flutter.pigeon.firebase_analytics_platform_interface.FirebaseAnalyticsHostApi.setSessionTimeoutDuration was null, expected non-null int.'); + final List args = message! as List; + final int arg_timeout = args[0]! as int; try { - await api.setSessionTimeoutDuration(arg_timeout!); + await api.setSessionTimeoutDuration(arg_timeout); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -263,9 +233,7 @@ abstract class TestFirebaseAnalyticsHostApi { } } { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_analytics_platform_interface.FirebaseAnalyticsHostApi.setConsent$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -276,15 +244,11 @@ abstract class TestFirebaseAnalyticsHostApi { _testBinaryMessengerBinding!.defaultBinaryMessenger .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_analytics_platform_interface.FirebaseAnalyticsHostApi.setConsent was null.'); - final List args = (message as List?)!; - final Map? arg_consent = - (args[0] as Map?)?.cast(); - assert(arg_consent != null, - 'Argument for dev.flutter.pigeon.firebase_analytics_platform_interface.FirebaseAnalyticsHostApi.setConsent was null, expected non-null Map.'); + final List args = message! as List; + final Map arg_consent = + (args[0]! as Map).cast(); try { - await api.setConsent(arg_consent!); + await api.setConsent(arg_consent); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -296,9 +260,7 @@ abstract class TestFirebaseAnalyticsHostApi { } } { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_analytics_platform_interface.FirebaseAnalyticsHostApi.setDefaultEventParameters$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -309,9 +271,7 @@ abstract class TestFirebaseAnalyticsHostApi { _testBinaryMessengerBinding!.defaultBinaryMessenger .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_analytics_platform_interface.FirebaseAnalyticsHostApi.setDefaultEventParameters was null.'); - final List args = (message as List?)!; + final List args = message! as List; final Map? arg_parameters = (args[0] as Map?)?.cast(); try { @@ -327,9 +287,7 @@ abstract class TestFirebaseAnalyticsHostApi { } } { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_analytics_platform_interface.FirebaseAnalyticsHostApi.getAppInstanceId$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -353,9 +311,7 @@ abstract class TestFirebaseAnalyticsHostApi { } } { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_analytics_platform_interface.FirebaseAnalyticsHostApi.getSessionId$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -379,9 +335,7 @@ abstract class TestFirebaseAnalyticsHostApi { } } { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_analytics_platform_interface.FirebaseAnalyticsHostApi.initiateOnDeviceConversionMeasurement$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -392,15 +346,11 @@ abstract class TestFirebaseAnalyticsHostApi { _testBinaryMessengerBinding!.defaultBinaryMessenger .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_analytics_platform_interface.FirebaseAnalyticsHostApi.initiateOnDeviceConversionMeasurement was null.'); - final List args = (message as List?)!; - final Map? arg_arguments = - (args[0] as Map?)?.cast(); - assert(arg_arguments != null, - 'Argument for dev.flutter.pigeon.firebase_analytics_platform_interface.FirebaseAnalyticsHostApi.initiateOnDeviceConversionMeasurement was null, expected non-null Map.'); + final List args = message! as List; + final Map arg_arguments = + (args[0]! as Map).cast(); try { - await api.initiateOnDeviceConversionMeasurement(arg_arguments!); + await api.initiateOnDeviceConversionMeasurement(arg_arguments); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -412,9 +362,7 @@ abstract class TestFirebaseAnalyticsHostApi { } } { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_analytics_platform_interface.FirebaseAnalyticsHostApi.logTransaction$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -425,14 +373,10 @@ abstract class TestFirebaseAnalyticsHostApi { _testBinaryMessengerBinding!.defaultBinaryMessenger .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_analytics_platform_interface.FirebaseAnalyticsHostApi.logTransaction was null.'); - final List args = (message as List?)!; - final String? arg_transactionId = (args[0] as String?); - assert(arg_transactionId != null, - 'Argument for dev.flutter.pigeon.firebase_analytics_platform_interface.FirebaseAnalyticsHostApi.logTransaction was null, expected non-null String.'); + final List args = message! as List; + final String arg_transactionId = args[0]! as String; try { - await api.logTransaction(arg_transactionId!); + await api.logTransaction(arg_transactionId); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); diff --git a/packages/firebase_app_check/analysis_options.yaml b/packages/firebase_app_check/analysis_options.yaml new file mode 100644 index 000000000000..0a5c260b3115 --- /dev/null +++ b/packages/firebase_app_check/analysis_options.yaml @@ -0,0 +1,10 @@ +# Copyright 2026 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# in the LICENSE file. + +include: ../../analysis_options.yaml + +analyzer: + exclude: + - firebase_app_check_platform_interface/lib/src/pigeon/messages.pigeon.dart + - firebase_app_check_platform_interface/pigeons/messages.dart diff --git a/packages/firebase_app_check/firebase_app_check_platform_interface/lib/src/pigeon/messages.pigeon.dart b/packages/firebase_app_check/firebase_app_check_platform_interface/lib/src/pigeon/messages.pigeon.dart index fab0d53008a2..8916928599ce 100644 --- a/packages/firebase_app_check/firebase_app_check_platform_interface/lib/src/pigeon/messages.pigeon.dart +++ b/packages/firebase_app_check/firebase_app_check_platform_interface/lib/src/pigeon/messages.pigeon.dart @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. // Autogenerated from Pigeon (v25.3.2), 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, no_leading_underscores_for_local_identifiers, require_trailing_commas +// 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, no_leading_underscores_for_local_identifiers import 'dart:async'; import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; diff --git a/packages/firebase_app_check/firebase_app_check_platform_interface/pubspec.yaml b/packages/firebase_app_check/firebase_app_check_platform_interface/pubspec.yaml index 863fa956cacf..3d90b2b238c5 100644 --- a/packages/firebase_app_check/firebase_app_check_platform_interface/pubspec.yaml +++ b/packages/firebase_app_check/firebase_app_check_platform_interface/pubspec.yaml @@ -20,4 +20,4 @@ dev_dependencies: flutter_test: sdk: flutter mockito: ^5.0.0 - pigeon: 25.3.2 + pigeon: 26.3.4 diff --git a/packages/firebase_auth/analysis_options.yaml b/packages/firebase_auth/analysis_options.yaml index 8b3451b56a01..6aa2853bfc0a 100644 --- a/packages/firebase_auth/analysis_options.yaml +++ b/packages/firebase_auth/analysis_options.yaml @@ -9,3 +9,4 @@ analyzer: exclude: - firebase_auth_platform_interface/lib/src/pigeon/messages.pigeon.dart - firebase_auth_platform_interface/test/pigeon/test_api.dart + - firebase_auth_platform_interface/pigeons/messages.dart diff --git a/packages/firebase_auth/firebase_auth/android/src/main/java/io/flutter/plugins/firebase/auth/FlutterFirebaseAuthPlugin.java b/packages/firebase_auth/firebase_auth/android/src/main/java/io/flutter/plugins/firebase/auth/FlutterFirebaseAuthPlugin.java index 74ee8c89aa14..890fbca4c32d 100755 --- a/packages/firebase_auth/firebase_auth/android/src/main/java/io/flutter/plugins/firebase/auth/FlutterFirebaseAuthPlugin.java +++ b/packages/firebase_auth/firebase_auth/android/src/main/java/io/flutter/plugins/firebase/auth/FlutterFirebaseAuthPlugin.java @@ -224,7 +224,7 @@ public void checkActionCode( @NonNull GeneratedAndroidFirebaseAuth.AuthPigeonFirebaseApp app, @NonNull String code, @NonNull - GeneratedAndroidFirebaseAuth.Result + GeneratedAndroidFirebaseAuth.Result result) { FirebaseAuth firebaseAuth = getAuthFromPigeon(app); firebaseAuth @@ -270,7 +270,7 @@ public void createUserWithEmailAndPassword( @NonNull String email, @NonNull String password, @NonNull - GeneratedAndroidFirebaseAuth.Result + GeneratedAndroidFirebaseAuth.Result result) { FirebaseAuth firebaseAuth = getAuthFromPigeon(app); @@ -293,7 +293,7 @@ public void createUserWithEmailAndPassword( public void signInAnonymously( @NonNull GeneratedAndroidFirebaseAuth.AuthPigeonFirebaseApp app, @NonNull - GeneratedAndroidFirebaseAuth.Result + GeneratedAndroidFirebaseAuth.Result result) { FirebaseAuth firebaseAuth = getAuthFromPigeon(app); firebaseAuth @@ -316,7 +316,7 @@ public void signInWithCredential( @NonNull GeneratedAndroidFirebaseAuth.AuthPigeonFirebaseApp app, @NonNull Map input, @NonNull - GeneratedAndroidFirebaseAuth.Result + GeneratedAndroidFirebaseAuth.Result result) { FirebaseAuth firebaseAuth = getAuthFromPigeon(app); AuthCredential credential = PigeonParser.getCredential(input); @@ -344,7 +344,7 @@ public void signInWithCustomToken( @NonNull GeneratedAndroidFirebaseAuth.AuthPigeonFirebaseApp app, @NonNull String token, @NonNull - GeneratedAndroidFirebaseAuth.Result + GeneratedAndroidFirebaseAuth.Result result) { FirebaseAuth firebaseAuth = getAuthFromPigeon(app); @@ -369,7 +369,7 @@ public void signInWithEmailAndPassword( @NonNull String email, @NonNull String password, @NonNull - GeneratedAndroidFirebaseAuth.Result + GeneratedAndroidFirebaseAuth.Result result) { FirebaseAuth firebaseAuth = getAuthFromPigeon(app); firebaseAuth @@ -392,7 +392,7 @@ public void signInWithEmailLink( @NonNull String email, @NonNull String emailLink, @NonNull - GeneratedAndroidFirebaseAuth.Result + GeneratedAndroidFirebaseAuth.Result result) { FirebaseAuth firebaseAuth = getAuthFromPigeon(app); firebaseAuth @@ -413,9 +413,9 @@ public void signInWithEmailLink( @Override public void signInWithProvider( @NonNull GeneratedAndroidFirebaseAuth.AuthPigeonFirebaseApp app, - @NonNull GeneratedAndroidFirebaseAuth.PigeonSignInProvider signInProvider, + @NonNull GeneratedAndroidFirebaseAuth.InternalSignInProvider signInProvider, @NonNull - GeneratedAndroidFirebaseAuth.Result + GeneratedAndroidFirebaseAuth.Result result) { FirebaseAuth firebaseAuth = getAuthFromPigeon(app); @@ -489,7 +489,7 @@ public void fetchSignInMethodsForEmail( public void sendPasswordResetEmail( @NonNull GeneratedAndroidFirebaseAuth.AuthPigeonFirebaseApp app, @NonNull String email, - @Nullable GeneratedAndroidFirebaseAuth.PigeonActionCodeSettings actionCodeSettings, + @Nullable GeneratedAndroidFirebaseAuth.InternalActionCodeSettings actionCodeSettings, @NonNull GeneratedAndroidFirebaseAuth.VoidResult result) { FirebaseAuth firebaseAuth = getAuthFromPigeon(app); @@ -527,7 +527,7 @@ public void sendPasswordResetEmail( public void sendSignInLinkToEmail( @NonNull GeneratedAndroidFirebaseAuth.AuthPigeonFirebaseApp app, @NonNull String email, - @NonNull GeneratedAndroidFirebaseAuth.PigeonActionCodeSettings actionCodeSettings, + @NonNull GeneratedAndroidFirebaseAuth.InternalActionCodeSettings actionCodeSettings, @NonNull GeneratedAndroidFirebaseAuth.VoidResult result) { FirebaseAuth firebaseAuth = getAuthFromPigeon(app); @@ -568,7 +568,7 @@ public void setLanguageCode( @Override public void setSettings( @NonNull GeneratedAndroidFirebaseAuth.AuthPigeonFirebaseApp app, - @NonNull GeneratedAndroidFirebaseAuth.PigeonFirebaseAuthSettings settings, + @NonNull GeneratedAndroidFirebaseAuth.InternalFirebaseAuthSettings settings, @NonNull GeneratedAndroidFirebaseAuth.VoidResult result) { try { FirebaseAuth firebaseAuth = getAuthFromPigeon(app); @@ -620,7 +620,7 @@ public void verifyPasswordResetCode( @Override public void verifyPhoneNumber( @NonNull GeneratedAndroidFirebaseAuth.AuthPigeonFirebaseApp app, - @NonNull GeneratedAndroidFirebaseAuth.PigeonVerifyPhoneNumberRequest request, + @NonNull GeneratedAndroidFirebaseAuth.InternalVerifyPhoneNumberRequest request, @NonNull GeneratedAndroidFirebaseAuth.Result result) { try { String eventChannelName = METHOD_CHANNEL_NAME + "/phone/" + UUID.randomUUID().toString(); @@ -730,7 +730,7 @@ public Task> getPluginConstantsForFirebaseApp(FirebaseApp fi FirebaseUser firebaseUser = firebaseAuth.getCurrentUser(); String languageCode = firebaseAuth.getLanguageCode(); - GeneratedAndroidFirebaseAuth.PigeonUserDetails user = + GeneratedAndroidFirebaseAuth.InternalUserDetails user = firebaseUser == null ? null : PigeonParser.parseFirebaseUser(firebaseUser); if (languageCode != null) { diff --git a/packages/firebase_auth/firebase_auth/android/src/main/java/io/flutter/plugins/firebase/auth/FlutterFirebaseAuthUser.java b/packages/firebase_auth/firebase_auth/android/src/main/java/io/flutter/plugins/firebase/auth/FlutterFirebaseAuthUser.java index 9f84d832c419..7039a38f18e8 100644 --- a/packages/firebase_auth/firebase_auth/android/src/main/java/io/flutter/plugins/firebase/auth/FlutterFirebaseAuthUser.java +++ b/packages/firebase_auth/firebase_auth/android/src/main/java/io/flutter/plugins/firebase/auth/FlutterFirebaseAuthUser.java @@ -73,7 +73,7 @@ public void getIdToken( @NonNull GeneratedAndroidFirebaseAuth.AuthPigeonFirebaseApp app, @NonNull Boolean forceRefresh, @NonNull - GeneratedAndroidFirebaseAuth.Result + GeneratedAndroidFirebaseAuth.Result result) { cachedThreadPool.execute( () -> { @@ -97,7 +97,7 @@ public void linkWithCredential( @NonNull GeneratedAndroidFirebaseAuth.AuthPigeonFirebaseApp app, @NonNull Map input, @NonNull - GeneratedAndroidFirebaseAuth.Result + GeneratedAndroidFirebaseAuth.Result result) { FirebaseUser firebaseUser = getCurrentUserFromPigeon(app); AuthCredential credential = PigeonParser.getCredential(input); @@ -129,9 +129,9 @@ public void linkWithCredential( @Override public void linkWithProvider( @NonNull GeneratedAndroidFirebaseAuth.AuthPigeonFirebaseApp app, - @NonNull GeneratedAndroidFirebaseAuth.PigeonSignInProvider signInProvider, + @NonNull GeneratedAndroidFirebaseAuth.InternalSignInProvider signInProvider, @NonNull - GeneratedAndroidFirebaseAuth.Result + GeneratedAndroidFirebaseAuth.Result result) { FirebaseUser firebaseUser = getCurrentUserFromPigeon(app); @@ -162,7 +162,7 @@ public void reauthenticateWithCredential( @NonNull GeneratedAndroidFirebaseAuth.AuthPigeonFirebaseApp app, @NonNull Map input, @NonNull - GeneratedAndroidFirebaseAuth.Result + GeneratedAndroidFirebaseAuth.Result result) { FirebaseUser firebaseUser = getCurrentUserFromPigeon(app); AuthCredential credential = PigeonParser.getCredential(input); @@ -194,9 +194,9 @@ public void reauthenticateWithCredential( @Override public void reauthenticateWithProvider( @NonNull GeneratedAndroidFirebaseAuth.AuthPigeonFirebaseApp app, - @NonNull GeneratedAndroidFirebaseAuth.PigeonSignInProvider signInProvider, + @NonNull GeneratedAndroidFirebaseAuth.InternalSignInProvider signInProvider, @NonNull - GeneratedAndroidFirebaseAuth.Result + GeneratedAndroidFirebaseAuth.Result result) { FirebaseUser firebaseUser = getCurrentUserFromPigeon(app); @@ -226,7 +226,7 @@ public void reauthenticateWithProvider( public void reload( @NonNull GeneratedAndroidFirebaseAuth.AuthPigeonFirebaseApp app, @NonNull - GeneratedAndroidFirebaseAuth.Result + GeneratedAndroidFirebaseAuth.Result result) { FirebaseUser firebaseUser = getCurrentUserFromPigeon(app); @@ -252,7 +252,7 @@ public void reload( @Override public void sendEmailVerification( @NonNull GeneratedAndroidFirebaseAuth.AuthPigeonFirebaseApp app, - @Nullable GeneratedAndroidFirebaseAuth.PigeonActionCodeSettings actionCodeSettings, + @Nullable GeneratedAndroidFirebaseAuth.InternalActionCodeSettings actionCodeSettings, @NonNull GeneratedAndroidFirebaseAuth.VoidResult result) { FirebaseUser firebaseUser = getCurrentUserFromPigeon(app); @@ -296,7 +296,7 @@ public void unlink( @NonNull GeneratedAndroidFirebaseAuth.AuthPigeonFirebaseApp app, @NonNull String providerId, @NonNull - GeneratedAndroidFirebaseAuth.Result + GeneratedAndroidFirebaseAuth.Result result) { FirebaseUser firebaseUser = getCurrentUserFromPigeon(app); @@ -330,7 +330,7 @@ public void updateEmail( @NonNull GeneratedAndroidFirebaseAuth.AuthPigeonFirebaseApp app, @NonNull String newEmail, @NonNull - GeneratedAndroidFirebaseAuth.Result + GeneratedAndroidFirebaseAuth.Result result) { FirebaseUser firebaseUser = getCurrentUserFromPigeon(app); @@ -369,7 +369,7 @@ public void updatePassword( @NonNull GeneratedAndroidFirebaseAuth.AuthPigeonFirebaseApp app, @NonNull String newPassword, @NonNull - GeneratedAndroidFirebaseAuth.Result + GeneratedAndroidFirebaseAuth.Result result) { FirebaseUser firebaseUser = getCurrentUserFromPigeon(app); @@ -408,7 +408,7 @@ public void updatePhoneNumber( @NonNull GeneratedAndroidFirebaseAuth.AuthPigeonFirebaseApp app, @NonNull Map input, @NonNull - GeneratedAndroidFirebaseAuth.Result + GeneratedAndroidFirebaseAuth.Result result) { FirebaseUser firebaseUser = getCurrentUserFromPigeon(app); @@ -453,9 +453,9 @@ public void updatePhoneNumber( @Override public void updateProfile( @NonNull GeneratedAndroidFirebaseAuth.AuthPigeonFirebaseApp app, - @NonNull GeneratedAndroidFirebaseAuth.PigeonUserProfile profile, + @NonNull GeneratedAndroidFirebaseAuth.InternalUserProfile profile, @NonNull - GeneratedAndroidFirebaseAuth.Result + GeneratedAndroidFirebaseAuth.Result result) { FirebaseUser firebaseUser = getCurrentUserFromPigeon(app); @@ -507,7 +507,7 @@ public void updateProfile( public void verifyBeforeUpdateEmail( @NonNull GeneratedAndroidFirebaseAuth.AuthPigeonFirebaseApp app, @NonNull String newEmail, - @Nullable GeneratedAndroidFirebaseAuth.PigeonActionCodeSettings actionCodeSettings, + @Nullable GeneratedAndroidFirebaseAuth.InternalActionCodeSettings actionCodeSettings, @NonNull GeneratedAndroidFirebaseAuth.VoidResult result) { FirebaseUser firebaseUser = getCurrentUserFromPigeon(app); diff --git a/packages/firebase_auth/firebase_auth/android/src/main/java/io/flutter/plugins/firebase/auth/FlutterFirebaseMultiFactor.java b/packages/firebase_auth/firebase_auth/android/src/main/java/io/flutter/plugins/firebase/auth/FlutterFirebaseMultiFactor.java index f2d1ed575ca6..1ba51914254e 100644 --- a/packages/firebase_auth/firebase_auth/android/src/main/java/io/flutter/plugins/firebase/auth/FlutterFirebaseMultiFactor.java +++ b/packages/firebase_auth/firebase_auth/android/src/main/java/io/flutter/plugins/firebase/auth/FlutterFirebaseMultiFactor.java @@ -60,7 +60,7 @@ MultiFactor getAppMultiFactor(@NonNull GeneratedAndroidFirebaseAuth.AuthPigeonFi @Override public void enrollPhone( @NonNull GeneratedAndroidFirebaseAuth.AuthPigeonFirebaseApp app, - @NonNull GeneratedAndroidFirebaseAuth.PigeonPhoneMultiFactorAssertion assertion, + @NonNull GeneratedAndroidFirebaseAuth.InternalPhoneMultiFactorAssertion assertion, @Nullable String displayName, @NonNull GeneratedAndroidFirebaseAuth.VoidResult result) { final MultiFactor multiFactor; @@ -126,7 +126,8 @@ public void enrollTotp( public void getSession( @NonNull GeneratedAndroidFirebaseAuth.AuthPigeonFirebaseApp app, @NonNull - GeneratedAndroidFirebaseAuth.Result + GeneratedAndroidFirebaseAuth.Result< + GeneratedAndroidFirebaseAuth.InternalMultiFactorSession> result) { final MultiFactor multiFactor; try { @@ -145,7 +146,7 @@ public void getSession( final String id = UUID.randomUUID().toString(); multiFactorSessionMap.put(id, sessionResult); result.success( - new GeneratedAndroidFirebaseAuth.PigeonMultiFactorSession.Builder() + new GeneratedAndroidFirebaseAuth.InternalMultiFactorSession.Builder() .setId(id) .build()); } else { @@ -188,7 +189,7 @@ public void getEnrolledFactors( @NonNull GeneratedAndroidFirebaseAuth.AuthPigeonFirebaseApp app, @NonNull GeneratedAndroidFirebaseAuth.Result< - List> + List> result) { final MultiFactor multiFactor; try { @@ -200,7 +201,7 @@ public void getEnrolledFactors( final List factors = multiFactor.getEnrolledFactors(); - final List resultFactors = + final List resultFactors = PigeonParser.multiFactorInfoToPigeon(factors); result.success(resultFactors); @@ -209,10 +210,10 @@ public void getEnrolledFactors( @Override public void resolveSignIn( @NonNull String resolverId, - @Nullable GeneratedAndroidFirebaseAuth.PigeonPhoneMultiFactorAssertion assertion, + @Nullable GeneratedAndroidFirebaseAuth.InternalPhoneMultiFactorAssertion assertion, @Nullable String totpAssertionId, @NonNull - GeneratedAndroidFirebaseAuth.Result + GeneratedAndroidFirebaseAuth.Result result) { final MultiFactorResolver resolver = multiFactorResolverMap.get(resolverId); diff --git a/packages/firebase_auth/firebase_auth/android/src/main/java/io/flutter/plugins/firebase/auth/FlutterFirebaseTotpMultiFactor.java b/packages/firebase_auth/firebase_auth/android/src/main/java/io/flutter/plugins/firebase/auth/FlutterFirebaseTotpMultiFactor.java index c766b9598ed4..9761a5df73f2 100644 --- a/packages/firebase_auth/firebase_auth/android/src/main/java/io/flutter/plugins/firebase/auth/FlutterFirebaseTotpMultiFactor.java +++ b/packages/firebase_auth/firebase_auth/android/src/main/java/io/flutter/plugins/firebase/auth/FlutterFirebaseTotpMultiFactor.java @@ -25,7 +25,7 @@ public class FlutterFirebaseTotpMultiFactor public void generateSecret( @NonNull String sessionId, @NonNull - GeneratedAndroidFirebaseAuth.Result + GeneratedAndroidFirebaseAuth.Result result) { MultiFactorSession multiFactorSession = FlutterFirebaseMultiFactor.multiFactorSessionMap.get(sessionId); @@ -38,7 +38,7 @@ public void generateSecret( TotpSecret secret = task.getResult(); multiFactorSecret.put(secret.getSharedSecretKey(), secret); result.success( - new GeneratedAndroidFirebaseAuth.PigeonTotpSecret.Builder() + new GeneratedAndroidFirebaseAuth.InternalTotpSecret.Builder() .setCodeIntervalSeconds((long) secret.getCodeIntervalSeconds()) .setCodeLength((long) secret.getCodeLength()) .setSecretKey(secret.getSharedSecretKey()) diff --git a/packages/firebase_auth/firebase_auth/android/src/main/java/io/flutter/plugins/firebase/auth/GeneratedAndroidFirebaseAuth.java b/packages/firebase_auth/firebase_auth/android/src/main/java/io/flutter/plugins/firebase/auth/GeneratedAndroidFirebaseAuth.java index 19545ba97da0..ee16c9973a33 100644 --- a/packages/firebase_auth/firebase_auth/android/src/main/java/io/flutter/plugins/firebase/auth/GeneratedAndroidFirebaseAuth.java +++ b/packages/firebase_auth/firebase_auth/android/src/main/java/io/flutter/plugins/firebase/auth/GeneratedAndroidFirebaseAuth.java @@ -1,7 +1,7 @@ // Copyright 2023, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v19.0.0), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), do not edit directly. // See also: https://pub.dev/packages/pigeon package io.flutter.plugins.firebase.auth; @@ -21,12 +21,170 @@ import java.lang.annotation.Target; import java.nio.ByteBuffer; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.Map; /** Generated class from Pigeon. */ @SuppressWarnings({"unused", "unchecked", "CodeBlock2Expr", "RedundantSuppression", "serial"}) public class GeneratedAndroidFirebaseAuth { + static boolean pigeonDoubleEquals(double a, double b) { + // Normalize -0.0 to 0.0 and handle NaN equality. + return (a == 0.0 ? 0.0 : a) == (b == 0.0 ? 0.0 : b) || (Double.isNaN(a) && Double.isNaN(b)); + } + + static boolean pigeonFloatEquals(float a, float b) { + // Normalize -0.0 to 0.0 and handle NaN equality. + return (a == 0.0f ? 0.0f : a) == (b == 0.0f ? 0.0f : b) || (Float.isNaN(a) && Float.isNaN(b)); + } + + static int pigeonDoubleHashCode(double d) { + // Normalize -0.0 to 0.0 and handle NaN to ensure consistent hash codes. + if (d == 0.0) { + d = 0.0; + } + long bits = Double.doubleToLongBits(d); + return (int) (bits ^ (bits >>> 32)); + } + + static int pigeonFloatHashCode(float f) { + // Normalize -0.0 to 0.0 and handle NaN to ensure consistent hash codes. + if (f == 0.0f) { + f = 0.0f; + } + return Float.floatToIntBits(f); + } + + static boolean pigeonDeepEquals(Object a, Object b) { + if (a == b) { + return true; + } + if (a == null || b == null) { + return false; + } + if (a instanceof byte[] && b instanceof byte[]) { + return Arrays.equals((byte[]) a, (byte[]) b); + } + if (a instanceof int[] && b instanceof int[]) { + return Arrays.equals((int[]) a, (int[]) b); + } + if (a instanceof long[] && b instanceof long[]) { + return Arrays.equals((long[]) a, (long[]) b); + } + if (a instanceof double[] && b instanceof double[]) { + double[] da = (double[]) a; + double[] db = (double[]) b; + if (da.length != db.length) { + return false; + } + for (int i = 0; i < da.length; i++) { + if (!pigeonDoubleEquals(da[i], db[i])) { + return false; + } + } + return true; + } + if (a instanceof List && b instanceof List) { + List listA = (List) a; + List listB = (List) b; + if (listA.size() != listB.size()) { + return false; + } + for (int i = 0; i < listA.size(); i++) { + if (!pigeonDeepEquals(listA.get(i), listB.get(i))) { + return false; + } + } + return true; + } + if (a instanceof Map && b instanceof Map) { + Map mapA = (Map) a; + Map mapB = (Map) b; + if (mapA.size() != mapB.size()) { + return false; + } + for (Map.Entry entryA : mapA.entrySet()) { + Object keyA = entryA.getKey(); + Object valueA = entryA.getValue(); + boolean found = false; + for (Map.Entry entryB : mapB.entrySet()) { + Object keyB = entryB.getKey(); + if (pigeonDeepEquals(keyA, keyB)) { + Object valueB = entryB.getValue(); + if (pigeonDeepEquals(valueA, valueB)) { + found = true; + break; + } else { + return false; + } + } + } + if (!found) { + return false; + } + } + return true; + } + if (a instanceof Double && b instanceof Double) { + return pigeonDoubleEquals((double) a, (double) b); + } + if (a instanceof Float && b instanceof Float) { + return pigeonFloatEquals((float) a, (float) b); + } + return a.equals(b); + } + + static int pigeonDeepHashCode(Object value) { + if (value == null) { + return 0; + } + if (value instanceof byte[]) { + return Arrays.hashCode((byte[]) value); + } + if (value instanceof int[]) { + return Arrays.hashCode((int[]) value); + } + if (value instanceof long[]) { + return Arrays.hashCode((long[]) value); + } + if (value instanceof double[]) { + double[] da = (double[]) value; + int result = 1; + for (double d : da) { + result = 31 * result + pigeonDoubleHashCode(d); + } + return result; + } + if (value instanceof List) { + int result = 1; + for (Object item : (List) value) { + result = 31 * result + pigeonDeepHashCode(item); + } + return result; + } + if (value instanceof Map) { + int result = 0; + for (Map.Entry entry : ((Map) value).entrySet()) { + result += + ((pigeonDeepHashCode(entry.getKey()) * 31) ^ pigeonDeepHashCode(entry.getValue())); + } + return result; + } + if (value instanceof Object[]) { + int result = 1; + for (Object item : (Object[]) value) { + result = 31 * result + pigeonDeepHashCode(item); + } + return result; + } + if (value instanceof Double) { + return pigeonDoubleHashCode((double) value); + } + if (value instanceof Float) { + return pigeonFloatHashCode((float) value); + } + return value.hashCode(); + } /** Error class for passing custom error details to Flutter via a thrown PlatformException. */ public static class FlutterError extends RuntimeException { @@ -46,7 +204,7 @@ public FlutterError(@NonNull String code, @Nullable String message, @Nullable Ob @NonNull protected static ArrayList wrapError(@NonNull Throwable exception) { - ArrayList errorList = new ArrayList(3); + ArrayList errorList = new ArrayList<>(3); if (exception instanceof FlutterError) { FlutterError error = (FlutterError) exception; errorList.add(error.code); @@ -84,13 +242,13 @@ public enum ActionCodeInfoOperation { final int index; - private ActionCodeInfoOperation(final int index) { + ActionCodeInfoOperation(final int index) { this.index = index; } } /** Generated class from Pigeon that represents data sent in messages. */ - public static final class PigeonMultiFactorSession { + public static final class InternalMultiFactorSession { private @NonNull String id; public @NonNull String getId() { @@ -105,7 +263,25 @@ public void setId(@NonNull String setterArg) { } /** Constructor is non-public to enforce null safety; use Builder. */ - PigeonMultiFactorSession() {} + InternalMultiFactorSession() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InternalMultiFactorSession that = (InternalMultiFactorSession) o; + return pigeonDeepEquals(id, that.id); + } + + @Override + public int hashCode() { + Object[] fields = new Object[] {getClass(), id}; + return pigeonDeepHashCode(fields); + } public static final class Builder { @@ -117,30 +293,30 @@ public static final class Builder { return this; } - public @NonNull PigeonMultiFactorSession build() { - PigeonMultiFactorSession pigeonReturn = new PigeonMultiFactorSession(); + public @NonNull InternalMultiFactorSession build() { + InternalMultiFactorSession pigeonReturn = new InternalMultiFactorSession(); pigeonReturn.setId(id); return pigeonReturn; } } @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(1); + public ArrayList toList() { + ArrayList toListResult = new ArrayList<>(1); toListResult.add(id); return toListResult; } - static @NonNull PigeonMultiFactorSession fromList(@NonNull ArrayList __pigeon_list) { - PigeonMultiFactorSession pigeonResult = new PigeonMultiFactorSession(); - Object id = __pigeon_list.get(0); + static @NonNull InternalMultiFactorSession fromList(@NonNull ArrayList pigeonVar_list) { + InternalMultiFactorSession pigeonResult = new InternalMultiFactorSession(); + Object id = pigeonVar_list.get(0); pigeonResult.setId((String) id); return pigeonResult; } } /** Generated class from Pigeon that represents data sent in messages. */ - public static final class PigeonPhoneMultiFactorAssertion { + public static final class InternalPhoneMultiFactorAssertion { private @NonNull String verificationId; public @NonNull String getVerificationId() { @@ -168,7 +344,26 @@ public void setVerificationCode(@NonNull String setterArg) { } /** Constructor is non-public to enforce null safety; use Builder. */ - PigeonPhoneMultiFactorAssertion() {} + InternalPhoneMultiFactorAssertion() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InternalPhoneMultiFactorAssertion that = (InternalPhoneMultiFactorAssertion) o; + return pigeonDeepEquals(verificationId, that.verificationId) + && pigeonDeepEquals(verificationCode, that.verificationCode); + } + + @Override + public int hashCode() { + Object[] fields = new Object[] {getClass(), verificationId, verificationCode}; + return pigeonDeepHashCode(fields); + } public static final class Builder { @@ -188,8 +383,8 @@ public static final class Builder { return this; } - public @NonNull PigeonPhoneMultiFactorAssertion build() { - PigeonPhoneMultiFactorAssertion pigeonReturn = new PigeonPhoneMultiFactorAssertion(); + public @NonNull InternalPhoneMultiFactorAssertion build() { + InternalPhoneMultiFactorAssertion pigeonReturn = new InternalPhoneMultiFactorAssertion(); pigeonReturn.setVerificationId(verificationId); pigeonReturn.setVerificationCode(verificationCode); return pigeonReturn; @@ -197,26 +392,26 @@ public static final class Builder { } @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(2); + public ArrayList toList() { + ArrayList toListResult = new ArrayList<>(2); toListResult.add(verificationId); toListResult.add(verificationCode); return toListResult; } - static @NonNull PigeonPhoneMultiFactorAssertion fromList( - @NonNull ArrayList __pigeon_list) { - PigeonPhoneMultiFactorAssertion pigeonResult = new PigeonPhoneMultiFactorAssertion(); - Object verificationId = __pigeon_list.get(0); + static @NonNull InternalPhoneMultiFactorAssertion fromList( + @NonNull ArrayList pigeonVar_list) { + InternalPhoneMultiFactorAssertion pigeonResult = new InternalPhoneMultiFactorAssertion(); + Object verificationId = pigeonVar_list.get(0); pigeonResult.setVerificationId((String) verificationId); - Object verificationCode = __pigeon_list.get(1); + Object verificationCode = pigeonVar_list.get(1); pigeonResult.setVerificationCode((String) verificationCode); return pigeonResult; } } /** Generated class from Pigeon that represents data sent in messages. */ - public static final class PigeonMultiFactorInfo { + public static final class InternalMultiFactorInfo { private @Nullable String displayName; public @Nullable String getDisplayName() { @@ -274,7 +469,30 @@ public void setPhoneNumber(@Nullable String setterArg) { } /** Constructor is non-public to enforce null safety; use Builder. */ - PigeonMultiFactorInfo() {} + InternalMultiFactorInfo() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InternalMultiFactorInfo that = (InternalMultiFactorInfo) o; + return pigeonDeepEquals(displayName, that.displayName) + && pigeonDeepEquals(enrollmentTimestamp, that.enrollmentTimestamp) + && pigeonDeepEquals(factorId, that.factorId) + && pigeonDeepEquals(uid, that.uid) + && pigeonDeepEquals(phoneNumber, that.phoneNumber); + } + + @Override + public int hashCode() { + Object[] fields = + new Object[] {getClass(), displayName, enrollmentTimestamp, factorId, uid, phoneNumber}; + return pigeonDeepHashCode(fields); + } public static final class Builder { @@ -318,8 +536,8 @@ public static final class Builder { return this; } - public @NonNull PigeonMultiFactorInfo build() { - PigeonMultiFactorInfo pigeonReturn = new PigeonMultiFactorInfo(); + public @NonNull InternalMultiFactorInfo build() { + InternalMultiFactorInfo pigeonReturn = new InternalMultiFactorInfo(); pigeonReturn.setDisplayName(displayName); pigeonReturn.setEnrollmentTimestamp(enrollmentTimestamp); pigeonReturn.setFactorId(factorId); @@ -330,8 +548,8 @@ public static final class Builder { } @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(5); + public ArrayList toList() { + ArrayList toListResult = new ArrayList<>(5); toListResult.add(displayName); toListResult.add(enrollmentTimestamp); toListResult.add(factorId); @@ -340,17 +558,17 @@ ArrayList toList() { return toListResult; } - static @NonNull PigeonMultiFactorInfo fromList(@NonNull ArrayList __pigeon_list) { - PigeonMultiFactorInfo pigeonResult = new PigeonMultiFactorInfo(); - Object displayName = __pigeon_list.get(0); + static @NonNull InternalMultiFactorInfo fromList(@NonNull ArrayList pigeonVar_list) { + InternalMultiFactorInfo pigeonResult = new InternalMultiFactorInfo(); + Object displayName = pigeonVar_list.get(0); pigeonResult.setDisplayName((String) displayName); - Object enrollmentTimestamp = __pigeon_list.get(1); + Object enrollmentTimestamp = pigeonVar_list.get(1); pigeonResult.setEnrollmentTimestamp((Double) enrollmentTimestamp); - Object factorId = __pigeon_list.get(2); + Object factorId = pigeonVar_list.get(2); pigeonResult.setFactorId((String) factorId); - Object uid = __pigeon_list.get(3); + Object uid = pigeonVar_list.get(3); pigeonResult.setUid((String) uid); - Object phoneNumber = __pigeon_list.get(4); + Object phoneNumber = pigeonVar_list.get(4); pigeonResult.setPhoneNumber((String) phoneNumber); return pigeonResult; } @@ -394,6 +612,26 @@ public void setCustomAuthDomain(@Nullable String setterArg) { /** Constructor is non-public to enforce null safety; use Builder. */ AuthPigeonFirebaseApp() {} + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AuthPigeonFirebaseApp that = (AuthPigeonFirebaseApp) o; + return pigeonDeepEquals(appName, that.appName) + && pigeonDeepEquals(tenantId, that.tenantId) + && pigeonDeepEquals(customAuthDomain, that.customAuthDomain); + } + + @Override + public int hashCode() { + Object[] fields = new Object[] {getClass(), appName, tenantId, customAuthDomain}; + return pigeonDeepHashCode(fields); + } + public static final class Builder { private @Nullable String appName; @@ -430,28 +668,28 @@ public static final class Builder { } @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(3); + public ArrayList toList() { + ArrayList toListResult = new ArrayList<>(3); toListResult.add(appName); toListResult.add(tenantId); toListResult.add(customAuthDomain); return toListResult; } - static @NonNull AuthPigeonFirebaseApp fromList(@NonNull ArrayList __pigeon_list) { + static @NonNull AuthPigeonFirebaseApp fromList(@NonNull ArrayList pigeonVar_list) { AuthPigeonFirebaseApp pigeonResult = new AuthPigeonFirebaseApp(); - Object appName = __pigeon_list.get(0); + Object appName = pigeonVar_list.get(0); pigeonResult.setAppName((String) appName); - Object tenantId = __pigeon_list.get(1); + Object tenantId = pigeonVar_list.get(1); pigeonResult.setTenantId((String) tenantId); - Object customAuthDomain = __pigeon_list.get(2); + Object customAuthDomain = pigeonVar_list.get(2); pigeonResult.setCustomAuthDomain((String) customAuthDomain); return pigeonResult; } } /** Generated class from Pigeon that represents data sent in messages. */ - public static final class PigeonActionCodeInfoData { + public static final class InternalActionCodeInfoData { private @Nullable String email; public @Nullable String getEmail() { @@ -472,6 +710,25 @@ public void setPreviousEmail(@Nullable String setterArg) { this.previousEmail = setterArg; } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InternalActionCodeInfoData that = (InternalActionCodeInfoData) o; + return pigeonDeepEquals(email, that.email) + && pigeonDeepEquals(previousEmail, that.previousEmail); + } + + @Override + public int hashCode() { + Object[] fields = new Object[] {getClass(), email, previousEmail}; + return pigeonDeepHashCode(fields); + } + public static final class Builder { private @Nullable String email; @@ -490,8 +747,8 @@ public static final class Builder { return this; } - public @NonNull PigeonActionCodeInfoData build() { - PigeonActionCodeInfoData pigeonReturn = new PigeonActionCodeInfoData(); + public @NonNull InternalActionCodeInfoData build() { + InternalActionCodeInfoData pigeonReturn = new InternalActionCodeInfoData(); pigeonReturn.setEmail(email); pigeonReturn.setPreviousEmail(previousEmail); return pigeonReturn; @@ -499,25 +756,25 @@ public static final class Builder { } @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(2); + public ArrayList toList() { + ArrayList toListResult = new ArrayList<>(2); toListResult.add(email); toListResult.add(previousEmail); return toListResult; } - static @NonNull PigeonActionCodeInfoData fromList(@NonNull ArrayList __pigeon_list) { - PigeonActionCodeInfoData pigeonResult = new PigeonActionCodeInfoData(); - Object email = __pigeon_list.get(0); + static @NonNull InternalActionCodeInfoData fromList(@NonNull ArrayList pigeonVar_list) { + InternalActionCodeInfoData pigeonResult = new InternalActionCodeInfoData(); + Object email = pigeonVar_list.get(0); pigeonResult.setEmail((String) email); - Object previousEmail = __pigeon_list.get(1); + Object previousEmail = pigeonVar_list.get(1); pigeonResult.setPreviousEmail((String) previousEmail); return pigeonResult; } } /** Generated class from Pigeon that represents data sent in messages. */ - public static final class PigeonActionCodeInfo { + public static final class InternalActionCodeInfo { private @NonNull ActionCodeInfoOperation operation; public @NonNull ActionCodeInfoOperation getOperation() { @@ -531,13 +788,13 @@ public void setOperation(@NonNull ActionCodeInfoOperation setterArg) { this.operation = setterArg; } - private @NonNull PigeonActionCodeInfoData data; + private @NonNull InternalActionCodeInfoData data; - public @NonNull PigeonActionCodeInfoData getData() { + public @NonNull InternalActionCodeInfoData getData() { return data; } - public void setData(@NonNull PigeonActionCodeInfoData setterArg) { + public void setData(@NonNull InternalActionCodeInfoData setterArg) { if (setterArg == null) { throw new IllegalStateException("Nonnull field \"data\" is null."); } @@ -545,7 +802,25 @@ public void setData(@NonNull PigeonActionCodeInfoData setterArg) { } /** Constructor is non-public to enforce null safety; use Builder. */ - PigeonActionCodeInfo() {} + InternalActionCodeInfo() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InternalActionCodeInfo that = (InternalActionCodeInfo) o; + return pigeonDeepEquals(operation, that.operation) && pigeonDeepEquals(data, that.data); + } + + @Override + public int hashCode() { + Object[] fields = new Object[] {getClass(), operation, data}; + return pigeonDeepHashCode(fields); + } public static final class Builder { @@ -557,16 +832,16 @@ public static final class Builder { return this; } - private @Nullable PigeonActionCodeInfoData data; + private @Nullable InternalActionCodeInfoData data; @CanIgnoreReturnValue - public @NonNull Builder setData(@NonNull PigeonActionCodeInfoData setterArg) { + public @NonNull Builder setData(@NonNull InternalActionCodeInfoData setterArg) { this.data = setterArg; return this; } - public @NonNull PigeonActionCodeInfo build() { - PigeonActionCodeInfo pigeonReturn = new PigeonActionCodeInfo(); + public @NonNull InternalActionCodeInfo build() { + InternalActionCodeInfo pigeonReturn = new InternalActionCodeInfo(); pigeonReturn.setOperation(operation); pigeonReturn.setData(data); return pigeonReturn; @@ -574,25 +849,25 @@ public static final class Builder { } @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(2); - toListResult.add(operation == null ? null : operation.index); + public ArrayList toList() { + ArrayList toListResult = new ArrayList<>(2); + toListResult.add(operation); toListResult.add(data); return toListResult; } - static @NonNull PigeonActionCodeInfo fromList(@NonNull ArrayList __pigeon_list) { - PigeonActionCodeInfo pigeonResult = new PigeonActionCodeInfo(); - Object operation = __pigeon_list.get(0); - pigeonResult.setOperation(ActionCodeInfoOperation.values()[(int) operation]); - Object data = __pigeon_list.get(1); - pigeonResult.setData((PigeonActionCodeInfoData) data); + static @NonNull InternalActionCodeInfo fromList(@NonNull ArrayList pigeonVar_list) { + InternalActionCodeInfo pigeonResult = new InternalActionCodeInfo(); + Object operation = pigeonVar_list.get(0); + pigeonResult.setOperation((ActionCodeInfoOperation) operation); + Object data = pigeonVar_list.get(1); + pigeonResult.setData((InternalActionCodeInfoData) data); return pigeonResult; } } /** Generated class from Pigeon that represents data sent in messages. */ - public static final class PigeonAdditionalUserInfo { + public static final class InternalAdditionalUserInfo { private @NonNull Boolean isNewUser; public @NonNull Boolean getIsNewUser() { @@ -647,7 +922,30 @@ public void setProfile(@Nullable Map setterArg) { } /** Constructor is non-public to enforce null safety; use Builder. */ - PigeonAdditionalUserInfo() {} + InternalAdditionalUserInfo() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InternalAdditionalUserInfo that = (InternalAdditionalUserInfo) o; + return pigeonDeepEquals(isNewUser, that.isNewUser) + && pigeonDeepEquals(providerId, that.providerId) + && pigeonDeepEquals(username, that.username) + && pigeonDeepEquals(authorizationCode, that.authorizationCode) + && pigeonDeepEquals(profile, that.profile); + } + + @Override + public int hashCode() { + Object[] fields = + new Object[] {getClass(), isNewUser, providerId, username, authorizationCode, profile}; + return pigeonDeepHashCode(fields); + } public static final class Builder { @@ -691,8 +989,8 @@ public static final class Builder { return this; } - public @NonNull PigeonAdditionalUserInfo build() { - PigeonAdditionalUserInfo pigeonReturn = new PigeonAdditionalUserInfo(); + public @NonNull InternalAdditionalUserInfo build() { + InternalAdditionalUserInfo pigeonReturn = new InternalAdditionalUserInfo(); pigeonReturn.setIsNewUser(isNewUser); pigeonReturn.setProviderId(providerId); pigeonReturn.setUsername(username); @@ -703,8 +1001,8 @@ public static final class Builder { } @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(5); + public ArrayList toList() { + ArrayList toListResult = new ArrayList<>(5); toListResult.add(isNewUser); toListResult.add(providerId); toListResult.add(username); @@ -713,24 +1011,24 @@ ArrayList toList() { return toListResult; } - static @NonNull PigeonAdditionalUserInfo fromList(@NonNull ArrayList __pigeon_list) { - PigeonAdditionalUserInfo pigeonResult = new PigeonAdditionalUserInfo(); - Object isNewUser = __pigeon_list.get(0); + static @NonNull InternalAdditionalUserInfo fromList(@NonNull ArrayList pigeonVar_list) { + InternalAdditionalUserInfo pigeonResult = new InternalAdditionalUserInfo(); + Object isNewUser = pigeonVar_list.get(0); pigeonResult.setIsNewUser((Boolean) isNewUser); - Object providerId = __pigeon_list.get(1); + Object providerId = pigeonVar_list.get(1); pigeonResult.setProviderId((String) providerId); - Object username = __pigeon_list.get(2); + Object username = pigeonVar_list.get(2); pigeonResult.setUsername((String) username); - Object authorizationCode = __pigeon_list.get(3); + Object authorizationCode = pigeonVar_list.get(3); pigeonResult.setAuthorizationCode((String) authorizationCode); - Object profile = __pigeon_list.get(4); + Object profile = pigeonVar_list.get(4); pigeonResult.setProfile((Map) profile); return pigeonResult; } } /** Generated class from Pigeon that represents data sent in messages. */ - public static final class PigeonAuthCredential { + public static final class InternalAuthCredential { private @NonNull String providerId; public @NonNull String getProviderId() { @@ -781,7 +1079,28 @@ public void setAccessToken(@Nullable String setterArg) { } /** Constructor is non-public to enforce null safety; use Builder. */ - PigeonAuthCredential() {} + InternalAuthCredential() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InternalAuthCredential that = (InternalAuthCredential) o; + return pigeonDeepEquals(providerId, that.providerId) + && pigeonDeepEquals(signInMethod, that.signInMethod) + && pigeonDeepEquals(nativeId, that.nativeId) + && pigeonDeepEquals(accessToken, that.accessToken); + } + + @Override + public int hashCode() { + Object[] fields = new Object[] {getClass(), providerId, signInMethod, nativeId, accessToken}; + return pigeonDeepHashCode(fields); + } public static final class Builder { @@ -817,8 +1136,8 @@ public static final class Builder { return this; } - public @NonNull PigeonAuthCredential build() { - PigeonAuthCredential pigeonReturn = new PigeonAuthCredential(); + public @NonNull InternalAuthCredential build() { + InternalAuthCredential pigeonReturn = new InternalAuthCredential(); pigeonReturn.setProviderId(providerId); pigeonReturn.setSignInMethod(signInMethod); pigeonReturn.setNativeId(nativeId); @@ -828,8 +1147,8 @@ public static final class Builder { } @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(4); + public ArrayList toList() { + ArrayList toListResult = new ArrayList<>(4); toListResult.add(providerId); toListResult.add(signInMethod); toListResult.add(nativeId); @@ -837,25 +1156,22 @@ ArrayList toList() { return toListResult; } - static @NonNull PigeonAuthCredential fromList(@NonNull ArrayList __pigeon_list) { - PigeonAuthCredential pigeonResult = new PigeonAuthCredential(); - Object providerId = __pigeon_list.get(0); + static @NonNull InternalAuthCredential fromList(@NonNull ArrayList pigeonVar_list) { + InternalAuthCredential pigeonResult = new InternalAuthCredential(); + Object providerId = pigeonVar_list.get(0); pigeonResult.setProviderId((String) providerId); - Object signInMethod = __pigeon_list.get(1); + Object signInMethod = pigeonVar_list.get(1); pigeonResult.setSignInMethod((String) signInMethod); - Object nativeId = __pigeon_list.get(2); - pigeonResult.setNativeId( - (nativeId == null) - ? null - : ((nativeId instanceof Integer) ? (Integer) nativeId : (Long) nativeId)); - Object accessToken = __pigeon_list.get(3); + Object nativeId = pigeonVar_list.get(2); + pigeonResult.setNativeId((Long) nativeId); + Object accessToken = pigeonVar_list.get(3); pigeonResult.setAccessToken((String) accessToken); return pigeonResult; } } /** Generated class from Pigeon that represents data sent in messages. */ - public static final class PigeonUserInfo { + public static final class InternalUserInfo { private @NonNull String uid; public @NonNull String getUid() { @@ -986,7 +1302,51 @@ public void setLastSignInTimestamp(@Nullable Long setterArg) { } /** Constructor is non-public to enforce null safety; use Builder. */ - PigeonUserInfo() {} + InternalUserInfo() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InternalUserInfo that = (InternalUserInfo) o; + return pigeonDeepEquals(uid, that.uid) + && pigeonDeepEquals(email, that.email) + && pigeonDeepEquals(displayName, that.displayName) + && pigeonDeepEquals(photoUrl, that.photoUrl) + && pigeonDeepEquals(phoneNumber, that.phoneNumber) + && pigeonDeepEquals(isAnonymous, that.isAnonymous) + && pigeonDeepEquals(isEmailVerified, that.isEmailVerified) + && pigeonDeepEquals(providerId, that.providerId) + && pigeonDeepEquals(tenantId, that.tenantId) + && pigeonDeepEquals(refreshToken, that.refreshToken) + && pigeonDeepEquals(creationTimestamp, that.creationTimestamp) + && pigeonDeepEquals(lastSignInTimestamp, that.lastSignInTimestamp); + } + + @Override + public int hashCode() { + Object[] fields = + new Object[] { + getClass(), + uid, + email, + displayName, + photoUrl, + phoneNumber, + isAnonymous, + isEmailVerified, + providerId, + tenantId, + refreshToken, + creationTimestamp, + lastSignInTimestamp + }; + return pigeonDeepHashCode(fields); + } public static final class Builder { @@ -1086,8 +1446,8 @@ public static final class Builder { return this; } - public @NonNull PigeonUserInfo build() { - PigeonUserInfo pigeonReturn = new PigeonUserInfo(); + public @NonNull InternalUserInfo build() { + InternalUserInfo pigeonReturn = new InternalUserInfo(); pigeonReturn.setUid(uid); pigeonReturn.setEmail(email); pigeonReturn.setDisplayName(displayName); @@ -1105,8 +1465,8 @@ public static final class Builder { } @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(12); + public ArrayList toList() { + ArrayList toListResult = new ArrayList<>(12); toListResult.add(uid); toListResult.add(email); toListResult.add(displayName); @@ -1122,55 +1482,45 @@ ArrayList toList() { return toListResult; } - static @NonNull PigeonUserInfo fromList(@NonNull ArrayList __pigeon_list) { - PigeonUserInfo pigeonResult = new PigeonUserInfo(); - Object uid = __pigeon_list.get(0); + static @NonNull InternalUserInfo fromList(@NonNull ArrayList pigeonVar_list) { + InternalUserInfo pigeonResult = new InternalUserInfo(); + Object uid = pigeonVar_list.get(0); pigeonResult.setUid((String) uid); - Object email = __pigeon_list.get(1); + Object email = pigeonVar_list.get(1); pigeonResult.setEmail((String) email); - Object displayName = __pigeon_list.get(2); + Object displayName = pigeonVar_list.get(2); pigeonResult.setDisplayName((String) displayName); - Object photoUrl = __pigeon_list.get(3); + Object photoUrl = pigeonVar_list.get(3); pigeonResult.setPhotoUrl((String) photoUrl); - Object phoneNumber = __pigeon_list.get(4); + Object phoneNumber = pigeonVar_list.get(4); pigeonResult.setPhoneNumber((String) phoneNumber); - Object isAnonymous = __pigeon_list.get(5); + Object isAnonymous = pigeonVar_list.get(5); pigeonResult.setIsAnonymous((Boolean) isAnonymous); - Object isEmailVerified = __pigeon_list.get(6); + Object isEmailVerified = pigeonVar_list.get(6); pigeonResult.setIsEmailVerified((Boolean) isEmailVerified); - Object providerId = __pigeon_list.get(7); + Object providerId = pigeonVar_list.get(7); pigeonResult.setProviderId((String) providerId); - Object tenantId = __pigeon_list.get(8); + Object tenantId = pigeonVar_list.get(8); pigeonResult.setTenantId((String) tenantId); - Object refreshToken = __pigeon_list.get(9); + Object refreshToken = pigeonVar_list.get(9); pigeonResult.setRefreshToken((String) refreshToken); - Object creationTimestamp = __pigeon_list.get(10); - pigeonResult.setCreationTimestamp( - (creationTimestamp == null) - ? null - : ((creationTimestamp instanceof Integer) - ? (Integer) creationTimestamp - : (Long) creationTimestamp)); - Object lastSignInTimestamp = __pigeon_list.get(11); - pigeonResult.setLastSignInTimestamp( - (lastSignInTimestamp == null) - ? null - : ((lastSignInTimestamp instanceof Integer) - ? (Integer) lastSignInTimestamp - : (Long) lastSignInTimestamp)); + Object creationTimestamp = pigeonVar_list.get(10); + pigeonResult.setCreationTimestamp((Long) creationTimestamp); + Object lastSignInTimestamp = pigeonVar_list.get(11); + pigeonResult.setLastSignInTimestamp((Long) lastSignInTimestamp); return pigeonResult; } } /** Generated class from Pigeon that represents data sent in messages. */ - public static final class PigeonUserDetails { - private @NonNull PigeonUserInfo userInfo; + public static final class InternalUserDetails { + private @NonNull InternalUserInfo userInfo; - public @NonNull PigeonUserInfo getUserInfo() { + public @NonNull InternalUserInfo getUserInfo() { return userInfo; } - public void setUserInfo(@NonNull PigeonUserInfo setterArg) { + public void setUserInfo(@NonNull InternalUserInfo setterArg) { if (setterArg == null) { throw new IllegalStateException("Nonnull field \"userInfo\" is null."); } @@ -1191,14 +1541,33 @@ public void setProviderData(@NonNull List> setterArg) { } /** Constructor is non-public to enforce null safety; use Builder. */ - PigeonUserDetails() {} + InternalUserDetails() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InternalUserDetails that = (InternalUserDetails) o; + return pigeonDeepEquals(userInfo, that.userInfo) + && pigeonDeepEquals(providerData, that.providerData); + } + + @Override + public int hashCode() { + Object[] fields = new Object[] {getClass(), userInfo, providerData}; + return pigeonDeepHashCode(fields); + } public static final class Builder { - private @Nullable PigeonUserInfo userInfo; + private @Nullable InternalUserInfo userInfo; @CanIgnoreReturnValue - public @NonNull Builder setUserInfo(@NonNull PigeonUserInfo setterArg) { + public @NonNull Builder setUserInfo(@NonNull InternalUserInfo setterArg) { this.userInfo = setterArg; return this; } @@ -1211,8 +1580,8 @@ public static final class Builder { return this; } - public @NonNull PigeonUserDetails build() { - PigeonUserDetails pigeonReturn = new PigeonUserDetails(); + public @NonNull InternalUserDetails build() { + InternalUserDetails pigeonReturn = new InternalUserDetails(); pigeonReturn.setUserInfo(userInfo); pigeonReturn.setProviderData(providerData); return pigeonReturn; @@ -1220,83 +1589,104 @@ public static final class Builder { } @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(2); + public ArrayList toList() { + ArrayList toListResult = new ArrayList<>(2); toListResult.add(userInfo); toListResult.add(providerData); return toListResult; } - static @NonNull PigeonUserDetails fromList(@NonNull ArrayList __pigeon_list) { - PigeonUserDetails pigeonResult = new PigeonUserDetails(); - Object userInfo = __pigeon_list.get(0); - pigeonResult.setUserInfo((PigeonUserInfo) userInfo); - Object providerData = __pigeon_list.get(1); + static @NonNull InternalUserDetails fromList(@NonNull ArrayList pigeonVar_list) { + InternalUserDetails pigeonResult = new InternalUserDetails(); + Object userInfo = pigeonVar_list.get(0); + pigeonResult.setUserInfo((InternalUserInfo) userInfo); + Object providerData = pigeonVar_list.get(1); pigeonResult.setProviderData((List>) providerData); return pigeonResult; } } /** Generated class from Pigeon that represents data sent in messages. */ - public static final class PigeonUserCredential { - private @Nullable PigeonUserDetails user; + public static final class InternalUserCredential { + private @Nullable InternalUserDetails user; - public @Nullable PigeonUserDetails getUser() { + public @Nullable InternalUserDetails getUser() { return user; } - public void setUser(@Nullable PigeonUserDetails setterArg) { + public void setUser(@Nullable InternalUserDetails setterArg) { this.user = setterArg; } - private @Nullable PigeonAdditionalUserInfo additionalUserInfo; + private @Nullable InternalAdditionalUserInfo additionalUserInfo; - public @Nullable PigeonAdditionalUserInfo getAdditionalUserInfo() { + public @Nullable InternalAdditionalUserInfo getAdditionalUserInfo() { return additionalUserInfo; } - public void setAdditionalUserInfo(@Nullable PigeonAdditionalUserInfo setterArg) { + public void setAdditionalUserInfo(@Nullable InternalAdditionalUserInfo setterArg) { this.additionalUserInfo = setterArg; } - private @Nullable PigeonAuthCredential credential; + private @Nullable InternalAuthCredential credential; - public @Nullable PigeonAuthCredential getCredential() { + public @Nullable InternalAuthCredential getCredential() { return credential; } - public void setCredential(@Nullable PigeonAuthCredential setterArg) { + public void setCredential(@Nullable InternalAuthCredential setterArg) { this.credential = setterArg; } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InternalUserCredential that = (InternalUserCredential) o; + return pigeonDeepEquals(user, that.user) + && pigeonDeepEquals(additionalUserInfo, that.additionalUserInfo) + && pigeonDeepEquals(credential, that.credential); + } + + @Override + public int hashCode() { + Object[] fields = new Object[] {getClass(), user, additionalUserInfo, credential}; + return pigeonDeepHashCode(fields); + } + public static final class Builder { - private @Nullable PigeonUserDetails user; + private @Nullable InternalUserDetails user; @CanIgnoreReturnValue - public @NonNull Builder setUser(@Nullable PigeonUserDetails setterArg) { + public @NonNull Builder setUser(@Nullable InternalUserDetails setterArg) { this.user = setterArg; return this; } - private @Nullable PigeonAdditionalUserInfo additionalUserInfo; + private @Nullable InternalAdditionalUserInfo additionalUserInfo; @CanIgnoreReturnValue - public @NonNull Builder setAdditionalUserInfo(@Nullable PigeonAdditionalUserInfo setterArg) { + public @NonNull Builder setAdditionalUserInfo( + @Nullable InternalAdditionalUserInfo setterArg) { this.additionalUserInfo = setterArg; return this; } - private @Nullable PigeonAuthCredential credential; + private @Nullable InternalAuthCredential credential; @CanIgnoreReturnValue - public @NonNull Builder setCredential(@Nullable PigeonAuthCredential setterArg) { + public @NonNull Builder setCredential(@Nullable InternalAuthCredential setterArg) { this.credential = setterArg; return this; } - public @NonNull PigeonUserCredential build() { - PigeonUserCredential pigeonReturn = new PigeonUserCredential(); + public @NonNull InternalUserCredential build() { + InternalUserCredential pigeonReturn = new InternalUserCredential(); pigeonReturn.setUser(user); pigeonReturn.setAdditionalUserInfo(additionalUserInfo); pigeonReturn.setCredential(credential); @@ -1305,28 +1695,169 @@ public static final class Builder { } @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(3); + public ArrayList toList() { + ArrayList toListResult = new ArrayList<>(3); toListResult.add(user); toListResult.add(additionalUserInfo); toListResult.add(credential); return toListResult; } - static @NonNull PigeonUserCredential fromList(@NonNull ArrayList __pigeon_list) { - PigeonUserCredential pigeonResult = new PigeonUserCredential(); - Object user = __pigeon_list.get(0); - pigeonResult.setUser((PigeonUserDetails) user); - Object additionalUserInfo = __pigeon_list.get(1); - pigeonResult.setAdditionalUserInfo((PigeonAdditionalUserInfo) additionalUserInfo); - Object credential = __pigeon_list.get(2); - pigeonResult.setCredential((PigeonAuthCredential) credential); + static @NonNull InternalUserCredential fromList(@NonNull ArrayList pigeonVar_list) { + InternalUserCredential pigeonResult = new InternalUserCredential(); + Object user = pigeonVar_list.get(0); + pigeonResult.setUser((InternalUserDetails) user); + Object additionalUserInfo = pigeonVar_list.get(1); + pigeonResult.setAdditionalUserInfo((InternalAdditionalUserInfo) additionalUserInfo); + Object credential = pigeonVar_list.get(2); + pigeonResult.setCredential((InternalAuthCredential) credential); + return pigeonResult; + } + } + + /** Generated class from Pigeon that represents data sent in messages. */ + public static final class InternalAuthCredentialInput { + private @NonNull String providerId; + + public @NonNull String getProviderId() { + return providerId; + } + + public void setProviderId(@NonNull String setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"providerId\" is null."); + } + this.providerId = setterArg; + } + + private @NonNull String signInMethod; + + public @NonNull String getSignInMethod() { + return signInMethod; + } + + public void setSignInMethod(@NonNull String setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"signInMethod\" is null."); + } + this.signInMethod = setterArg; + } + + private @Nullable String token; + + public @Nullable String getToken() { + return token; + } + + public void setToken(@Nullable String setterArg) { + this.token = setterArg; + } + + private @Nullable String accessToken; + + public @Nullable String getAccessToken() { + return accessToken; + } + + public void setAccessToken(@Nullable String setterArg) { + this.accessToken = setterArg; + } + + /** Constructor is non-public to enforce null safety; use Builder. */ + InternalAuthCredentialInput() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InternalAuthCredentialInput that = (InternalAuthCredentialInput) o; + return pigeonDeepEquals(providerId, that.providerId) + && pigeonDeepEquals(signInMethod, that.signInMethod) + && pigeonDeepEquals(token, that.token) + && pigeonDeepEquals(accessToken, that.accessToken); + } + + @Override + public int hashCode() { + Object[] fields = new Object[] {getClass(), providerId, signInMethod, token, accessToken}; + return pigeonDeepHashCode(fields); + } + + public static final class Builder { + + private @Nullable String providerId; + + @CanIgnoreReturnValue + public @NonNull Builder setProviderId(@NonNull String setterArg) { + this.providerId = setterArg; + return this; + } + + private @Nullable String signInMethod; + + @CanIgnoreReturnValue + public @NonNull Builder setSignInMethod(@NonNull String setterArg) { + this.signInMethod = setterArg; + return this; + } + + private @Nullable String token; + + @CanIgnoreReturnValue + public @NonNull Builder setToken(@Nullable String setterArg) { + this.token = setterArg; + return this; + } + + private @Nullable String accessToken; + + @CanIgnoreReturnValue + public @NonNull Builder setAccessToken(@Nullable String setterArg) { + this.accessToken = setterArg; + return this; + } + + public @NonNull InternalAuthCredentialInput build() { + InternalAuthCredentialInput pigeonReturn = new InternalAuthCredentialInput(); + pigeonReturn.setProviderId(providerId); + pigeonReturn.setSignInMethod(signInMethod); + pigeonReturn.setToken(token); + pigeonReturn.setAccessToken(accessToken); + return pigeonReturn; + } + } + + @NonNull + public ArrayList toList() { + ArrayList toListResult = new ArrayList<>(4); + toListResult.add(providerId); + toListResult.add(signInMethod); + toListResult.add(token); + toListResult.add(accessToken); + return toListResult; + } + + static @NonNull InternalAuthCredentialInput fromList( + @NonNull ArrayList pigeonVar_list) { + InternalAuthCredentialInput pigeonResult = new InternalAuthCredentialInput(); + Object providerId = pigeonVar_list.get(0); + pigeonResult.setProviderId((String) providerId); + Object signInMethod = pigeonVar_list.get(1); + pigeonResult.setSignInMethod((String) signInMethod); + Object token = pigeonVar_list.get(2); + pigeonResult.setToken((String) token); + Object accessToken = pigeonVar_list.get(3); + pigeonResult.setAccessToken((String) accessToken); return pigeonResult; } } /** Generated class from Pigeon that represents data sent in messages. */ - public static final class PigeonActionCodeSettings { + public static final class InternalActionCodeSettings { private @NonNull String url; public @NonNull String getUrl() { @@ -1417,7 +1948,43 @@ public void setLinkDomain(@Nullable String setterArg) { } /** Constructor is non-public to enforce null safety; use Builder. */ - PigeonActionCodeSettings() {} + InternalActionCodeSettings() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InternalActionCodeSettings that = (InternalActionCodeSettings) o; + return pigeonDeepEquals(url, that.url) + && pigeonDeepEquals(dynamicLinkDomain, that.dynamicLinkDomain) + && pigeonDeepEquals(handleCodeInApp, that.handleCodeInApp) + && pigeonDeepEquals(iOSBundleId, that.iOSBundleId) + && pigeonDeepEquals(androidPackageName, that.androidPackageName) + && pigeonDeepEquals(androidInstallApp, that.androidInstallApp) + && pigeonDeepEquals(androidMinimumVersion, that.androidMinimumVersion) + && pigeonDeepEquals(linkDomain, that.linkDomain); + } + + @Override + public int hashCode() { + Object[] fields = + new Object[] { + getClass(), + url, + dynamicLinkDomain, + handleCodeInApp, + iOSBundleId, + androidPackageName, + androidInstallApp, + androidMinimumVersion, + linkDomain + }; + return pigeonDeepHashCode(fields); + } public static final class Builder { @@ -1485,8 +2052,8 @@ public static final class Builder { return this; } - public @NonNull PigeonActionCodeSettings build() { - PigeonActionCodeSettings pigeonReturn = new PigeonActionCodeSettings(); + public @NonNull InternalActionCodeSettings build() { + InternalActionCodeSettings pigeonReturn = new InternalActionCodeSettings(); pigeonReturn.setUrl(url); pigeonReturn.setDynamicLinkDomain(dynamicLinkDomain); pigeonReturn.setHandleCodeInApp(handleCodeInApp); @@ -1500,8 +2067,8 @@ public static final class Builder { } @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(8); + public ArrayList toList() { + ArrayList toListResult = new ArrayList<>(8); toListResult.add(url); toListResult.add(dynamicLinkDomain); toListResult.add(handleCodeInApp); @@ -1513,30 +2080,30 @@ ArrayList toList() { return toListResult; } - static @NonNull PigeonActionCodeSettings fromList(@NonNull ArrayList __pigeon_list) { - PigeonActionCodeSettings pigeonResult = new PigeonActionCodeSettings(); - Object url = __pigeon_list.get(0); + static @NonNull InternalActionCodeSettings fromList(@NonNull ArrayList pigeonVar_list) { + InternalActionCodeSettings pigeonResult = new InternalActionCodeSettings(); + Object url = pigeonVar_list.get(0); pigeonResult.setUrl((String) url); - Object dynamicLinkDomain = __pigeon_list.get(1); + Object dynamicLinkDomain = pigeonVar_list.get(1); pigeonResult.setDynamicLinkDomain((String) dynamicLinkDomain); - Object handleCodeInApp = __pigeon_list.get(2); + Object handleCodeInApp = pigeonVar_list.get(2); pigeonResult.setHandleCodeInApp((Boolean) handleCodeInApp); - Object iOSBundleId = __pigeon_list.get(3); + Object iOSBundleId = pigeonVar_list.get(3); pigeonResult.setIOSBundleId((String) iOSBundleId); - Object androidPackageName = __pigeon_list.get(4); + Object androidPackageName = pigeonVar_list.get(4); pigeonResult.setAndroidPackageName((String) androidPackageName); - Object androidInstallApp = __pigeon_list.get(5); + Object androidInstallApp = pigeonVar_list.get(5); pigeonResult.setAndroidInstallApp((Boolean) androidInstallApp); - Object androidMinimumVersion = __pigeon_list.get(6); + Object androidMinimumVersion = pigeonVar_list.get(6); pigeonResult.setAndroidMinimumVersion((String) androidMinimumVersion); - Object linkDomain = __pigeon_list.get(7); + Object linkDomain = pigeonVar_list.get(7); pigeonResult.setLinkDomain((String) linkDomain); return pigeonResult; } } /** Generated class from Pigeon that represents data sent in messages. */ - public static final class PigeonFirebaseAuthSettings { + public static final class InternalFirebaseAuthSettings { private @NonNull Boolean appVerificationDisabledForTesting; public @NonNull Boolean getAppVerificationDisabledForTesting() { @@ -1592,7 +2159,38 @@ public void setForceRecaptchaFlow(@Nullable Boolean setterArg) { } /** Constructor is non-public to enforce null safety; use Builder. */ - PigeonFirebaseAuthSettings() {} + InternalFirebaseAuthSettings() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InternalFirebaseAuthSettings that = (InternalFirebaseAuthSettings) o; + return pigeonDeepEquals( + appVerificationDisabledForTesting, that.appVerificationDisabledForTesting) + && pigeonDeepEquals(userAccessGroup, that.userAccessGroup) + && pigeonDeepEquals(phoneNumber, that.phoneNumber) + && pigeonDeepEquals(smsCode, that.smsCode) + && pigeonDeepEquals(forceRecaptchaFlow, that.forceRecaptchaFlow); + } + + @Override + public int hashCode() { + Object[] fields = + new Object[] { + getClass(), + appVerificationDisabledForTesting, + userAccessGroup, + phoneNumber, + smsCode, + forceRecaptchaFlow + }; + return pigeonDeepHashCode(fields); + } public static final class Builder { @@ -1636,8 +2234,8 @@ public static final class Builder { return this; } - public @NonNull PigeonFirebaseAuthSettings build() { - PigeonFirebaseAuthSettings pigeonReturn = new PigeonFirebaseAuthSettings(); + public @NonNull InternalFirebaseAuthSettings build() { + InternalFirebaseAuthSettings pigeonReturn = new InternalFirebaseAuthSettings(); pigeonReturn.setAppVerificationDisabledForTesting(appVerificationDisabledForTesting); pigeonReturn.setUserAccessGroup(userAccessGroup); pigeonReturn.setPhoneNumber(phoneNumber); @@ -1648,8 +2246,8 @@ public static final class Builder { } @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(5); + public ArrayList toList() { + ArrayList toListResult = new ArrayList<>(5); toListResult.add(appVerificationDisabledForTesting); toListResult.add(userAccessGroup); toListResult.add(phoneNumber); @@ -1658,25 +2256,26 @@ ArrayList toList() { return toListResult; } - static @NonNull PigeonFirebaseAuthSettings fromList(@NonNull ArrayList __pigeon_list) { - PigeonFirebaseAuthSettings pigeonResult = new PigeonFirebaseAuthSettings(); - Object appVerificationDisabledForTesting = __pigeon_list.get(0); + static @NonNull InternalFirebaseAuthSettings fromList( + @NonNull ArrayList pigeonVar_list) { + InternalFirebaseAuthSettings pigeonResult = new InternalFirebaseAuthSettings(); + Object appVerificationDisabledForTesting = pigeonVar_list.get(0); pigeonResult.setAppVerificationDisabledForTesting( (Boolean) appVerificationDisabledForTesting); - Object userAccessGroup = __pigeon_list.get(1); + Object userAccessGroup = pigeonVar_list.get(1); pigeonResult.setUserAccessGroup((String) userAccessGroup); - Object phoneNumber = __pigeon_list.get(2); + Object phoneNumber = pigeonVar_list.get(2); pigeonResult.setPhoneNumber((String) phoneNumber); - Object smsCode = __pigeon_list.get(3); + Object smsCode = pigeonVar_list.get(3); pigeonResult.setSmsCode((String) smsCode); - Object forceRecaptchaFlow = __pigeon_list.get(4); + Object forceRecaptchaFlow = pigeonVar_list.get(4); pigeonResult.setForceRecaptchaFlow((Boolean) forceRecaptchaFlow); return pigeonResult; } } /** Generated class from Pigeon that represents data sent in messages. */ - public static final class PigeonSignInProvider { + public static final class InternalSignInProvider { private @NonNull String providerId; public @NonNull String getProviderId() { @@ -1711,7 +2310,27 @@ public void setCustomParameters(@Nullable Map setterArg) { } /** Constructor is non-public to enforce null safety; use Builder. */ - PigeonSignInProvider() {} + InternalSignInProvider() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InternalSignInProvider that = (InternalSignInProvider) o; + return pigeonDeepEquals(providerId, that.providerId) + && pigeonDeepEquals(scopes, that.scopes) + && pigeonDeepEquals(customParameters, that.customParameters); + } + + @Override + public int hashCode() { + Object[] fields = new Object[] {getClass(), providerId, scopes, customParameters}; + return pigeonDeepHashCode(fields); + } public static final class Builder { @@ -1739,8 +2358,8 @@ public static final class Builder { return this; } - public @NonNull PigeonSignInProvider build() { - PigeonSignInProvider pigeonReturn = new PigeonSignInProvider(); + public @NonNull InternalSignInProvider build() { + InternalSignInProvider pigeonReturn = new InternalSignInProvider(); pigeonReturn.setProviderId(providerId); pigeonReturn.setScopes(scopes); pigeonReturn.setCustomParameters(customParameters); @@ -1749,28 +2368,28 @@ public static final class Builder { } @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(3); + public ArrayList toList() { + ArrayList toListResult = new ArrayList<>(3); toListResult.add(providerId); toListResult.add(scopes); toListResult.add(customParameters); return toListResult; } - static @NonNull PigeonSignInProvider fromList(@NonNull ArrayList __pigeon_list) { - PigeonSignInProvider pigeonResult = new PigeonSignInProvider(); - Object providerId = __pigeon_list.get(0); + static @NonNull InternalSignInProvider fromList(@NonNull ArrayList pigeonVar_list) { + InternalSignInProvider pigeonResult = new InternalSignInProvider(); + Object providerId = pigeonVar_list.get(0); pigeonResult.setProviderId((String) providerId); - Object scopes = __pigeon_list.get(1); + Object scopes = pigeonVar_list.get(1); pigeonResult.setScopes((List) scopes); - Object customParameters = __pigeon_list.get(2); + Object customParameters = pigeonVar_list.get(2); pigeonResult.setCustomParameters((Map) customParameters); return pigeonResult; } } /** Generated class from Pigeon that represents data sent in messages. */ - public static final class PigeonVerifyPhoneNumberRequest { + public static final class InternalVerifyPhoneNumberRequest { private @Nullable String phoneNumber; public @Nullable String getPhoneNumber() { @@ -1835,7 +2454,39 @@ public void setMultiFactorSessionId(@Nullable String setterArg) { } /** Constructor is non-public to enforce null safety; use Builder. */ - PigeonVerifyPhoneNumberRequest() {} + InternalVerifyPhoneNumberRequest() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InternalVerifyPhoneNumberRequest that = (InternalVerifyPhoneNumberRequest) o; + return pigeonDeepEquals(phoneNumber, that.phoneNumber) + && pigeonDeepEquals(timeout, that.timeout) + && pigeonDeepEquals(forceResendingToken, that.forceResendingToken) + && pigeonDeepEquals(autoRetrievedSmsCodeForTesting, that.autoRetrievedSmsCodeForTesting) + && pigeonDeepEquals(multiFactorInfoId, that.multiFactorInfoId) + && pigeonDeepEquals(multiFactorSessionId, that.multiFactorSessionId); + } + + @Override + public int hashCode() { + Object[] fields = + new Object[] { + getClass(), + phoneNumber, + timeout, + forceResendingToken, + autoRetrievedSmsCodeForTesting, + multiFactorInfoId, + multiFactorSessionId + }; + return pigeonDeepHashCode(fields); + } public static final class Builder { @@ -1887,8 +2538,8 @@ public static final class Builder { return this; } - public @NonNull PigeonVerifyPhoneNumberRequest build() { - PigeonVerifyPhoneNumberRequest pigeonReturn = new PigeonVerifyPhoneNumberRequest(); + public @NonNull InternalVerifyPhoneNumberRequest build() { + InternalVerifyPhoneNumberRequest pigeonReturn = new InternalVerifyPhoneNumberRequest(); pigeonReturn.setPhoneNumber(phoneNumber); pigeonReturn.setTimeout(timeout); pigeonReturn.setForceResendingToken(forceResendingToken); @@ -1900,8 +2551,8 @@ public static final class Builder { } @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(6); + public ArrayList toList() { + ArrayList toListResult = new ArrayList<>(6); toListResult.add(phoneNumber); toListResult.add(timeout); toListResult.add(forceResendingToken); @@ -1911,35 +2562,27 @@ ArrayList toList() { return toListResult; } - static @NonNull PigeonVerifyPhoneNumberRequest fromList( - @NonNull ArrayList __pigeon_list) { - PigeonVerifyPhoneNumberRequest pigeonResult = new PigeonVerifyPhoneNumberRequest(); - Object phoneNumber = __pigeon_list.get(0); + static @NonNull InternalVerifyPhoneNumberRequest fromList( + @NonNull ArrayList pigeonVar_list) { + InternalVerifyPhoneNumberRequest pigeonResult = new InternalVerifyPhoneNumberRequest(); + Object phoneNumber = pigeonVar_list.get(0); pigeonResult.setPhoneNumber((String) phoneNumber); - Object timeout = __pigeon_list.get(1); - pigeonResult.setTimeout( - (timeout == null) - ? null - : ((timeout instanceof Integer) ? (Integer) timeout : (Long) timeout)); - Object forceResendingToken = __pigeon_list.get(2); - pigeonResult.setForceResendingToken( - (forceResendingToken == null) - ? null - : ((forceResendingToken instanceof Integer) - ? (Integer) forceResendingToken - : (Long) forceResendingToken)); - Object autoRetrievedSmsCodeForTesting = __pigeon_list.get(3); + Object timeout = pigeonVar_list.get(1); + pigeonResult.setTimeout((Long) timeout); + Object forceResendingToken = pigeonVar_list.get(2); + pigeonResult.setForceResendingToken((Long) forceResendingToken); + Object autoRetrievedSmsCodeForTesting = pigeonVar_list.get(3); pigeonResult.setAutoRetrievedSmsCodeForTesting((String) autoRetrievedSmsCodeForTesting); - Object multiFactorInfoId = __pigeon_list.get(4); + Object multiFactorInfoId = pigeonVar_list.get(4); pigeonResult.setMultiFactorInfoId((String) multiFactorInfoId); - Object multiFactorSessionId = __pigeon_list.get(5); + Object multiFactorSessionId = pigeonVar_list.get(5); pigeonResult.setMultiFactorSessionId((String) multiFactorSessionId); return pigeonResult; } } /** Generated class from Pigeon that represents data sent in messages. */ - public static final class PigeonIdTokenResult { + public static final class InternalIdTokenResult { private @Nullable String token; public @Nullable String getToken() { @@ -2010,6 +2653,40 @@ public void setSignInSecondFactor(@Nullable String setterArg) { this.signInSecondFactor = setterArg; } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InternalIdTokenResult that = (InternalIdTokenResult) o; + return pigeonDeepEquals(token, that.token) + && pigeonDeepEquals(expirationTimestamp, that.expirationTimestamp) + && pigeonDeepEquals(authTimestamp, that.authTimestamp) + && pigeonDeepEquals(issuedAtTimestamp, that.issuedAtTimestamp) + && pigeonDeepEquals(signInProvider, that.signInProvider) + && pigeonDeepEquals(claims, that.claims) + && pigeonDeepEquals(signInSecondFactor, that.signInSecondFactor); + } + + @Override + public int hashCode() { + Object[] fields = + new Object[] { + getClass(), + token, + expirationTimestamp, + authTimestamp, + issuedAtTimestamp, + signInProvider, + claims, + signInSecondFactor + }; + return pigeonDeepHashCode(fields); + } + public static final class Builder { private @Nullable String token; @@ -2068,8 +2745,8 @@ public static final class Builder { return this; } - public @NonNull PigeonIdTokenResult build() { - PigeonIdTokenResult pigeonReturn = new PigeonIdTokenResult(); + public @NonNull InternalIdTokenResult build() { + InternalIdTokenResult pigeonReturn = new InternalIdTokenResult(); pigeonReturn.setToken(token); pigeonReturn.setExpirationTimestamp(expirationTimestamp); pigeonReturn.setAuthTimestamp(authTimestamp); @@ -2082,8 +2759,8 @@ public static final class Builder { } @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(7); + public ArrayList toList() { + ArrayList toListResult = new ArrayList<>(7); toListResult.add(token); toListResult.add(expirationTimestamp); toListResult.add(authTimestamp); @@ -2094,43 +2771,28 @@ ArrayList toList() { return toListResult; } - static @NonNull PigeonIdTokenResult fromList(@NonNull ArrayList __pigeon_list) { - PigeonIdTokenResult pigeonResult = new PigeonIdTokenResult(); - Object token = __pigeon_list.get(0); + static @NonNull InternalIdTokenResult fromList(@NonNull ArrayList pigeonVar_list) { + InternalIdTokenResult pigeonResult = new InternalIdTokenResult(); + Object token = pigeonVar_list.get(0); pigeonResult.setToken((String) token); - Object expirationTimestamp = __pigeon_list.get(1); - pigeonResult.setExpirationTimestamp( - (expirationTimestamp == null) - ? null - : ((expirationTimestamp instanceof Integer) - ? (Integer) expirationTimestamp - : (Long) expirationTimestamp)); - Object authTimestamp = __pigeon_list.get(2); - pigeonResult.setAuthTimestamp( - (authTimestamp == null) - ? null - : ((authTimestamp instanceof Integer) - ? (Integer) authTimestamp - : (Long) authTimestamp)); - Object issuedAtTimestamp = __pigeon_list.get(3); - pigeonResult.setIssuedAtTimestamp( - (issuedAtTimestamp == null) - ? null - : ((issuedAtTimestamp instanceof Integer) - ? (Integer) issuedAtTimestamp - : (Long) issuedAtTimestamp)); - Object signInProvider = __pigeon_list.get(4); + Object expirationTimestamp = pigeonVar_list.get(1); + pigeonResult.setExpirationTimestamp((Long) expirationTimestamp); + Object authTimestamp = pigeonVar_list.get(2); + pigeonResult.setAuthTimestamp((Long) authTimestamp); + Object issuedAtTimestamp = pigeonVar_list.get(3); + pigeonResult.setIssuedAtTimestamp((Long) issuedAtTimestamp); + Object signInProvider = pigeonVar_list.get(4); pigeonResult.setSignInProvider((String) signInProvider); - Object claims = __pigeon_list.get(5); + Object claims = pigeonVar_list.get(5); pigeonResult.setClaims((Map) claims); - Object signInSecondFactor = __pigeon_list.get(6); + Object signInSecondFactor = pigeonVar_list.get(6); pigeonResult.setSignInSecondFactor((String) signInSecondFactor); return pigeonResult; } } /** Generated class from Pigeon that represents data sent in messages. */ - public static final class PigeonUserProfile { + public static final class InternalUserProfile { private @Nullable String displayName; public @Nullable String getDisplayName() { @@ -2178,7 +2840,29 @@ public void setPhotoUrlChanged(@NonNull Boolean setterArg) { } /** Constructor is non-public to enforce null safety; use Builder. */ - PigeonUserProfile() {} + InternalUserProfile() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InternalUserProfile that = (InternalUserProfile) o; + return pigeonDeepEquals(displayName, that.displayName) + && pigeonDeepEquals(photoUrl, that.photoUrl) + && pigeonDeepEquals(displayNameChanged, that.displayNameChanged) + && pigeonDeepEquals(photoUrlChanged, that.photoUrlChanged); + } + + @Override + public int hashCode() { + Object[] fields = + new Object[] {getClass(), displayName, photoUrl, displayNameChanged, photoUrlChanged}; + return pigeonDeepHashCode(fields); + } public static final class Builder { @@ -2214,8 +2898,8 @@ public static final class Builder { return this; } - public @NonNull PigeonUserProfile build() { - PigeonUserProfile pigeonReturn = new PigeonUserProfile(); + public @NonNull InternalUserProfile build() { + InternalUserProfile pigeonReturn = new InternalUserProfile(); pigeonReturn.setDisplayName(displayName); pigeonReturn.setPhotoUrl(photoUrl); pigeonReturn.setDisplayNameChanged(displayNameChanged); @@ -2225,8 +2909,8 @@ public static final class Builder { } @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(4); + public ArrayList toList() { + ArrayList toListResult = new ArrayList<>(4); toListResult.add(displayName); toListResult.add(photoUrl); toListResult.add(displayNameChanged); @@ -2234,22 +2918,22 @@ ArrayList toList() { return toListResult; } - static @NonNull PigeonUserProfile fromList(@NonNull ArrayList __pigeon_list) { - PigeonUserProfile pigeonResult = new PigeonUserProfile(); - Object displayName = __pigeon_list.get(0); + static @NonNull InternalUserProfile fromList(@NonNull ArrayList pigeonVar_list) { + InternalUserProfile pigeonResult = new InternalUserProfile(); + Object displayName = pigeonVar_list.get(0); pigeonResult.setDisplayName((String) displayName); - Object photoUrl = __pigeon_list.get(1); + Object photoUrl = pigeonVar_list.get(1); pigeonResult.setPhotoUrl((String) photoUrl); - Object displayNameChanged = __pigeon_list.get(2); + Object displayNameChanged = pigeonVar_list.get(2); pigeonResult.setDisplayNameChanged((Boolean) displayNameChanged); - Object photoUrlChanged = __pigeon_list.get(3); + Object photoUrlChanged = pigeonVar_list.get(3); pigeonResult.setPhotoUrlChanged((Boolean) photoUrlChanged); return pigeonResult; } } /** Generated class from Pigeon that represents data sent in messages. */ - public static final class PigeonTotpSecret { + public static final class InternalTotpSecret { private @Nullable Long codeIntervalSeconds; public @Nullable Long getCodeIntervalSeconds() { @@ -2304,7 +2988,37 @@ public void setSecretKey(@NonNull String setterArg) { } /** Constructor is non-public to enforce null safety; use Builder. */ - PigeonTotpSecret() {} + InternalTotpSecret() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InternalTotpSecret that = (InternalTotpSecret) o; + return pigeonDeepEquals(codeIntervalSeconds, that.codeIntervalSeconds) + && pigeonDeepEquals(codeLength, that.codeLength) + && pigeonDeepEquals(enrollmentCompletionDeadline, that.enrollmentCompletionDeadline) + && pigeonDeepEquals(hashingAlgorithm, that.hashingAlgorithm) + && pigeonDeepEquals(secretKey, that.secretKey); + } + + @Override + public int hashCode() { + Object[] fields = + new Object[] { + getClass(), + codeIntervalSeconds, + codeLength, + enrollmentCompletionDeadline, + hashingAlgorithm, + secretKey + }; + return pigeonDeepHashCode(fields); + } public static final class Builder { @@ -2348,8 +3062,8 @@ public static final class Builder { return this; } - public @NonNull PigeonTotpSecret build() { - PigeonTotpSecret pigeonReturn = new PigeonTotpSecret(); + public @NonNull InternalTotpSecret build() { + InternalTotpSecret pigeonReturn = new InternalTotpSecret(); pigeonReturn.setCodeIntervalSeconds(codeIntervalSeconds); pigeonReturn.setCodeLength(codeLength); pigeonReturn.setEnrollmentCompletionDeadline(enrollmentCompletionDeadline); @@ -2360,8 +3074,8 @@ public static final class Builder { } @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(5); + public ArrayList toList() { + ArrayList toListResult = new ArrayList<>(5); toListResult.add(codeIntervalSeconds); toListResult.add(codeLength); toListResult.add(enrollmentCompletionDeadline); @@ -2370,104 +3084,75 @@ ArrayList toList() { return toListResult; } - static @NonNull PigeonTotpSecret fromList(@NonNull ArrayList __pigeon_list) { - PigeonTotpSecret pigeonResult = new PigeonTotpSecret(); - Object codeIntervalSeconds = __pigeon_list.get(0); - pigeonResult.setCodeIntervalSeconds( - (codeIntervalSeconds == null) - ? null - : ((codeIntervalSeconds instanceof Integer) - ? (Integer) codeIntervalSeconds - : (Long) codeIntervalSeconds)); - Object codeLength = __pigeon_list.get(1); - pigeonResult.setCodeLength( - (codeLength == null) - ? null - : ((codeLength instanceof Integer) ? (Integer) codeLength : (Long) codeLength)); - Object enrollmentCompletionDeadline = __pigeon_list.get(2); - pigeonResult.setEnrollmentCompletionDeadline( - (enrollmentCompletionDeadline == null) - ? null - : ((enrollmentCompletionDeadline instanceof Integer) - ? (Integer) enrollmentCompletionDeadline - : (Long) enrollmentCompletionDeadline)); - Object hashingAlgorithm = __pigeon_list.get(3); + static @NonNull InternalTotpSecret fromList(@NonNull ArrayList pigeonVar_list) { + InternalTotpSecret pigeonResult = new InternalTotpSecret(); + Object codeIntervalSeconds = pigeonVar_list.get(0); + pigeonResult.setCodeIntervalSeconds((Long) codeIntervalSeconds); + Object codeLength = pigeonVar_list.get(1); + pigeonResult.setCodeLength((Long) codeLength); + Object enrollmentCompletionDeadline = pigeonVar_list.get(2); + pigeonResult.setEnrollmentCompletionDeadline((Long) enrollmentCompletionDeadline); + Object hashingAlgorithm = pigeonVar_list.get(3); pigeonResult.setHashingAlgorithm((String) hashingAlgorithm); - Object secretKey = __pigeon_list.get(4); + Object secretKey = pigeonVar_list.get(4); pigeonResult.setSecretKey((String) secretKey); return pigeonResult; } } - /** Asynchronous error handling return type for non-nullable API method returns. */ - public interface Result { - /** Success case callback method for handling returns. */ - void success(@NonNull T result); - - /** Failure case callback method for handling errors. */ - void error(@NonNull Throwable error); - } - /** Asynchronous error handling return type for nullable API method returns. */ - public interface NullableResult { - /** Success case callback method for handling returns. */ - void success(@Nullable T result); - - /** Failure case callback method for handling errors. */ - void error(@NonNull Throwable error); - } - /** Asynchronous error handling return type for void API method returns. */ - public interface VoidResult { - /** Success case callback method for handling returns. */ - void success(); - - /** Failure case callback method for handling errors. */ - void error(@NonNull Throwable error); - } - - private static class FirebaseAuthHostApiCodec extends StandardMessageCodec { - public static final FirebaseAuthHostApiCodec INSTANCE = new FirebaseAuthHostApiCodec(); + private static class PigeonCodec extends StandardMessageCodec { + public static final PigeonCodec INSTANCE = new PigeonCodec(); - private FirebaseAuthHostApiCodec() {} + private PigeonCodec() {} @Override protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { switch (type) { - case (byte) 128: - return AuthPigeonFirebaseApp.fromList((ArrayList) readValue(buffer)); case (byte) 129: - return PigeonActionCodeInfo.fromList((ArrayList) readValue(buffer)); + { + Object value = readValue(buffer); + return value == null + ? null + : ActionCodeInfoOperation.values()[((Long) value).intValue()]; + } case (byte) 130: - return PigeonActionCodeInfoData.fromList((ArrayList) readValue(buffer)); + return InternalMultiFactorSession.fromList((ArrayList) readValue(buffer)); case (byte) 131: - return PigeonActionCodeSettings.fromList((ArrayList) readValue(buffer)); + return InternalPhoneMultiFactorAssertion.fromList((ArrayList) readValue(buffer)); case (byte) 132: - return PigeonAdditionalUserInfo.fromList((ArrayList) readValue(buffer)); + return InternalMultiFactorInfo.fromList((ArrayList) readValue(buffer)); case (byte) 133: - return PigeonAuthCredential.fromList((ArrayList) readValue(buffer)); + return AuthPigeonFirebaseApp.fromList((ArrayList) readValue(buffer)); case (byte) 134: - return PigeonFirebaseAuthSettings.fromList((ArrayList) readValue(buffer)); + return InternalActionCodeInfoData.fromList((ArrayList) readValue(buffer)); case (byte) 135: - return PigeonIdTokenResult.fromList((ArrayList) readValue(buffer)); + return InternalActionCodeInfo.fromList((ArrayList) readValue(buffer)); case (byte) 136: - return PigeonMultiFactorInfo.fromList((ArrayList) readValue(buffer)); + return InternalAdditionalUserInfo.fromList((ArrayList) readValue(buffer)); case (byte) 137: - return PigeonMultiFactorSession.fromList((ArrayList) readValue(buffer)); + return InternalAuthCredential.fromList((ArrayList) readValue(buffer)); case (byte) 138: - return PigeonPhoneMultiFactorAssertion.fromList((ArrayList) readValue(buffer)); + return InternalUserInfo.fromList((ArrayList) readValue(buffer)); case (byte) 139: - return PigeonSignInProvider.fromList((ArrayList) readValue(buffer)); + return InternalUserDetails.fromList((ArrayList) readValue(buffer)); case (byte) 140: - return PigeonTotpSecret.fromList((ArrayList) readValue(buffer)); + return InternalUserCredential.fromList((ArrayList) readValue(buffer)); case (byte) 141: - return PigeonUserCredential.fromList((ArrayList) readValue(buffer)); + return InternalAuthCredentialInput.fromList((ArrayList) readValue(buffer)); case (byte) 142: - return PigeonUserDetails.fromList((ArrayList) readValue(buffer)); + return InternalActionCodeSettings.fromList((ArrayList) readValue(buffer)); case (byte) 143: - return PigeonUserInfo.fromList((ArrayList) readValue(buffer)); + return InternalFirebaseAuthSettings.fromList((ArrayList) readValue(buffer)); case (byte) 144: - return PigeonUserProfile.fromList((ArrayList) readValue(buffer)); + return InternalSignInProvider.fromList((ArrayList) readValue(buffer)); case (byte) 145: - return PigeonVerifyPhoneNumberRequest.fromList((ArrayList) readValue(buffer)); + return InternalVerifyPhoneNumberRequest.fromList((ArrayList) readValue(buffer)); + case (byte) 146: + return InternalIdTokenResult.fromList((ArrayList) readValue(buffer)); + case (byte) 147: + return InternalUserProfile.fromList((ArrayList) readValue(buffer)); + case (byte) 148: + return InternalTotpSecret.fromList((ArrayList) readValue(buffer)); default: return super.readValueOfType(type, buffer); } @@ -2475,66 +3160,96 @@ protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { @Override protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { - if (value instanceof AuthPigeonFirebaseApp) { - stream.write(128); - writeValue(stream, ((AuthPigeonFirebaseApp) value).toList()); - } else if (value instanceof PigeonActionCodeInfo) { + if (value instanceof ActionCodeInfoOperation) { stream.write(129); - writeValue(stream, ((PigeonActionCodeInfo) value).toList()); - } else if (value instanceof PigeonActionCodeInfoData) { + writeValue(stream, value == null ? null : ((ActionCodeInfoOperation) value).index); + } else if (value instanceof InternalMultiFactorSession) { stream.write(130); - writeValue(stream, ((PigeonActionCodeInfoData) value).toList()); - } else if (value instanceof PigeonActionCodeSettings) { + writeValue(stream, ((InternalMultiFactorSession) value).toList()); + } else if (value instanceof InternalPhoneMultiFactorAssertion) { stream.write(131); - writeValue(stream, ((PigeonActionCodeSettings) value).toList()); - } else if (value instanceof PigeonAdditionalUserInfo) { + writeValue(stream, ((InternalPhoneMultiFactorAssertion) value).toList()); + } else if (value instanceof InternalMultiFactorInfo) { stream.write(132); - writeValue(stream, ((PigeonAdditionalUserInfo) value).toList()); - } else if (value instanceof PigeonAuthCredential) { + writeValue(stream, ((InternalMultiFactorInfo) value).toList()); + } else if (value instanceof AuthPigeonFirebaseApp) { stream.write(133); - writeValue(stream, ((PigeonAuthCredential) value).toList()); - } else if (value instanceof PigeonFirebaseAuthSettings) { + writeValue(stream, ((AuthPigeonFirebaseApp) value).toList()); + } else if (value instanceof InternalActionCodeInfoData) { stream.write(134); - writeValue(stream, ((PigeonFirebaseAuthSettings) value).toList()); - } else if (value instanceof PigeonIdTokenResult) { + writeValue(stream, ((InternalActionCodeInfoData) value).toList()); + } else if (value instanceof InternalActionCodeInfo) { stream.write(135); - writeValue(stream, ((PigeonIdTokenResult) value).toList()); - } else if (value instanceof PigeonMultiFactorInfo) { + writeValue(stream, ((InternalActionCodeInfo) value).toList()); + } else if (value instanceof InternalAdditionalUserInfo) { stream.write(136); - writeValue(stream, ((PigeonMultiFactorInfo) value).toList()); - } else if (value instanceof PigeonMultiFactorSession) { + writeValue(stream, ((InternalAdditionalUserInfo) value).toList()); + } else if (value instanceof InternalAuthCredential) { stream.write(137); - writeValue(stream, ((PigeonMultiFactorSession) value).toList()); - } else if (value instanceof PigeonPhoneMultiFactorAssertion) { + writeValue(stream, ((InternalAuthCredential) value).toList()); + } else if (value instanceof InternalUserInfo) { stream.write(138); - writeValue(stream, ((PigeonPhoneMultiFactorAssertion) value).toList()); - } else if (value instanceof PigeonSignInProvider) { + writeValue(stream, ((InternalUserInfo) value).toList()); + } else if (value instanceof InternalUserDetails) { stream.write(139); - writeValue(stream, ((PigeonSignInProvider) value).toList()); - } else if (value instanceof PigeonTotpSecret) { + writeValue(stream, ((InternalUserDetails) value).toList()); + } else if (value instanceof InternalUserCredential) { stream.write(140); - writeValue(stream, ((PigeonTotpSecret) value).toList()); - } else if (value instanceof PigeonUserCredential) { + writeValue(stream, ((InternalUserCredential) value).toList()); + } else if (value instanceof InternalAuthCredentialInput) { stream.write(141); - writeValue(stream, ((PigeonUserCredential) value).toList()); - } else if (value instanceof PigeonUserDetails) { + writeValue(stream, ((InternalAuthCredentialInput) value).toList()); + } else if (value instanceof InternalActionCodeSettings) { stream.write(142); - writeValue(stream, ((PigeonUserDetails) value).toList()); - } else if (value instanceof PigeonUserInfo) { + writeValue(stream, ((InternalActionCodeSettings) value).toList()); + } else if (value instanceof InternalFirebaseAuthSettings) { stream.write(143); - writeValue(stream, ((PigeonUserInfo) value).toList()); - } else if (value instanceof PigeonUserProfile) { + writeValue(stream, ((InternalFirebaseAuthSettings) value).toList()); + } else if (value instanceof InternalSignInProvider) { stream.write(144); - writeValue(stream, ((PigeonUserProfile) value).toList()); - } else if (value instanceof PigeonVerifyPhoneNumberRequest) { + writeValue(stream, ((InternalSignInProvider) value).toList()); + } else if (value instanceof InternalVerifyPhoneNumberRequest) { stream.write(145); - writeValue(stream, ((PigeonVerifyPhoneNumberRequest) value).toList()); + writeValue(stream, ((InternalVerifyPhoneNumberRequest) value).toList()); + } else if (value instanceof InternalIdTokenResult) { + stream.write(146); + writeValue(stream, ((InternalIdTokenResult) value).toList()); + } else if (value instanceof InternalUserProfile) { + stream.write(147); + writeValue(stream, ((InternalUserProfile) value).toList()); + } else if (value instanceof InternalTotpSecret) { + stream.write(148); + writeValue(stream, ((InternalTotpSecret) value).toList()); } else { super.writeValue(stream, value); } } } + /** Asynchronous error handling return type for non-nullable API method returns. */ + public interface Result { + /** Success case callback method for handling returns. */ + void success(@NonNull T result); + + /** Failure case callback method for handling errors. */ + void error(@NonNull Throwable error); + } + /** Asynchronous error handling return type for nullable API method returns. */ + public interface NullableResult { + /** Success case callback method for handling returns. */ + void success(@Nullable T result); + + /** Failure case callback method for handling errors. */ + void error(@NonNull Throwable error); + } + /** Asynchronous error handling return type for void API method returns. */ + public interface VoidResult { + /** Success case callback method for handling returns. */ + void success(); + + /** Failure case callback method for handling errors. */ + void error(@NonNull Throwable error); + } /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface FirebaseAuthHostApi { @@ -2556,7 +3271,7 @@ void applyActionCode( void checkActionCode( @NonNull AuthPigeonFirebaseApp app, @NonNull String code, - @NonNull Result result); + @NonNull Result result); void confirmPasswordReset( @NonNull AuthPigeonFirebaseApp app, @@ -2568,37 +3283,37 @@ void createUserWithEmailAndPassword( @NonNull AuthPigeonFirebaseApp app, @NonNull String email, @NonNull String password, - @NonNull Result result); + @NonNull Result result); void signInAnonymously( - @NonNull AuthPigeonFirebaseApp app, @NonNull Result result); + @NonNull AuthPigeonFirebaseApp app, @NonNull Result result); void signInWithCredential( @NonNull AuthPigeonFirebaseApp app, @NonNull Map input, - @NonNull Result result); + @NonNull Result result); void signInWithCustomToken( @NonNull AuthPigeonFirebaseApp app, @NonNull String token, - @NonNull Result result); + @NonNull Result result); void signInWithEmailAndPassword( @NonNull AuthPigeonFirebaseApp app, @NonNull String email, @NonNull String password, - @NonNull Result result); + @NonNull Result result); void signInWithEmailLink( @NonNull AuthPigeonFirebaseApp app, @NonNull String email, @NonNull String emailLink, - @NonNull Result result); + @NonNull Result result); void signInWithProvider( @NonNull AuthPigeonFirebaseApp app, - @NonNull PigeonSignInProvider signInProvider, - @NonNull Result result); + @NonNull InternalSignInProvider signInProvider, + @NonNull Result result); void signOut(@NonNull AuthPigeonFirebaseApp app, @NonNull VoidResult result); @@ -2610,13 +3325,13 @@ void fetchSignInMethodsForEmail( void sendPasswordResetEmail( @NonNull AuthPigeonFirebaseApp app, @NonNull String email, - @Nullable PigeonActionCodeSettings actionCodeSettings, + @Nullable InternalActionCodeSettings actionCodeSettings, @NonNull VoidResult result); void sendSignInLinkToEmail( @NonNull AuthPigeonFirebaseApp app, @NonNull String email, - @NonNull PigeonActionCodeSettings actionCodeSettings, + @NonNull InternalActionCodeSettings actionCodeSettings, @NonNull VoidResult result); void setLanguageCode( @@ -2626,7 +3341,7 @@ void setLanguageCode( void setSettings( @NonNull AuthPigeonFirebaseApp app, - @NonNull PigeonFirebaseAuthSettings settings, + @NonNull InternalFirebaseAuthSettings settings, @NonNull VoidResult result); void verifyPasswordResetCode( @@ -2634,7 +3349,7 @@ void verifyPasswordResetCode( void verifyPhoneNumber( @NonNull AuthPigeonFirebaseApp app, - @NonNull PigeonVerifyPhoneNumberRequest request, + @NonNull InternalVerifyPhoneNumberRequest request, @NonNull Result result); void revokeTokenWithAuthorizationCode( @@ -2651,7 +3366,7 @@ void revokeAccessToken( /** The codec used by FirebaseAuthHostApi. */ static @NonNull MessageCodec getCodec() { - return FirebaseAuthHostApiCodec.INSTANCE; + return PigeonCodec.INSTANCE; } /** * Sets up an instance of `FirebaseAuthHostApi` to handle messages through the @@ -2676,7 +3391,7 @@ static void setUp( if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; AuthPigeonFirebaseApp appArg = (AuthPigeonFirebaseApp) args.get(0); Result resultCallback = @@ -2708,7 +3423,7 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; AuthPigeonFirebaseApp appArg = (AuthPigeonFirebaseApp) args.get(0); Result resultCallback = @@ -2740,11 +3455,11 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; AuthPigeonFirebaseApp appArg = (AuthPigeonFirebaseApp) args.get(0); String hostArg = (String) args.get(1); - Number portArg = (Number) args.get(2); + Long portArg = (Long) args.get(2); VoidResult resultCallback = new VoidResult() { public void success() { @@ -2758,11 +3473,7 @@ public void error(Throwable error) { } }; - api.useEmulator( - appArg, - hostArg, - (portArg == null) ? null : portArg.longValue(), - resultCallback); + api.useEmulator(appArg, hostArg, portArg, resultCallback); }); } else { channel.setMessageHandler(null); @@ -2778,7 +3489,7 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; AuthPigeonFirebaseApp appArg = (AuthPigeonFirebaseApp) args.get(0); String codeArg = (String) args.get(1); @@ -2811,13 +3522,13 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; AuthPigeonFirebaseApp appArg = (AuthPigeonFirebaseApp) args.get(0); String codeArg = (String) args.get(1); - Result resultCallback = - new Result() { - public void success(PigeonActionCodeInfo result) { + Result resultCallback = + new Result() { + public void success(InternalActionCodeInfo result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -2844,7 +3555,7 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; AuthPigeonFirebaseApp appArg = (AuthPigeonFirebaseApp) args.get(0); String codeArg = (String) args.get(1); @@ -2878,14 +3589,14 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; AuthPigeonFirebaseApp appArg = (AuthPigeonFirebaseApp) args.get(0); String emailArg = (String) args.get(1); String passwordArg = (String) args.get(2); - Result resultCallback = - new Result() { - public void success(PigeonUserCredential result) { + Result resultCallback = + new Result() { + public void success(InternalUserCredential result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -2912,12 +3623,12 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; AuthPigeonFirebaseApp appArg = (AuthPigeonFirebaseApp) args.get(0); - Result resultCallback = - new Result() { - public void success(PigeonUserCredential result) { + Result resultCallback = + new Result() { + public void success(InternalUserCredential result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -2944,13 +3655,13 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; AuthPigeonFirebaseApp appArg = (AuthPigeonFirebaseApp) args.get(0); Map inputArg = (Map) args.get(1); - Result resultCallback = - new Result() { - public void success(PigeonUserCredential result) { + Result resultCallback = + new Result() { + public void success(InternalUserCredential result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -2977,13 +3688,13 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; AuthPigeonFirebaseApp appArg = (AuthPigeonFirebaseApp) args.get(0); String tokenArg = (String) args.get(1); - Result resultCallback = - new Result() { - public void success(PigeonUserCredential result) { + Result resultCallback = + new Result() { + public void success(InternalUserCredential result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -3010,14 +3721,14 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; AuthPigeonFirebaseApp appArg = (AuthPigeonFirebaseApp) args.get(0); String emailArg = (String) args.get(1); String passwordArg = (String) args.get(2); - Result resultCallback = - new Result() { - public void success(PigeonUserCredential result) { + Result resultCallback = + new Result() { + public void success(InternalUserCredential result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -3044,14 +3755,14 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; AuthPigeonFirebaseApp appArg = (AuthPigeonFirebaseApp) args.get(0); String emailArg = (String) args.get(1); String emailLinkArg = (String) args.get(2); - Result resultCallback = - new Result() { - public void success(PigeonUserCredential result) { + Result resultCallback = + new Result() { + public void success(InternalUserCredential result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -3078,13 +3789,13 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; AuthPigeonFirebaseApp appArg = (AuthPigeonFirebaseApp) args.get(0); - PigeonSignInProvider signInProviderArg = (PigeonSignInProvider) args.get(1); - Result resultCallback = - new Result() { - public void success(PigeonUserCredential result) { + InternalSignInProvider signInProviderArg = (InternalSignInProvider) args.get(1); + Result resultCallback = + new Result() { + public void success(InternalUserCredential result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -3111,7 +3822,7 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; AuthPigeonFirebaseApp appArg = (AuthPigeonFirebaseApp) args.get(0); VoidResult resultCallback = @@ -3143,7 +3854,7 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; AuthPigeonFirebaseApp appArg = (AuthPigeonFirebaseApp) args.get(0); String emailArg = (String) args.get(1); @@ -3176,12 +3887,12 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; AuthPigeonFirebaseApp appArg = (AuthPigeonFirebaseApp) args.get(0); String emailArg = (String) args.get(1); - PigeonActionCodeSettings actionCodeSettingsArg = - (PigeonActionCodeSettings) args.get(2); + InternalActionCodeSettings actionCodeSettingsArg = + (InternalActionCodeSettings) args.get(2); VoidResult resultCallback = new VoidResult() { public void success() { @@ -3211,12 +3922,12 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; AuthPigeonFirebaseApp appArg = (AuthPigeonFirebaseApp) args.get(0); String emailArg = (String) args.get(1); - PigeonActionCodeSettings actionCodeSettingsArg = - (PigeonActionCodeSettings) args.get(2); + InternalActionCodeSettings actionCodeSettingsArg = + (InternalActionCodeSettings) args.get(2); VoidResult resultCallback = new VoidResult() { public void success() { @@ -3246,7 +3957,7 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; AuthPigeonFirebaseApp appArg = (AuthPigeonFirebaseApp) args.get(0); String languageCodeArg = (String) args.get(1); @@ -3279,10 +3990,11 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; AuthPigeonFirebaseApp appArg = (AuthPigeonFirebaseApp) args.get(0); - PigeonFirebaseAuthSettings settingsArg = (PigeonFirebaseAuthSettings) args.get(1); + InternalFirebaseAuthSettings settingsArg = + (InternalFirebaseAuthSettings) args.get(1); VoidResult resultCallback = new VoidResult() { public void success() { @@ -3312,7 +4024,7 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; AuthPigeonFirebaseApp appArg = (AuthPigeonFirebaseApp) args.get(0); String codeArg = (String) args.get(1); @@ -3345,11 +4057,11 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; AuthPigeonFirebaseApp appArg = (AuthPigeonFirebaseApp) args.get(0); - PigeonVerifyPhoneNumberRequest requestArg = - (PigeonVerifyPhoneNumberRequest) args.get(1); + InternalVerifyPhoneNumberRequest requestArg = + (InternalVerifyPhoneNumberRequest) args.get(1); Result resultCallback = new Result() { public void success(String result) { @@ -3379,7 +4091,7 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; AuthPigeonFirebaseApp appArg = (AuthPigeonFirebaseApp) args.get(0); String authorizationCodeArg = (String) args.get(1); @@ -3412,7 +4124,7 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; AuthPigeonFirebaseApp appArg = (AuthPigeonFirebaseApp) args.get(0); String accessTokenArg = (String) args.get(1); @@ -3445,7 +4157,7 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; AuthPigeonFirebaseApp appArg = (AuthPigeonFirebaseApp) args.get(0); VoidResult resultCallback = @@ -3469,118 +4181,6 @@ public void error(Throwable error) { } } } - - private static class FirebaseAuthUserHostApiCodec extends StandardMessageCodec { - public static final FirebaseAuthUserHostApiCodec INSTANCE = new FirebaseAuthUserHostApiCodec(); - - private FirebaseAuthUserHostApiCodec() {} - - @Override - protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { - switch (type) { - case (byte) 128: - return AuthPigeonFirebaseApp.fromList((ArrayList) readValue(buffer)); - case (byte) 129: - return PigeonActionCodeInfo.fromList((ArrayList) readValue(buffer)); - case (byte) 130: - return PigeonActionCodeInfoData.fromList((ArrayList) readValue(buffer)); - case (byte) 131: - return PigeonActionCodeSettings.fromList((ArrayList) readValue(buffer)); - case (byte) 132: - return PigeonAdditionalUserInfo.fromList((ArrayList) readValue(buffer)); - case (byte) 133: - return PigeonAuthCredential.fromList((ArrayList) readValue(buffer)); - case (byte) 134: - return PigeonFirebaseAuthSettings.fromList((ArrayList) readValue(buffer)); - case (byte) 135: - return PigeonIdTokenResult.fromList((ArrayList) readValue(buffer)); - case (byte) 136: - return PigeonMultiFactorInfo.fromList((ArrayList) readValue(buffer)); - case (byte) 137: - return PigeonMultiFactorSession.fromList((ArrayList) readValue(buffer)); - case (byte) 138: - return PigeonPhoneMultiFactorAssertion.fromList((ArrayList) readValue(buffer)); - case (byte) 139: - return PigeonSignInProvider.fromList((ArrayList) readValue(buffer)); - case (byte) 140: - return PigeonTotpSecret.fromList((ArrayList) readValue(buffer)); - case (byte) 141: - return PigeonUserCredential.fromList((ArrayList) readValue(buffer)); - case (byte) 142: - return PigeonUserDetails.fromList((ArrayList) readValue(buffer)); - case (byte) 143: - return PigeonUserInfo.fromList((ArrayList) readValue(buffer)); - case (byte) 144: - return PigeonUserProfile.fromList((ArrayList) readValue(buffer)); - case (byte) 145: - return PigeonVerifyPhoneNumberRequest.fromList((ArrayList) readValue(buffer)); - default: - return super.readValueOfType(type, buffer); - } - } - - @Override - protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { - if (value instanceof AuthPigeonFirebaseApp) { - stream.write(128); - writeValue(stream, ((AuthPigeonFirebaseApp) value).toList()); - } else if (value instanceof PigeonActionCodeInfo) { - stream.write(129); - writeValue(stream, ((PigeonActionCodeInfo) value).toList()); - } else if (value instanceof PigeonActionCodeInfoData) { - stream.write(130); - writeValue(stream, ((PigeonActionCodeInfoData) value).toList()); - } else if (value instanceof PigeonActionCodeSettings) { - stream.write(131); - writeValue(stream, ((PigeonActionCodeSettings) value).toList()); - } else if (value instanceof PigeonAdditionalUserInfo) { - stream.write(132); - writeValue(stream, ((PigeonAdditionalUserInfo) value).toList()); - } else if (value instanceof PigeonAuthCredential) { - stream.write(133); - writeValue(stream, ((PigeonAuthCredential) value).toList()); - } else if (value instanceof PigeonFirebaseAuthSettings) { - stream.write(134); - writeValue(stream, ((PigeonFirebaseAuthSettings) value).toList()); - } else if (value instanceof PigeonIdTokenResult) { - stream.write(135); - writeValue(stream, ((PigeonIdTokenResult) value).toList()); - } else if (value instanceof PigeonMultiFactorInfo) { - stream.write(136); - writeValue(stream, ((PigeonMultiFactorInfo) value).toList()); - } else if (value instanceof PigeonMultiFactorSession) { - stream.write(137); - writeValue(stream, ((PigeonMultiFactorSession) value).toList()); - } else if (value instanceof PigeonPhoneMultiFactorAssertion) { - stream.write(138); - writeValue(stream, ((PigeonPhoneMultiFactorAssertion) value).toList()); - } else if (value instanceof PigeonSignInProvider) { - stream.write(139); - writeValue(stream, ((PigeonSignInProvider) value).toList()); - } else if (value instanceof PigeonTotpSecret) { - stream.write(140); - writeValue(stream, ((PigeonTotpSecret) value).toList()); - } else if (value instanceof PigeonUserCredential) { - stream.write(141); - writeValue(stream, ((PigeonUserCredential) value).toList()); - } else if (value instanceof PigeonUserDetails) { - stream.write(142); - writeValue(stream, ((PigeonUserDetails) value).toList()); - } else if (value instanceof PigeonUserInfo) { - stream.write(143); - writeValue(stream, ((PigeonUserInfo) value).toList()); - } else if (value instanceof PigeonUserProfile) { - stream.write(144); - writeValue(stream, ((PigeonUserProfile) value).toList()); - } else if (value instanceof PigeonVerifyPhoneNumberRequest) { - stream.write(145); - writeValue(stream, ((PigeonVerifyPhoneNumberRequest) value).toList()); - } else { - super.writeValue(stream, value); - } - } - } - /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface FirebaseAuthUserHostApi { @@ -3589,69 +4189,69 @@ public interface FirebaseAuthUserHostApi { void getIdToken( @NonNull AuthPigeonFirebaseApp app, @NonNull Boolean forceRefresh, - @NonNull Result result); + @NonNull Result result); void linkWithCredential( @NonNull AuthPigeonFirebaseApp app, @NonNull Map input, - @NonNull Result result); + @NonNull Result result); void linkWithProvider( @NonNull AuthPigeonFirebaseApp app, - @NonNull PigeonSignInProvider signInProvider, - @NonNull Result result); + @NonNull InternalSignInProvider signInProvider, + @NonNull Result result); void reauthenticateWithCredential( @NonNull AuthPigeonFirebaseApp app, @NonNull Map input, - @NonNull Result result); + @NonNull Result result); void reauthenticateWithProvider( @NonNull AuthPigeonFirebaseApp app, - @NonNull PigeonSignInProvider signInProvider, - @NonNull Result result); + @NonNull InternalSignInProvider signInProvider, + @NonNull Result result); - void reload(@NonNull AuthPigeonFirebaseApp app, @NonNull Result result); + void reload(@NonNull AuthPigeonFirebaseApp app, @NonNull Result result); void sendEmailVerification( @NonNull AuthPigeonFirebaseApp app, - @Nullable PigeonActionCodeSettings actionCodeSettings, + @Nullable InternalActionCodeSettings actionCodeSettings, @NonNull VoidResult result); void unlink( @NonNull AuthPigeonFirebaseApp app, @NonNull String providerId, - @NonNull Result result); + @NonNull Result result); void updateEmail( @NonNull AuthPigeonFirebaseApp app, @NonNull String newEmail, - @NonNull Result result); + @NonNull Result result); void updatePassword( @NonNull AuthPigeonFirebaseApp app, @NonNull String newPassword, - @NonNull Result result); + @NonNull Result result); void updatePhoneNumber( @NonNull AuthPigeonFirebaseApp app, @NonNull Map input, - @NonNull Result result); + @NonNull Result result); void updateProfile( @NonNull AuthPigeonFirebaseApp app, - @NonNull PigeonUserProfile profile, - @NonNull Result result); + @NonNull InternalUserProfile profile, + @NonNull Result result); void verifyBeforeUpdateEmail( @NonNull AuthPigeonFirebaseApp app, @NonNull String newEmail, - @Nullable PigeonActionCodeSettings actionCodeSettings, + @Nullable InternalActionCodeSettings actionCodeSettings, @NonNull VoidResult result); /** The codec used by FirebaseAuthUserHostApi. */ static @NonNull MessageCodec getCodec() { - return FirebaseAuthUserHostApiCodec.INSTANCE; + return PigeonCodec.INSTANCE; } /** * Sets up an instance of `FirebaseAuthUserHostApi` to handle messages through the @@ -3677,7 +4277,7 @@ static void setUp( if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; AuthPigeonFirebaseApp appArg = (AuthPigeonFirebaseApp) args.get(0); VoidResult resultCallback = @@ -3709,13 +4309,13 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; AuthPigeonFirebaseApp appArg = (AuthPigeonFirebaseApp) args.get(0); Boolean forceRefreshArg = (Boolean) args.get(1); - Result resultCallback = - new Result() { - public void success(PigeonIdTokenResult result) { + Result resultCallback = + new Result() { + public void success(InternalIdTokenResult result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -3742,13 +4342,13 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; AuthPigeonFirebaseApp appArg = (AuthPigeonFirebaseApp) args.get(0); Map inputArg = (Map) args.get(1); - Result resultCallback = - new Result() { - public void success(PigeonUserCredential result) { + Result resultCallback = + new Result() { + public void success(InternalUserCredential result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -3775,13 +4375,13 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; AuthPigeonFirebaseApp appArg = (AuthPigeonFirebaseApp) args.get(0); - PigeonSignInProvider signInProviderArg = (PigeonSignInProvider) args.get(1); - Result resultCallback = - new Result() { - public void success(PigeonUserCredential result) { + InternalSignInProvider signInProviderArg = (InternalSignInProvider) args.get(1); + Result resultCallback = + new Result() { + public void success(InternalUserCredential result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -3808,13 +4408,13 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; AuthPigeonFirebaseApp appArg = (AuthPigeonFirebaseApp) args.get(0); Map inputArg = (Map) args.get(1); - Result resultCallback = - new Result() { - public void success(PigeonUserCredential result) { + Result resultCallback = + new Result() { + public void success(InternalUserCredential result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -3841,13 +4441,13 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; AuthPigeonFirebaseApp appArg = (AuthPigeonFirebaseApp) args.get(0); - PigeonSignInProvider signInProviderArg = (PigeonSignInProvider) args.get(1); - Result resultCallback = - new Result() { - public void success(PigeonUserCredential result) { + InternalSignInProvider signInProviderArg = (InternalSignInProvider) args.get(1); + Result resultCallback = + new Result() { + public void success(InternalUserCredential result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -3874,12 +4474,12 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; AuthPigeonFirebaseApp appArg = (AuthPigeonFirebaseApp) args.get(0); - Result resultCallback = - new Result() { - public void success(PigeonUserDetails result) { + Result resultCallback = + new Result() { + public void success(InternalUserDetails result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -3906,11 +4506,11 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; AuthPigeonFirebaseApp appArg = (AuthPigeonFirebaseApp) args.get(0); - PigeonActionCodeSettings actionCodeSettingsArg = - (PigeonActionCodeSettings) args.get(1); + InternalActionCodeSettings actionCodeSettingsArg = + (InternalActionCodeSettings) args.get(1); VoidResult resultCallback = new VoidResult() { public void success() { @@ -3940,13 +4540,13 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; AuthPigeonFirebaseApp appArg = (AuthPigeonFirebaseApp) args.get(0); String providerIdArg = (String) args.get(1); - Result resultCallback = - new Result() { - public void success(PigeonUserCredential result) { + Result resultCallback = + new Result() { + public void success(InternalUserCredential result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -3973,13 +4573,13 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; AuthPigeonFirebaseApp appArg = (AuthPigeonFirebaseApp) args.get(0); String newEmailArg = (String) args.get(1); - Result resultCallback = - new Result() { - public void success(PigeonUserDetails result) { + Result resultCallback = + new Result() { + public void success(InternalUserDetails result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -4006,13 +4606,13 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; AuthPigeonFirebaseApp appArg = (AuthPigeonFirebaseApp) args.get(0); String newPasswordArg = (String) args.get(1); - Result resultCallback = - new Result() { - public void success(PigeonUserDetails result) { + Result resultCallback = + new Result() { + public void success(InternalUserDetails result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -4039,13 +4639,13 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; AuthPigeonFirebaseApp appArg = (AuthPigeonFirebaseApp) args.get(0); Map inputArg = (Map) args.get(1); - Result resultCallback = - new Result() { - public void success(PigeonUserDetails result) { + Result resultCallback = + new Result() { + public void success(InternalUserDetails result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -4072,13 +4672,13 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; AuthPigeonFirebaseApp appArg = (AuthPigeonFirebaseApp) args.get(0); - PigeonUserProfile profileArg = (PigeonUserProfile) args.get(1); - Result resultCallback = - new Result() { - public void success(PigeonUserDetails result) { + InternalUserProfile profileArg = (InternalUserProfile) args.get(1); + Result resultCallback = + new Result() { + public void success(InternalUserDetails result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -4105,12 +4705,12 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; AuthPigeonFirebaseApp appArg = (AuthPigeonFirebaseApp) args.get(0); String newEmailArg = (String) args.get(1); - PigeonActionCodeSettings actionCodeSettingsArg = - (PigeonActionCodeSettings) args.get(2); + InternalActionCodeSettings actionCodeSettingsArg = + (InternalActionCodeSettings) args.get(2); VoidResult resultCallback = new VoidResult() { public void success() { @@ -4133,54 +4733,12 @@ public void error(Throwable error) { } } } - - private static class MultiFactorUserHostApiCodec extends StandardMessageCodec { - public static final MultiFactorUserHostApiCodec INSTANCE = new MultiFactorUserHostApiCodec(); - - private MultiFactorUserHostApiCodec() {} - - @Override - protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { - switch (type) { - case (byte) 128: - return AuthPigeonFirebaseApp.fromList((ArrayList) readValue(buffer)); - case (byte) 129: - return PigeonMultiFactorInfo.fromList((ArrayList) readValue(buffer)); - case (byte) 130: - return PigeonMultiFactorSession.fromList((ArrayList) readValue(buffer)); - case (byte) 131: - return PigeonPhoneMultiFactorAssertion.fromList((ArrayList) readValue(buffer)); - default: - return super.readValueOfType(type, buffer); - } - } - - @Override - protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { - if (value instanceof AuthPigeonFirebaseApp) { - stream.write(128); - writeValue(stream, ((AuthPigeonFirebaseApp) value).toList()); - } else if (value instanceof PigeonMultiFactorInfo) { - stream.write(129); - writeValue(stream, ((PigeonMultiFactorInfo) value).toList()); - } else if (value instanceof PigeonMultiFactorSession) { - stream.write(130); - writeValue(stream, ((PigeonMultiFactorSession) value).toList()); - } else if (value instanceof PigeonPhoneMultiFactorAssertion) { - stream.write(131); - writeValue(stream, ((PigeonPhoneMultiFactorAssertion) value).toList()); - } else { - super.writeValue(stream, value); - } - } - } - /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface MultiFactorUserHostApi { void enrollPhone( @NonNull AuthPigeonFirebaseApp app, - @NonNull PigeonPhoneMultiFactorAssertion assertion, + @NonNull InternalPhoneMultiFactorAssertion assertion, @Nullable String displayName, @NonNull VoidResult result); @@ -4191,17 +4749,17 @@ void enrollTotp( @NonNull VoidResult result); void getSession( - @NonNull AuthPigeonFirebaseApp app, @NonNull Result result); + @NonNull AuthPigeonFirebaseApp app, @NonNull Result result); void unenroll( @NonNull AuthPigeonFirebaseApp app, @NonNull String factorUid, @NonNull VoidResult result); void getEnrolledFactors( - @NonNull AuthPigeonFirebaseApp app, @NonNull Result> result); + @NonNull AuthPigeonFirebaseApp app, @NonNull Result> result); /** The codec used by MultiFactorUserHostApi. */ static @NonNull MessageCodec getCodec() { - return MultiFactorUserHostApiCodec.INSTANCE; + return PigeonCodec.INSTANCE; } /** * Sets up an instance of `MultiFactorUserHostApi` to handle messages through the @@ -4227,11 +4785,11 @@ static void setUp( if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; AuthPigeonFirebaseApp appArg = (AuthPigeonFirebaseApp) args.get(0); - PigeonPhoneMultiFactorAssertion assertionArg = - (PigeonPhoneMultiFactorAssertion) args.get(1); + InternalPhoneMultiFactorAssertion assertionArg = + (InternalPhoneMultiFactorAssertion) args.get(1); String displayNameArg = (String) args.get(2); VoidResult resultCallback = new VoidResult() { @@ -4262,7 +4820,7 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; AuthPigeonFirebaseApp appArg = (AuthPigeonFirebaseApp) args.get(0); String assertionIdArg = (String) args.get(1); @@ -4296,12 +4854,12 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; AuthPigeonFirebaseApp appArg = (AuthPigeonFirebaseApp) args.get(0); - Result resultCallback = - new Result() { - public void success(PigeonMultiFactorSession result) { + Result resultCallback = + new Result() { + public void success(InternalMultiFactorSession result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -4328,7 +4886,7 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; AuthPigeonFirebaseApp appArg = (AuthPigeonFirebaseApp) args.get(0); String factorUidArg = (String) args.get(1); @@ -4361,12 +4919,12 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; AuthPigeonFirebaseApp appArg = (AuthPigeonFirebaseApp) args.get(0); - Result> resultCallback = - new Result>() { - public void success(List result) { + Result> resultCallback = + new Result>() { + public void success(List result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -4385,71 +4943,18 @@ public void error(Throwable error) { } } } - - private static class MultiFactoResolverHostApiCodec extends StandardMessageCodec { - public static final MultiFactoResolverHostApiCodec INSTANCE = - new MultiFactoResolverHostApiCodec(); - - private MultiFactoResolverHostApiCodec() {} - - @Override - protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { - switch (type) { - case (byte) 128: - return PigeonAdditionalUserInfo.fromList((ArrayList) readValue(buffer)); - case (byte) 129: - return PigeonAuthCredential.fromList((ArrayList) readValue(buffer)); - case (byte) 130: - return PigeonPhoneMultiFactorAssertion.fromList((ArrayList) readValue(buffer)); - case (byte) 131: - return PigeonUserCredential.fromList((ArrayList) readValue(buffer)); - case (byte) 132: - return PigeonUserDetails.fromList((ArrayList) readValue(buffer)); - case (byte) 133: - return PigeonUserInfo.fromList((ArrayList) readValue(buffer)); - default: - return super.readValueOfType(type, buffer); - } - } - - @Override - protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { - if (value instanceof PigeonAdditionalUserInfo) { - stream.write(128); - writeValue(stream, ((PigeonAdditionalUserInfo) value).toList()); - } else if (value instanceof PigeonAuthCredential) { - stream.write(129); - writeValue(stream, ((PigeonAuthCredential) value).toList()); - } else if (value instanceof PigeonPhoneMultiFactorAssertion) { - stream.write(130); - writeValue(stream, ((PigeonPhoneMultiFactorAssertion) value).toList()); - } else if (value instanceof PigeonUserCredential) { - stream.write(131); - writeValue(stream, ((PigeonUserCredential) value).toList()); - } else if (value instanceof PigeonUserDetails) { - stream.write(132); - writeValue(stream, ((PigeonUserDetails) value).toList()); - } else if (value instanceof PigeonUserInfo) { - stream.write(133); - writeValue(stream, ((PigeonUserInfo) value).toList()); - } else { - super.writeValue(stream, value); - } - } - } - /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface MultiFactoResolverHostApi { void resolveSignIn( @NonNull String resolverId, - @Nullable PigeonPhoneMultiFactorAssertion assertion, + @Nullable InternalPhoneMultiFactorAssertion assertion, @Nullable String totpAssertionId, - @NonNull Result result); + @NonNull Result result); /** The codec used by MultiFactoResolverHostApi. */ static @NonNull MessageCodec getCodec() { - return MultiFactoResolverHostApiCodec.INSTANCE; + return PigeonCodec.INSTANCE; } /** * Sets up an instance of `MultiFactoResolverHostApi` to handle messages through the @@ -4475,15 +4980,15 @@ static void setUp( if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; String resolverIdArg = (String) args.get(0); - PigeonPhoneMultiFactorAssertion assertionArg = - (PigeonPhoneMultiFactorAssertion) args.get(1); + InternalPhoneMultiFactorAssertion assertionArg = + (InternalPhoneMultiFactorAssertion) args.get(1); String totpAssertionIdArg = (String) args.get(2); - Result resultCallback = - new Result() { - public void success(PigeonUserCredential result) { + Result resultCallback = + new Result() { + public void success(InternalUserCredential result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -4502,37 +5007,10 @@ public void error(Throwable error) { } } } - - private static class MultiFactorTotpHostApiCodec extends StandardMessageCodec { - public static final MultiFactorTotpHostApiCodec INSTANCE = new MultiFactorTotpHostApiCodec(); - - private MultiFactorTotpHostApiCodec() {} - - @Override - protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { - switch (type) { - case (byte) 128: - return PigeonTotpSecret.fromList((ArrayList) readValue(buffer)); - default: - return super.readValueOfType(type, buffer); - } - } - - @Override - protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { - if (value instanceof PigeonTotpSecret) { - stream.write(128); - writeValue(stream, ((PigeonTotpSecret) value).toList()); - } else { - super.writeValue(stream, value); - } - } - } - /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface MultiFactorTotpHostApi { - void generateSecret(@NonNull String sessionId, @NonNull Result result); + void generateSecret(@NonNull String sessionId, @NonNull Result result); void getAssertionForEnrollment( @NonNull String secretKey, @NonNull String oneTimePassword, @NonNull Result result); @@ -4544,7 +5022,7 @@ void getAssertionForSignIn( /** The codec used by MultiFactorTotpHostApi. */ static @NonNull MessageCodec getCodec() { - return MultiFactorTotpHostApiCodec.INSTANCE; + return PigeonCodec.INSTANCE; } /** * Sets up an instance of `MultiFactorTotpHostApi` to handle messages through the @@ -4570,12 +5048,12 @@ static void setUp( if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; String sessionIdArg = (String) args.get(0); - Result resultCallback = - new Result() { - public void success(PigeonTotpSecret result) { + Result resultCallback = + new Result() { + public void success(InternalTotpSecret result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -4602,7 +5080,7 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; String secretKeyArg = (String) args.get(0); String oneTimePasswordArg = (String) args.get(1); @@ -4635,7 +5113,7 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; String enrollmentIdArg = (String) args.get(0); String oneTimePasswordArg = (String) args.get(1); @@ -4674,7 +5152,7 @@ void openInOtpApp( /** The codec used by MultiFactorTotpSecretHostApi. */ static @NonNull MessageCodec getCodec() { - return new StandardMessageCodec(); + return PigeonCodec.INSTANCE; } /** * Sets up an instance of `MultiFactorTotpSecretHostApi` to handle messages through the @@ -4700,7 +5178,7 @@ static void setUp( if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; String secretKeyArg = (String) args.get(0); String accountNameArg = (String) args.get(1); @@ -4734,7 +5212,7 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; String secretKeyArg = (String) args.get(0); String qrCodeUrlArg = (String) args.get(1); @@ -4759,33 +5237,6 @@ public void error(Throwable error) { } } } - - private static class GenerateInterfacesCodec extends StandardMessageCodec { - public static final GenerateInterfacesCodec INSTANCE = new GenerateInterfacesCodec(); - - private GenerateInterfacesCodec() {} - - @Override - protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { - switch (type) { - case (byte) 128: - return PigeonMultiFactorInfo.fromList((ArrayList) readValue(buffer)); - default: - return super.readValueOfType(type, buffer); - } - } - - @Override - protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { - if (value instanceof PigeonMultiFactorInfo) { - stream.write(128); - writeValue(stream, ((PigeonMultiFactorInfo) value).toList()); - } else { - super.writeValue(stream, value); - } - } - } - /** * Only used to generate the object interface that are use outside of the Pigeon interface * @@ -4793,11 +5244,11 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { */ public interface GenerateInterfaces { - void pigeonInterface(@NonNull PigeonMultiFactorInfo info); + void pigeonInterface(@NonNull InternalMultiFactorInfo info); /** The codec used by GenerateInterfaces. */ static @NonNull MessageCodec getCodec() { - return GenerateInterfacesCodec.INSTANCE; + return PigeonCodec.INSTANCE; } /** * Sets up an instance of `GenerateInterfaces` to handle messages through the `binaryMessenger`. @@ -4821,15 +5272,14 @@ static void setUp( if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - PigeonMultiFactorInfo infoArg = (PigeonMultiFactorInfo) args.get(0); + InternalMultiFactorInfo infoArg = (InternalMultiFactorInfo) args.get(0); try { api.pigeonInterface(infoArg); wrapped.add(0, null); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); diff --git a/packages/firebase_auth/firebase_auth/android/src/main/java/io/flutter/plugins/firebase/auth/PhoneNumberVerificationStreamHandler.java b/packages/firebase_auth/firebase_auth/android/src/main/java/io/flutter/plugins/firebase/auth/PhoneNumberVerificationStreamHandler.java index f92e6f5b741d..a227be99a49d 100644 --- a/packages/firebase_auth/firebase_auth/android/src/main/java/io/flutter/plugins/firebase/auth/PhoneNumberVerificationStreamHandler.java +++ b/packages/firebase_auth/firebase_auth/android/src/main/java/io/flutter/plugins/firebase/auth/PhoneNumberVerificationStreamHandler.java @@ -50,7 +50,7 @@ interface OnCredentialsListener { public PhoneNumberVerificationStreamHandler( Activity activity, @NonNull GeneratedAndroidFirebaseAuth.AuthPigeonFirebaseApp app, - @NonNull GeneratedAndroidFirebaseAuth.PigeonVerifyPhoneNumberRequest request, + @NonNull GeneratedAndroidFirebaseAuth.InternalVerifyPhoneNumberRequest request, @Nullable MultiFactorSession multiFactorSession, @Nullable PhoneMultiFactorInfo multiFactorInfo, OnCredentialsListener onCredentialsListener) { diff --git a/packages/firebase_auth/firebase_auth/android/src/main/java/io/flutter/plugins/firebase/auth/PigeonParser.java b/packages/firebase_auth/firebase_auth/android/src/main/java/io/flutter/plugins/firebase/auth/PigeonParser.java index a94ae4d796a1..8c510f912e9d 100644 --- a/packages/firebase_auth/firebase_auth/android/src/main/java/io/flutter/plugins/firebase/auth/PigeonParser.java +++ b/packages/firebase_auth/firebase_auth/android/src/main/java/io/flutter/plugins/firebase/auth/PigeonParser.java @@ -39,17 +39,17 @@ public class PigeonParser { static List manuallyToList( - GeneratedAndroidFirebaseAuth.PigeonUserDetails pigeonUserDetails) { + GeneratedAndroidFirebaseAuth.InternalUserDetails pigeonUserDetails) { List output = new ArrayList<>(); output.add(pigeonUserDetails.getUserInfo().toList()); output.add(pigeonUserDetails.getProviderData()); return output; } - static GeneratedAndroidFirebaseAuth.PigeonUserCredential parseAuthResult( + static GeneratedAndroidFirebaseAuth.InternalUserCredential parseAuthResult( @NonNull AuthResult authResult) { - GeneratedAndroidFirebaseAuth.PigeonUserCredential.Builder builder = - new GeneratedAndroidFirebaseAuth.PigeonUserCredential.Builder(); + GeneratedAndroidFirebaseAuth.InternalUserCredential.Builder builder = + new GeneratedAndroidFirebaseAuth.InternalUserCredential.Builder(); builder.setAdditionalUserInfo(parseAdditionalUserInfo(authResult.getAdditionalUserInfo())); builder.setCredential(parseAuthCredential(authResult.getCredential())); @@ -58,14 +58,14 @@ static GeneratedAndroidFirebaseAuth.PigeonUserCredential parseAuthResult( return builder.build(); } - private static GeneratedAndroidFirebaseAuth.PigeonAdditionalUserInfo parseAdditionalUserInfo( + private static GeneratedAndroidFirebaseAuth.InternalAdditionalUserInfo parseAdditionalUserInfo( AdditionalUserInfo additionalUserInfo) { if (additionalUserInfo == null) { return null; } - GeneratedAndroidFirebaseAuth.PigeonAdditionalUserInfo.Builder builder = - new GeneratedAndroidFirebaseAuth.PigeonAdditionalUserInfo.Builder(); + GeneratedAndroidFirebaseAuth.InternalAdditionalUserInfo.Builder builder = + new GeneratedAndroidFirebaseAuth.InternalAdditionalUserInfo.Builder(); builder.setIsNewUser(additionalUserInfo.isNewUser()); builder.setProfile(additionalUserInfo.getProfile()); @@ -75,7 +75,7 @@ private static GeneratedAndroidFirebaseAuth.PigeonAdditionalUserInfo parseAdditi return builder.build(); } - static GeneratedAndroidFirebaseAuth.PigeonAuthCredential parseAuthCredential( + static GeneratedAndroidFirebaseAuth.InternalAuthCredential parseAuthCredential( AuthCredential authCredential) { if (authCredential == null) { return null; @@ -84,8 +84,8 @@ static GeneratedAndroidFirebaseAuth.PigeonAuthCredential parseAuthCredential( int authCredentialHashCode = authCredential.hashCode(); FlutterFirebaseAuthPlugin.authCredentials.put(authCredentialHashCode, authCredential); - GeneratedAndroidFirebaseAuth.PigeonAuthCredential.Builder builder = - new GeneratedAndroidFirebaseAuth.PigeonAuthCredential.Builder(); + GeneratedAndroidFirebaseAuth.InternalAuthCredential.Builder builder = + new GeneratedAndroidFirebaseAuth.InternalAuthCredential.Builder(); builder.setProviderId(authCredential.getProvider()); builder.setSignInMethod(authCredential.getSignInMethod()); @@ -97,17 +97,17 @@ static GeneratedAndroidFirebaseAuth.PigeonAuthCredential parseAuthCredential( return builder.build(); } - static GeneratedAndroidFirebaseAuth.PigeonUserDetails parseFirebaseUser( + static GeneratedAndroidFirebaseAuth.InternalUserDetails parseFirebaseUser( FirebaseUser firebaseUser) { if (firebaseUser == null) { return null; } - GeneratedAndroidFirebaseAuth.PigeonUserDetails.Builder builder = - new GeneratedAndroidFirebaseAuth.PigeonUserDetails.Builder(); + GeneratedAndroidFirebaseAuth.InternalUserDetails.Builder builder = + new GeneratedAndroidFirebaseAuth.InternalUserDetails.Builder(); - GeneratedAndroidFirebaseAuth.PigeonUserInfo.Builder builderInfo = - new GeneratedAndroidFirebaseAuth.PigeonUserInfo.Builder(); + GeneratedAndroidFirebaseAuth.InternalUserInfo.Builder builderInfo = + new GeneratedAndroidFirebaseAuth.InternalUserInfo.Builder(); builderInfo.setDisplayName(firebaseUser.getDisplayName()); builderInfo.setEmail(firebaseUser.getEmail()); @@ -249,7 +249,7 @@ static AuthCredential getCredential(Map credentialMap) { } static ActionCodeSettings getActionCodeSettings( - @NonNull GeneratedAndroidFirebaseAuth.PigeonActionCodeSettings pigeonActionCodeSettings) { + @NonNull GeneratedAndroidFirebaseAuth.InternalActionCodeSettings pigeonActionCodeSettings) { ActionCodeSettings.Builder builder = ActionCodeSettings.newBuilder(); builder.setUrl(pigeonActionCodeSettings.getUrl()); @@ -278,13 +278,13 @@ static ActionCodeSettings getActionCodeSettings( return builder.build(); } - static List multiFactorInfoToPigeon( + static List multiFactorInfoToPigeon( List hints) { - List pigeonHints = new ArrayList<>(); + List pigeonHints = new ArrayList<>(); for (MultiFactorInfo info : hints) { if (info instanceof PhoneMultiFactorInfo) { pigeonHints.add( - new GeneratedAndroidFirebaseAuth.PigeonMultiFactorInfo.Builder() + new GeneratedAndroidFirebaseAuth.InternalMultiFactorInfo.Builder() .setPhoneNumber(((PhoneMultiFactorInfo) info).getPhoneNumber()) .setDisplayName(info.getDisplayName()) .setEnrollmentTimestamp((double) info.getEnrollmentTimestamp()) @@ -294,7 +294,7 @@ static List multiFactorInfoT } else { pigeonHints.add( - new GeneratedAndroidFirebaseAuth.PigeonMultiFactorInfo.Builder() + new GeneratedAndroidFirebaseAuth.InternalMultiFactorInfo.Builder() .setDisplayName(info.getDisplayName()) .setEnrollmentTimestamp((double) info.getEnrollmentTimestamp()) .setUid(info.getUid()) @@ -307,18 +307,19 @@ static List multiFactorInfoT static List> multiFactorInfoToMap(List hints) { List> pigeonHints = new ArrayList<>(); - for (GeneratedAndroidFirebaseAuth.PigeonMultiFactorInfo info : multiFactorInfoToPigeon(hints)) { + for (GeneratedAndroidFirebaseAuth.InternalMultiFactorInfo info : + multiFactorInfoToPigeon(hints)) { pigeonHints.add(info.toList()); } return pigeonHints; } - static GeneratedAndroidFirebaseAuth.PigeonActionCodeInfo parseActionCodeResult( + static GeneratedAndroidFirebaseAuth.InternalActionCodeInfo parseActionCodeResult( @NonNull ActionCodeResult actionCodeResult) { - GeneratedAndroidFirebaseAuth.PigeonActionCodeInfo.Builder builder = - new GeneratedAndroidFirebaseAuth.PigeonActionCodeInfo.Builder(); - GeneratedAndroidFirebaseAuth.PigeonActionCodeInfoData.Builder builderData = - new GeneratedAndroidFirebaseAuth.PigeonActionCodeInfoData.Builder(); + GeneratedAndroidFirebaseAuth.InternalActionCodeInfo.Builder builder = + new GeneratedAndroidFirebaseAuth.InternalActionCodeInfo.Builder(); + GeneratedAndroidFirebaseAuth.InternalActionCodeInfoData.Builder builderData = + new GeneratedAndroidFirebaseAuth.InternalActionCodeInfoData.Builder(); int operation = actionCodeResult.getOperation(); @@ -363,10 +364,10 @@ static GeneratedAndroidFirebaseAuth.PigeonActionCodeInfo parseActionCodeResult( return builder.build(); } - static GeneratedAndroidFirebaseAuth.PigeonIdTokenResult parseTokenResult( + static GeneratedAndroidFirebaseAuth.InternalIdTokenResult parseTokenResult( @NonNull GetTokenResult tokenResult) { - final GeneratedAndroidFirebaseAuth.PigeonIdTokenResult.Builder builder = - new GeneratedAndroidFirebaseAuth.PigeonIdTokenResult.Builder(); + final GeneratedAndroidFirebaseAuth.InternalIdTokenResult.Builder builder = + new GeneratedAndroidFirebaseAuth.InternalIdTokenResult.Builder(); builder.setToken(tokenResult.getToken()); builder.setSignInProvider(tokenResult.getSignInProvider()); diff --git a/packages/firebase_auth/firebase_auth/example/android/app/build.gradle b/packages/firebase_auth/firebase_auth/example/android/app/build.gradle index 75b0c370e4d4..db427be91ec5 100644 --- a/packages/firebase_auth/firebase_auth/example/android/app/build.gradle +++ b/packages/firebase_auth/firebase_auth/example/android/app/build.gradle @@ -42,7 +42,7 @@ android { applicationId = "io.flutter.plugins.firebase.auth.example" // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. - minSdk = 23 + minSdkVersion = flutter.minSdkVersion targetSdk = flutter.targetSdkVersion versionCode = flutterVersionCode.toInteger() versionName = flutterVersionName diff --git a/packages/firebase_auth/firebase_auth/example/macos/Runner.xcodeproj/project.pbxproj b/packages/firebase_auth/firebase_auth/example/macos/Runner.xcodeproj/project.pbxproj index 719671ab76f6..4848b09b04b9 100644 --- a/packages/firebase_auth/firebase_auth/example/macos/Runner.xcodeproj/project.pbxproj +++ b/packages/firebase_auth/firebase_auth/example/macos/Runner.xcodeproj/project.pbxproj @@ -27,6 +27,7 @@ 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; }; B6036D992F5B77F0D48D7883 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1026236A547BC5196614E954 /* Pods_Runner.framework */; }; C0151CEAF69E3751D6A8FA78 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 2F30ED8EF0A1349EA81AEE1A /* GoogleService-Info.plist */; }; /* End PBXBuildFile section */ @@ -75,6 +76,7 @@ 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; 3D7BD4B06D0869EA1407E048 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; /* End PBXFileReference section */ @@ -84,6 +86,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */, B6036D992F5B77F0D48D7883 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -146,6 +149,7 @@ 33CEB47122A05771004F2AC0 /* Flutter */ = { isa = PBXGroup; children = ( + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */, 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */, 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */, 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */, @@ -198,6 +202,9 @@ 33CC11202044C79F0003C045 /* PBXTargetDependency */, ); name = Runner; + packageProductDependencies = ( + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */, + ); productName = Runner; productReference = 33CC10ED2044A3C60003C045 /* example.app */; productType = "com.apple.product-type.application"; @@ -237,6 +244,9 @@ Base, ); mainGroup = 33CC10E42044A3C60003C045; + packageReferences = ( + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */, + ); productRefGroup = 33CC10EE2044A3C60003C045 /* Products */; projectDirPath = ""; projectRoot = ""; @@ -307,12 +317,10 @@ ); inputPaths = ( "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh", - "${PODS_CONFIGURATION_BUILD_DIR}/firebase_messaging/firebase_messaging_Privacy.bundle", "${PODS_CONFIGURATION_BUILD_DIR}/google_sign_in_ios/google_sign_in_ios_privacy.bundle", ); name = "[CP] Copy Pods Resources"; outputPaths = ( - "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/firebase_messaging_Privacy.bundle", "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/google_sign_in_ios_privacy.bundle", ); runOnlyForDeploymentPostprocessing = 0; @@ -350,50 +358,20 @@ inputPaths = ( "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", "${BUILT_PRODUCTS_DIR}/AppAuth/AppAuth.framework", - "${BUILT_PRODUCTS_DIR}/FirebaseAppCheckInterop/FirebaseAppCheckInterop.framework", - "${BUILT_PRODUCTS_DIR}/FirebaseAuth/FirebaseAuth.framework", - "${BUILT_PRODUCTS_DIR}/FirebaseAuthInterop/FirebaseAuthInterop.framework", - "${BUILT_PRODUCTS_DIR}/FirebaseCore/FirebaseCore.framework", - "${BUILT_PRODUCTS_DIR}/FirebaseCoreExtension/FirebaseCoreExtension.framework", - "${BUILT_PRODUCTS_DIR}/FirebaseCoreInternal/FirebaseCoreInternal.framework", - "${BUILT_PRODUCTS_DIR}/FirebaseInstallations/FirebaseInstallations.framework", - "${BUILT_PRODUCTS_DIR}/FirebaseMessaging/FirebaseMessaging.framework", "${BUILT_PRODUCTS_DIR}/GTMAppAuth/GTMAppAuth.framework", "${BUILT_PRODUCTS_DIR}/GTMSessionFetcher/GTMSessionFetcher.framework", - "${BUILT_PRODUCTS_DIR}/GoogleDataTransport/GoogleDataTransport.framework", "${BUILT_PRODUCTS_DIR}/GoogleSignIn/GoogleSignIn.framework", - "${BUILT_PRODUCTS_DIR}/GoogleUtilities/GoogleUtilities.framework", - "${BUILT_PRODUCTS_DIR}/PromisesObjC/FBLPromises.framework", "${BUILT_PRODUCTS_DIR}/facebook_auth_desktop/facebook_auth_desktop.framework", "${BUILT_PRODUCTS_DIR}/flutter_secure_storage_macos/flutter_secure_storage_macos.framework", - "${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework", - "${BUILT_PRODUCTS_DIR}/path_provider_foundation/path_provider_foundation.framework", - "${BUILT_PRODUCTS_DIR}/shared_preferences_foundation/shared_preferences_foundation.framework", - "${BUILT_PRODUCTS_DIR}/url_launcher_macos/url_launcher_macos.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AppAuth.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseAppCheckInterop.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseAuth.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseAuthInterop.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCore.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCoreExtension.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCoreInternal.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseInstallations.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseMessaging.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GTMAppAuth.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GTMSessionFetcher.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleDataTransport.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleSignIn.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleUtilities.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBLPromises.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/facebook_auth_desktop.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_secure_storage_macos.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/nanopb.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider_foundation.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences_foundation.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/url_launcher_macos.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -721,6 +699,20 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCLocalSwiftPackageReference section */ + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; + }; +/* End XCLocalSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = { + isa = XCSwiftPackageProductDependency; + productName = FlutterGeneratedPluginSwiftPackage; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 33CC10E52044A3C60003C045 /* Project object */; } diff --git a/packages/firebase_auth/firebase_auth/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/firebase_auth/firebase_auth/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index bfbc9cb8ef3c..126b4eb8ea7d 100644 --- a/packages/firebase_auth/firebase_auth/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/packages/firebase_auth/firebase_auth/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -5,6 +5,24 @@ + + + + + + + + + + diff --git a/packages/firebase_auth/firebase_auth/ios/firebase_auth/Sources/firebase_auth/FLTFirebaseAuthPlugin.m b/packages/firebase_auth/firebase_auth/ios/firebase_auth/Sources/firebase_auth/FLTFirebaseAuthPlugin.m index 8247abf829da..606dda68176d 100644 --- a/packages/firebase_auth/firebase_auth/ios/firebase_auth/Sources/firebase_auth/FLTFirebaseAuthPlugin.m +++ b/packages/firebase_auth/firebase_auth/ios/firebase_auth/Sources/firebase_auth/FLTFirebaseAuthPlugin.m @@ -95,7 +95,7 @@ @interface FLTFirebaseAuthPlugin () @property BOOL isReauthenticatingWithApple; @property(strong, nonatomic) NSString *currentNonce; @property(strong, nonatomic) void (^appleCompletion) - (PigeonUserCredential *_Nullable, FlutterError *_Nullable); + (InternalUserCredential *_Nullable, FlutterError *_Nullable); @property(strong, nonatomic) AuthPigeonFirebaseApp *appleArguments; /// YES while an `ASAuthorizationController` Sign in with Apple flow is active. @property(nonatomic, assign) BOOL appleSignInRequestInFlight; @@ -380,7 +380,7 @@ - (NSString *)stringBySha256HashingString:(NSString *)input { static void handleSignInWithApple(FLTFirebaseAuthPlugin *object, FIRAuthDataResult *authResult, NSString *authorizationCode, NSError *error) { - void (^completion)(PigeonUserCredential *_Nullable, FlutterError *_Nullable) = + void (^completion)(InternalUserCredential *_Nullable, FlutterError *_Nullable) = object.appleCompletion; if (completion == nil) { object.appleSignInRequestInFlight = NO; @@ -417,7 +417,7 @@ - (void)authorizationController:(ASAuthorizationController *)controller if (appleIDCredential.identityToken == nil) { NSLog(@"Unable to fetch identity token."); - void (^completion)(PigeonUserCredential *_Nullable, FlutterError *_Nullable) = + void (^completion)(InternalUserCredential *_Nullable, FlutterError *_Nullable) = self.appleCompletion; self.appleCompletion = nil; self.appleSignInRequestInFlight = NO; @@ -448,7 +448,7 @@ - (void)authorizationController:(ASAuthorizationController *)controller if (self.isReauthenticatingWithApple == YES) { self.isReauthenticatingWithApple = NO; - void (^capturedCompletion)(PigeonUserCredential *_Nullable, FlutterError *_Nullable) = + void (^capturedCompletion)(InternalUserCredential *_Nullable, FlutterError *_Nullable) = self.appleCompletion; [[FIRAuth.auth currentUser] reauthenticateWithCredential:credential @@ -459,7 +459,7 @@ - (void)authorizationController:(ASAuthorizationController *)controller } else if (self.linkWithAppleUser != nil) { FIRUser *userToLink = self.linkWithAppleUser; - void (^capturedCompletion)(PigeonUserCredential *_Nullable, FlutterError *_Nullable) = + void (^capturedCompletion)(InternalUserCredential *_Nullable, FlutterError *_Nullable) = self.appleCompletion; [userToLink linkWithCredential:credential completion:^(FIRAuthDataResult *authResult, NSError *error) { @@ -470,7 +470,7 @@ - (void)authorizationController:(ASAuthorizationController *)controller } else { FIRAuth *signInAuth = self.signInWithAppleAuth != nil ? self.signInWithAppleAuth : FIRAuth.auth; - void (^capturedCompletion)(PigeonUserCredential *_Nullable, FlutterError *_Nullable) = + void (^capturedCompletion)(InternalUserCredential *_Nullable, FlutterError *_Nullable) = self.appleCompletion; [signInAuth signInWithCredential:credential completion:^(FIRAuthDataResult *_Nullable authResult, @@ -480,7 +480,7 @@ - (void)authorizationController:(ASAuthorizationController *)controller }]; } } else { - void (^completion)(PigeonUserCredential *_Nullable, FlutterError *_Nullable) = + void (^completion)(InternalUserCredential *_Nullable, FlutterError *_Nullable) = self.appleCompletion; self.appleCompletion = nil; self.appleSignInRequestInFlight = NO; @@ -494,7 +494,7 @@ - (void)authorizationController:(ASAuthorizationController *)controller - (void)authorizationController:(ASAuthorizationController *)controller didCompleteWithError:(NSError *)error API_AVAILABLE(macos(10.15), ios(13.0)) { - void (^completion)(PigeonUserCredential *_Nullable, FlutterError *_Nullable) = + void (^completion)(InternalUserCredential *_Nullable, FlutterError *_Nullable) = self.appleCompletion; self.appleCompletion = nil; self.appleSignInRequestInFlight = NO; @@ -537,7 +537,7 @@ - (void)authorizationController:(ASAuthorizationController *)controller } } -- (void)handleInternalError:(nonnull void (^)(PigeonUserCredential *_Nullable, +- (void)handleInternalError:(nonnull void (^)(InternalUserCredential *_Nullable, FlutterError *_Nullable))completion withError:(NSError *)error { const NSError *underlyingError = error.userInfo[@"NSUnderlyingError"]; @@ -555,7 +555,7 @@ - (void)handleInternalError:(nonnull void (^)(PigeonUserCredential *_Nullable, } - (void)handleMultiFactorError:(AuthPigeonFirebaseApp *)app - completion:(nonnull void (^)(PigeonUserCredential *_Nullable, + completion:(nonnull void (^)(InternalUserCredential *_Nullable, FlutterError *_Nullable))completion withError:(NSError *_Nullable)error { FIRMultiFactorResolver *resolver = @@ -579,7 +579,7 @@ - (void)handleMultiFactorError:(AuthPigeonFirebaseApp *)app phoneNumber = phoneFactorInfo.phoneNumber; } - PigeonMultiFactorInfo *object = [PigeonMultiFactorInfo + InternalMultiFactorInfo *object = [InternalMultiFactorInfo makeWithDisplayName:multiFactorInfo.displayName enrollmentTimestamp:multiFactorInfo.enrollmentDate.timeIntervalSince1970 factorId:multiFactorInfo.factorID @@ -601,8 +601,8 @@ - (void)handleMultiFactorError:(AuthPigeonFirebaseApp *)app } static void launchAppleSignInRequest(FLTFirebaseAuthPlugin *object, AuthPigeonFirebaseApp *app, - PigeonSignInProvider *signInProvider, - void (^_Nonnull completion)(PigeonUserCredential *_Nullable, + InternalSignInProvider *signInProvider, + void (^_Nonnull completion)(InternalUserCredential *_Nullable, FlutterError *_Nullable)) { if (@available(iOS 13.0, macOS 10.15, *)) { if (object.appleSignInRequestInFlight) { @@ -645,7 +645,7 @@ static void launchAppleSignInRequest(FLTFirebaseAuthPlugin *object, AuthPigeonFi static void handleAppleAuthResult(FLTFirebaseAuthPlugin *object, AuthPigeonFirebaseApp *app, FIRAuth *auth, FIRAuthCredential *credentials, NSError *error, - void (^_Nonnull completion)(PigeonUserCredential *_Nullable, + void (^_Nonnull completion)(InternalUserCredential *_Nullable, FlutterError *_Nullable)) { if (error) { if (error.code == FIRAuthErrorCodeSecondFactorRequired) { @@ -928,7 +928,7 @@ - (nonnull ASPresentationAnchor)presentationAnchorForAuthorizationController: } - (void)enrollPhoneApp:(nonnull AuthPigeonFirebaseApp *)app - assertion:(nonnull PigeonPhoneMultiFactorAssertion *)assertion + assertion:(nonnull InternalPhoneMultiFactorAssertion *)assertion displayName:(nullable NSString *)displayName completion:(nonnull void (^)(FlutterError *_Nullable))completion { #if TARGET_OS_OSX @@ -962,13 +962,13 @@ - (void)enrollPhoneApp:(nonnull AuthPigeonFirebaseApp *)app } - (void)getEnrolledFactorsApp:(nonnull AuthPigeonFirebaseApp *)app - completion:(nonnull void (^)(NSArray *_Nullable, + completion:(nonnull void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { FIRMultiFactor *multiFactor = [self getAppMultiFactorFromPigeon:app]; NSArray *enrolledFactors = [multiFactor enrolledFactors]; - NSMutableArray *results = [NSMutableArray array]; + NSMutableArray *results = [NSMutableArray array]; for (FIRMultiFactorInfo *multiFactorInfo in enrolledFactors) { NSString *phoneNumber; @@ -977,7 +977,7 @@ - (void)getEnrolledFactorsApp:(nonnull AuthPigeonFirebaseApp *)app phoneNumber = phoneFactorInfo.phoneNumber; } - [results addObject:[PigeonMultiFactorInfo + [results addObject:[InternalMultiFactorInfo makeWithDisplayName:multiFactorInfo.displayName enrollmentTimestamp:multiFactorInfo.enrollmentDate.timeIntervalSince1970 factorId:multiFactorInfo.factorID @@ -989,7 +989,7 @@ - (void)getEnrolledFactorsApp:(nonnull AuthPigeonFirebaseApp *)app } - (void)getSessionApp:(nonnull AuthPigeonFirebaseApp *)app - completion:(nonnull void (^)(PigeonMultiFactorSession *_Nullable, + completion:(nonnull void (^)(InternalMultiFactorSession *_Nullable, FlutterError *_Nullable))completion { FIRMultiFactor *multiFactor = [self getAppMultiFactorFromPigeon:app]; [multiFactor getSessionWithCompletion:^(FIRMultiFactorSession *_Nullable session, @@ -997,7 +997,7 @@ - (void)getSessionApp:(nonnull AuthPigeonFirebaseApp *)app NSString *UUID = [[NSUUID UUID] UUIDString]; self->_multiFactorSessionMap[UUID] = session; - PigeonMultiFactorSession *pigeonSession = [PigeonMultiFactorSession makeWithId:UUID]; + InternalMultiFactorSession *pigeonSession = [InternalMultiFactorSession makeWithId:UUID]; completion(pigeonSession, nil); }]; } @@ -1040,9 +1040,9 @@ - (void)enrollTotpApp:(nonnull AuthPigeonFirebaseApp *)app } - (void)resolveSignInResolverId:(nonnull NSString *)resolverId - assertion:(nullable PigeonPhoneMultiFactorAssertion *)assertion + assertion:(nullable InternalPhoneMultiFactorAssertion *)assertion totpAssertionId:(nullable NSString *)totpAssertionId - completion:(nonnull void (^)(PigeonUserCredential *_Nullable, + completion:(nonnull void (^)(InternalUserCredential *_Nullable, FlutterError *_Nullable))completion { FIRMultiFactorResolver *resolver = _multiFactorResolverMap[resolverId]; @@ -1082,7 +1082,7 @@ - (void)resolveSignInResolverId:(nonnull NSString *)resolverId } - (void)generateSecretSessionId:(nonnull NSString *)sessionId - completion:(nonnull void (^)(PigeonTotpSecret *_Nullable, + completion:(nonnull void (^)(InternalTotpSecret *_Nullable, FlutterError *_Nullable))completion { FIRMultiFactorSession *multiFactorSession = _multiFactorSessionMap[sessionId]; @@ -1175,9 +1175,20 @@ - (void)revokeTokenWithAuthorizationCodeApp:(nonnull AuthPigeonFirebaseApp *)app }]; } +- (void)revokeAccessTokenApp:(nonnull AuthPigeonFirebaseApp *)app + accessToken:(nonnull NSString *)accessToken + completion:(nonnull void (^)(FlutterError *_Nullable))completion { + // `revokeAccessToken(_:)` is currently Android-only on the Firebase SDK. + // On Apple platforms use `revokeTokenWithAuthorizationCode:` instead. + completion([FlutterError errorWithCode:@"unsupported-platform-operation" + message:@"revokeAccessToken is not supported on iOS/macOS. " + @"Use revokeTokenWithAuthorizationCode instead." + details:nil]); +} + - (void)checkActionCodeApp:(nonnull AuthPigeonFirebaseApp *)app code:(nonnull NSString *)code - completion:(nonnull void (^)(PigeonActionCodeInfo *_Nullable, + completion:(nonnull void (^)(InternalActionCodeInfo *_Nullable, FlutterError *_Nullable))completion { FIRAuth *auth = [self getFIRAuthFromAppNameFromPigeon:app]; [auth checkActionCode:code @@ -1185,7 +1196,7 @@ - (void)checkActionCodeApp:(nonnull AuthPigeonFirebaseApp *)app if (error != nil) { completion(nil, [FLTFirebaseAuthPlugin convertToFlutterError:error]); } else { - PigeonActionCodeInfo *result = [self parseActionCode:info]; + InternalActionCodeInfo *result = [self parseActionCode:info]; if (result.operation == ActionCodeInfoOperationUnknown) { // Workaround: Firebase iOS SDK >=11.12.0 returns .unknown because // actionCodeOperation(forRequestType:) only matches camelCase but the @@ -1203,9 +1214,9 @@ - (void)checkActionCodeApp:(nonnull AuthPigeonFirebaseApp *)app }]; } -- (PigeonActionCodeInfo *_Nullable)parseActionCode:(nonnull FIRActionCodeInfo *)info { - PigeonActionCodeInfoData *data = [PigeonActionCodeInfoData makeWithEmail:info.email - previousEmail:info.previousEmail]; +- (InternalActionCodeInfo *_Nullable)parseActionCode:(nonnull FIRActionCodeInfo *)info { + InternalActionCodeInfoData *data = [InternalActionCodeInfoData makeWithEmail:info.email + previousEmail:info.previousEmail]; ActionCodeInfoOperation operation; @@ -1225,7 +1236,7 @@ - (PigeonActionCodeInfo *_Nullable)parseActionCode:(nonnull FIRActionCodeInfo *) operation = ActionCodeInfoOperationUnknown; } - return [PigeonActionCodeInfo makeWithOperation:operation data:data]; + return [InternalActionCodeInfo makeWithOperation:operation data:data]; } /// Maps a raw requestType string (either camelCase or SCREAMING_SNAKE_CASE) to @@ -1259,8 +1270,8 @@ + (ActionCodeInfoOperation)operationFromRequestType:(nullable NSString *)request /// result if the REST call fails for any reason. - (void)resolveActionCodeOperationForApp:(nonnull AuthPigeonFirebaseApp *)app code:(nonnull NSString *)code - fallbackInfo:(nonnull PigeonActionCodeInfo *)fallbackInfo - completion:(nonnull void (^)(PigeonActionCodeInfo *_Nullable, + fallbackInfo:(nonnull InternalActionCodeInfo *)fallbackInfo + completion:(nonnull void (^)(InternalActionCodeInfo *_Nullable, FlutterError *_Nullable))completion { FIRApp *firebaseApp = [FLTFirebasePlugin firebaseAppNamed:app.appName]; NSString *apiKey = firebaseApp.options.APIKey; @@ -1304,7 +1315,7 @@ - (void)resolveActionCodeOperationForApp:(nonnull AuthPigeonFirebaseApp *)app [FLTFirebaseAuthPlugin operationFromRequestType:json[@"requestType"]]; if (operation != ActionCodeInfoOperationUnknown) { - completion([PigeonActionCodeInfo makeWithOperation:operation data:fallbackInfo.data], + completion([InternalActionCodeInfo makeWithOperation:operation data:fallbackInfo.data], nil); } else { completion(fallbackInfo, nil); @@ -1332,7 +1343,7 @@ - (void)confirmPasswordResetApp:(nonnull AuthPigeonFirebaseApp *)app - (void)createUserWithEmailAndPasswordApp:(nonnull AuthPigeonFirebaseApp *)app email:(nonnull NSString *)email password:(nonnull NSString *)password - completion:(nonnull void (^)(PigeonUserCredential *_Nullable, + completion:(nonnull void (^)(InternalUserCredential *_Nullable, FlutterError *_Nullable))completion { FIRAuth *auth = [self getFIRAuthFromAppNameFromPigeon:app]; [auth createUserWithEmail:email @@ -1411,7 +1422,7 @@ - (void)registerIdTokenListenerApp:(nonnull AuthPigeonFirebaseApp *)app - (void)sendPasswordResetEmailApp:(nonnull AuthPigeonFirebaseApp *)app email:(nonnull NSString *)email - actionCodeSettings:(nullable PigeonActionCodeSettings *)actionCodeSettings + actionCodeSettings:(nullable InternalActionCodeSettings *)actionCodeSettings completion:(nonnull void (^)(FlutterError *_Nullable))completion { FIRAuth *auth = [self getFIRAuthFromAppNameFromPigeon:app]; if (actionCodeSettings != nil) { @@ -1439,7 +1450,7 @@ - (void)sendPasswordResetEmailApp:(nonnull AuthPigeonFirebaseApp *)app - (void)sendSignInLinkToEmailApp:(nonnull AuthPigeonFirebaseApp *)app email:(nonnull NSString *)email - actionCodeSettings:(nonnull PigeonActionCodeSettings *)actionCodeSettings + actionCodeSettings:(nonnull InternalActionCodeSettings *)actionCodeSettings completion:(nonnull void (^)(FlutterError *_Nullable))completion { FIRAuth *auth = [self getFIRAuthFromAppNameFromPigeon:app]; [auth sendSignInLinkToEmail:email @@ -1448,7 +1459,7 @@ - (void)sendSignInLinkToEmailApp:(nonnull AuthPigeonFirebaseApp *)app if (error != nil) { if (error.code == FIRAuthErrorCodeInternalError) { [self - handleInternalError:^(PigeonUserCredential *_Nullable creds, + handleInternalError:^(InternalUserCredential *_Nullable creds, FlutterError *_Nullable internalError) { completion(internalError); } @@ -1478,7 +1489,7 @@ - (void)setLanguageCodeApp:(nonnull AuthPigeonFirebaseApp *)app } - (void)setSettingsApp:(nonnull AuthPigeonFirebaseApp *)app - settings:(nonnull PigeonFirebaseAuthSettings *)settings + settings:(nonnull InternalFirebaseAuthSettings *)settings completion:(nonnull void (^)(FlutterError *_Nullable))completion { FIRAuth *auth = [self getFIRAuthFromAppNameFromPigeon:app]; @@ -1506,7 +1517,7 @@ - (void)setSettingsApp:(nonnull AuthPigeonFirebaseApp *)app } - (void)signInAnonymouslyApp:(nonnull AuthPigeonFirebaseApp *)app - completion:(nonnull void (^)(PigeonUserCredential *_Nullable, + completion:(nonnull void (^)(InternalUserCredential *_Nullable, FlutterError *_Nullable))completion { FIRAuth *auth = [self getFIRAuthFromAppNameFromPigeon:app]; [auth signInAnonymouslyWithCompletion:^(FIRAuthDataResult *authResult, NSError *error) { @@ -1522,7 +1533,7 @@ - (void)signInAnonymouslyApp:(nonnull AuthPigeonFirebaseApp *)app - (void)signInWithCredentialApp:(nonnull AuthPigeonFirebaseApp *)app input:(nonnull NSDictionary *)input - completion:(nonnull void (^)(PigeonUserCredential *_Nullable, + completion:(nonnull void (^)(InternalUserCredential *_Nullable, FlutterError *_Nullable))completion { FIRAuth *auth = [self getFIRAuthFromAppNameFromPigeon:app]; [self @@ -1603,7 +1614,7 @@ - (void)signInWithCredentialApp:(nonnull AuthPigeonFirebaseApp *)app - (void)signInWithCustomTokenApp:(nonnull AuthPigeonFirebaseApp *)app token:(nonnull NSString *)token - completion:(nonnull void (^)(PigeonUserCredential *_Nullable, + completion:(nonnull void (^)(InternalUserCredential *_Nullable, FlutterError *_Nullable))completion { FIRAuth *auth = [self getFIRAuthFromAppNameFromPigeon:app]; @@ -1628,7 +1639,7 @@ - (void)signInWithCustomTokenApp:(nonnull AuthPigeonFirebaseApp *)app - (void)signInWithEmailAndPasswordApp:(nonnull AuthPigeonFirebaseApp *)app email:(nonnull NSString *)email password:(nonnull NSString *)password - completion:(nonnull void (^)(PigeonUserCredential *_Nullable, + completion:(nonnull void (^)(InternalUserCredential *_Nullable, FlutterError *_Nullable))completion { FIRAuth *auth = [self getFIRAuthFromAppNameFromPigeon:app]; [auth signInWithEmail:email @@ -1653,7 +1664,7 @@ - (void)signInWithEmailAndPasswordApp:(nonnull AuthPigeonFirebaseApp *)app - (void)signInWithEmailLinkApp:(nonnull AuthPigeonFirebaseApp *)app email:(nonnull NSString *)email emailLink:(nonnull NSString *)emailLink - completion:(nonnull void (^)(PigeonUserCredential *_Nullable, + completion:(nonnull void (^)(InternalUserCredential *_Nullable, FlutterError *_Nullable))completion { FIRAuth *auth = [self getFIRAuthFromAppNameFromPigeon:app]; [auth signInWithEmail:email @@ -1676,8 +1687,8 @@ - (void)signInWithEmailLinkApp:(nonnull AuthPigeonFirebaseApp *)app } - (void)signInWithProviderApp:(nonnull AuthPigeonFirebaseApp *)app - signInProvider:(nonnull PigeonSignInProvider *)signInProvider - completion:(nonnull void (^)(PigeonUserCredential *_Nullable, + signInProvider:(nonnull InternalSignInProvider *)signInProvider + completion:(nonnull void (^)(InternalUserCredential *_Nullable, FlutterError *_Nullable))completion { FIRAuth *auth = [self getFIRAuthFromAppNameFromPigeon:app]; @@ -1767,7 +1778,7 @@ - (void)verifyPasswordResetCodeApp:(nonnull AuthPigeonFirebaseApp *)app } - (void)verifyPhoneNumberApp:(nonnull AuthPigeonFirebaseApp *)app - request:(nonnull PigeonVerifyPhoneNumberRequest *)request + request:(nonnull InternalVerifyPhoneNumberRequest *)request completion: (nonnull void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { #if TARGET_OS_OSX @@ -1846,7 +1857,7 @@ - (void)deleteApp:(nonnull AuthPigeonFirebaseApp *)app - (void)getIdTokenApp:(nonnull AuthPigeonFirebaseApp *)app forceRefresh:(BOOL)forceRefresh - completion:(nonnull void (^)(PigeonIdTokenResult *_Nullable, + completion:(nonnull void (^)(InternalIdTokenResult *_Nullable, FlutterError *_Nullable))completion { FIRAuth *auth = [self getFIRAuthFromAppNameFromPigeon:app]; FIRUser *currentUser = auth.currentUser; @@ -1871,7 +1882,7 @@ - (void)getIdTokenApp:(nonnull AuthPigeonFirebaseApp *)app - (void)linkWithCredentialApp:(nonnull AuthPigeonFirebaseApp *)app input:(nonnull NSDictionary *)input - completion:(nonnull void (^)(PigeonUserCredential *_Nullable, + completion:(nonnull void (^)(InternalUserCredential *_Nullable, FlutterError *_Nullable))completion { FIRAuth *auth = [self getFIRAuthFromAppNameFromPigeon:app]; FIRUser *currentUser = auth.currentUser; @@ -1926,8 +1937,8 @@ - (void)linkWithCredentialApp:(nonnull AuthPigeonFirebaseApp *)app } - (void)linkWithProviderApp:(nonnull AuthPigeonFirebaseApp *)app - signInProvider:(nonnull PigeonSignInProvider *)signInProvider - completion:(nonnull void (^)(PigeonUserCredential *_Nullable, + signInProvider:(nonnull InternalSignInProvider *)signInProvider + completion:(nonnull void (^)(InternalUserCredential *_Nullable, FlutterError *_Nullable))completion { FIRAuth *auth = [self getFIRAuthFromAppNameFromPigeon:app]; FIRUser *currentUser = auth.currentUser; @@ -1979,7 +1990,7 @@ - (void)linkWithProviderApp:(nonnull AuthPigeonFirebaseApp *)app - (void)reauthenticateWithCredentialApp:(nonnull AuthPigeonFirebaseApp *)app input:(nonnull NSDictionary *)input - completion:(nonnull void (^)(PigeonUserCredential *_Nullable, + completion:(nonnull void (^)(InternalUserCredential *_Nullable, FlutterError *_Nullable))completion { FIRAuth *auth = [self getFIRAuthFromAppNameFromPigeon:app]; FIRUser *currentUser = auth.currentUser; @@ -2037,8 +2048,8 @@ - (void)reauthenticateWithCredentialApp:(nonnull AuthPigeonFirebaseApp *)app } - (void)reauthenticateWithProviderApp:(nonnull AuthPigeonFirebaseApp *)app - signInProvider:(nonnull PigeonSignInProvider *)signInProvider - completion:(nonnull void (^)(PigeonUserCredential *_Nullable, + signInProvider:(nonnull InternalSignInProvider *)signInProvider + completion:(nonnull void (^)(InternalUserCredential *_Nullable, FlutterError *_Nullable))completion { FIRAuth *auth = [self getFIRAuthFromAppNameFromPigeon:app]; FIRUser *currentUser = auth.currentUser; @@ -2080,7 +2091,7 @@ - (void)reauthenticateWithProviderApp:(nonnull AuthPigeonFirebaseApp *)app - (void)reloadApp:(nonnull AuthPigeonFirebaseApp *)app completion: - (nonnull void (^)(PigeonUserDetails *_Nullable, FlutterError *_Nullable))completion { + (nonnull void (^)(InternalUserDetails *_Nullable, FlutterError *_Nullable))completion { FIRAuth *auth = [self getFIRAuthFromAppNameFromPigeon:app]; FIRUser *currentUser = auth.currentUser; if (currentUser == nil) { @@ -2100,7 +2111,7 @@ - (void)reloadApp:(nonnull AuthPigeonFirebaseApp *)app } - (void)sendEmailVerificationApp:(nonnull AuthPigeonFirebaseApp *)app - actionCodeSettings:(nullable PigeonActionCodeSettings *)actionCodeSettings + actionCodeSettings:(nullable InternalActionCodeSettings *)actionCodeSettings completion:(nonnull void (^)(FlutterError *_Nullable))completion { FIRAuth *auth = [self getFIRAuthFromAppNameFromPigeon:app]; FIRUser *currentUser = auth.currentUser; @@ -2127,8 +2138,8 @@ - (void)sendEmailVerificationApp:(nonnull AuthPigeonFirebaseApp *)app - (void)unlinkApp:(nonnull AuthPigeonFirebaseApp *)app providerId:(nonnull NSString *)providerId - completion: - (nonnull void (^)(PigeonUserCredential *_Nullable, FlutterError *_Nullable))completion { + completion:(nonnull void (^)(InternalUserCredential *_Nullable, + FlutterError *_Nullable))completion { FIRAuth *auth = [self getFIRAuthFromAppNameFromPigeon:app]; FIRUser *currentUser = auth.currentUser; if (currentUser == nil) { @@ -2150,7 +2161,7 @@ - (void)unlinkApp:(nonnull AuthPigeonFirebaseApp *)app - (void)updateEmailApp:(nonnull AuthPigeonFirebaseApp *)app newEmail:(nonnull NSString *)newEmail - completion:(nonnull void (^)(PigeonUserDetails *_Nullable, + completion:(nonnull void (^)(InternalUserDetails *_Nullable, FlutterError *_Nullable))completion { FIRAuth *auth = [self getFIRAuthFromAppNameFromPigeon:app]; FIRUser *currentUser = auth.currentUser; @@ -2179,7 +2190,7 @@ - (void)updateEmailApp:(nonnull AuthPigeonFirebaseApp *)app - (void)updatePasswordApp:(nonnull AuthPigeonFirebaseApp *)app newPassword:(nonnull NSString *)newPassword - completion:(nonnull void (^)(PigeonUserDetails *_Nullable, + completion:(nonnull void (^)(InternalUserDetails *_Nullable, FlutterError *_Nullable))completion { FIRAuth *auth = [self getFIRAuthFromAppNameFromPigeon:app]; FIRUser *currentUser = auth.currentUser; @@ -2209,7 +2220,7 @@ - (void)updatePasswordApp:(nonnull AuthPigeonFirebaseApp *)app - (void)updatePhoneNumberApp:(nonnull AuthPigeonFirebaseApp *)app input:(nonnull NSDictionary *)input - completion:(nonnull void (^)(PigeonUserDetails *_Nullable, + completion:(nonnull void (^)(InternalUserDetails *_Nullable, FlutterError *_Nullable))completion { #if TARGET_OS_IPHONE FIRAuth *auth = [self getFIRAuthFromAppNameFromPigeon:app]; @@ -2273,8 +2284,8 @@ - (void)updatePhoneNumberApp:(nonnull AuthPigeonFirebaseApp *)app } - (void)updateProfileApp:(nonnull AuthPigeonFirebaseApp *)app - profile:(nonnull PigeonUserProfile *)profile - completion:(nonnull void (^)(PigeonUserDetails *_Nullable, + profile:(nonnull InternalUserProfile *)profile + completion:(nonnull void (^)(InternalUserDetails *_Nullable, FlutterError *_Nullable))completion { FIRAuth *auth = [self getFIRAuthFromAppNameFromPigeon:app]; FIRUser *currentUser = auth.currentUser; @@ -2319,7 +2330,7 @@ - (void)updateProfileApp:(nonnull AuthPigeonFirebaseApp *)app - (void)verifyBeforeUpdateEmailApp:(nonnull AuthPigeonFirebaseApp *)app newEmail:(nonnull NSString *)newEmail - actionCodeSettings:(nullable PigeonActionCodeSettings *)actionCodeSettings + actionCodeSettings:(nullable InternalActionCodeSettings *)actionCodeSettings completion:(nonnull void (^)(FlutterError *_Nullable))completion { FIRAuth *auth = [self getFIRAuthFromAppNameFromPigeon:app]; FIRUser *currentUser = auth.currentUser; diff --git a/packages/firebase_auth/firebase_auth/ios/firebase_auth/Sources/firebase_auth/FLTPhoneNumberVerificationStreamHandler.m b/packages/firebase_auth/firebase_auth/ios/firebase_auth/Sources/firebase_auth/FLTPhoneNumberVerificationStreamHandler.m index 69b9d7dea14d..511d2caa8841 100644 --- a/packages/firebase_auth/firebase_auth/ios/firebase_auth/Sources/firebase_auth/FLTPhoneNumberVerificationStreamHandler.m +++ b/packages/firebase_auth/firebase_auth/ios/firebase_auth/Sources/firebase_auth/FLTPhoneNumberVerificationStreamHandler.m @@ -18,7 +18,7 @@ @implementation FLTPhoneNumberVerificationStreamHandler { } #if TARGET_OS_OSX -- (instancetype)initWithAuth:(id)auth request:(PigeonVerifyPhoneNumberRequest *)request { +- (instancetype)initWithAuth:(id)auth request:(InternalVerifyPhoneNumberRequest *)request { self = [super init]; if (self) { _auth = auth; @@ -28,7 +28,7 @@ - (instancetype)initWithAuth:(id)auth request:(PigeonVerifyPhoneNumberRequest *) } #else - (instancetype)initWithAuth:(id)auth - request:(PigeonVerifyPhoneNumberRequest *)request + request:(InternalVerifyPhoneNumberRequest *)request session:(FIRMultiFactorSession *)session factorInfo:(FIRPhoneMultiFactorInfo *)factorInfo { self = [super init]; diff --git a/packages/firebase_auth/firebase_auth/ios/firebase_auth/Sources/firebase_auth/PigeonParser.m b/packages/firebase_auth/firebase_auth/ios/firebase_auth/Sources/firebase_auth/PigeonParser.m index f8ef1b77493c..8d7a7b1c2f0e 100644 --- a/packages/firebase_auth/firebase_auth/ios/firebase_auth/Sources/firebase_auth/PigeonParser.m +++ b/packages/firebase_auth/firebase_auth/ios/firebase_auth/Sources/firebase_auth/PigeonParser.m @@ -10,30 +10,30 @@ @implementation PigeonParser -+ (PigeonUserCredential *) ++ (InternalUserCredential *) getPigeonUserCredentialFromAuthResult:(nonnull FIRAuthDataResult *)authResult authorizationCode:(nullable NSString *)authorizationCode { - return [PigeonUserCredential + return [InternalUserCredential makeWithUser:[self getPigeonDetails:authResult.user] additionalUserInfo:[self getPigeonAdditionalUserInfo:authResult.additionalUserInfo authorizationCode:authorizationCode] credential:[self getPigeonAuthCredential:authResult.credential token:nil]]; } -+ (PigeonUserCredential *)getPigeonUserCredentialFromFIRUser:(nonnull FIRUser *)user { - return [PigeonUserCredential makeWithUser:[self getPigeonDetails:user] - additionalUserInfo:nil - credential:nil]; ++ (InternalUserCredential *)getPigeonUserCredentialFromFIRUser:(nonnull FIRUser *)user { + return [InternalUserCredential makeWithUser:[self getPigeonDetails:user] + additionalUserInfo:nil + credential:nil]; } -+ (PigeonUserDetails *)getPigeonDetails:(nonnull FIRUser *)user { - return [PigeonUserDetails makeWithUserInfo:[self getPigeonUserInfo:user] - providerData:[self getProviderData:user.providerData]]; ++ (InternalUserDetails *)getPigeonDetails:(nonnull FIRUser *)user { + return [InternalUserDetails makeWithUserInfo:[self getPigeonUserInfo:user] + providerData:[self getProviderData:user.providerData]]; } -+ (PigeonUserInfo *)getPigeonUserInfo:(nonnull FIRUser *)user { ++ (InternalUserInfo *)getPigeonUserInfo:(nonnull FIRUser *)user { NSString *photoUrlString = user.photoURL.absoluteString; - return [PigeonUserInfo + return [InternalUserInfo makeWithUid:user.uid email:user.email displayName:user.displayName @@ -74,25 +74,26 @@ + (PigeonUserInfo *)getPigeonUserInfo:(nonnull FIRUser *)user { return [dataArray copy]; } -+ (PigeonAdditionalUserInfo *)getPigeonAdditionalUserInfo:(nonnull FIRAdditionalUserInfo *)userInfo - authorizationCode:(nullable NSString *)authorizationCode { - return [PigeonAdditionalUserInfo makeWithIsNewUser:userInfo.isNewUser - providerId:userInfo.providerID - username:userInfo.username - authorizationCode:authorizationCode - profile:userInfo.profile]; ++ (InternalAdditionalUserInfo *)getPigeonAdditionalUserInfo: + (nonnull FIRAdditionalUserInfo *)userInfo + authorizationCode:(nullable NSString *)authorizationCode { + return [InternalAdditionalUserInfo makeWithIsNewUser:userInfo.isNewUser + providerId:userInfo.providerID + username:userInfo.username + authorizationCode:authorizationCode + profile:userInfo.profile]; } -+ (PigeonTotpSecret *)getPigeonTotpSecret:(FIRTOTPSecret *)secret { - return [PigeonTotpSecret makeWithCodeIntervalSeconds:nil - codeLength:nil - enrollmentCompletionDeadline:nil - hashingAlgorithm:nil - secretKey:secret.sharedSecretKey]; ++ (InternalTotpSecret *)getPigeonTotpSecret:(FIRTOTPSecret *)secret { + return [InternalTotpSecret makeWithCodeIntervalSeconds:nil + codeLength:nil + enrollmentCompletionDeadline:nil + hashingAlgorithm:nil + secretKey:secret.sharedSecretKey]; } -+ (PigeonAuthCredential *)getPigeonAuthCredential:(FIRAuthCredential *)authCredential - token:(NSNumber *_Nullable)token { ++ (InternalAuthCredential *)getPigeonAuthCredential:(FIRAuthCredential *)authCredential + token:(NSNumber *_Nullable)token { if (authCredential == nil) { return nil; } @@ -110,14 +111,14 @@ + (PigeonAuthCredential *)getPigeonAuthCredential:(FIRAuthCredential *)authCrede NSUInteger nativeId = token != nil ? [token unsignedLongValue] : (NSUInteger)[authCredential hash]; - return [PigeonAuthCredential makeWithProviderId:authCredential.provider - signInMethod:authCredential.provider - nativeId:nativeId - accessToken:accessToken ?: nil]; + return [InternalAuthCredential makeWithProviderId:authCredential.provider + signInMethod:authCredential.provider + nativeId:nativeId + accessToken:accessToken ?: nil]; } + (FIRActionCodeSettings *_Nullable)parseActionCodeSettings: - (nullable PigeonActionCodeSettings *)settings { + (nullable InternalActionCodeSettings *)settings { if (settings == nil) { return nil; } @@ -141,21 +142,21 @@ + (FIRActionCodeSettings *_Nullable)parseActionCodeSettings: return codeSettings; } -+ (PigeonIdTokenResult *)parseIdTokenResult:(FIRAuthTokenResult *)tokenResult { ++ (InternalIdTokenResult *)parseIdTokenResult:(FIRAuthTokenResult *)tokenResult { long expirationTimestamp = (long)[tokenResult.expirationDate timeIntervalSince1970] * 1000; long authTimestamp = (long)[tokenResult.authDate timeIntervalSince1970] * 1000; long issuedAtTimestamp = (long)[tokenResult.issuedAtDate timeIntervalSince1970] * 1000; - return [PigeonIdTokenResult makeWithToken:tokenResult.token - expirationTimestamp:@(expirationTimestamp) - authTimestamp:@(authTimestamp) - issuedAtTimestamp:@(issuedAtTimestamp) - signInProvider:tokenResult.signInProvider - claims:tokenResult.claims - signInSecondFactor:tokenResult.signInSecondFactor]; + return [InternalIdTokenResult makeWithToken:tokenResult.token + expirationTimestamp:@(expirationTimestamp) + authTimestamp:@(authTimestamp) + issuedAtTimestamp:@(issuedAtTimestamp) + signInProvider:tokenResult.signInProvider + claims:tokenResult.claims + signInSecondFactor:tokenResult.signInSecondFactor]; } -+ (NSArray *_Nonnull)getManualList:(nonnull PigeonUserDetails *)userDetails { ++ (NSArray *_Nonnull)getManualList:(nonnull InternalUserDetails *)userDetails { NSMutableArray *output = [NSMutableArray array]; id userInfoList = [[userDetails userInfo] toList]; diff --git a/packages/firebase_auth/firebase_auth/ios/firebase_auth/Sources/firebase_auth/firebase_auth_messages.g.m b/packages/firebase_auth/firebase_auth/ios/firebase_auth/Sources/firebase_auth/firebase_auth_messages.g.m index 365ff70d690c..d110643c17fc 100644 --- a/packages/firebase_auth/firebase_auth/ios/firebase_auth/Sources/firebase_auth/firebase_auth_messages.g.m +++ b/packages/firebase_auth/firebase_auth/ios/firebase_auth/Sources/firebase_auth/firebase_auth_messages.g.m @@ -1,22 +1,109 @@ // Copyright 2023, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v19.0.0), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), do not edit directly. // See also: https://pub.dev/packages/pigeon -#import "include/Public/firebase_auth_messages.g.h" +#import "firebase_auth_messages.g.h" #if TARGET_OS_OSX -#import +@import FlutterMacOS; #else -#import +@import Flutter; #endif -#if !__has_feature(objc_arc) -#error File requires ARC to be enabled. -#endif +static BOOL __attribute__((unused)) FLTPigeonDeepEquals(id _Nullable a, id _Nullable b) { + if (a == b) { + return YES; + } + if (a == nil) { + return b == [NSNull null]; + } + if (b == nil) { + return a == [NSNull null]; + } + if ([a isKindOfClass:[NSNumber class]] && [b isKindOfClass:[NSNumber class]]) { + return + [a isEqual:b] || (isnan([(NSNumber *)a doubleValue]) && isnan([(NSNumber *)b doubleValue])); + } + if ([a isKindOfClass:[NSArray class]] && [b isKindOfClass:[NSArray class]]) { + NSArray *arrayA = (NSArray *)a; + NSArray *arrayB = (NSArray *)b; + if (arrayA.count != arrayB.count) { + return NO; + } + for (NSUInteger i = 0; i < arrayA.count; i++) { + if (!FLTPigeonDeepEquals(arrayA[i], arrayB[i])) { + return NO; + } + } + return YES; + } + if ([a isKindOfClass:[NSDictionary class]] && [b isKindOfClass:[NSDictionary class]]) { + NSDictionary *dictA = (NSDictionary *)a; + NSDictionary *dictB = (NSDictionary *)b; + if (dictA.count != dictB.count) { + return NO; + } + for (id keyA in dictA) { + id valueA = dictA[keyA]; + BOOL found = NO; + for (id keyB in dictB) { + if (FLTPigeonDeepEquals(keyA, keyB)) { + id valueB = dictB[keyB]; + if (FLTPigeonDeepEquals(valueA, valueB)) { + found = YES; + break; + } else { + return NO; + } + } + } + if (!found) { + return NO; + } + } + return YES; + } + return [a isEqual:b]; +} + +static NSUInteger __attribute__((unused)) FLTPigeonDeepHash(id _Nullable value) { + if (value == nil || value == (id)[NSNull null]) { + return 0; + } + if ([value isKindOfClass:[NSNumber class]]) { + NSNumber *n = (NSNumber *)value; + double d = n.doubleValue; + if (isnan(d)) { + // Normalize NaN to a consistent hash. + return (NSUInteger)0x7FF8000000000000; + } + if (d == 0.0) { + // Normalize -0.0 to 0.0 so they have the same hash code. + d = 0.0; + } + return @(d).hash; + } + if ([value isKindOfClass:[NSArray class]]) { + NSUInteger result = 1; + for (id item in (NSArray *)value) { + result = result * 31 + FLTPigeonDeepHash(item); + } + return result; + } + if ([value isKindOfClass:[NSDictionary class]]) { + NSUInteger result = 0; + NSDictionary *dict = (NSDictionary *)value; + for (id key in dict) { + result += ((FLTPigeonDeepHash(key) * 31) ^ FLTPigeonDeepHash(dict[key])); + } + return result; + } + return [value hash]; +} -static NSArray *wrapResult(id result, FlutterError *error) { +static NSArray *wrapResult(id result, FlutterError *error) { if (error) { return @[ error.code ?: [NSNull null], error.message ?: [NSNull null], error.details ?: [NSNull null] @@ -25,7 +112,7 @@ return @[ result ?: [NSNull null] ]; } -static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) { +static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) { id result = array[key]; return (result == [NSNull null]) ? nil : result; } @@ -42,167 +129,209 @@ - (instancetype)initWithValue:(ActionCodeInfoOperation)value { } @end -@interface PigeonMultiFactorSession () -+ (PigeonMultiFactorSession *)fromList:(NSArray *)list; -+ (nullable PigeonMultiFactorSession *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; +@interface InternalMultiFactorSession () ++ (InternalMultiFactorSession *)fromList:(NSArray *)list; ++ (nullable InternalMultiFactorSession *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end -@interface PigeonPhoneMultiFactorAssertion () -+ (PigeonPhoneMultiFactorAssertion *)fromList:(NSArray *)list; -+ (nullable PigeonPhoneMultiFactorAssertion *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; +@interface InternalPhoneMultiFactorAssertion () ++ (InternalPhoneMultiFactorAssertion *)fromList:(NSArray *)list; ++ (nullable InternalPhoneMultiFactorAssertion *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end -@interface PigeonMultiFactorInfo () -+ (PigeonMultiFactorInfo *)fromList:(NSArray *)list; -+ (nullable PigeonMultiFactorInfo *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; +@interface InternalMultiFactorInfo () ++ (InternalMultiFactorInfo *)fromList:(NSArray *)list; ++ (nullable InternalMultiFactorInfo *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end @interface AuthPigeonFirebaseApp () -+ (AuthPigeonFirebaseApp *)fromList:(NSArray *)list; -+ (nullable AuthPigeonFirebaseApp *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; ++ (AuthPigeonFirebaseApp *)fromList:(NSArray *)list; ++ (nullable AuthPigeonFirebaseApp *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; +@end + +@interface InternalActionCodeInfoData () ++ (InternalActionCodeInfoData *)fromList:(NSArray *)list; ++ (nullable InternalActionCodeInfoData *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end -@interface PigeonActionCodeInfoData () -+ (PigeonActionCodeInfoData *)fromList:(NSArray *)list; -+ (nullable PigeonActionCodeInfoData *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; +@interface InternalActionCodeInfo () ++ (InternalActionCodeInfo *)fromList:(NSArray *)list; ++ (nullable InternalActionCodeInfo *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end -@interface PigeonActionCodeInfo () -+ (PigeonActionCodeInfo *)fromList:(NSArray *)list; -+ (nullable PigeonActionCodeInfo *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; +@interface InternalAdditionalUserInfo () ++ (InternalAdditionalUserInfo *)fromList:(NSArray *)list; ++ (nullable InternalAdditionalUserInfo *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end -@interface PigeonAdditionalUserInfo () -+ (PigeonAdditionalUserInfo *)fromList:(NSArray *)list; -+ (nullable PigeonAdditionalUserInfo *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; +@interface InternalAuthCredential () ++ (InternalAuthCredential *)fromList:(NSArray *)list; ++ (nullable InternalAuthCredential *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end -@interface PigeonAuthCredential () -+ (PigeonAuthCredential *)fromList:(NSArray *)list; -+ (nullable PigeonAuthCredential *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; +@interface InternalUserInfo () ++ (InternalUserInfo *)fromList:(NSArray *)list; ++ (nullable InternalUserInfo *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end -@interface PigeonUserInfo () -+ (PigeonUserInfo *)fromList:(NSArray *)list; -+ (nullable PigeonUserInfo *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; +@interface InternalUserDetails () ++ (InternalUserDetails *)fromList:(NSArray *)list; ++ (nullable InternalUserDetails *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end -@interface PigeonUserDetails () -+ (PigeonUserDetails *)fromList:(NSArray *)list; -+ (nullable PigeonUserDetails *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; +@interface InternalUserCredential () ++ (InternalUserCredential *)fromList:(NSArray *)list; ++ (nullable InternalUserCredential *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end -@interface PigeonUserCredential () -+ (PigeonUserCredential *)fromList:(NSArray *)list; -+ (nullable PigeonUserCredential *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; +@interface InternalAuthCredentialInput () ++ (InternalAuthCredentialInput *)fromList:(NSArray *)list; ++ (nullable InternalAuthCredentialInput *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end -@interface PigeonActionCodeSettings () -+ (PigeonActionCodeSettings *)fromList:(NSArray *)list; -+ (nullable PigeonActionCodeSettings *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; +@interface InternalActionCodeSettings () ++ (InternalActionCodeSettings *)fromList:(NSArray *)list; ++ (nullable InternalActionCodeSettings *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end -@interface PigeonFirebaseAuthSettings () -+ (PigeonFirebaseAuthSettings *)fromList:(NSArray *)list; -+ (nullable PigeonFirebaseAuthSettings *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; +@interface InternalFirebaseAuthSettings () ++ (InternalFirebaseAuthSettings *)fromList:(NSArray *)list; ++ (nullable InternalFirebaseAuthSettings *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end -@interface PigeonSignInProvider () -+ (PigeonSignInProvider *)fromList:(NSArray *)list; -+ (nullable PigeonSignInProvider *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; +@interface InternalSignInProvider () ++ (InternalSignInProvider *)fromList:(NSArray *)list; ++ (nullable InternalSignInProvider *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end -@interface PigeonVerifyPhoneNumberRequest () -+ (PigeonVerifyPhoneNumberRequest *)fromList:(NSArray *)list; -+ (nullable PigeonVerifyPhoneNumberRequest *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; +@interface InternalVerifyPhoneNumberRequest () ++ (InternalVerifyPhoneNumberRequest *)fromList:(NSArray *)list; ++ (nullable InternalVerifyPhoneNumberRequest *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end -@interface PigeonIdTokenResult () -+ (PigeonIdTokenResult *)fromList:(NSArray *)list; -+ (nullable PigeonIdTokenResult *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; +@interface InternalIdTokenResult () ++ (InternalIdTokenResult *)fromList:(NSArray *)list; ++ (nullable InternalIdTokenResult *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end -@interface PigeonUserProfile () -+ (PigeonUserProfile *)fromList:(NSArray *)list; -+ (nullable PigeonUserProfile *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; +@interface InternalUserProfile () ++ (InternalUserProfile *)fromList:(NSArray *)list; ++ (nullable InternalUserProfile *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end -@interface PigeonTotpSecret () -+ (PigeonTotpSecret *)fromList:(NSArray *)list; -+ (nullable PigeonTotpSecret *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; +@interface InternalTotpSecret () ++ (InternalTotpSecret *)fromList:(NSArray *)list; ++ (nullable InternalTotpSecret *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end -@implementation PigeonMultiFactorSession +@implementation InternalMultiFactorSession + (instancetype)makeWithId:(NSString *)id { - PigeonMultiFactorSession *pigeonResult = [[PigeonMultiFactorSession alloc] init]; + InternalMultiFactorSession *pigeonResult = [[InternalMultiFactorSession alloc] init]; pigeonResult.id = id; return pigeonResult; } -+ (PigeonMultiFactorSession *)fromList:(NSArray *)list { - PigeonMultiFactorSession *pigeonResult = [[PigeonMultiFactorSession alloc] init]; ++ (InternalMultiFactorSession *)fromList:(NSArray *)list { + InternalMultiFactorSession *pigeonResult = [[InternalMultiFactorSession alloc] init]; pigeonResult.id = GetNullableObjectAtIndex(list, 0); return pigeonResult; } -+ (nullable PigeonMultiFactorSession *)nullableFromList:(NSArray *)list { - return (list) ? [PigeonMultiFactorSession fromList:list] : nil; ++ (nullable InternalMultiFactorSession *)nullableFromList:(NSArray *)list { + return (list) ? [InternalMultiFactorSession fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ self.id ?: [NSNull null], ]; } +- (BOOL)isEqual:(id)object { + if (self == object) { + return YES; + } + if (![object isKindOfClass:[self class]]) { + return NO; + } + InternalMultiFactorSession *other = (InternalMultiFactorSession *)object; + return FLTPigeonDeepEquals(self.id, other.id); +} + +- (NSUInteger)hash { + NSUInteger result = [self class].hash; + result = result * 31 + FLTPigeonDeepHash(self.id); + return result; +} @end -@implementation PigeonPhoneMultiFactorAssertion +@implementation InternalPhoneMultiFactorAssertion + (instancetype)makeWithVerificationId:(NSString *)verificationId verificationCode:(NSString *)verificationCode { - PigeonPhoneMultiFactorAssertion *pigeonResult = [[PigeonPhoneMultiFactorAssertion alloc] init]; + InternalPhoneMultiFactorAssertion *pigeonResult = + [[InternalPhoneMultiFactorAssertion alloc] init]; pigeonResult.verificationId = verificationId; pigeonResult.verificationCode = verificationCode; return pigeonResult; } -+ (PigeonPhoneMultiFactorAssertion *)fromList:(NSArray *)list { - PigeonPhoneMultiFactorAssertion *pigeonResult = [[PigeonPhoneMultiFactorAssertion alloc] init]; ++ (InternalPhoneMultiFactorAssertion *)fromList:(NSArray *)list { + InternalPhoneMultiFactorAssertion *pigeonResult = + [[InternalPhoneMultiFactorAssertion alloc] init]; pigeonResult.verificationId = GetNullableObjectAtIndex(list, 0); pigeonResult.verificationCode = GetNullableObjectAtIndex(list, 1); return pigeonResult; } -+ (nullable PigeonPhoneMultiFactorAssertion *)nullableFromList:(NSArray *)list { - return (list) ? [PigeonPhoneMultiFactorAssertion fromList:list] : nil; ++ (nullable InternalPhoneMultiFactorAssertion *)nullableFromList:(NSArray *)list { + return (list) ? [InternalPhoneMultiFactorAssertion fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ self.verificationId ?: [NSNull null], self.verificationCode ?: [NSNull null], ]; } +- (BOOL)isEqual:(id)object { + if (self == object) { + return YES; + } + if (![object isKindOfClass:[self class]]) { + return NO; + } + InternalPhoneMultiFactorAssertion *other = (InternalPhoneMultiFactorAssertion *)object; + return FLTPigeonDeepEquals(self.verificationId, other.verificationId) && + FLTPigeonDeepEquals(self.verificationCode, other.verificationCode); +} + +- (NSUInteger)hash { + NSUInteger result = [self class].hash; + result = result * 31 + FLTPigeonDeepHash(self.verificationId); + result = result * 31 + FLTPigeonDeepHash(self.verificationCode); + return result; +} @end -@implementation PigeonMultiFactorInfo +@implementation InternalMultiFactorInfo + (instancetype)makeWithDisplayName:(nullable NSString *)displayName enrollmentTimestamp:(double)enrollmentTimestamp factorId:(nullable NSString *)factorId uid:(NSString *)uid phoneNumber:(nullable NSString *)phoneNumber { - PigeonMultiFactorInfo *pigeonResult = [[PigeonMultiFactorInfo alloc] init]; + InternalMultiFactorInfo *pigeonResult = [[InternalMultiFactorInfo alloc] init]; pigeonResult.displayName = displayName; pigeonResult.enrollmentTimestamp = enrollmentTimestamp; pigeonResult.factorId = factorId; @@ -210,8 +339,8 @@ + (instancetype)makeWithDisplayName:(nullable NSString *)displayName pigeonResult.phoneNumber = phoneNumber; return pigeonResult; } -+ (PigeonMultiFactorInfo *)fromList:(NSArray *)list { - PigeonMultiFactorInfo *pigeonResult = [[PigeonMultiFactorInfo alloc] init]; ++ (InternalMultiFactorInfo *)fromList:(NSArray *)list { + InternalMultiFactorInfo *pigeonResult = [[InternalMultiFactorInfo alloc] init]; pigeonResult.displayName = GetNullableObjectAtIndex(list, 0); pigeonResult.enrollmentTimestamp = [GetNullableObjectAtIndex(list, 1) doubleValue]; pigeonResult.factorId = GetNullableObjectAtIndex(list, 2); @@ -219,10 +348,10 @@ + (PigeonMultiFactorInfo *)fromList:(NSArray *)list { pigeonResult.phoneNumber = GetNullableObjectAtIndex(list, 4); return pigeonResult; } -+ (nullable PigeonMultiFactorInfo *)nullableFromList:(NSArray *)list { - return (list) ? [PigeonMultiFactorInfo fromList:list] : nil; ++ (nullable InternalMultiFactorInfo *)nullableFromList:(NSArray *)list { + return (list) ? [InternalMultiFactorInfo fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ self.displayName ?: [NSNull null], @(self.enrollmentTimestamp), @@ -231,6 +360,32 @@ - (NSArray *)toList { self.phoneNumber ?: [NSNull null], ]; } +- (BOOL)isEqual:(id)object { + if (self == object) { + return YES; + } + if (![object isKindOfClass:[self class]]) { + return NO; + } + InternalMultiFactorInfo *other = (InternalMultiFactorInfo *)object; + return FLTPigeonDeepEquals(self.displayName, other.displayName) && + (self.enrollmentTimestamp == other.enrollmentTimestamp || + (isnan(self.enrollmentTimestamp) && isnan(other.enrollmentTimestamp))) && + FLTPigeonDeepEquals(self.factorId, other.factorId) && + FLTPigeonDeepEquals(self.uid, other.uid) && + FLTPigeonDeepEquals(self.phoneNumber, other.phoneNumber); +} + +- (NSUInteger)hash { + NSUInteger result = [self class].hash; + result = result * 31 + FLTPigeonDeepHash(self.displayName); + result = result * 31 + (isnan(self.enrollmentTimestamp) ? (NSUInteger)0x7FF8000000000000 + : @(self.enrollmentTimestamp).hash); + result = result * 31 + FLTPigeonDeepHash(self.factorId); + result = result * 31 + FLTPigeonDeepHash(self.uid); + result = result * 31 + FLTPigeonDeepHash(self.phoneNumber); + return result; +} @end @implementation AuthPigeonFirebaseApp @@ -243,82 +398,138 @@ + (instancetype)makeWithAppName:(NSString *)appName pigeonResult.customAuthDomain = customAuthDomain; return pigeonResult; } -+ (AuthPigeonFirebaseApp *)fromList:(NSArray *)list { ++ (AuthPigeonFirebaseApp *)fromList:(NSArray *)list { AuthPigeonFirebaseApp *pigeonResult = [[AuthPigeonFirebaseApp alloc] init]; pigeonResult.appName = GetNullableObjectAtIndex(list, 0); pigeonResult.tenantId = GetNullableObjectAtIndex(list, 1); pigeonResult.customAuthDomain = GetNullableObjectAtIndex(list, 2); return pigeonResult; } -+ (nullable AuthPigeonFirebaseApp *)nullableFromList:(NSArray *)list { ++ (nullable AuthPigeonFirebaseApp *)nullableFromList:(NSArray *)list { return (list) ? [AuthPigeonFirebaseApp fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ self.appName ?: [NSNull null], self.tenantId ?: [NSNull null], self.customAuthDomain ?: [NSNull null], ]; } +- (BOOL)isEqual:(id)object { + if (self == object) { + return YES; + } + if (![object isKindOfClass:[self class]]) { + return NO; + } + AuthPigeonFirebaseApp *other = (AuthPigeonFirebaseApp *)object; + return FLTPigeonDeepEquals(self.appName, other.appName) && + FLTPigeonDeepEquals(self.tenantId, other.tenantId) && + FLTPigeonDeepEquals(self.customAuthDomain, other.customAuthDomain); +} + +- (NSUInteger)hash { + NSUInteger result = [self class].hash; + result = result * 31 + FLTPigeonDeepHash(self.appName); + result = result * 31 + FLTPigeonDeepHash(self.tenantId); + result = result * 31 + FLTPigeonDeepHash(self.customAuthDomain); + return result; +} @end -@implementation PigeonActionCodeInfoData +@implementation InternalActionCodeInfoData + (instancetype)makeWithEmail:(nullable NSString *)email previousEmail:(nullable NSString *)previousEmail { - PigeonActionCodeInfoData *pigeonResult = [[PigeonActionCodeInfoData alloc] init]; + InternalActionCodeInfoData *pigeonResult = [[InternalActionCodeInfoData alloc] init]; pigeonResult.email = email; pigeonResult.previousEmail = previousEmail; return pigeonResult; } -+ (PigeonActionCodeInfoData *)fromList:(NSArray *)list { - PigeonActionCodeInfoData *pigeonResult = [[PigeonActionCodeInfoData alloc] init]; ++ (InternalActionCodeInfoData *)fromList:(NSArray *)list { + InternalActionCodeInfoData *pigeonResult = [[InternalActionCodeInfoData alloc] init]; pigeonResult.email = GetNullableObjectAtIndex(list, 0); pigeonResult.previousEmail = GetNullableObjectAtIndex(list, 1); return pigeonResult; } -+ (nullable PigeonActionCodeInfoData *)nullableFromList:(NSArray *)list { - return (list) ? [PigeonActionCodeInfoData fromList:list] : nil; ++ (nullable InternalActionCodeInfoData *)nullableFromList:(NSArray *)list { + return (list) ? [InternalActionCodeInfoData fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ self.email ?: [NSNull null], self.previousEmail ?: [NSNull null], ]; } +- (BOOL)isEqual:(id)object { + if (self == object) { + return YES; + } + if (![object isKindOfClass:[self class]]) { + return NO; + } + InternalActionCodeInfoData *other = (InternalActionCodeInfoData *)object; + return FLTPigeonDeepEquals(self.email, other.email) && + FLTPigeonDeepEquals(self.previousEmail, other.previousEmail); +} + +- (NSUInteger)hash { + NSUInteger result = [self class].hash; + result = result * 31 + FLTPigeonDeepHash(self.email); + result = result * 31 + FLTPigeonDeepHash(self.previousEmail); + return result; +} @end -@implementation PigeonActionCodeInfo +@implementation InternalActionCodeInfo + (instancetype)makeWithOperation:(ActionCodeInfoOperation)operation - data:(PigeonActionCodeInfoData *)data { - PigeonActionCodeInfo *pigeonResult = [[PigeonActionCodeInfo alloc] init]; + data:(InternalActionCodeInfoData *)data { + InternalActionCodeInfo *pigeonResult = [[InternalActionCodeInfo alloc] init]; pigeonResult.operation = operation; pigeonResult.data = data; return pigeonResult; } -+ (PigeonActionCodeInfo *)fromList:(NSArray *)list { - PigeonActionCodeInfo *pigeonResult = [[PigeonActionCodeInfo alloc] init]; - pigeonResult.operation = [GetNullableObjectAtIndex(list, 0) integerValue]; ++ (InternalActionCodeInfo *)fromList:(NSArray *)list { + InternalActionCodeInfo *pigeonResult = [[InternalActionCodeInfo alloc] init]; + ActionCodeInfoOperationBox *boxedActionCodeInfoOperation = GetNullableObjectAtIndex(list, 0); + pigeonResult.operation = boxedActionCodeInfoOperation.value; pigeonResult.data = GetNullableObjectAtIndex(list, 1); return pigeonResult; } -+ (nullable PigeonActionCodeInfo *)nullableFromList:(NSArray *)list { - return (list) ? [PigeonActionCodeInfo fromList:list] : nil; ++ (nullable InternalActionCodeInfo *)nullableFromList:(NSArray *)list { + return (list) ? [InternalActionCodeInfo fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ - @(self.operation), + [[ActionCodeInfoOperationBox alloc] initWithValue:self.operation], self.data ?: [NSNull null], ]; } +- (BOOL)isEqual:(id)object { + if (self == object) { + return YES; + } + if (![object isKindOfClass:[self class]]) { + return NO; + } + InternalActionCodeInfo *other = (InternalActionCodeInfo *)object; + return self.operation == other.operation && FLTPigeonDeepEquals(self.data, other.data); +} + +- (NSUInteger)hash { + NSUInteger result = [self class].hash; + result = result * 31 + @(self.operation).hash; + result = result * 31 + FLTPigeonDeepHash(self.data); + return result; +} @end -@implementation PigeonAdditionalUserInfo +@implementation InternalAdditionalUserInfo + (instancetype)makeWithIsNewUser:(BOOL)isNewUser providerId:(nullable NSString *)providerId username:(nullable NSString *)username authorizationCode:(nullable NSString *)authorizationCode profile:(nullable NSDictionary *)profile { - PigeonAdditionalUserInfo *pigeonResult = [[PigeonAdditionalUserInfo alloc] init]; + InternalAdditionalUserInfo *pigeonResult = [[InternalAdditionalUserInfo alloc] init]; pigeonResult.isNewUser = isNewUser; pigeonResult.providerId = providerId; pigeonResult.username = username; @@ -326,8 +537,8 @@ + (instancetype)makeWithIsNewUser:(BOOL)isNewUser pigeonResult.profile = profile; return pigeonResult; } -+ (PigeonAdditionalUserInfo *)fromList:(NSArray *)list { - PigeonAdditionalUserInfo *pigeonResult = [[PigeonAdditionalUserInfo alloc] init]; ++ (InternalAdditionalUserInfo *)fromList:(NSArray *)list { + InternalAdditionalUserInfo *pigeonResult = [[InternalAdditionalUserInfo alloc] init]; pigeonResult.isNewUser = [GetNullableObjectAtIndex(list, 0) boolValue]; pigeonResult.providerId = GetNullableObjectAtIndex(list, 1); pigeonResult.username = GetNullableObjectAtIndex(list, 2); @@ -335,10 +546,10 @@ + (PigeonAdditionalUserInfo *)fromList:(NSArray *)list { pigeonResult.profile = GetNullableObjectAtIndex(list, 4); return pigeonResult; } -+ (nullable PigeonAdditionalUserInfo *)nullableFromList:(NSArray *)list { - return (list) ? [PigeonAdditionalUserInfo fromList:list] : nil; ++ (nullable InternalAdditionalUserInfo *)nullableFromList:(NSArray *)list { + return (list) ? [InternalAdditionalUserInfo fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ @(self.isNewUser), self.providerId ?: [NSNull null], @@ -347,32 +558,56 @@ - (NSArray *)toList { self.profile ?: [NSNull null], ]; } +- (BOOL)isEqual:(id)object { + if (self == object) { + return YES; + } + if (![object isKindOfClass:[self class]]) { + return NO; + } + InternalAdditionalUserInfo *other = (InternalAdditionalUserInfo *)object; + return self.isNewUser == other.isNewUser && + FLTPigeonDeepEquals(self.providerId, other.providerId) && + FLTPigeonDeepEquals(self.username, other.username) && + FLTPigeonDeepEquals(self.authorizationCode, other.authorizationCode) && + FLTPigeonDeepEquals(self.profile, other.profile); +} + +- (NSUInteger)hash { + NSUInteger result = [self class].hash; + result = result * 31 + @(self.isNewUser).hash; + result = result * 31 + FLTPigeonDeepHash(self.providerId); + result = result * 31 + FLTPigeonDeepHash(self.username); + result = result * 31 + FLTPigeonDeepHash(self.authorizationCode); + result = result * 31 + FLTPigeonDeepHash(self.profile); + return result; +} @end -@implementation PigeonAuthCredential +@implementation InternalAuthCredential + (instancetype)makeWithProviderId:(NSString *)providerId signInMethod:(NSString *)signInMethod nativeId:(NSInteger)nativeId accessToken:(nullable NSString *)accessToken { - PigeonAuthCredential *pigeonResult = [[PigeonAuthCredential alloc] init]; + InternalAuthCredential *pigeonResult = [[InternalAuthCredential alloc] init]; pigeonResult.providerId = providerId; pigeonResult.signInMethod = signInMethod; pigeonResult.nativeId = nativeId; pigeonResult.accessToken = accessToken; return pigeonResult; } -+ (PigeonAuthCredential *)fromList:(NSArray *)list { - PigeonAuthCredential *pigeonResult = [[PigeonAuthCredential alloc] init]; ++ (InternalAuthCredential *)fromList:(NSArray *)list { + InternalAuthCredential *pigeonResult = [[InternalAuthCredential alloc] init]; pigeonResult.providerId = GetNullableObjectAtIndex(list, 0); pigeonResult.signInMethod = GetNullableObjectAtIndex(list, 1); pigeonResult.nativeId = [GetNullableObjectAtIndex(list, 2) integerValue]; pigeonResult.accessToken = GetNullableObjectAtIndex(list, 3); return pigeonResult; } -+ (nullable PigeonAuthCredential *)nullableFromList:(NSArray *)list { - return (list) ? [PigeonAuthCredential fromList:list] : nil; ++ (nullable InternalAuthCredential *)nullableFromList:(NSArray *)list { + return (list) ? [InternalAuthCredential fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ self.providerId ?: [NSNull null], self.signInMethod ?: [NSNull null], @@ -380,9 +615,31 @@ - (NSArray *)toList { self.accessToken ?: [NSNull null], ]; } +- (BOOL)isEqual:(id)object { + if (self == object) { + return YES; + } + if (![object isKindOfClass:[self class]]) { + return NO; + } + InternalAuthCredential *other = (InternalAuthCredential *)object; + return FLTPigeonDeepEquals(self.providerId, other.providerId) && + FLTPigeonDeepEquals(self.signInMethod, other.signInMethod) && + self.nativeId == other.nativeId && + FLTPigeonDeepEquals(self.accessToken, other.accessToken); +} + +- (NSUInteger)hash { + NSUInteger result = [self class].hash; + result = result * 31 + FLTPigeonDeepHash(self.providerId); + result = result * 31 + FLTPigeonDeepHash(self.signInMethod); + result = result * 31 + @(self.nativeId).hash; + result = result * 31 + FLTPigeonDeepHash(self.accessToken); + return result; +} @end -@implementation PigeonUserInfo +@implementation InternalUserInfo + (instancetype)makeWithUid:(NSString *)uid email:(nullable NSString *)email displayName:(nullable NSString *)displayName @@ -395,7 +652,7 @@ + (instancetype)makeWithUid:(NSString *)uid refreshToken:(nullable NSString *)refreshToken creationTimestamp:(nullable NSNumber *)creationTimestamp lastSignInTimestamp:(nullable NSNumber *)lastSignInTimestamp { - PigeonUserInfo *pigeonResult = [[PigeonUserInfo alloc] init]; + InternalUserInfo *pigeonResult = [[InternalUserInfo alloc] init]; pigeonResult.uid = uid; pigeonResult.email = email; pigeonResult.displayName = displayName; @@ -410,8 +667,8 @@ + (instancetype)makeWithUid:(NSString *)uid pigeonResult.lastSignInTimestamp = lastSignInTimestamp; return pigeonResult; } -+ (PigeonUserInfo *)fromList:(NSArray *)list { - PigeonUserInfo *pigeonResult = [[PigeonUserInfo alloc] init]; ++ (InternalUserInfo *)fromList:(NSArray *)list { + InternalUserInfo *pigeonResult = [[InternalUserInfo alloc] init]; pigeonResult.uid = GetNullableObjectAtIndex(list, 0); pigeonResult.email = GetNullableObjectAtIndex(list, 1); pigeonResult.displayName = GetNullableObjectAtIndex(list, 2); @@ -426,10 +683,10 @@ + (PigeonUserInfo *)fromList:(NSArray *)list { pigeonResult.lastSignInTimestamp = GetNullableObjectAtIndex(list, 11); return pigeonResult; } -+ (nullable PigeonUserInfo *)nullableFromList:(NSArray *)list { - return (list) ? [PigeonUserInfo fromList:list] : nil; ++ (nullable InternalUserInfo *)nullableFromList:(NSArray *)list { + return (list) ? [InternalUserInfo fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ self.uid ?: [NSNull null], self.email ?: [NSNull null], @@ -445,63 +702,192 @@ - (NSArray *)toList { self.lastSignInTimestamp ?: [NSNull null], ]; } -@end - -@implementation PigeonUserDetails -+ (instancetype)makeWithUserInfo:(PigeonUserInfo *)userInfo +- (BOOL)isEqual:(id)object { + if (self == object) { + return YES; + } + if (![object isKindOfClass:[self class]]) { + return NO; + } + InternalUserInfo *other = (InternalUserInfo *)object; + return FLTPigeonDeepEquals(self.uid, other.uid) && FLTPigeonDeepEquals(self.email, other.email) && + FLTPigeonDeepEquals(self.displayName, other.displayName) && + FLTPigeonDeepEquals(self.photoUrl, other.photoUrl) && + FLTPigeonDeepEquals(self.phoneNumber, other.phoneNumber) && + self.isAnonymous == other.isAnonymous && self.isEmailVerified == other.isEmailVerified && + FLTPigeonDeepEquals(self.providerId, other.providerId) && + FLTPigeonDeepEquals(self.tenantId, other.tenantId) && + FLTPigeonDeepEquals(self.refreshToken, other.refreshToken) && + FLTPigeonDeepEquals(self.creationTimestamp, other.creationTimestamp) && + FLTPigeonDeepEquals(self.lastSignInTimestamp, other.lastSignInTimestamp); +} + +- (NSUInteger)hash { + NSUInteger result = [self class].hash; + result = result * 31 + FLTPigeonDeepHash(self.uid); + result = result * 31 + FLTPigeonDeepHash(self.email); + result = result * 31 + FLTPigeonDeepHash(self.displayName); + result = result * 31 + FLTPigeonDeepHash(self.photoUrl); + result = result * 31 + FLTPigeonDeepHash(self.phoneNumber); + result = result * 31 + @(self.isAnonymous).hash; + result = result * 31 + @(self.isEmailVerified).hash; + result = result * 31 + FLTPigeonDeepHash(self.providerId); + result = result * 31 + FLTPigeonDeepHash(self.tenantId); + result = result * 31 + FLTPigeonDeepHash(self.refreshToken); + result = result * 31 + FLTPigeonDeepHash(self.creationTimestamp); + result = result * 31 + FLTPigeonDeepHash(self.lastSignInTimestamp); + return result; +} +@end + +@implementation InternalUserDetails ++ (instancetype)makeWithUserInfo:(InternalUserInfo *)userInfo providerData:(NSArray *> *)providerData { - PigeonUserDetails *pigeonResult = [[PigeonUserDetails alloc] init]; + InternalUserDetails *pigeonResult = [[InternalUserDetails alloc] init]; pigeonResult.userInfo = userInfo; pigeonResult.providerData = providerData; return pigeonResult; } -+ (PigeonUserDetails *)fromList:(NSArray *)list { - PigeonUserDetails *pigeonResult = [[PigeonUserDetails alloc] init]; ++ (InternalUserDetails *)fromList:(NSArray *)list { + InternalUserDetails *pigeonResult = [[InternalUserDetails alloc] init]; pigeonResult.userInfo = GetNullableObjectAtIndex(list, 0); pigeonResult.providerData = GetNullableObjectAtIndex(list, 1); return pigeonResult; } -+ (nullable PigeonUserDetails *)nullableFromList:(NSArray *)list { - return (list) ? [PigeonUserDetails fromList:list] : nil; ++ (nullable InternalUserDetails *)nullableFromList:(NSArray *)list { + return (list) ? [InternalUserDetails fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ self.userInfo ?: [NSNull null], self.providerData ?: [NSNull null], ]; } +- (BOOL)isEqual:(id)object { + if (self == object) { + return YES; + } + if (![object isKindOfClass:[self class]]) { + return NO; + } + InternalUserDetails *other = (InternalUserDetails *)object; + return FLTPigeonDeepEquals(self.userInfo, other.userInfo) && + FLTPigeonDeepEquals(self.providerData, other.providerData); +} + +- (NSUInteger)hash { + NSUInteger result = [self class].hash; + result = result * 31 + FLTPigeonDeepHash(self.userInfo); + result = result * 31 + FLTPigeonDeepHash(self.providerData); + return result; +} @end -@implementation PigeonUserCredential -+ (instancetype)makeWithUser:(nullable PigeonUserDetails *)user - additionalUserInfo:(nullable PigeonAdditionalUserInfo *)additionalUserInfo - credential:(nullable PigeonAuthCredential *)credential { - PigeonUserCredential *pigeonResult = [[PigeonUserCredential alloc] init]; +@implementation InternalUserCredential ++ (instancetype)makeWithUser:(nullable InternalUserDetails *)user + additionalUserInfo:(nullable InternalAdditionalUserInfo *)additionalUserInfo + credential:(nullable InternalAuthCredential *)credential { + InternalUserCredential *pigeonResult = [[InternalUserCredential alloc] init]; pigeonResult.user = user; pigeonResult.additionalUserInfo = additionalUserInfo; pigeonResult.credential = credential; return pigeonResult; } -+ (PigeonUserCredential *)fromList:(NSArray *)list { - PigeonUserCredential *pigeonResult = [[PigeonUserCredential alloc] init]; ++ (InternalUserCredential *)fromList:(NSArray *)list { + InternalUserCredential *pigeonResult = [[InternalUserCredential alloc] init]; pigeonResult.user = GetNullableObjectAtIndex(list, 0); pigeonResult.additionalUserInfo = GetNullableObjectAtIndex(list, 1); pigeonResult.credential = GetNullableObjectAtIndex(list, 2); return pigeonResult; } -+ (nullable PigeonUserCredential *)nullableFromList:(NSArray *)list { - return (list) ? [PigeonUserCredential fromList:list] : nil; ++ (nullable InternalUserCredential *)nullableFromList:(NSArray *)list { + return (list) ? [InternalUserCredential fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ self.user ?: [NSNull null], self.additionalUserInfo ?: [NSNull null], self.credential ?: [NSNull null], ]; } +- (BOOL)isEqual:(id)object { + if (self == object) { + return YES; + } + if (![object isKindOfClass:[self class]]) { + return NO; + } + InternalUserCredential *other = (InternalUserCredential *)object; + return FLTPigeonDeepEquals(self.user, other.user) && + FLTPigeonDeepEquals(self.additionalUserInfo, other.additionalUserInfo) && + FLTPigeonDeepEquals(self.credential, other.credential); +} + +- (NSUInteger)hash { + NSUInteger result = [self class].hash; + result = result * 31 + FLTPigeonDeepHash(self.user); + result = result * 31 + FLTPigeonDeepHash(self.additionalUserInfo); + result = result * 31 + FLTPigeonDeepHash(self.credential); + return result; +} +@end + +@implementation InternalAuthCredentialInput ++ (instancetype)makeWithProviderId:(NSString *)providerId + signInMethod:(NSString *)signInMethod + token:(nullable NSString *)token + accessToken:(nullable NSString *)accessToken { + InternalAuthCredentialInput *pigeonResult = [[InternalAuthCredentialInput alloc] init]; + pigeonResult.providerId = providerId; + pigeonResult.signInMethod = signInMethod; + pigeonResult.token = token; + pigeonResult.accessToken = accessToken; + return pigeonResult; +} ++ (InternalAuthCredentialInput *)fromList:(NSArray *)list { + InternalAuthCredentialInput *pigeonResult = [[InternalAuthCredentialInput alloc] init]; + pigeonResult.providerId = GetNullableObjectAtIndex(list, 0); + pigeonResult.signInMethod = GetNullableObjectAtIndex(list, 1); + pigeonResult.token = GetNullableObjectAtIndex(list, 2); + pigeonResult.accessToken = GetNullableObjectAtIndex(list, 3); + return pigeonResult; +} ++ (nullable InternalAuthCredentialInput *)nullableFromList:(NSArray *)list { + return (list) ? [InternalAuthCredentialInput fromList:list] : nil; +} +- (NSArray *)toList { + return @[ + self.providerId ?: [NSNull null], + self.signInMethod ?: [NSNull null], + self.token ?: [NSNull null], + self.accessToken ?: [NSNull null], + ]; +} +- (BOOL)isEqual:(id)object { + if (self == object) { + return YES; + } + if (![object isKindOfClass:[self class]]) { + return NO; + } + InternalAuthCredentialInput *other = (InternalAuthCredentialInput *)object; + return FLTPigeonDeepEquals(self.providerId, other.providerId) && + FLTPigeonDeepEquals(self.signInMethod, other.signInMethod) && + FLTPigeonDeepEquals(self.token, other.token) && + FLTPigeonDeepEquals(self.accessToken, other.accessToken); +} + +- (NSUInteger)hash { + NSUInteger result = [self class].hash; + result = result * 31 + FLTPigeonDeepHash(self.providerId); + result = result * 31 + FLTPigeonDeepHash(self.signInMethod); + result = result * 31 + FLTPigeonDeepHash(self.token); + result = result * 31 + FLTPigeonDeepHash(self.accessToken); + return result; +} @end -@implementation PigeonActionCodeSettings +@implementation InternalActionCodeSettings + (instancetype)makeWithUrl:(NSString *)url dynamicLinkDomain:(nullable NSString *)dynamicLinkDomain handleCodeInApp:(BOOL)handleCodeInApp @@ -510,7 +896,7 @@ + (instancetype)makeWithUrl:(NSString *)url androidInstallApp:(BOOL)androidInstallApp androidMinimumVersion:(nullable NSString *)androidMinimumVersion linkDomain:(nullable NSString *)linkDomain { - PigeonActionCodeSettings *pigeonResult = [[PigeonActionCodeSettings alloc] init]; + InternalActionCodeSettings *pigeonResult = [[InternalActionCodeSettings alloc] init]; pigeonResult.url = url; pigeonResult.dynamicLinkDomain = dynamicLinkDomain; pigeonResult.handleCodeInApp = handleCodeInApp; @@ -521,8 +907,8 @@ + (instancetype)makeWithUrl:(NSString *)url pigeonResult.linkDomain = linkDomain; return pigeonResult; } -+ (PigeonActionCodeSettings *)fromList:(NSArray *)list { - PigeonActionCodeSettings *pigeonResult = [[PigeonActionCodeSettings alloc] init]; ++ (InternalActionCodeSettings *)fromList:(NSArray *)list { + InternalActionCodeSettings *pigeonResult = [[InternalActionCodeSettings alloc] init]; pigeonResult.url = GetNullableObjectAtIndex(list, 0); pigeonResult.dynamicLinkDomain = GetNullableObjectAtIndex(list, 1); pigeonResult.handleCodeInApp = [GetNullableObjectAtIndex(list, 2) boolValue]; @@ -533,10 +919,10 @@ + (PigeonActionCodeSettings *)fromList:(NSArray *)list { pigeonResult.linkDomain = GetNullableObjectAtIndex(list, 7); return pigeonResult; } -+ (nullable PigeonActionCodeSettings *)nullableFromList:(NSArray *)list { - return (list) ? [PigeonActionCodeSettings fromList:list] : nil; ++ (nullable InternalActionCodeSettings *)nullableFromList:(NSArray *)list { + return (list) ? [InternalActionCodeSettings fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ self.url ?: [NSNull null], self.dynamicLinkDomain ?: [NSNull null], @@ -548,15 +934,45 @@ - (NSArray *)toList { self.linkDomain ?: [NSNull null], ]; } -@end - -@implementation PigeonFirebaseAuthSettings +- (BOOL)isEqual:(id)object { + if (self == object) { + return YES; + } + if (![object isKindOfClass:[self class]]) { + return NO; + } + InternalActionCodeSettings *other = (InternalActionCodeSettings *)object; + return FLTPigeonDeepEquals(self.url, other.url) && + FLTPigeonDeepEquals(self.dynamicLinkDomain, other.dynamicLinkDomain) && + self.handleCodeInApp == other.handleCodeInApp && + FLTPigeonDeepEquals(self.iOSBundleId, other.iOSBundleId) && + FLTPigeonDeepEquals(self.androidPackageName, other.androidPackageName) && + self.androidInstallApp == other.androidInstallApp && + FLTPigeonDeepEquals(self.androidMinimumVersion, other.androidMinimumVersion) && + FLTPigeonDeepEquals(self.linkDomain, other.linkDomain); +} + +- (NSUInteger)hash { + NSUInteger result = [self class].hash; + result = result * 31 + FLTPigeonDeepHash(self.url); + result = result * 31 + FLTPigeonDeepHash(self.dynamicLinkDomain); + result = result * 31 + @(self.handleCodeInApp).hash; + result = result * 31 + FLTPigeonDeepHash(self.iOSBundleId); + result = result * 31 + FLTPigeonDeepHash(self.androidPackageName); + result = result * 31 + @(self.androidInstallApp).hash; + result = result * 31 + FLTPigeonDeepHash(self.androidMinimumVersion); + result = result * 31 + FLTPigeonDeepHash(self.linkDomain); + return result; +} +@end + +@implementation InternalFirebaseAuthSettings + (instancetype)makeWithAppVerificationDisabledForTesting:(BOOL)appVerificationDisabledForTesting userAccessGroup:(nullable NSString *)userAccessGroup phoneNumber:(nullable NSString *)phoneNumber smsCode:(nullable NSString *)smsCode forceRecaptchaFlow:(nullable NSNumber *)forceRecaptchaFlow { - PigeonFirebaseAuthSettings *pigeonResult = [[PigeonFirebaseAuthSettings alloc] init]; + InternalFirebaseAuthSettings *pigeonResult = [[InternalFirebaseAuthSettings alloc] init]; pigeonResult.appVerificationDisabledForTesting = appVerificationDisabledForTesting; pigeonResult.userAccessGroup = userAccessGroup; pigeonResult.phoneNumber = phoneNumber; @@ -564,8 +980,8 @@ + (instancetype)makeWithAppVerificationDisabledForTesting:(BOOL)appVerificationD pigeonResult.forceRecaptchaFlow = forceRecaptchaFlow; return pigeonResult; } -+ (PigeonFirebaseAuthSettings *)fromList:(NSArray *)list { - PigeonFirebaseAuthSettings *pigeonResult = [[PigeonFirebaseAuthSettings alloc] init]; ++ (InternalFirebaseAuthSettings *)fromList:(NSArray *)list { + InternalFirebaseAuthSettings *pigeonResult = [[InternalFirebaseAuthSettings alloc] init]; pigeonResult.appVerificationDisabledForTesting = [GetNullableObjectAtIndex(list, 0) boolValue]; pigeonResult.userAccessGroup = GetNullableObjectAtIndex(list, 1); pigeonResult.phoneNumber = GetNullableObjectAtIndex(list, 2); @@ -573,10 +989,10 @@ + (PigeonFirebaseAuthSettings *)fromList:(NSArray *)list { pigeonResult.forceRecaptchaFlow = GetNullableObjectAtIndex(list, 4); return pigeonResult; } -+ (nullable PigeonFirebaseAuthSettings *)nullableFromList:(NSArray *)list { - return (list) ? [PigeonFirebaseAuthSettings fromList:list] : nil; ++ (nullable InternalFirebaseAuthSettings *)nullableFromList:(NSArray *)list { + return (list) ? [InternalFirebaseAuthSettings fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ @(self.appVerificationDisabledForTesting), self.userAccessGroup ?: [NSNull null], @@ -585,46 +1001,90 @@ - (NSArray *)toList { self.forceRecaptchaFlow ?: [NSNull null], ]; } +- (BOOL)isEqual:(id)object { + if (self == object) { + return YES; + } + if (![object isKindOfClass:[self class]]) { + return NO; + } + InternalFirebaseAuthSettings *other = (InternalFirebaseAuthSettings *)object; + return self.appVerificationDisabledForTesting == other.appVerificationDisabledForTesting && + FLTPigeonDeepEquals(self.userAccessGroup, other.userAccessGroup) && + FLTPigeonDeepEquals(self.phoneNumber, other.phoneNumber) && + FLTPigeonDeepEquals(self.smsCode, other.smsCode) && + FLTPigeonDeepEquals(self.forceRecaptchaFlow, other.forceRecaptchaFlow); +} + +- (NSUInteger)hash { + NSUInteger result = [self class].hash; + result = result * 31 + @(self.appVerificationDisabledForTesting).hash; + result = result * 31 + FLTPigeonDeepHash(self.userAccessGroup); + result = result * 31 + FLTPigeonDeepHash(self.phoneNumber); + result = result * 31 + FLTPigeonDeepHash(self.smsCode); + result = result * 31 + FLTPigeonDeepHash(self.forceRecaptchaFlow); + return result; +} @end -@implementation PigeonSignInProvider +@implementation InternalSignInProvider + (instancetype)makeWithProviderId:(NSString *)providerId scopes:(nullable NSArray *)scopes customParameters: (nullable NSDictionary *)customParameters { - PigeonSignInProvider *pigeonResult = [[PigeonSignInProvider alloc] init]; + InternalSignInProvider *pigeonResult = [[InternalSignInProvider alloc] init]; pigeonResult.providerId = providerId; pigeonResult.scopes = scopes; pigeonResult.customParameters = customParameters; return pigeonResult; } -+ (PigeonSignInProvider *)fromList:(NSArray *)list { - PigeonSignInProvider *pigeonResult = [[PigeonSignInProvider alloc] init]; ++ (InternalSignInProvider *)fromList:(NSArray *)list { + InternalSignInProvider *pigeonResult = [[InternalSignInProvider alloc] init]; pigeonResult.providerId = GetNullableObjectAtIndex(list, 0); pigeonResult.scopes = GetNullableObjectAtIndex(list, 1); pigeonResult.customParameters = GetNullableObjectAtIndex(list, 2); return pigeonResult; } -+ (nullable PigeonSignInProvider *)nullableFromList:(NSArray *)list { - return (list) ? [PigeonSignInProvider fromList:list] : nil; ++ (nullable InternalSignInProvider *)nullableFromList:(NSArray *)list { + return (list) ? [InternalSignInProvider fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ self.providerId ?: [NSNull null], self.scopes ?: [NSNull null], self.customParameters ?: [NSNull null], ]; } +- (BOOL)isEqual:(id)object { + if (self == object) { + return YES; + } + if (![object isKindOfClass:[self class]]) { + return NO; + } + InternalSignInProvider *other = (InternalSignInProvider *)object; + return FLTPigeonDeepEquals(self.providerId, other.providerId) && + FLTPigeonDeepEquals(self.scopes, other.scopes) && + FLTPigeonDeepEquals(self.customParameters, other.customParameters); +} + +- (NSUInteger)hash { + NSUInteger result = [self class].hash; + result = result * 31 + FLTPigeonDeepHash(self.providerId); + result = result * 31 + FLTPigeonDeepHash(self.scopes); + result = result * 31 + FLTPigeonDeepHash(self.customParameters); + return result; +} @end -@implementation PigeonVerifyPhoneNumberRequest +@implementation InternalVerifyPhoneNumberRequest + (instancetype)makeWithPhoneNumber:(nullable NSString *)phoneNumber timeout:(NSInteger)timeout forceResendingToken:(nullable NSNumber *)forceResendingToken autoRetrievedSmsCodeForTesting:(nullable NSString *)autoRetrievedSmsCodeForTesting multiFactorInfoId:(nullable NSString *)multiFactorInfoId multiFactorSessionId:(nullable NSString *)multiFactorSessionId { - PigeonVerifyPhoneNumberRequest *pigeonResult = [[PigeonVerifyPhoneNumberRequest alloc] init]; + InternalVerifyPhoneNumberRequest *pigeonResult = [[InternalVerifyPhoneNumberRequest alloc] init]; pigeonResult.phoneNumber = phoneNumber; pigeonResult.timeout = timeout; pigeonResult.forceResendingToken = forceResendingToken; @@ -633,8 +1093,8 @@ + (instancetype)makeWithPhoneNumber:(nullable NSString *)phoneNumber pigeonResult.multiFactorSessionId = multiFactorSessionId; return pigeonResult; } -+ (PigeonVerifyPhoneNumberRequest *)fromList:(NSArray *)list { - PigeonVerifyPhoneNumberRequest *pigeonResult = [[PigeonVerifyPhoneNumberRequest alloc] init]; ++ (InternalVerifyPhoneNumberRequest *)fromList:(NSArray *)list { + InternalVerifyPhoneNumberRequest *pigeonResult = [[InternalVerifyPhoneNumberRequest alloc] init]; pigeonResult.phoneNumber = GetNullableObjectAtIndex(list, 0); pigeonResult.timeout = [GetNullableObjectAtIndex(list, 1) integerValue]; pigeonResult.forceResendingToken = GetNullableObjectAtIndex(list, 2); @@ -643,10 +1103,10 @@ + (PigeonVerifyPhoneNumberRequest *)fromList:(NSArray *)list { pigeonResult.multiFactorSessionId = GetNullableObjectAtIndex(list, 5); return pigeonResult; } -+ (nullable PigeonVerifyPhoneNumberRequest *)nullableFromList:(NSArray *)list { - return (list) ? [PigeonVerifyPhoneNumberRequest fromList:list] : nil; ++ (nullable InternalVerifyPhoneNumberRequest *)nullableFromList:(NSArray *)list { + return (list) ? [InternalVerifyPhoneNumberRequest fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ self.phoneNumber ?: [NSNull null], @(self.timeout), @@ -656,9 +1116,36 @@ - (NSArray *)toList { self.multiFactorSessionId ?: [NSNull null], ]; } +- (BOOL)isEqual:(id)object { + if (self == object) { + return YES; + } + if (![object isKindOfClass:[self class]]) { + return NO; + } + InternalVerifyPhoneNumberRequest *other = (InternalVerifyPhoneNumberRequest *)object; + return FLTPigeonDeepEquals(self.phoneNumber, other.phoneNumber) && + self.timeout == other.timeout && + FLTPigeonDeepEquals(self.forceResendingToken, other.forceResendingToken) && + FLTPigeonDeepEquals(self.autoRetrievedSmsCodeForTesting, + other.autoRetrievedSmsCodeForTesting) && + FLTPigeonDeepEquals(self.multiFactorInfoId, other.multiFactorInfoId) && + FLTPigeonDeepEquals(self.multiFactorSessionId, other.multiFactorSessionId); +} + +- (NSUInteger)hash { + NSUInteger result = [self class].hash; + result = result * 31 + FLTPigeonDeepHash(self.phoneNumber); + result = result * 31 + @(self.timeout).hash; + result = result * 31 + FLTPigeonDeepHash(self.forceResendingToken); + result = result * 31 + FLTPigeonDeepHash(self.autoRetrievedSmsCodeForTesting); + result = result * 31 + FLTPigeonDeepHash(self.multiFactorInfoId); + result = result * 31 + FLTPigeonDeepHash(self.multiFactorSessionId); + return result; +} @end -@implementation PigeonIdTokenResult +@implementation InternalIdTokenResult + (instancetype)makeWithToken:(nullable NSString *)token expirationTimestamp:(nullable NSNumber *)expirationTimestamp authTimestamp:(nullable NSNumber *)authTimestamp @@ -666,7 +1153,7 @@ + (instancetype)makeWithToken:(nullable NSString *)token signInProvider:(nullable NSString *)signInProvider claims:(nullable NSDictionary *)claims signInSecondFactor:(nullable NSString *)signInSecondFactor { - PigeonIdTokenResult *pigeonResult = [[PigeonIdTokenResult alloc] init]; + InternalIdTokenResult *pigeonResult = [[InternalIdTokenResult alloc] init]; pigeonResult.token = token; pigeonResult.expirationTimestamp = expirationTimestamp; pigeonResult.authTimestamp = authTimestamp; @@ -676,8 +1163,8 @@ + (instancetype)makeWithToken:(nullable NSString *)token pigeonResult.signInSecondFactor = signInSecondFactor; return pigeonResult; } -+ (PigeonIdTokenResult *)fromList:(NSArray *)list { - PigeonIdTokenResult *pigeonResult = [[PigeonIdTokenResult alloc] init]; ++ (InternalIdTokenResult *)fromList:(NSArray *)list { + InternalIdTokenResult *pigeonResult = [[InternalIdTokenResult alloc] init]; pigeonResult.token = GetNullableObjectAtIndex(list, 0); pigeonResult.expirationTimestamp = GetNullableObjectAtIndex(list, 1); pigeonResult.authTimestamp = GetNullableObjectAtIndex(list, 2); @@ -687,10 +1174,10 @@ + (PigeonIdTokenResult *)fromList:(NSArray *)list { pigeonResult.signInSecondFactor = GetNullableObjectAtIndex(list, 6); return pigeonResult; } -+ (nullable PigeonIdTokenResult *)nullableFromList:(NSArray *)list { - return (list) ? [PigeonIdTokenResult fromList:list] : nil; ++ (nullable InternalIdTokenResult *)nullableFromList:(NSArray *)list { + return (list) ? [InternalIdTokenResult fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ self.token ?: [NSNull null], self.expirationTimestamp ?: [NSNull null], @@ -701,32 +1188,60 @@ - (NSArray *)toList { self.signInSecondFactor ?: [NSNull null], ]; } -@end - -@implementation PigeonUserProfile +- (BOOL)isEqual:(id)object { + if (self == object) { + return YES; + } + if (![object isKindOfClass:[self class]]) { + return NO; + } + InternalIdTokenResult *other = (InternalIdTokenResult *)object; + return FLTPigeonDeepEquals(self.token, other.token) && + FLTPigeonDeepEquals(self.expirationTimestamp, other.expirationTimestamp) && + FLTPigeonDeepEquals(self.authTimestamp, other.authTimestamp) && + FLTPigeonDeepEquals(self.issuedAtTimestamp, other.issuedAtTimestamp) && + FLTPigeonDeepEquals(self.signInProvider, other.signInProvider) && + FLTPigeonDeepEquals(self.claims, other.claims) && + FLTPigeonDeepEquals(self.signInSecondFactor, other.signInSecondFactor); +} + +- (NSUInteger)hash { + NSUInteger result = [self class].hash; + result = result * 31 + FLTPigeonDeepHash(self.token); + result = result * 31 + FLTPigeonDeepHash(self.expirationTimestamp); + result = result * 31 + FLTPigeonDeepHash(self.authTimestamp); + result = result * 31 + FLTPigeonDeepHash(self.issuedAtTimestamp); + result = result * 31 + FLTPigeonDeepHash(self.signInProvider); + result = result * 31 + FLTPigeonDeepHash(self.claims); + result = result * 31 + FLTPigeonDeepHash(self.signInSecondFactor); + return result; +} +@end + +@implementation InternalUserProfile + (instancetype)makeWithDisplayName:(nullable NSString *)displayName photoUrl:(nullable NSString *)photoUrl displayNameChanged:(BOOL)displayNameChanged photoUrlChanged:(BOOL)photoUrlChanged { - PigeonUserProfile *pigeonResult = [[PigeonUserProfile alloc] init]; + InternalUserProfile *pigeonResult = [[InternalUserProfile alloc] init]; pigeonResult.displayName = displayName; pigeonResult.photoUrl = photoUrl; pigeonResult.displayNameChanged = displayNameChanged; pigeonResult.photoUrlChanged = photoUrlChanged; return pigeonResult; } -+ (PigeonUserProfile *)fromList:(NSArray *)list { - PigeonUserProfile *pigeonResult = [[PigeonUserProfile alloc] init]; ++ (InternalUserProfile *)fromList:(NSArray *)list { + InternalUserProfile *pigeonResult = [[InternalUserProfile alloc] init]; pigeonResult.displayName = GetNullableObjectAtIndex(list, 0); pigeonResult.photoUrl = GetNullableObjectAtIndex(list, 1); pigeonResult.displayNameChanged = [GetNullableObjectAtIndex(list, 2) boolValue]; pigeonResult.photoUrlChanged = [GetNullableObjectAtIndex(list, 3) boolValue]; return pigeonResult; } -+ (nullable PigeonUserProfile *)nullableFromList:(NSArray *)list { - return (list) ? [PigeonUserProfile fromList:list] : nil; ++ (nullable InternalUserProfile *)nullableFromList:(NSArray *)list { + return (list) ? [InternalUserProfile fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ self.displayName ?: [NSNull null], self.photoUrl ?: [NSNull null], @@ -734,15 +1249,37 @@ - (NSArray *)toList { @(self.photoUrlChanged), ]; } +- (BOOL)isEqual:(id)object { + if (self == object) { + return YES; + } + if (![object isKindOfClass:[self class]]) { + return NO; + } + InternalUserProfile *other = (InternalUserProfile *)object; + return FLTPigeonDeepEquals(self.displayName, other.displayName) && + FLTPigeonDeepEquals(self.photoUrl, other.photoUrl) && + self.displayNameChanged == other.displayNameChanged && + self.photoUrlChanged == other.photoUrlChanged; +} + +- (NSUInteger)hash { + NSUInteger result = [self class].hash; + result = result * 31 + FLTPigeonDeepHash(self.displayName); + result = result * 31 + FLTPigeonDeepHash(self.photoUrl); + result = result * 31 + @(self.displayNameChanged).hash; + result = result * 31 + @(self.photoUrlChanged).hash; + return result; +} @end -@implementation PigeonTotpSecret +@implementation InternalTotpSecret + (instancetype)makeWithCodeIntervalSeconds:(nullable NSNumber *)codeIntervalSeconds codeLength:(nullable NSNumber *)codeLength enrollmentCompletionDeadline:(nullable NSNumber *)enrollmentCompletionDeadline hashingAlgorithm:(nullable NSString *)hashingAlgorithm secretKey:(NSString *)secretKey { - PigeonTotpSecret *pigeonResult = [[PigeonTotpSecret alloc] init]; + InternalTotpSecret *pigeonResult = [[InternalTotpSecret alloc] init]; pigeonResult.codeIntervalSeconds = codeIntervalSeconds; pigeonResult.codeLength = codeLength; pigeonResult.enrollmentCompletionDeadline = enrollmentCompletionDeadline; @@ -750,8 +1287,8 @@ + (instancetype)makeWithCodeIntervalSeconds:(nullable NSNumber *)codeIntervalSec pigeonResult.secretKey = secretKey; return pigeonResult; } -+ (PigeonTotpSecret *)fromList:(NSArray *)list { - PigeonTotpSecret *pigeonResult = [[PigeonTotpSecret alloc] init]; ++ (InternalTotpSecret *)fromList:(NSArray *)list { + InternalTotpSecret *pigeonResult = [[InternalTotpSecret alloc] init]; pigeonResult.codeIntervalSeconds = GetNullableObjectAtIndex(list, 0); pigeonResult.codeLength = GetNullableObjectAtIndex(list, 1); pigeonResult.enrollmentCompletionDeadline = GetNullableObjectAtIndex(list, 2); @@ -759,10 +1296,10 @@ + (PigeonTotpSecret *)fromList:(NSArray *)list { pigeonResult.secretKey = GetNullableObjectAtIndex(list, 4); return pigeonResult; } -+ (nullable PigeonTotpSecret *)nullableFromList:(NSArray *)list { - return (list) ? [PigeonTotpSecret fromList:list] : nil; ++ (nullable InternalTotpSecret *)nullableFromList:(NSArray *)list { + return (list) ? [InternalTotpSecret fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ self.codeIntervalSeconds ?: [NSNull null], self.codeLength ?: [NSNull null], @@ -771,141 +1308,180 @@ - (NSArray *)toList { self.secretKey ?: [NSNull null], ]; } +- (BOOL)isEqual:(id)object { + if (self == object) { + return YES; + } + if (![object isKindOfClass:[self class]]) { + return NO; + } + InternalTotpSecret *other = (InternalTotpSecret *)object; + return FLTPigeonDeepEquals(self.codeIntervalSeconds, other.codeIntervalSeconds) && + FLTPigeonDeepEquals(self.codeLength, other.codeLength) && + FLTPigeonDeepEquals(self.enrollmentCompletionDeadline, + other.enrollmentCompletionDeadline) && + FLTPigeonDeepEquals(self.hashingAlgorithm, other.hashingAlgorithm) && + FLTPigeonDeepEquals(self.secretKey, other.secretKey); +} + +- (NSUInteger)hash { + NSUInteger result = [self class].hash; + result = result * 31 + FLTPigeonDeepHash(self.codeIntervalSeconds); + result = result * 31 + FLTPigeonDeepHash(self.codeLength); + result = result * 31 + FLTPigeonDeepHash(self.enrollmentCompletionDeadline); + result = result * 31 + FLTPigeonDeepHash(self.hashingAlgorithm); + result = result * 31 + FLTPigeonDeepHash(self.secretKey); + return result; +} @end -@interface FirebaseAuthHostApiCodecReader : FlutterStandardReader +@interface nullFirebaseAuthMessagesPigeonCodecReader : FlutterStandardReader @end -@implementation FirebaseAuthHostApiCodecReader +@implementation nullFirebaseAuthMessagesPigeonCodecReader - (nullable id)readValueOfType:(UInt8)type { switch (type) { - case 128: - return [AuthPigeonFirebaseApp fromList:[self readValue]]; - case 129: - return [PigeonActionCodeInfo fromList:[self readValue]]; + case 129: { + NSNumber *enumAsNumber = [self readValue]; + return enumAsNumber == nil + ? nil + : [[ActionCodeInfoOperationBox alloc] initWithValue:[enumAsNumber integerValue]]; + } case 130: - return [PigeonActionCodeInfoData fromList:[self readValue]]; + return [InternalMultiFactorSession fromList:[self readValue]]; case 131: - return [PigeonActionCodeSettings fromList:[self readValue]]; + return [InternalPhoneMultiFactorAssertion fromList:[self readValue]]; case 132: - return [PigeonAdditionalUserInfo fromList:[self readValue]]; + return [InternalMultiFactorInfo fromList:[self readValue]]; case 133: - return [PigeonAuthCredential fromList:[self readValue]]; + return [AuthPigeonFirebaseApp fromList:[self readValue]]; case 134: - return [PigeonFirebaseAuthSettings fromList:[self readValue]]; + return [InternalActionCodeInfoData fromList:[self readValue]]; case 135: - return [PigeonIdTokenResult fromList:[self readValue]]; + return [InternalActionCodeInfo fromList:[self readValue]]; case 136: - return [PigeonMultiFactorInfo fromList:[self readValue]]; + return [InternalAdditionalUserInfo fromList:[self readValue]]; case 137: - return [PigeonMultiFactorSession fromList:[self readValue]]; + return [InternalAuthCredential fromList:[self readValue]]; case 138: - return [PigeonPhoneMultiFactorAssertion fromList:[self readValue]]; + return [InternalUserInfo fromList:[self readValue]]; case 139: - return [PigeonSignInProvider fromList:[self readValue]]; + return [InternalUserDetails fromList:[self readValue]]; case 140: - return [PigeonTotpSecret fromList:[self readValue]]; + return [InternalUserCredential fromList:[self readValue]]; case 141: - return [PigeonUserCredential fromList:[self readValue]]; + return [InternalAuthCredentialInput fromList:[self readValue]]; case 142: - return [PigeonUserDetails fromList:[self readValue]]; + return [InternalActionCodeSettings fromList:[self readValue]]; case 143: - return [PigeonUserInfo fromList:[self readValue]]; + return [InternalFirebaseAuthSettings fromList:[self readValue]]; case 144: - return [PigeonUserProfile fromList:[self readValue]]; + return [InternalSignInProvider fromList:[self readValue]]; case 145: - return [PigeonVerifyPhoneNumberRequest fromList:[self readValue]]; + return [InternalVerifyPhoneNumberRequest fromList:[self readValue]]; + case 146: + return [InternalIdTokenResult fromList:[self readValue]]; + case 147: + return [InternalUserProfile fromList:[self readValue]]; + case 148: + return [InternalTotpSecret fromList:[self readValue]]; default: return [super readValueOfType:type]; } } @end -@interface FirebaseAuthHostApiCodecWriter : FlutterStandardWriter +@interface nullFirebaseAuthMessagesPigeonCodecWriter : FlutterStandardWriter @end -@implementation FirebaseAuthHostApiCodecWriter +@implementation nullFirebaseAuthMessagesPigeonCodecWriter - (void)writeValue:(id)value { - if ([value isKindOfClass:[AuthPigeonFirebaseApp class]]) { - [self writeByte:128]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonActionCodeInfo class]]) { + if ([value isKindOfClass:[ActionCodeInfoOperationBox class]]) { + ActionCodeInfoOperationBox *box = (ActionCodeInfoOperationBox *)value; [self writeByte:129]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonActionCodeInfoData class]]) { + [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; + } else if ([value isKindOfClass:[InternalMultiFactorSession class]]) { [self writeByte:130]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonActionCodeSettings class]]) { + } else if ([value isKindOfClass:[InternalPhoneMultiFactorAssertion class]]) { [self writeByte:131]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonAdditionalUserInfo class]]) { + } else if ([value isKindOfClass:[InternalMultiFactorInfo class]]) { [self writeByte:132]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonAuthCredential class]]) { + } else if ([value isKindOfClass:[AuthPigeonFirebaseApp class]]) { [self writeByte:133]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonFirebaseAuthSettings class]]) { + } else if ([value isKindOfClass:[InternalActionCodeInfoData class]]) { [self writeByte:134]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonIdTokenResult class]]) { + } else if ([value isKindOfClass:[InternalActionCodeInfo class]]) { [self writeByte:135]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonMultiFactorInfo class]]) { + } else if ([value isKindOfClass:[InternalAdditionalUserInfo class]]) { [self writeByte:136]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonMultiFactorSession class]]) { + } else if ([value isKindOfClass:[InternalAuthCredential class]]) { [self writeByte:137]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonPhoneMultiFactorAssertion class]]) { + } else if ([value isKindOfClass:[InternalUserInfo class]]) { [self writeByte:138]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonSignInProvider class]]) { + } else if ([value isKindOfClass:[InternalUserDetails class]]) { [self writeByte:139]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonTotpSecret class]]) { + } else if ([value isKindOfClass:[InternalUserCredential class]]) { [self writeByte:140]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonUserCredential class]]) { + } else if ([value isKindOfClass:[InternalAuthCredentialInput class]]) { [self writeByte:141]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonUserDetails class]]) { + } else if ([value isKindOfClass:[InternalActionCodeSettings class]]) { [self writeByte:142]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonUserInfo class]]) { + } else if ([value isKindOfClass:[InternalFirebaseAuthSettings class]]) { [self writeByte:143]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonUserProfile class]]) { + } else if ([value isKindOfClass:[InternalSignInProvider class]]) { [self writeByte:144]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonVerifyPhoneNumberRequest class]]) { + } else if ([value isKindOfClass:[InternalVerifyPhoneNumberRequest class]]) { [self writeByte:145]; [self writeValue:[value toList]]; + } else if ([value isKindOfClass:[InternalIdTokenResult class]]) { + [self writeByte:146]; + [self writeValue:[value toList]]; + } else if ([value isKindOfClass:[InternalUserProfile class]]) { + [self writeByte:147]; + [self writeValue:[value toList]]; + } else if ([value isKindOfClass:[InternalTotpSecret class]]) { + [self writeByte:148]; + [self writeValue:[value toList]]; } else { [super writeValue:value]; } } @end -@interface FirebaseAuthHostApiCodecReaderWriter : FlutterStandardReaderWriter +@interface nullFirebaseAuthMessagesPigeonCodecReaderWriter : FlutterStandardReaderWriter @end -@implementation FirebaseAuthHostApiCodecReaderWriter +@implementation nullFirebaseAuthMessagesPigeonCodecReaderWriter - (FlutterStandardWriter *)writerWithData:(NSMutableData *)data { - return [[FirebaseAuthHostApiCodecWriter alloc] initWithData:data]; + return [[nullFirebaseAuthMessagesPigeonCodecWriter alloc] initWithData:data]; } - (FlutterStandardReader *)readerWithData:(NSData *)data { - return [[FirebaseAuthHostApiCodecReader alloc] initWithData:data]; + return [[nullFirebaseAuthMessagesPigeonCodecReader alloc] initWithData:data]; } @end -NSObject *FirebaseAuthHostApiGetCodec(void) { +NSObject *nullGetFirebaseAuthMessagesCodec(void) { static FlutterStandardMessageCodec *sSharedObject = nil; static dispatch_once_t sPred = 0; dispatch_once(&sPred, ^{ - FirebaseAuthHostApiCodecReaderWriter *readerWriter = - [[FirebaseAuthHostApiCodecReaderWriter alloc] init]; + nullFirebaseAuthMessagesPigeonCodecReaderWriter *readerWriter = + [[nullFirebaseAuthMessagesPigeonCodecReaderWriter alloc] init]; sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; }); return sSharedObject; } - void SetUpFirebaseAuthHostApi(id binaryMessenger, NSObject *api) { SetUpFirebaseAuthHostApiWithSuffix(binaryMessenger, api, @""); @@ -925,14 +1501,14 @@ void SetUpFirebaseAuthHostApiWithSuffix(id binaryMesseng @"FirebaseAuthHostApi.registerIdTokenListener", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseAuthHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(registerIdTokenListenerApp:completion:)], @"FirebaseAuthHostApi api (%@) doesn't respond to " @"@selector(registerIdTokenListenerApp:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; AuthPigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); [api registerIdTokenListenerApp:arg_app completion:^(NSString *_Nullable output, @@ -952,14 +1528,14 @@ void SetUpFirebaseAuthHostApiWithSuffix(id binaryMesseng @"FirebaseAuthHostApi.registerAuthStateListener", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseAuthHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(registerAuthStateListenerApp:completion:)], @"FirebaseAuthHostApi api (%@) doesn't respond to " @"@selector(registerAuthStateListenerApp:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; AuthPigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); [api registerAuthStateListenerApp:arg_app completion:^(NSString *_Nullable output, @@ -978,14 +1554,14 @@ void SetUpFirebaseAuthHostApiWithSuffix(id binaryMesseng @"interface.FirebaseAuthHostApi.useEmulator", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseAuthHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(useEmulatorApp:host:port:completion:)], @"FirebaseAuthHostApi api (%@) doesn't respond to " @"@selector(useEmulatorApp:host:port:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; AuthPigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); NSString *arg_host = GetNullableObjectAtIndex(args, 1); NSInteger arg_port = [GetNullableObjectAtIndex(args, 2) integerValue]; @@ -1007,14 +1583,14 @@ void SetUpFirebaseAuthHostApiWithSuffix(id binaryMesseng @"interface.FirebaseAuthHostApi.applyActionCode", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseAuthHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(applyActionCodeApp:code:completion:)], @"FirebaseAuthHostApi api (%@) doesn't respond to " @"@selector(applyActionCodeApp:code:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; AuthPigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); NSString *arg_code = GetNullableObjectAtIndex(args, 1); [api applyActionCodeApp:arg_app @@ -1034,19 +1610,19 @@ void SetUpFirebaseAuthHostApiWithSuffix(id binaryMesseng @"interface.FirebaseAuthHostApi.checkActionCode", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseAuthHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(checkActionCodeApp:code:completion:)], @"FirebaseAuthHostApi api (%@) doesn't respond to " @"@selector(checkActionCodeApp:code:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; AuthPigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); NSString *arg_code = GetNullableObjectAtIndex(args, 1); [api checkActionCodeApp:arg_app code:arg_code - completion:^(PigeonActionCodeInfo *_Nullable output, + completion:^(InternalActionCodeInfo *_Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; @@ -1063,7 +1639,7 @@ void SetUpFirebaseAuthHostApiWithSuffix(id binaryMesseng @"FirebaseAuthHostApi.confirmPasswordReset", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseAuthHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert( [api respondsToSelector:@selector(confirmPasswordResetApp:code:newPassword:completion:)], @@ -1071,7 +1647,7 @@ void SetUpFirebaseAuthHostApiWithSuffix(id binaryMesseng @"@selector(confirmPasswordResetApp:code:newPassword:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; AuthPigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); NSString *arg_code = GetNullableObjectAtIndex(args, 1); NSString *arg_newPassword = GetNullableObjectAtIndex(args, 2); @@ -1094,7 +1670,7 @@ void SetUpFirebaseAuthHostApiWithSuffix(id binaryMesseng @"FirebaseAuthHostApi.createUserWithEmailAndPassword", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseAuthHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert( [api @@ -1104,14 +1680,14 @@ void SetUpFirebaseAuthHostApiWithSuffix(id binaryMesseng @"@selector(createUserWithEmailAndPasswordApp:email:password:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; AuthPigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); NSString *arg_email = GetNullableObjectAtIndex(args, 1); NSString *arg_password = GetNullableObjectAtIndex(args, 2); [api createUserWithEmailAndPasswordApp:arg_app email:arg_email password:arg_password - completion:^(PigeonUserCredential *_Nullable output, + completion:^(InternalUserCredential *_Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; @@ -1128,17 +1704,17 @@ void SetUpFirebaseAuthHostApiWithSuffix(id binaryMesseng @"FirebaseAuthHostApi.signInAnonymously", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseAuthHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(signInAnonymouslyApp:completion:)], @"FirebaseAuthHostApi api (%@) doesn't respond to " @"@selector(signInAnonymouslyApp:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; AuthPigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); [api signInAnonymouslyApp:arg_app - completion:^(PigeonUserCredential *_Nullable output, + completion:^(InternalUserCredential *_Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; @@ -1155,19 +1731,19 @@ void SetUpFirebaseAuthHostApiWithSuffix(id binaryMesseng @"FirebaseAuthHostApi.signInWithCredential", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseAuthHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(signInWithCredentialApp:input:completion:)], @"FirebaseAuthHostApi api (%@) doesn't respond to " @"@selector(signInWithCredentialApp:input:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; AuthPigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); NSDictionary *arg_input = GetNullableObjectAtIndex(args, 1); [api signInWithCredentialApp:arg_app input:arg_input - completion:^(PigeonUserCredential *_Nullable output, + completion:^(InternalUserCredential *_Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; @@ -1184,19 +1760,19 @@ void SetUpFirebaseAuthHostApiWithSuffix(id binaryMesseng @"FirebaseAuthHostApi.signInWithCustomToken", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseAuthHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(signInWithCustomTokenApp:token:completion:)], @"FirebaseAuthHostApi api (%@) doesn't respond to " @"@selector(signInWithCustomTokenApp:token:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; AuthPigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); NSString *arg_token = GetNullableObjectAtIndex(args, 1); [api signInWithCustomTokenApp:arg_app token:arg_token - completion:^(PigeonUserCredential *_Nullable output, + completion:^(InternalUserCredential *_Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; @@ -1213,7 +1789,7 @@ void SetUpFirebaseAuthHostApiWithSuffix(id binaryMesseng @"FirebaseAuthHostApi.signInWithEmailAndPassword", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseAuthHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert( [api respondsToSelector:@selector( @@ -1222,14 +1798,14 @@ void SetUpFirebaseAuthHostApiWithSuffix(id binaryMesseng @"@selector(signInWithEmailAndPasswordApp:email:password:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; AuthPigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); NSString *arg_email = GetNullableObjectAtIndex(args, 1); NSString *arg_password = GetNullableObjectAtIndex(args, 2); [api signInWithEmailAndPasswordApp:arg_app email:arg_email password:arg_password - completion:^(PigeonUserCredential *_Nullable output, + completion:^(InternalUserCredential *_Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; @@ -1246,7 +1822,7 @@ void SetUpFirebaseAuthHostApiWithSuffix(id binaryMesseng @"FirebaseAuthHostApi.signInWithEmailLink", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseAuthHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert( [api respondsToSelector:@selector(signInWithEmailLinkApp:email:emailLink:completion:)], @@ -1254,14 +1830,14 @@ void SetUpFirebaseAuthHostApiWithSuffix(id binaryMesseng @"@selector(signInWithEmailLinkApp:email:emailLink:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; AuthPigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); NSString *arg_email = GetNullableObjectAtIndex(args, 1); NSString *arg_emailLink = GetNullableObjectAtIndex(args, 2); [api signInWithEmailLinkApp:arg_app email:arg_email emailLink:arg_emailLink - completion:^(PigeonUserCredential *_Nullable output, + completion:^(InternalUserCredential *_Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; @@ -1278,7 +1854,7 @@ void SetUpFirebaseAuthHostApiWithSuffix(id binaryMesseng @"FirebaseAuthHostApi.signInWithProvider", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseAuthHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert( [api respondsToSelector:@selector(signInWithProviderApp:signInProvider:completion:)], @@ -1286,12 +1862,12 @@ void SetUpFirebaseAuthHostApiWithSuffix(id binaryMesseng @"@selector(signInWithProviderApp:signInProvider:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; AuthPigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); - PigeonSignInProvider *arg_signInProvider = GetNullableObjectAtIndex(args, 1); + InternalSignInProvider *arg_signInProvider = GetNullableObjectAtIndex(args, 1); [api signInWithProviderApp:arg_app signInProvider:arg_signInProvider - completion:^(PigeonUserCredential *_Nullable output, + completion:^(InternalUserCredential *_Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; @@ -1307,14 +1883,14 @@ void SetUpFirebaseAuthHostApiWithSuffix(id binaryMesseng @"interface.FirebaseAuthHostApi.signOut", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseAuthHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert( [api respondsToSelector:@selector(signOutApp:completion:)], @"FirebaseAuthHostApi api (%@) doesn't respond to @selector(signOutApp:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; AuthPigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); [api signOutApp:arg_app completion:^(FlutterError *_Nullable error) { @@ -1333,14 +1909,14 @@ void SetUpFirebaseAuthHostApiWithSuffix(id binaryMesseng @"FirebaseAuthHostApi.fetchSignInMethodsForEmail", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseAuthHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(fetchSignInMethodsForEmailApp:email:completion:)], @"FirebaseAuthHostApi api (%@) doesn't respond to " @"@selector(fetchSignInMethodsForEmailApp:email:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; AuthPigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); NSString *arg_email = GetNullableObjectAtIndex(args, 1); [api fetchSignInMethodsForEmailApp:arg_app @@ -1362,7 +1938,7 @@ void SetUpFirebaseAuthHostApiWithSuffix(id binaryMesseng @"FirebaseAuthHostApi.sendPasswordResetEmail", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseAuthHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector: @selector(sendPasswordResetEmailApp:email:actionCodeSettings:completion:)], @@ -1370,10 +1946,10 @@ void SetUpFirebaseAuthHostApiWithSuffix(id binaryMesseng @"@selector(sendPasswordResetEmailApp:email:actionCodeSettings:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; AuthPigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); NSString *arg_email = GetNullableObjectAtIndex(args, 1); - PigeonActionCodeSettings *arg_actionCodeSettings = GetNullableObjectAtIndex(args, 2); + InternalActionCodeSettings *arg_actionCodeSettings = GetNullableObjectAtIndex(args, 2); [api sendPasswordResetEmailApp:arg_app email:arg_email actionCodeSettings:arg_actionCodeSettings @@ -1393,7 +1969,7 @@ void SetUpFirebaseAuthHostApiWithSuffix(id binaryMesseng @"FirebaseAuthHostApi.sendSignInLinkToEmail", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseAuthHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector: @selector(sendSignInLinkToEmailApp:email:actionCodeSettings:completion:)], @@ -1401,10 +1977,10 @@ void SetUpFirebaseAuthHostApiWithSuffix(id binaryMesseng @"@selector(sendSignInLinkToEmailApp:email:actionCodeSettings:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; AuthPigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); NSString *arg_email = GetNullableObjectAtIndex(args, 1); - PigeonActionCodeSettings *arg_actionCodeSettings = GetNullableObjectAtIndex(args, 2); + InternalActionCodeSettings *arg_actionCodeSettings = GetNullableObjectAtIndex(args, 2); [api sendSignInLinkToEmailApp:arg_app email:arg_email actionCodeSettings:arg_actionCodeSettings @@ -1423,14 +1999,14 @@ void SetUpFirebaseAuthHostApiWithSuffix(id binaryMesseng @"interface.FirebaseAuthHostApi.setLanguageCode", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseAuthHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(setLanguageCodeApp:languageCode:completion:)], @"FirebaseAuthHostApi api (%@) doesn't respond to " @"@selector(setLanguageCodeApp:languageCode:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; AuthPigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); NSString *arg_languageCode = GetNullableObjectAtIndex(args, 1); [api setLanguageCodeApp:arg_app @@ -1450,16 +2026,16 @@ void SetUpFirebaseAuthHostApiWithSuffix(id binaryMesseng @"interface.FirebaseAuthHostApi.setSettings", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseAuthHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(setSettingsApp:settings:completion:)], @"FirebaseAuthHostApi api (%@) doesn't respond to " @"@selector(setSettingsApp:settings:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; AuthPigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); - PigeonFirebaseAuthSettings *arg_settings = GetNullableObjectAtIndex(args, 1); + InternalFirebaseAuthSettings *arg_settings = GetNullableObjectAtIndex(args, 1); [api setSettingsApp:arg_app settings:arg_settings completion:^(FlutterError *_Nullable error) { @@ -1478,14 +2054,14 @@ void SetUpFirebaseAuthHostApiWithSuffix(id binaryMesseng @"FirebaseAuthHostApi.verifyPasswordResetCode", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseAuthHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(verifyPasswordResetCodeApp:code:completion:)], @"FirebaseAuthHostApi api (%@) doesn't respond to " @"@selector(verifyPasswordResetCodeApp:code:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; AuthPigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); NSString *arg_code = GetNullableObjectAtIndex(args, 1); [api verifyPasswordResetCodeApp:arg_app @@ -1507,16 +2083,16 @@ void SetUpFirebaseAuthHostApiWithSuffix(id binaryMesseng @"FirebaseAuthHostApi.verifyPhoneNumber", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseAuthHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(verifyPhoneNumberApp:request:completion:)], @"FirebaseAuthHostApi api (%@) doesn't respond to " @"@selector(verifyPhoneNumberApp:request:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; AuthPigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); - PigeonVerifyPhoneNumberRequest *arg_request = GetNullableObjectAtIndex(args, 1); + InternalVerifyPhoneNumberRequest *arg_request = GetNullableObjectAtIndex(args, 1); [api verifyPhoneNumberApp:arg_app request:arg_request completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { @@ -1535,7 +2111,7 @@ void SetUpFirebaseAuthHostApiWithSuffix(id binaryMesseng @"FirebaseAuthHostApi.revokeTokenWithAuthorizationCode", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseAuthHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(revokeTokenWithAuthorizationCodeApp: authorizationCode:completion:)], @@ -1543,7 +2119,7 @@ void SetUpFirebaseAuthHostApiWithSuffix(id binaryMesseng @"@selector(revokeTokenWithAuthorizationCodeApp:authorizationCode:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; AuthPigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); NSString *arg_authorizationCode = GetNullableObjectAtIndex(args, 1); [api revokeTokenWithAuthorizationCodeApp:arg_app @@ -1556,6 +2132,34 @@ void SetUpFirebaseAuthHostApiWithSuffix(id binaryMesseng [channel setMessageHandler:nil]; } } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.firebase_auth_platform_interface." + @"FirebaseAuthHostApi.revokeAccessToken", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:nullGetFirebaseAuthMessagesCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(revokeAccessTokenApp:accessToken:completion:)], + @"FirebaseAuthHostApi api (%@) doesn't respond to " + @"@selector(revokeAccessTokenApp:accessToken:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + AuthPigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); + NSString *arg_accessToken = GetNullableObjectAtIndex(args, 1); + [api revokeAccessTokenApp:arg_app + accessToken:arg_accessToken + completion:^(FlutterError *_Nullable error) { + callback(wrapResult(nil, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString @@ -1564,14 +2168,14 @@ void SetUpFirebaseAuthHostApiWithSuffix(id binaryMesseng @"FirebaseAuthHostApi.initializeRecaptchaConfig", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseAuthHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(initializeRecaptchaConfigApp:completion:)], @"FirebaseAuthHostApi api (%@) doesn't respond to " @"@selector(initializeRecaptchaConfigApp:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; AuthPigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); [api initializeRecaptchaConfigApp:arg_app completion:^(FlutterError *_Nullable error) { @@ -1583,139 +2187,6 @@ void SetUpFirebaseAuthHostApiWithSuffix(id binaryMesseng } } } -@interface FirebaseAuthUserHostApiCodecReader : FlutterStandardReader -@end -@implementation FirebaseAuthUserHostApiCodecReader -- (nullable id)readValueOfType:(UInt8)type { - switch (type) { - case 128: - return [AuthPigeonFirebaseApp fromList:[self readValue]]; - case 129: - return [PigeonActionCodeInfo fromList:[self readValue]]; - case 130: - return [PigeonActionCodeInfoData fromList:[self readValue]]; - case 131: - return [PigeonActionCodeSettings fromList:[self readValue]]; - case 132: - return [PigeonAdditionalUserInfo fromList:[self readValue]]; - case 133: - return [PigeonAuthCredential fromList:[self readValue]]; - case 134: - return [PigeonFirebaseAuthSettings fromList:[self readValue]]; - case 135: - return [PigeonIdTokenResult fromList:[self readValue]]; - case 136: - return [PigeonMultiFactorInfo fromList:[self readValue]]; - case 137: - return [PigeonMultiFactorSession fromList:[self readValue]]; - case 138: - return [PigeonPhoneMultiFactorAssertion fromList:[self readValue]]; - case 139: - return [PigeonSignInProvider fromList:[self readValue]]; - case 140: - return [PigeonTotpSecret fromList:[self readValue]]; - case 141: - return [PigeonUserCredential fromList:[self readValue]]; - case 142: - return [PigeonUserDetails fromList:[self readValue]]; - case 143: - return [PigeonUserInfo fromList:[self readValue]]; - case 144: - return [PigeonUserProfile fromList:[self readValue]]; - case 145: - return [PigeonVerifyPhoneNumberRequest fromList:[self readValue]]; - default: - return [super readValueOfType:type]; - } -} -@end - -@interface FirebaseAuthUserHostApiCodecWriter : FlutterStandardWriter -@end -@implementation FirebaseAuthUserHostApiCodecWriter -- (void)writeValue:(id)value { - if ([value isKindOfClass:[AuthPigeonFirebaseApp class]]) { - [self writeByte:128]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonActionCodeInfo class]]) { - [self writeByte:129]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonActionCodeInfoData class]]) { - [self writeByte:130]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonActionCodeSettings class]]) { - [self writeByte:131]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonAdditionalUserInfo class]]) { - [self writeByte:132]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonAuthCredential class]]) { - [self writeByte:133]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonFirebaseAuthSettings class]]) { - [self writeByte:134]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonIdTokenResult class]]) { - [self writeByte:135]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonMultiFactorInfo class]]) { - [self writeByte:136]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonMultiFactorSession class]]) { - [self writeByte:137]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonPhoneMultiFactorAssertion class]]) { - [self writeByte:138]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonSignInProvider class]]) { - [self writeByte:139]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonTotpSecret class]]) { - [self writeByte:140]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonUserCredential class]]) { - [self writeByte:141]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonUserDetails class]]) { - [self writeByte:142]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonUserInfo class]]) { - [self writeByte:143]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonUserProfile class]]) { - [self writeByte:144]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonVerifyPhoneNumberRequest class]]) { - [self writeByte:145]; - [self writeValue:[value toList]]; - } else { - [super writeValue:value]; - } -} -@end - -@interface FirebaseAuthUserHostApiCodecReaderWriter : FlutterStandardReaderWriter -@end -@implementation FirebaseAuthUserHostApiCodecReaderWriter -- (FlutterStandardWriter *)writerWithData:(NSMutableData *)data { - return [[FirebaseAuthUserHostApiCodecWriter alloc] initWithData:data]; -} -- (FlutterStandardReader *)readerWithData:(NSData *)data { - return [[FirebaseAuthUserHostApiCodecReader alloc] initWithData:data]; -} -@end - -NSObject *FirebaseAuthUserHostApiGetCodec(void) { - static FlutterStandardMessageCodec *sSharedObject = nil; - static dispatch_once_t sPred = 0; - dispatch_once(&sPred, ^{ - FirebaseAuthUserHostApiCodecReaderWriter *readerWriter = - [[FirebaseAuthUserHostApiCodecReaderWriter alloc] init]; - sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; - }); - return sSharedObject; -} - void SetUpFirebaseAuthUserHostApi(id binaryMessenger, NSObject *api) { SetUpFirebaseAuthUserHostApiWithSuffix(binaryMessenger, api, @""); @@ -1734,14 +2205,14 @@ void SetUpFirebaseAuthUserHostApiWithSuffix(id binaryMes @"interface.FirebaseAuthUserHostApi.delete", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseAuthUserHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert( [api respondsToSelector:@selector(deleteApp:completion:)], @"FirebaseAuthUserHostApi api (%@) doesn't respond to @selector(deleteApp:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; AuthPigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); [api deleteApp:arg_app completion:^(FlutterError *_Nullable error) { @@ -1759,19 +2230,20 @@ void SetUpFirebaseAuthUserHostApiWithSuffix(id binaryMes @"interface.FirebaseAuthUserHostApi.getIdToken", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseAuthUserHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(getIdTokenApp:forceRefresh:completion:)], @"FirebaseAuthUserHostApi api (%@) doesn't respond to " @"@selector(getIdTokenApp:forceRefresh:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; AuthPigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); BOOL arg_forceRefresh = [GetNullableObjectAtIndex(args, 1) boolValue]; [api getIdTokenApp:arg_app forceRefresh:arg_forceRefresh - completion:^(PigeonIdTokenResult *_Nullable output, FlutterError *_Nullable error) { + completion:^(InternalIdTokenResult *_Nullable output, + FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; }]; @@ -1787,19 +2259,19 @@ void SetUpFirebaseAuthUserHostApiWithSuffix(id binaryMes @"FirebaseAuthUserHostApi.linkWithCredential", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseAuthUserHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(linkWithCredentialApp:input:completion:)], @"FirebaseAuthUserHostApi api (%@) doesn't respond to " @"@selector(linkWithCredentialApp:input:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; AuthPigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); NSDictionary *arg_input = GetNullableObjectAtIndex(args, 1); [api linkWithCredentialApp:arg_app input:arg_input - completion:^(PigeonUserCredential *_Nullable output, + completion:^(InternalUserCredential *_Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; @@ -1816,19 +2288,19 @@ void SetUpFirebaseAuthUserHostApiWithSuffix(id binaryMes @"FirebaseAuthUserHostApi.linkWithProvider", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseAuthUserHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(linkWithProviderApp:signInProvider:completion:)], @"FirebaseAuthUserHostApi api (%@) doesn't respond to " @"@selector(linkWithProviderApp:signInProvider:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; AuthPigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); - PigeonSignInProvider *arg_signInProvider = GetNullableObjectAtIndex(args, 1); + InternalSignInProvider *arg_signInProvider = GetNullableObjectAtIndex(args, 1); [api linkWithProviderApp:arg_app signInProvider:arg_signInProvider - completion:^(PigeonUserCredential *_Nullable output, + completion:^(InternalUserCredential *_Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; @@ -1845,7 +2317,7 @@ void SetUpFirebaseAuthUserHostApiWithSuffix(id binaryMes @"FirebaseAuthUserHostApi.reauthenticateWithCredential", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseAuthUserHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert( [api respondsToSelector:@selector(reauthenticateWithCredentialApp:input:completion:)], @@ -1853,12 +2325,12 @@ void SetUpFirebaseAuthUserHostApiWithSuffix(id binaryMes @"@selector(reauthenticateWithCredentialApp:input:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; AuthPigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); NSDictionary *arg_input = GetNullableObjectAtIndex(args, 1); [api reauthenticateWithCredentialApp:arg_app input:arg_input - completion:^(PigeonUserCredential *_Nullable output, + completion:^(InternalUserCredential *_Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; @@ -1875,7 +2347,7 @@ void SetUpFirebaseAuthUserHostApiWithSuffix(id binaryMes @"FirebaseAuthUserHostApi.reauthenticateWithProvider", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseAuthUserHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert( [api respondsToSelector:@selector( @@ -1884,12 +2356,12 @@ void SetUpFirebaseAuthUserHostApiWithSuffix(id binaryMes @"@selector(reauthenticateWithProviderApp:signInProvider:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; AuthPigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); - PigeonSignInProvider *arg_signInProvider = GetNullableObjectAtIndex(args, 1); + InternalSignInProvider *arg_signInProvider = GetNullableObjectAtIndex(args, 1); [api reauthenticateWithProviderApp:arg_app signInProvider:arg_signInProvider - completion:^(PigeonUserCredential *_Nullable output, + completion:^(InternalUserCredential *_Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; @@ -1905,17 +2377,17 @@ void SetUpFirebaseAuthUserHostApiWithSuffix(id binaryMes @"interface.FirebaseAuthUserHostApi.reload", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseAuthUserHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert( [api respondsToSelector:@selector(reloadApp:completion:)], @"FirebaseAuthUserHostApi api (%@) doesn't respond to @selector(reloadApp:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; AuthPigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); [api reloadApp:arg_app - completion:^(PigeonUserDetails *_Nullable output, FlutterError *_Nullable error) { + completion:^(InternalUserDetails *_Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; }]; @@ -1931,7 +2403,7 @@ void SetUpFirebaseAuthUserHostApiWithSuffix(id binaryMes @"FirebaseAuthUserHostApi.sendEmailVerification", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseAuthUserHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert( [api respondsToSelector:@selector( @@ -1940,9 +2412,9 @@ void SetUpFirebaseAuthUserHostApiWithSuffix(id binaryMes @"@selector(sendEmailVerificationApp:actionCodeSettings:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; AuthPigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); - PigeonActionCodeSettings *arg_actionCodeSettings = GetNullableObjectAtIndex(args, 1); + InternalActionCodeSettings *arg_actionCodeSettings = GetNullableObjectAtIndex(args, 1); [api sendEmailVerificationApp:arg_app actionCodeSettings:arg_actionCodeSettings completion:^(FlutterError *_Nullable error) { @@ -1960,19 +2432,19 @@ void SetUpFirebaseAuthUserHostApiWithSuffix(id binaryMes @"interface.FirebaseAuthUserHostApi.unlink", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseAuthUserHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(unlinkApp:providerId:completion:)], @"FirebaseAuthUserHostApi api (%@) doesn't respond to " @"@selector(unlinkApp:providerId:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; AuthPigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); NSString *arg_providerId = GetNullableObjectAtIndex(args, 1); [api unlinkApp:arg_app providerId:arg_providerId - completion:^(PigeonUserCredential *_Nullable output, FlutterError *_Nullable error) { + completion:^(InternalUserCredential *_Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; }]; @@ -1987,21 +2459,22 @@ void SetUpFirebaseAuthUserHostApiWithSuffix(id binaryMes @"interface.FirebaseAuthUserHostApi.updateEmail", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseAuthUserHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(updateEmailApp:newEmail:completion:)], @"FirebaseAuthUserHostApi api (%@) doesn't respond to " @"@selector(updateEmailApp:newEmail:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; AuthPigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); NSString *arg_newEmail = GetNullableObjectAtIndex(args, 1); - [api updateEmailApp:arg_app - newEmail:arg_newEmail - completion:^(PigeonUserDetails *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api + updateEmailApp:arg_app + newEmail:arg_newEmail + completion:^(InternalUserDetails *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -2015,19 +2488,19 @@ void SetUpFirebaseAuthUserHostApiWithSuffix(id binaryMes @"FirebaseAuthUserHostApi.updatePassword", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseAuthUserHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(updatePasswordApp:newPassword:completion:)], @"FirebaseAuthUserHostApi api (%@) doesn't respond to " @"@selector(updatePasswordApp:newPassword:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; AuthPigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); NSString *arg_newPassword = GetNullableObjectAtIndex(args, 1); [api updatePasswordApp:arg_app newPassword:arg_newPassword - completion:^(PigeonUserDetails *_Nullable output, + completion:^(InternalUserDetails *_Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; @@ -2044,19 +2517,19 @@ void SetUpFirebaseAuthUserHostApiWithSuffix(id binaryMes @"FirebaseAuthUserHostApi.updatePhoneNumber", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseAuthUserHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(updatePhoneNumberApp:input:completion:)], @"FirebaseAuthUserHostApi api (%@) doesn't respond to " @"@selector(updatePhoneNumberApp:input:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; AuthPigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); NSDictionary *arg_input = GetNullableObjectAtIndex(args, 1); [api updatePhoneNumberApp:arg_app input:arg_input - completion:^(PigeonUserDetails *_Nullable output, + completion:^(InternalUserDetails *_Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; @@ -2073,22 +2546,22 @@ void SetUpFirebaseAuthUserHostApiWithSuffix(id binaryMes @"FirebaseAuthUserHostApi.updateProfile", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseAuthUserHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(updateProfileApp:profile:completion:)], @"FirebaseAuthUserHostApi api (%@) doesn't respond to " @"@selector(updateProfileApp:profile:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; AuthPigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); - PigeonUserProfile *arg_profile = GetNullableObjectAtIndex(args, 1); - [api - updateProfileApp:arg_app - profile:arg_profile - completion:^(PigeonUserDetails *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + InternalUserProfile *arg_profile = GetNullableObjectAtIndex(args, 1); + [api updateProfileApp:arg_app + profile:arg_profile + completion:^(InternalUserDetails *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -2102,7 +2575,7 @@ void SetUpFirebaseAuthUserHostApiWithSuffix(id binaryMes @"FirebaseAuthUserHostApi.verifyBeforeUpdateEmail", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FirebaseAuthUserHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(verifyBeforeUpdateEmailApp:newEmail: actionCodeSettings:completion:)], @@ -2110,10 +2583,10 @@ void SetUpFirebaseAuthUserHostApiWithSuffix(id binaryMes @"@selector(verifyBeforeUpdateEmailApp:newEmail:actionCodeSettings:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; AuthPigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); NSString *arg_newEmail = GetNullableObjectAtIndex(args, 1); - PigeonActionCodeSettings *arg_actionCodeSettings = GetNullableObjectAtIndex(args, 2); + InternalActionCodeSettings *arg_actionCodeSettings = GetNullableObjectAtIndex(args, 2); [api verifyBeforeUpdateEmailApp:arg_app newEmail:arg_newEmail actionCodeSettings:arg_actionCodeSettings @@ -2126,69 +2599,6 @@ void SetUpFirebaseAuthUserHostApiWithSuffix(id binaryMes } } } -@interface MultiFactorUserHostApiCodecReader : FlutterStandardReader -@end -@implementation MultiFactorUserHostApiCodecReader -- (nullable id)readValueOfType:(UInt8)type { - switch (type) { - case 128: - return [AuthPigeonFirebaseApp fromList:[self readValue]]; - case 129: - return [PigeonMultiFactorInfo fromList:[self readValue]]; - case 130: - return [PigeonMultiFactorSession fromList:[self readValue]]; - case 131: - return [PigeonPhoneMultiFactorAssertion fromList:[self readValue]]; - default: - return [super readValueOfType:type]; - } -} -@end - -@interface MultiFactorUserHostApiCodecWriter : FlutterStandardWriter -@end -@implementation MultiFactorUserHostApiCodecWriter -- (void)writeValue:(id)value { - if ([value isKindOfClass:[AuthPigeonFirebaseApp class]]) { - [self writeByte:128]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonMultiFactorInfo class]]) { - [self writeByte:129]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonMultiFactorSession class]]) { - [self writeByte:130]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonPhoneMultiFactorAssertion class]]) { - [self writeByte:131]; - [self writeValue:[value toList]]; - } else { - [super writeValue:value]; - } -} -@end - -@interface MultiFactorUserHostApiCodecReaderWriter : FlutterStandardReaderWriter -@end -@implementation MultiFactorUserHostApiCodecReaderWriter -- (FlutterStandardWriter *)writerWithData:(NSMutableData *)data { - return [[MultiFactorUserHostApiCodecWriter alloc] initWithData:data]; -} -- (FlutterStandardReader *)readerWithData:(NSData *)data { - return [[MultiFactorUserHostApiCodecReader alloc] initWithData:data]; -} -@end - -NSObject *MultiFactorUserHostApiGetCodec(void) { - static FlutterStandardMessageCodec *sSharedObject = nil; - static dispatch_once_t sPred = 0; - dispatch_once(&sPred, ^{ - MultiFactorUserHostApiCodecReaderWriter *readerWriter = - [[MultiFactorUserHostApiCodecReaderWriter alloc] init]; - sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; - }); - return sSharedObject; -} - void SetUpMultiFactorUserHostApi(id binaryMessenger, NSObject *api) { SetUpMultiFactorUserHostApiWithSuffix(binaryMessenger, api, @""); @@ -2207,7 +2617,7 @@ void SetUpMultiFactorUserHostApiWithSuffix(id binaryMess @"interface.MultiFactorUserHostApi.enrollPhone", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:MultiFactorUserHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert( [api respondsToSelector:@selector(enrollPhoneApp:assertion:displayName:completion:)], @@ -2215,9 +2625,9 @@ void SetUpMultiFactorUserHostApiWithSuffix(id binaryMess @"@selector(enrollPhoneApp:assertion:displayName:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; AuthPigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); - PigeonPhoneMultiFactorAssertion *arg_assertion = GetNullableObjectAtIndex(args, 1); + InternalPhoneMultiFactorAssertion *arg_assertion = GetNullableObjectAtIndex(args, 1); NSString *arg_displayName = GetNullableObjectAtIndex(args, 2); [api enrollPhoneApp:arg_app assertion:arg_assertion @@ -2237,7 +2647,7 @@ void SetUpMultiFactorUserHostApiWithSuffix(id binaryMess @"interface.MultiFactorUserHostApi.enrollTotp", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:MultiFactorUserHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert( [api respondsToSelector:@selector(enrollTotpApp:assertionId:displayName:completion:)], @@ -2245,7 +2655,7 @@ void SetUpMultiFactorUserHostApiWithSuffix(id binaryMess @"@selector(enrollTotpApp:assertionId:displayName:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; AuthPigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); NSString *arg_assertionId = GetNullableObjectAtIndex(args, 1); NSString *arg_displayName = GetNullableObjectAtIndex(args, 2); @@ -2267,17 +2677,17 @@ void SetUpMultiFactorUserHostApiWithSuffix(id binaryMess @"interface.MultiFactorUserHostApi.getSession", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:MultiFactorUserHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(getSessionApp:completion:)], @"MultiFactorUserHostApi api (%@) doesn't respond to " @"@selector(getSessionApp:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; AuthPigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); [api getSessionApp:arg_app - completion:^(PigeonMultiFactorSession *_Nullable output, + completion:^(InternalMultiFactorSession *_Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; @@ -2293,14 +2703,14 @@ void SetUpMultiFactorUserHostApiWithSuffix(id binaryMess @"interface.MultiFactorUserHostApi.unenroll", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:MultiFactorUserHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(unenrollApp:factorUid:completion:)], @"MultiFactorUserHostApi api (%@) doesn't respond to " @"@selector(unenrollApp:factorUid:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; AuthPigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); NSString *arg_factorUid = GetNullableObjectAtIndex(args, 1); [api unenrollApp:arg_app @@ -2321,17 +2731,17 @@ void SetUpMultiFactorUserHostApiWithSuffix(id binaryMess @"MultiFactorUserHostApi.getEnrolledFactors", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:MultiFactorUserHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(getEnrolledFactorsApp:completion:)], @"MultiFactorUserHostApi api (%@) doesn't respond to " @"@selector(getEnrolledFactorsApp:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; AuthPigeonFirebaseApp *arg_app = GetNullableObjectAtIndex(args, 0); [api getEnrolledFactorsApp:arg_app - completion:^(NSArray *_Nullable output, + completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; @@ -2341,79 +2751,6 @@ void SetUpMultiFactorUserHostApiWithSuffix(id binaryMess } } } -@interface MultiFactoResolverHostApiCodecReader : FlutterStandardReader -@end -@implementation MultiFactoResolverHostApiCodecReader -- (nullable id)readValueOfType:(UInt8)type { - switch (type) { - case 128: - return [PigeonAdditionalUserInfo fromList:[self readValue]]; - case 129: - return [PigeonAuthCredential fromList:[self readValue]]; - case 130: - return [PigeonPhoneMultiFactorAssertion fromList:[self readValue]]; - case 131: - return [PigeonUserCredential fromList:[self readValue]]; - case 132: - return [PigeonUserDetails fromList:[self readValue]]; - case 133: - return [PigeonUserInfo fromList:[self readValue]]; - default: - return [super readValueOfType:type]; - } -} -@end - -@interface MultiFactoResolverHostApiCodecWriter : FlutterStandardWriter -@end -@implementation MultiFactoResolverHostApiCodecWriter -- (void)writeValue:(id)value { - if ([value isKindOfClass:[PigeonAdditionalUserInfo class]]) { - [self writeByte:128]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonAuthCredential class]]) { - [self writeByte:129]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonPhoneMultiFactorAssertion class]]) { - [self writeByte:130]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonUserCredential class]]) { - [self writeByte:131]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonUserDetails class]]) { - [self writeByte:132]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[PigeonUserInfo class]]) { - [self writeByte:133]; - [self writeValue:[value toList]]; - } else { - [super writeValue:value]; - } -} -@end - -@interface MultiFactoResolverHostApiCodecReaderWriter : FlutterStandardReaderWriter -@end -@implementation MultiFactoResolverHostApiCodecReaderWriter -- (FlutterStandardWriter *)writerWithData:(NSMutableData *)data { - return [[MultiFactoResolverHostApiCodecWriter alloc] initWithData:data]; -} -- (FlutterStandardReader *)readerWithData:(NSData *)data { - return [[MultiFactoResolverHostApiCodecReader alloc] initWithData:data]; -} -@end - -NSObject *MultiFactoResolverHostApiGetCodec(void) { - static FlutterStandardMessageCodec *sSharedObject = nil; - static dispatch_once_t sPred = 0; - dispatch_once(&sPred, ^{ - MultiFactoResolverHostApiCodecReaderWriter *readerWriter = - [[MultiFactoResolverHostApiCodecReaderWriter alloc] init]; - sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; - }); - return sSharedObject; -} - void SetUpMultiFactoResolverHostApi(id binaryMessenger, NSObject *api) { SetUpMultiFactoResolverHostApiWithSuffix(binaryMessenger, api, @""); @@ -2433,7 +2770,7 @@ void SetUpMultiFactoResolverHostApiWithSuffix(id binaryM @"MultiFactoResolverHostApi.resolveSignIn", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:MultiFactoResolverHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector: @selector(resolveSignInResolverId:assertion:totpAssertionId:completion:)], @@ -2441,14 +2778,14 @@ void SetUpMultiFactoResolverHostApiWithSuffix(id binaryM @"@selector(resolveSignInResolverId:assertion:totpAssertionId:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; NSString *arg_resolverId = GetNullableObjectAtIndex(args, 0); - PigeonPhoneMultiFactorAssertion *arg_assertion = GetNullableObjectAtIndex(args, 1); + InternalPhoneMultiFactorAssertion *arg_assertion = GetNullableObjectAtIndex(args, 1); NSString *arg_totpAssertionId = GetNullableObjectAtIndex(args, 2); [api resolveSignInResolverId:arg_resolverId assertion:arg_assertion totpAssertionId:arg_totpAssertionId - completion:^(PigeonUserCredential *_Nullable output, + completion:^(InternalUserCredential *_Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; @@ -2458,54 +2795,6 @@ void SetUpMultiFactoResolverHostApiWithSuffix(id binaryM } } } -@interface MultiFactorTotpHostApiCodecReader : FlutterStandardReader -@end -@implementation MultiFactorTotpHostApiCodecReader -- (nullable id)readValueOfType:(UInt8)type { - switch (type) { - case 128: - return [PigeonTotpSecret fromList:[self readValue]]; - default: - return [super readValueOfType:type]; - } -} -@end - -@interface MultiFactorTotpHostApiCodecWriter : FlutterStandardWriter -@end -@implementation MultiFactorTotpHostApiCodecWriter -- (void)writeValue:(id)value { - if ([value isKindOfClass:[PigeonTotpSecret class]]) { - [self writeByte:128]; - [self writeValue:[value toList]]; - } else { - [super writeValue:value]; - } -} -@end - -@interface MultiFactorTotpHostApiCodecReaderWriter : FlutterStandardReaderWriter -@end -@implementation MultiFactorTotpHostApiCodecReaderWriter -- (FlutterStandardWriter *)writerWithData:(NSMutableData *)data { - return [[MultiFactorTotpHostApiCodecWriter alloc] initWithData:data]; -} -- (FlutterStandardReader *)readerWithData:(NSData *)data { - return [[MultiFactorTotpHostApiCodecReader alloc] initWithData:data]; -} -@end - -NSObject *MultiFactorTotpHostApiGetCodec(void) { - static FlutterStandardMessageCodec *sSharedObject = nil; - static dispatch_once_t sPred = 0; - dispatch_once(&sPred, ^{ - MultiFactorTotpHostApiCodecReaderWriter *readerWriter = - [[MultiFactorTotpHostApiCodecReaderWriter alloc] init]; - sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; - }); - return sSharedObject; -} - void SetUpMultiFactorTotpHostApi(id binaryMessenger, NSObject *api) { SetUpMultiFactorTotpHostApiWithSuffix(binaryMessenger, api, @""); @@ -2525,17 +2814,17 @@ void SetUpMultiFactorTotpHostApiWithSuffix(id binaryMess @"MultiFactorTotpHostApi.generateSecret", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:MultiFactorTotpHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(generateSecretSessionId:completion:)], @"MultiFactorTotpHostApi api (%@) doesn't respond to " @"@selector(generateSecretSessionId:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; NSString *arg_sessionId = GetNullableObjectAtIndex(args, 0); [api generateSecretSessionId:arg_sessionId - completion:^(PigeonTotpSecret *_Nullable output, + completion:^(InternalTotpSecret *_Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; @@ -2552,7 +2841,7 @@ void SetUpMultiFactorTotpHostApiWithSuffix(id binaryMess @"MultiFactorTotpHostApi.getAssertionForEnrollment", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:MultiFactorTotpHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector: @selector(getAssertionForEnrollmentSecretKey:oneTimePassword:completion:)], @@ -2560,7 +2849,7 @@ void SetUpMultiFactorTotpHostApiWithSuffix(id binaryMess @"@selector(getAssertionForEnrollmentSecretKey:oneTimePassword:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; NSString *arg_secretKey = GetNullableObjectAtIndex(args, 0); NSString *arg_oneTimePassword = GetNullableObjectAtIndex(args, 1); [api getAssertionForEnrollmentSecretKey:arg_secretKey @@ -2582,7 +2871,7 @@ void SetUpMultiFactorTotpHostApiWithSuffix(id binaryMess @"MultiFactorTotpHostApi.getAssertionForSignIn", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:MultiFactorTotpHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector: @selector(getAssertionForSignInEnrollmentId:oneTimePassword:completion:)], @@ -2590,7 +2879,7 @@ void SetUpMultiFactorTotpHostApiWithSuffix(id binaryMess @"@selector(getAssertionForSignInEnrollmentId:oneTimePassword:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; NSString *arg_enrollmentId = GetNullableObjectAtIndex(args, 0); NSString *arg_oneTimePassword = GetNullableObjectAtIndex(args, 1); [api getAssertionForSignInEnrollmentId:arg_enrollmentId @@ -2605,12 +2894,6 @@ void SetUpMultiFactorTotpHostApiWithSuffix(id binaryMess } } } -NSObject *MultiFactorTotpSecretHostApiGetCodec(void) { - static FlutterStandardMessageCodec *sSharedObject = nil; - sSharedObject = [FlutterStandardMessageCodec sharedInstance]; - return sSharedObject; -} - void SetUpMultiFactorTotpSecretHostApi(id binaryMessenger, NSObject *api) { SetUpMultiFactorTotpSecretHostApiWithSuffix(binaryMessenger, api, @""); @@ -2630,7 +2913,7 @@ void SetUpMultiFactorTotpSecretHostApiWithSuffix(id bina @"MultiFactorTotpSecretHostApi.generateQrCodeUrl", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:MultiFactorTotpSecretHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert( [api respondsToSelector:@selector( @@ -2639,7 +2922,7 @@ void SetUpMultiFactorTotpSecretHostApiWithSuffix(id bina @"@selector(generateQrCodeUrlSecretKey:accountName:issuer:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; NSString *arg_secretKey = GetNullableObjectAtIndex(args, 0); NSString *arg_accountName = GetNullableObjectAtIndex(args, 1); NSString *arg_issuer = GetNullableObjectAtIndex(args, 2); @@ -2663,14 +2946,14 @@ void SetUpMultiFactorTotpSecretHostApiWithSuffix(id bina @"MultiFactorTotpSecretHostApi.openInOtpApp", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:MultiFactorTotpSecretHostApiGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(openInOtpAppSecretKey:qrCodeUrl:completion:)], @"MultiFactorTotpSecretHostApi api (%@) doesn't respond to " @"@selector(openInOtpAppSecretKey:qrCodeUrl:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; NSString *arg_secretKey = GetNullableObjectAtIndex(args, 0); NSString *arg_qrCodeUrl = GetNullableObjectAtIndex(args, 1); [api openInOtpAppSecretKey:arg_secretKey @@ -2684,54 +2967,6 @@ void SetUpMultiFactorTotpSecretHostApiWithSuffix(id bina } } } -@interface GenerateInterfacesCodecReader : FlutterStandardReader -@end -@implementation GenerateInterfacesCodecReader -- (nullable id)readValueOfType:(UInt8)type { - switch (type) { - case 128: - return [PigeonMultiFactorInfo fromList:[self readValue]]; - default: - return [super readValueOfType:type]; - } -} -@end - -@interface GenerateInterfacesCodecWriter : FlutterStandardWriter -@end -@implementation GenerateInterfacesCodecWriter -- (void)writeValue:(id)value { - if ([value isKindOfClass:[PigeonMultiFactorInfo class]]) { - [self writeByte:128]; - [self writeValue:[value toList]]; - } else { - [super writeValue:value]; - } -} -@end - -@interface GenerateInterfacesCodecReaderWriter : FlutterStandardReaderWriter -@end -@implementation GenerateInterfacesCodecReaderWriter -- (FlutterStandardWriter *)writerWithData:(NSMutableData *)data { - return [[GenerateInterfacesCodecWriter alloc] initWithData:data]; -} -- (FlutterStandardReader *)readerWithData:(NSData *)data { - return [[GenerateInterfacesCodecReader alloc] initWithData:data]; -} -@end - -NSObject *GenerateInterfacesGetCodec(void) { - static FlutterStandardMessageCodec *sSharedObject = nil; - static dispatch_once_t sPred = 0; - dispatch_once(&sPred, ^{ - GenerateInterfacesCodecReaderWriter *readerWriter = - [[GenerateInterfacesCodecReaderWriter alloc] init]; - sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; - }); - return sSharedObject; -} - void SetUpGenerateInterfaces(id binaryMessenger, NSObject *api) { SetUpGenerateInterfacesWithSuffix(binaryMessenger, api, @""); @@ -2750,15 +2985,15 @@ void SetUpGenerateInterfacesWithSuffix(id binaryMessenge @"interface.GenerateInterfaces.pigeonInterface", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GenerateInterfacesGetCodec()]; + codec:nullGetFirebaseAuthMessagesCodec()]; if (api) { NSCAssert( [api respondsToSelector:@selector(pigeonInterfaceInfo:error:)], @"GenerateInterfaces api (%@) doesn't respond to @selector(pigeonInterfaceInfo:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - PigeonMultiFactorInfo *arg_info = GetNullableObjectAtIndex(args, 0); + NSArray *args = message; + InternalMultiFactorInfo *arg_info = GetNullableObjectAtIndex(args, 0); FlutterError *error; [api pigeonInterfaceInfo:arg_info error:&error]; callback(wrapResult(nil, error)); diff --git a/packages/firebase_auth/firebase_auth/ios/firebase_auth/Sources/firebase_auth/include/Private/FLTPhoneNumberVerificationStreamHandler.h b/packages/firebase_auth/firebase_auth/ios/firebase_auth/Sources/firebase_auth/include/Private/FLTPhoneNumberVerificationStreamHandler.h index a576f233e99a..53e5f28cea90 100644 --- a/packages/firebase_auth/firebase_auth/ios/firebase_auth/Sources/firebase_auth/include/Private/FLTPhoneNumberVerificationStreamHandler.h +++ b/packages/firebase_auth/firebase_auth/ios/firebase_auth/Sources/firebase_auth/include/Private/FLTPhoneNumberVerificationStreamHandler.h @@ -26,7 +26,7 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)initWithAuth:(FIRAuth *)auth arguments:(NSDictionary *)arguments; #else - (instancetype)initWithAuth:(FIRAuth *)auth - request:(PigeonVerifyPhoneNumberRequest *)request + request:(InternalVerifyPhoneNumberRequest *)request session:(FIRMultiFactorSession *)session factorInfo:(FIRPhoneMultiFactorInfo *)factorInfo; #endif diff --git a/packages/firebase_auth/firebase_auth/ios/firebase_auth/Sources/firebase_auth/include/Private/PigeonParser.h b/packages/firebase_auth/firebase_auth/ios/firebase_auth/Sources/firebase_auth/include/Private/PigeonParser.h index 515a61a895b5..b500fd2c878e 100644 --- a/packages/firebase_auth/firebase_auth/ios/firebase_auth/Sources/firebase_auth/include/Private/PigeonParser.h +++ b/packages/firebase_auth/firebase_auth/ios/firebase_auth/Sources/firebase_auth/include/Private/PigeonParser.h @@ -16,18 +16,18 @@ @interface PigeonParser : NSObject -+ (NSArray *_Nonnull)getManualList:(nonnull PigeonUserDetails *)userDetails; -+ (PigeonUserCredential *_Nullable) ++ (NSArray *_Nonnull)getManualList:(nonnull InternalUserDetails *)userDetails; ++ (InternalUserCredential *_Nullable) getPigeonUserCredentialFromAuthResult:(nonnull FIRAuthDataResult *)authResult authorizationCode:(nullable NSString *)authorizationCode; -+ (PigeonUserDetails *_Nullable)getPigeonDetails:(nonnull FIRUser *)user; -+ (PigeonUserInfo *_Nullable)getPigeonUserInfo:(nonnull FIRUser *)user; ++ (InternalUserDetails *_Nullable)getPigeonDetails:(nonnull FIRUser *)user; ++ (InternalUserInfo *_Nullable)getPigeonUserInfo:(nonnull FIRUser *)user; + (FIRActionCodeSettings *_Nullable)parseActionCodeSettings: - (nullable PigeonActionCodeSettings *)settings; -+ (PigeonUserCredential *_Nullable)getPigeonUserCredentialFromFIRUser:(nonnull FIRUser *)user; -+ (PigeonIdTokenResult *_Nonnull)parseIdTokenResult:(nonnull FIRAuthTokenResult *)tokenResult; -+ (PigeonTotpSecret *_Nonnull)getPigeonTotpSecret:(nonnull FIRTOTPSecret *)secret; -+ (PigeonAuthCredential *_Nullable)getPigeonAuthCredential: - (FIRAuthCredential *_Nullable)authCredentialToken - token:(NSNumber *_Nullable)token; + (nullable InternalActionCodeSettings *)settings; ++ (InternalUserCredential *_Nullable)getPigeonUserCredentialFromFIRUser:(nonnull FIRUser *)user; ++ (InternalIdTokenResult *_Nonnull)parseIdTokenResult:(nonnull FIRAuthTokenResult *)tokenResult; ++ (InternalTotpSecret *_Nonnull)getPigeonTotpSecret:(nonnull FIRTOTPSecret *)secret; ++ (InternalAuthCredential *_Nullable)getPigeonAuthCredential: + (FIRAuthCredential *_Nullable)authCredentialToken + token:(NSNumber *_Nullable)token; @end diff --git a/packages/firebase_auth/firebase_auth/ios/firebase_auth/Sources/firebase_auth/include/Public/CustomPigeonHeader.h b/packages/firebase_auth/firebase_auth/ios/firebase_auth/Sources/firebase_auth/include/Public/CustomPigeonHeader.h index 17111415acb6..d32a6b451629 100644 --- a/packages/firebase_auth/firebase_auth/ios/firebase_auth/Sources/firebase_auth/include/Public/CustomPigeonHeader.h +++ b/packages/firebase_auth/firebase_auth/ios/firebase_auth/Sources/firebase_auth/include/Public/CustomPigeonHeader.h @@ -3,14 +3,14 @@ // found in the LICENSE file. #import "firebase_auth_messages.g.h" -@interface PigeonMultiFactorInfo (Map) +@interface InternalMultiFactorInfo (Map) - (NSDictionary *)toList; @end -@interface PigeonUserDetails (Map) +@interface InternalUserDetails (Map) - (NSDictionary *)toList; @end -@interface PigeonUserInfo (Map) +@interface InternalUserInfo (Map) - (NSDictionary *)toList; @end diff --git a/packages/firebase_auth/firebase_auth/ios/firebase_auth/Sources/firebase_auth/include/Public/firebase_auth_messages.g.h b/packages/firebase_auth/firebase_auth/ios/firebase_auth/Sources/firebase_auth/include/Public/firebase_auth_messages.g.h index fe48f267f2af..f83da7e34a3b 100644 --- a/packages/firebase_auth/firebase_auth/ios/firebase_auth/Sources/firebase_auth/include/Public/firebase_auth_messages.g.h +++ b/packages/firebase_auth/firebase_auth/ios/firebase_auth/Sources/firebase_auth/include/Public/firebase_auth_messages.g.h @@ -1,10 +1,10 @@ // Copyright 2023, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v19.0.0), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), do not edit directly. // See also: https://pub.dev/packages/pigeon -#import +@import Foundation; @protocol FlutterBinaryMessenger; @protocol FlutterMessageCodec; @@ -38,33 +38,34 @@ typedef NS_ENUM(NSUInteger, ActionCodeInfoOperation) { - (instancetype)initWithValue:(ActionCodeInfoOperation)value; @end -@class PigeonMultiFactorSession; -@class PigeonPhoneMultiFactorAssertion; -@class PigeonMultiFactorInfo; +@class InternalMultiFactorSession; +@class InternalPhoneMultiFactorAssertion; +@class InternalMultiFactorInfo; @class AuthPigeonFirebaseApp; -@class PigeonActionCodeInfoData; -@class PigeonActionCodeInfo; -@class PigeonAdditionalUserInfo; -@class PigeonAuthCredential; -@class PigeonUserInfo; -@class PigeonUserDetails; -@class PigeonUserCredential; -@class PigeonActionCodeSettings; -@class PigeonFirebaseAuthSettings; -@class PigeonSignInProvider; -@class PigeonVerifyPhoneNumberRequest; -@class PigeonIdTokenResult; -@class PigeonUserProfile; -@class PigeonTotpSecret; - -@interface PigeonMultiFactorSession : NSObject +@class InternalActionCodeInfoData; +@class InternalActionCodeInfo; +@class InternalAdditionalUserInfo; +@class InternalAuthCredential; +@class InternalUserInfo; +@class InternalUserDetails; +@class InternalUserCredential; +@class InternalAuthCredentialInput; +@class InternalActionCodeSettings; +@class InternalFirebaseAuthSettings; +@class InternalSignInProvider; +@class InternalVerifyPhoneNumberRequest; +@class InternalIdTokenResult; +@class InternalUserProfile; +@class InternalTotpSecret; + +@interface InternalMultiFactorSession : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; + (instancetype)makeWithId:(NSString *)id; @property(nonatomic, copy) NSString *id; @end -@interface PigeonPhoneMultiFactorAssertion : NSObject +@interface InternalPhoneMultiFactorAssertion : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; + (instancetype)makeWithVerificationId:(NSString *)verificationId @@ -73,7 +74,7 @@ typedef NS_ENUM(NSUInteger, ActionCodeInfoOperation) { @property(nonatomic, copy) NSString *verificationCode; @end -@interface PigeonMultiFactorInfo : NSObject +@interface InternalMultiFactorInfo : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; + (instancetype)makeWithDisplayName:(nullable NSString *)displayName @@ -99,23 +100,23 @@ typedef NS_ENUM(NSUInteger, ActionCodeInfoOperation) { @property(nonatomic, copy, nullable) NSString *customAuthDomain; @end -@interface PigeonActionCodeInfoData : NSObject +@interface InternalActionCodeInfoData : NSObject + (instancetype)makeWithEmail:(nullable NSString *)email previousEmail:(nullable NSString *)previousEmail; @property(nonatomic, copy, nullable) NSString *email; @property(nonatomic, copy, nullable) NSString *previousEmail; @end -@interface PigeonActionCodeInfo : NSObject +@interface InternalActionCodeInfo : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; + (instancetype)makeWithOperation:(ActionCodeInfoOperation)operation - data:(PigeonActionCodeInfoData *)data; + data:(InternalActionCodeInfoData *)data; @property(nonatomic, assign) ActionCodeInfoOperation operation; -@property(nonatomic, strong) PigeonActionCodeInfoData *data; +@property(nonatomic, strong) InternalActionCodeInfoData *data; @end -@interface PigeonAdditionalUserInfo : NSObject +@interface InternalAdditionalUserInfo : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; + (instancetype)makeWithIsNewUser:(BOOL)isNewUser @@ -130,7 +131,7 @@ typedef NS_ENUM(NSUInteger, ActionCodeInfoOperation) { @property(nonatomic, copy, nullable) NSDictionary *profile; @end -@interface PigeonAuthCredential : NSObject +@interface InternalAuthCredential : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; + (instancetype)makeWithProviderId:(NSString *)providerId @@ -143,7 +144,7 @@ typedef NS_ENUM(NSUInteger, ActionCodeInfoOperation) { @property(nonatomic, copy, nullable) NSString *accessToken; @end -@interface PigeonUserInfo : NSObject +@interface InternalUserInfo : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; + (instancetype)makeWithUid:(NSString *)uid @@ -172,25 +173,38 @@ typedef NS_ENUM(NSUInteger, ActionCodeInfoOperation) { @property(nonatomic, strong, nullable) NSNumber *lastSignInTimestamp; @end -@interface PigeonUserDetails : NSObject +@interface InternalUserDetails : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithUserInfo:(PigeonUserInfo *)userInfo ++ (instancetype)makeWithUserInfo:(InternalUserInfo *)userInfo providerData:(NSArray *> *)providerData; -@property(nonatomic, strong) PigeonUserInfo *userInfo; +@property(nonatomic, strong) InternalUserInfo *userInfo; @property(nonatomic, copy) NSArray *> *providerData; @end -@interface PigeonUserCredential : NSObject -+ (instancetype)makeWithUser:(nullable PigeonUserDetails *)user - additionalUserInfo:(nullable PigeonAdditionalUserInfo *)additionalUserInfo - credential:(nullable PigeonAuthCredential *)credential; -@property(nonatomic, strong, nullable) PigeonUserDetails *user; -@property(nonatomic, strong, nullable) PigeonAdditionalUserInfo *additionalUserInfo; -@property(nonatomic, strong, nullable) PigeonAuthCredential *credential; +@interface InternalUserCredential : NSObject ++ (instancetype)makeWithUser:(nullable InternalUserDetails *)user + additionalUserInfo:(nullable InternalAdditionalUserInfo *)additionalUserInfo + credential:(nullable InternalAuthCredential *)credential; +@property(nonatomic, strong, nullable) InternalUserDetails *user; +@property(nonatomic, strong, nullable) InternalAdditionalUserInfo *additionalUserInfo; +@property(nonatomic, strong, nullable) InternalAuthCredential *credential; @end -@interface PigeonActionCodeSettings : NSObject +@interface InternalAuthCredentialInput : NSObject +/// `init` unavailable to enforce nonnull fields, see the `make` class method. +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)makeWithProviderId:(NSString *)providerId + signInMethod:(NSString *)signInMethod + token:(nullable NSString *)token + accessToken:(nullable NSString *)accessToken; +@property(nonatomic, copy) NSString *providerId; +@property(nonatomic, copy) NSString *signInMethod; +@property(nonatomic, copy, nullable) NSString *token; +@property(nonatomic, copy, nullable) NSString *accessToken; +@end + +@interface InternalActionCodeSettings : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; + (instancetype)makeWithUrl:(NSString *)url @@ -211,7 +225,7 @@ typedef NS_ENUM(NSUInteger, ActionCodeInfoOperation) { @property(nonatomic, copy, nullable) NSString *linkDomain; @end -@interface PigeonFirebaseAuthSettings : NSObject +@interface InternalFirebaseAuthSettings : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; + (instancetype)makeWithAppVerificationDisabledForTesting:(BOOL)appVerificationDisabledForTesting @@ -226,7 +240,7 @@ typedef NS_ENUM(NSUInteger, ActionCodeInfoOperation) { @property(nonatomic, strong, nullable) NSNumber *forceRecaptchaFlow; @end -@interface PigeonSignInProvider : NSObject +@interface InternalSignInProvider : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; + (instancetype)makeWithProviderId:(NSString *)providerId @@ -238,7 +252,7 @@ typedef NS_ENUM(NSUInteger, ActionCodeInfoOperation) { @property(nonatomic, copy, nullable) NSDictionary *customParameters; @end -@interface PigeonVerifyPhoneNumberRequest : NSObject +@interface InternalVerifyPhoneNumberRequest : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; + (instancetype)makeWithPhoneNumber:(nullable NSString *)phoneNumber @@ -255,7 +269,7 @@ typedef NS_ENUM(NSUInteger, ActionCodeInfoOperation) { @property(nonatomic, copy, nullable) NSString *multiFactorSessionId; @end -@interface PigeonIdTokenResult : NSObject +@interface InternalIdTokenResult : NSObject + (instancetype)makeWithToken:(nullable NSString *)token expirationTimestamp:(nullable NSNumber *)expirationTimestamp authTimestamp:(nullable NSNumber *)authTimestamp @@ -272,7 +286,7 @@ typedef NS_ENUM(NSUInteger, ActionCodeInfoOperation) { @property(nonatomic, copy, nullable) NSString *signInSecondFactor; @end -@interface PigeonUserProfile : NSObject +@interface InternalUserProfile : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; + (instancetype)makeWithDisplayName:(nullable NSString *)displayName @@ -285,7 +299,7 @@ typedef NS_ENUM(NSUInteger, ActionCodeInfoOperation) { @property(nonatomic, assign) BOOL photoUrlChanged; @end -@interface PigeonTotpSecret : NSObject +@interface InternalTotpSecret : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; + (instancetype)makeWithCodeIntervalSeconds:(nullable NSNumber *)codeIntervalSeconds @@ -300,8 +314,8 @@ typedef NS_ENUM(NSUInteger, ActionCodeInfoOperation) { @property(nonatomic, copy) NSString *secretKey; @end -/// The codec used by FirebaseAuthHostApi. -NSObject *FirebaseAuthHostApiGetCodec(void); +/// The codec used by all APIs. +NSObject *nullGetFirebaseAuthMessagesCodec(void); @protocol FirebaseAuthHostApi - (void)registerIdTokenListenerApp:(AuthPigeonFirebaseApp *)app @@ -319,8 +333,8 @@ NSObject *FirebaseAuthHostApiGetCodec(void); completion:(void (^)(FlutterError *_Nullable))completion; - (void)checkActionCodeApp:(AuthPigeonFirebaseApp *)app code:(NSString *)code - completion: - (void (^)(PigeonActionCodeInfo *_Nullable, FlutterError *_Nullable))completion; + completion:(void (^)(InternalActionCodeInfo *_Nullable, + FlutterError *_Nullable))completion; - (void)confirmPasswordResetApp:(AuthPigeonFirebaseApp *)app code:(NSString *)code newPassword:(NSString *)newPassword @@ -328,32 +342,32 @@ NSObject *FirebaseAuthHostApiGetCodec(void); - (void)createUserWithEmailAndPasswordApp:(AuthPigeonFirebaseApp *)app email:(NSString *)email password:(NSString *)password - completion:(void (^)(PigeonUserCredential *_Nullable, + completion:(void (^)(InternalUserCredential *_Nullable, FlutterError *_Nullable))completion; - (void)signInAnonymouslyApp:(AuthPigeonFirebaseApp *)app - completion:(void (^)(PigeonUserCredential *_Nullable, + completion:(void (^)(InternalUserCredential *_Nullable, FlutterError *_Nullable))completion; - (void)signInWithCredentialApp:(AuthPigeonFirebaseApp *)app input:(NSDictionary *)input - completion:(void (^)(PigeonUserCredential *_Nullable, + completion:(void (^)(InternalUserCredential *_Nullable, FlutterError *_Nullable))completion; - (void)signInWithCustomTokenApp:(AuthPigeonFirebaseApp *)app token:(NSString *)token - completion:(void (^)(PigeonUserCredential *_Nullable, + completion:(void (^)(InternalUserCredential *_Nullable, FlutterError *_Nullable))completion; - (void)signInWithEmailAndPasswordApp:(AuthPigeonFirebaseApp *)app email:(NSString *)email password:(NSString *)password - completion:(void (^)(PigeonUserCredential *_Nullable, + completion:(void (^)(InternalUserCredential *_Nullable, FlutterError *_Nullable))completion; - (void)signInWithEmailLinkApp:(AuthPigeonFirebaseApp *)app email:(NSString *)email emailLink:(NSString *)emailLink - completion:(void (^)(PigeonUserCredential *_Nullable, + completion:(void (^)(InternalUserCredential *_Nullable, FlutterError *_Nullable))completion; - (void)signInWithProviderApp:(AuthPigeonFirebaseApp *)app - signInProvider:(PigeonSignInProvider *)signInProvider - completion:(void (^)(PigeonUserCredential *_Nullable, + signInProvider:(InternalSignInProvider *)signInProvider + completion:(void (^)(InternalUserCredential *_Nullable, FlutterError *_Nullable))completion; - (void)signOutApp:(AuthPigeonFirebaseApp *)app completion:(void (^)(FlutterError *_Nullable))completion; @@ -363,28 +377,31 @@ NSObject *FirebaseAuthHostApiGetCodec(void); FlutterError *_Nullable))completion; - (void)sendPasswordResetEmailApp:(AuthPigeonFirebaseApp *)app email:(NSString *)email - actionCodeSettings:(nullable PigeonActionCodeSettings *)actionCodeSettings + actionCodeSettings:(nullable InternalActionCodeSettings *)actionCodeSettings completion:(void (^)(FlutterError *_Nullable))completion; - (void)sendSignInLinkToEmailApp:(AuthPigeonFirebaseApp *)app email:(NSString *)email - actionCodeSettings:(PigeonActionCodeSettings *)actionCodeSettings + actionCodeSettings:(InternalActionCodeSettings *)actionCodeSettings completion:(void (^)(FlutterError *_Nullable))completion; - (void)setLanguageCodeApp:(AuthPigeonFirebaseApp *)app languageCode:(nullable NSString *)languageCode completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; - (void)setSettingsApp:(AuthPigeonFirebaseApp *)app - settings:(PigeonFirebaseAuthSettings *)settings + settings:(InternalFirebaseAuthSettings *)settings completion:(void (^)(FlutterError *_Nullable))completion; - (void)verifyPasswordResetCodeApp:(AuthPigeonFirebaseApp *)app code:(NSString *)code completion: (void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; - (void)verifyPhoneNumberApp:(AuthPigeonFirebaseApp *)app - request:(PigeonVerifyPhoneNumberRequest *)request + request:(InternalVerifyPhoneNumberRequest *)request completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; - (void)revokeTokenWithAuthorizationCodeApp:(AuthPigeonFirebaseApp *)app authorizationCode:(NSString *)authorizationCode completion:(void (^)(FlutterError *_Nullable))completion; +- (void)revokeAccessTokenApp:(AuthPigeonFirebaseApp *)app + accessToken:(NSString *)accessToken + completion:(void (^)(FlutterError *_Nullable))completion; - (void)initializeRecaptchaConfigApp:(AuthPigeonFirebaseApp *)app completion:(void (^)(FlutterError *_Nullable))completion; @end @@ -396,57 +413,56 @@ extern void SetUpFirebaseAuthHostApiWithSuffix(id binary NSObject *_Nullable api, NSString *messageChannelSuffix); -/// The codec used by FirebaseAuthUserHostApi. -NSObject *FirebaseAuthUserHostApiGetCodec(void); - @protocol FirebaseAuthUserHostApi - (void)deleteApp:(AuthPigeonFirebaseApp *)app completion:(void (^)(FlutterError *_Nullable))completion; - (void)getIdTokenApp:(AuthPigeonFirebaseApp *)app forceRefresh:(BOOL)forceRefresh - completion:(void (^)(PigeonIdTokenResult *_Nullable, FlutterError *_Nullable))completion; + completion: + (void (^)(InternalIdTokenResult *_Nullable, FlutterError *_Nullable))completion; - (void)linkWithCredentialApp:(AuthPigeonFirebaseApp *)app input:(NSDictionary *)input - completion:(void (^)(PigeonUserCredential *_Nullable, + completion:(void (^)(InternalUserCredential *_Nullable, FlutterError *_Nullable))completion; - (void)linkWithProviderApp:(AuthPigeonFirebaseApp *)app - signInProvider:(PigeonSignInProvider *)signInProvider - completion: - (void (^)(PigeonUserCredential *_Nullable, FlutterError *_Nullable))completion; + signInProvider:(InternalSignInProvider *)signInProvider + completion:(void (^)(InternalUserCredential *_Nullable, + FlutterError *_Nullable))completion; - (void)reauthenticateWithCredentialApp:(AuthPigeonFirebaseApp *)app input:(NSDictionary *)input - completion:(void (^)(PigeonUserCredential *_Nullable, + completion:(void (^)(InternalUserCredential *_Nullable, FlutterError *_Nullable))completion; - (void)reauthenticateWithProviderApp:(AuthPigeonFirebaseApp *)app - signInProvider:(PigeonSignInProvider *)signInProvider - completion:(void (^)(PigeonUserCredential *_Nullable, + signInProvider:(InternalSignInProvider *)signInProvider + completion:(void (^)(InternalUserCredential *_Nullable, FlutterError *_Nullable))completion; - (void)reloadApp:(AuthPigeonFirebaseApp *)app - completion:(void (^)(PigeonUserDetails *_Nullable, FlutterError *_Nullable))completion; + completion:(void (^)(InternalUserDetails *_Nullable, FlutterError *_Nullable))completion; - (void)sendEmailVerificationApp:(AuthPigeonFirebaseApp *)app - actionCodeSettings:(nullable PigeonActionCodeSettings *)actionCodeSettings + actionCodeSettings:(nullable InternalActionCodeSettings *)actionCodeSettings completion:(void (^)(FlutterError *_Nullable))completion; - (void)unlinkApp:(AuthPigeonFirebaseApp *)app providerId:(NSString *)providerId - completion:(void (^)(PigeonUserCredential *_Nullable, FlutterError *_Nullable))completion; + completion:(void (^)(InternalUserCredential *_Nullable, FlutterError *_Nullable))completion; - (void)updateEmailApp:(AuthPigeonFirebaseApp *)app newEmail:(NSString *)newEmail - completion:(void (^)(PigeonUserDetails *_Nullable, FlutterError *_Nullable))completion; + completion: + (void (^)(InternalUserDetails *_Nullable, FlutterError *_Nullable))completion; - (void)updatePasswordApp:(AuthPigeonFirebaseApp *)app newPassword:(NSString *)newPassword completion: - (void (^)(PigeonUserDetails *_Nullable, FlutterError *_Nullable))completion; + (void (^)(InternalUserDetails *_Nullable, FlutterError *_Nullable))completion; - (void)updatePhoneNumberApp:(AuthPigeonFirebaseApp *)app input:(NSDictionary *)input completion: - (void (^)(PigeonUserDetails *_Nullable, FlutterError *_Nullable))completion; + (void (^)(InternalUserDetails *_Nullable, FlutterError *_Nullable))completion; - (void)updateProfileApp:(AuthPigeonFirebaseApp *)app - profile:(PigeonUserProfile *)profile + profile:(InternalUserProfile *)profile completion: - (void (^)(PigeonUserDetails *_Nullable, FlutterError *_Nullable))completion; + (void (^)(InternalUserDetails *_Nullable, FlutterError *_Nullable))completion; - (void)verifyBeforeUpdateEmailApp:(AuthPigeonFirebaseApp *)app newEmail:(NSString *)newEmail - actionCodeSettings:(nullable PigeonActionCodeSettings *)actionCodeSettings + actionCodeSettings:(nullable InternalActionCodeSettings *)actionCodeSettings completion:(void (^)(FlutterError *_Nullable))completion; @end @@ -457,12 +473,9 @@ extern void SetUpFirebaseAuthUserHostApiWithSuffix(id bi NSObject *_Nullable api, NSString *messageChannelSuffix); -/// The codec used by MultiFactorUserHostApi. -NSObject *MultiFactorUserHostApiGetCodec(void); - @protocol MultiFactorUserHostApi - (void)enrollPhoneApp:(AuthPigeonFirebaseApp *)app - assertion:(PigeonPhoneMultiFactorAssertion *)assertion + assertion:(InternalPhoneMultiFactorAssertion *)assertion displayName:(nullable NSString *)displayName completion:(void (^)(FlutterError *_Nullable))completion; - (void)enrollTotpApp:(AuthPigeonFirebaseApp *)app @@ -471,12 +484,12 @@ NSObject *MultiFactorUserHostApiGetCodec(void); completion:(void (^)(FlutterError *_Nullable))completion; - (void)getSessionApp:(AuthPigeonFirebaseApp *)app completion: - (void (^)(PigeonMultiFactorSession *_Nullable, FlutterError *_Nullable))completion; + (void (^)(InternalMultiFactorSession *_Nullable, FlutterError *_Nullable))completion; - (void)unenrollApp:(AuthPigeonFirebaseApp *)app factorUid:(NSString *)factorUid completion:(void (^)(FlutterError *_Nullable))completion; - (void)getEnrolledFactorsApp:(AuthPigeonFirebaseApp *)app - completion:(void (^)(NSArray *_Nullable, + completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; @end @@ -487,14 +500,11 @@ extern void SetUpMultiFactorUserHostApiWithSuffix(id bin NSObject *_Nullable api, NSString *messageChannelSuffix); -/// The codec used by MultiFactoResolverHostApi. -NSObject *MultiFactoResolverHostApiGetCodec(void); - @protocol MultiFactoResolverHostApi - (void)resolveSignInResolverId:(NSString *)resolverId - assertion:(nullable PigeonPhoneMultiFactorAssertion *)assertion + assertion:(nullable InternalPhoneMultiFactorAssertion *)assertion totpAssertionId:(nullable NSString *)totpAssertionId - completion:(void (^)(PigeonUserCredential *_Nullable, + completion:(void (^)(InternalUserCredential *_Nullable, FlutterError *_Nullable))completion; @end @@ -505,13 +515,10 @@ extern void SetUpMultiFactoResolverHostApiWithSuffix( id binaryMessenger, NSObject *_Nullable api, NSString *messageChannelSuffix); -/// The codec used by MultiFactorTotpHostApi. -NSObject *MultiFactorTotpHostApiGetCodec(void); - @protocol MultiFactorTotpHostApi - (void)generateSecretSessionId:(NSString *)sessionId - completion: - (void (^)(PigeonTotpSecret *_Nullable, FlutterError *_Nullable))completion; + completion:(void (^)(InternalTotpSecret *_Nullable, + FlutterError *_Nullable))completion; - (void)getAssertionForEnrollmentSecretKey:(NSString *)secretKey oneTimePassword:(NSString *)oneTimePassword completion:(void (^)(NSString *_Nullable, @@ -529,9 +536,6 @@ extern void SetUpMultiFactorTotpHostApiWithSuffix(id bin NSObject *_Nullable api, NSString *messageChannelSuffix); -/// The codec used by MultiFactorTotpSecretHostApi. -NSObject *MultiFactorTotpSecretHostApiGetCodec(void); - @protocol MultiFactorTotpSecretHostApi - (void)generateQrCodeUrlSecretKey:(NSString *)secretKey accountName:(nullable NSString *)accountName @@ -551,12 +555,9 @@ extern void SetUpMultiFactorTotpSecretHostApiWithSuffix( id binaryMessenger, NSObject *_Nullable api, NSString *messageChannelSuffix); -/// The codec used by GenerateInterfaces. -NSObject *GenerateInterfacesGetCodec(void); - /// Only used to generate the object interface that are use outside of the Pigeon interface @protocol GenerateInterfaces -- (void)pigeonInterfaceInfo:(PigeonMultiFactorInfo *)info +- (void)pigeonInterfaceInfo:(InternalMultiFactorInfo *)info error:(FlutterError *_Nullable *_Nonnull)error; @end diff --git a/packages/firebase_auth/firebase_auth/test/firebase_auth_test.dart b/packages/firebase_auth/firebase_auth/test/firebase_auth_test.dart index f53d18e5dccf..cbaaafcdacce 100644 --- a/packages/firebase_auth/firebase_auth/test/firebase_auth_test.dart +++ b/packages/firebase_auth/firebase_auth/test/firebase_auth_test.dart @@ -68,8 +68,8 @@ void main() { final int kMockLastSignInTimestamp = DateTime.now().subtract(const Duration(days: 1)).millisecondsSinceEpoch; - final kMockUser = PigeonUserDetails( - userInfo: PigeonUserInfo( + final kMockUser = InternalUserDetails( + userInfo: InternalUserInfo( uid: '12345', displayName: 'displayName', creationTimestamp: kMockCreationTimestamp, @@ -98,7 +98,7 @@ void main() { MockFirebaseAuth mockAuthPlatform = MockFirebaseAuth(); group('$FirebaseAuth', () { - PigeonUserDetails user; + InternalUserDetails user; // used to generate a unique application name for each test var testCount = 0; @@ -995,7 +995,7 @@ class MockFirebaseAuth extends Mock @override FirebaseAuthPlatform setInitialValues({ - PigeonUserDetails? currentUser, + InternalUserDetails? currentUser, String? languageCode, }) { return super.noSuchMethod( @@ -1192,7 +1192,7 @@ class FakeFirebaseAuthPlatform extends Fake @override FirebaseAuthPlatform setInitialValues({ - PigeonUserDetails? currentUser, + InternalUserDetails? currentUser, String? languageCode, }) { return this; @@ -1203,7 +1203,7 @@ class MockUserPlatform extends Mock with MockPlatformInterfaceMixin implements TestUserPlatform { MockUserPlatform(FirebaseAuthPlatform auth, MultiFactorPlatform multiFactor, - PigeonUserDetails _user) { + InternalUserDetails _user) { TestUserPlatform(auth, multiFactor, _user); } } @@ -1254,7 +1254,7 @@ class TestFirebaseAuthPlatform extends FirebaseAuthPlatform { @override FirebaseAuthPlatform setInitialValues({ - PigeonUserDetails? currentUser, + InternalUserDetails? currentUser, String? languageCode, }) { return this; @@ -1323,7 +1323,7 @@ class TestAuthProvider extends AuthProvider { class TestUserPlatform extends UserPlatform { TestUserPlatform(FirebaseAuthPlatform auth, MultiFactorPlatform multiFactor, - PigeonUserDetails data) + InternalUserDetails data) : super(auth, multiFactor, data); } diff --git a/packages/firebase_auth/firebase_auth/test/user_test.dart b/packages/firebase_auth/firebase_auth/test/user_test.dart index 0b2abfb19ce9..967be866fee2 100644 --- a/packages/firebase_auth/firebase_auth/test/user_test.dart +++ b/packages/firebase_auth/firebase_auth/test/user_test.dart @@ -31,7 +31,7 @@ void main() { late FirebaseAuth auth; - final kMockIdTokenResult = PigeonIdTokenResult( + final kMockIdTokenResult = InternalIdTokenResult( token: '12345', expirationTimestamp: 123456, authTimestamp: 1234567, @@ -47,8 +47,8 @@ void main() { final int kMockLastSignInTimestamp = DateTime.now().subtract(const Duration(days: 1)).millisecondsSinceEpoch; - final kMockUser = PigeonUserDetails( - userInfo: PigeonUserInfo( + final kMockUser = InternalUserDetails( + userInfo: InternalUserInfo( uid: '12345', displayName: 'displayName', creationTimestamp: kMockCreationTimestamp, @@ -85,7 +85,7 @@ void main() { var mockAuthPlatform = MockFirebaseAuth(); group('$User', () { - late PigeonUserDetails user; + late InternalUserDetails user; // used to generate a unique application name for each test var testCount = 0; @@ -376,7 +376,7 @@ class MockFirebaseAuth extends Mock @override FirebaseAuthPlatform setInitialValues({ - PigeonUserDetails? currentUser, + InternalUserDetails? currentUser, String? languageCode, }) { return super.noSuchMethod( @@ -393,7 +393,7 @@ class MockFirebaseAuth extends Mock class MockUserPlatform extends Mock with MockPlatformInterfaceMixin implements TestUserPlatform { - MockUserPlatform(FirebaseAuthPlatform auth, PigeonUserDetails _user) { + MockUserPlatform(FirebaseAuthPlatform auth, InternalUserDetails _user) { TestUserPlatform(auth, TestMultiFactorPlatform(auth), _user); } @@ -544,7 +544,7 @@ class TestFirebaseAuthPlatform extends FirebaseAuthPlatform { @override FirebaseAuthPlatform setInitialValues({ - PigeonUserDetails? currentUser, + InternalUserDetails? currentUser, String? languageCode, }) { return this; @@ -553,7 +553,7 @@ class TestFirebaseAuthPlatform extends FirebaseAuthPlatform { class TestUserPlatform extends UserPlatform { TestUserPlatform(FirebaseAuthPlatform auth, MultiFactorPlatform multiFactor, - PigeonUserDetails data) + InternalUserDetails data) : super(auth, multiFactor, data); } diff --git a/packages/firebase_auth/firebase_auth/windows/firebase_auth_plugin.cpp b/packages/firebase_auth/firebase_auth/windows/firebase_auth_plugin.cpp index 5a4f1bf27faf..a931dac2b36b 100644 --- a/packages/firebase_auth/firebase_auth/windows/firebase_auth_plugin.cpp +++ b/packages/firebase_auth/firebase_auth/windows/firebase_auth_plugin.cpp @@ -79,9 +79,9 @@ Auth* GetAuthFromPigeon(const AuthPigeonFirebaseApp& pigeonApp) { return auth; } -PigeonUserCredential ParseAuthResult( +InternalUserCredential ParseAuthResult( const firebase::auth::AuthResult* authResult) { - PigeonUserCredential result = PigeonUserCredential(); + InternalUserCredential result = InternalUserCredential(); result.set_user(FirebaseAuthPlugin::ParseUserDetails(authResult->user)); result.set_additional_user_info(FirebaseAuthPlugin::ParseAdditionalUserInfo( authResult->additional_user_info)); @@ -133,29 +133,29 @@ firebase_auth_windows::FirebaseAuthPlugin::ConvertToEncodableValue( } } -PigeonAdditionalUserInfo FirebaseAuthPlugin::ParseAdditionalUserInfo( +InternalAdditionalUserInfo FirebaseAuthPlugin::ParseAdditionalUserInfo( const firebase::auth::AdditionalUserInfo additionalUserInfo) { // Cannot know if the user is new or not with current API - PigeonAdditionalUserInfo result = PigeonAdditionalUserInfo(false); + InternalAdditionalUserInfo result = InternalAdditionalUserInfo(false); result.set_profile(ConvertToEncodableMap(additionalUserInfo.profile)); result.set_provider_id(additionalUserInfo.provider_id); result.set_username(additionalUserInfo.user_name); return result; } -PigeonUserDetails FirebaseAuthPlugin::ParseUserDetails( +InternalUserDetails FirebaseAuthPlugin::ParseUserDetails( const firebase::auth::User user) { - PigeonUserDetails result = - PigeonUserDetails(FirebaseAuthPlugin::ParseUserInfo(&user), - FirebaseAuthPlugin::ParseProviderData(&user)); + InternalUserDetails result = + InternalUserDetails(FirebaseAuthPlugin::ParseUserInfo(&user), + FirebaseAuthPlugin::ParseProviderData(&user)); return result; } -PigeonUserInfo FirebaseAuthPlugin::ParseUserInfo( +InternalUserInfo FirebaseAuthPlugin::ParseUserInfo( const firebase::auth::User* user) { - PigeonUserInfo result = PigeonUserInfo(user->uid(), user->is_anonymous(), - user->is_email_verified()); + InternalUserInfo result = InternalUserInfo(user->uid(), user->is_anonymous(), + user->is_email_verified()); result.set_display_name(user->display_name()); result.set_email(user->email()); result.set_phone_number(user->phone_number()); @@ -322,7 +322,8 @@ class FlutterIdTokenListener : public firebase::auth::IdTokenListener { void OnIdTokenChanged(Auth* auth) override { // Generate your ID Token firebase::auth::User user = auth->current_user(); - PigeonUserDetails userDetails = FirebaseAuthPlugin::ParseUserDetails(user); + InternalUserDetails userDetails = + FirebaseAuthPlugin::ParseUserDetails(user); using flutter::EncodableList; using flutter::EncodableMap; @@ -406,7 +407,8 @@ class FlutterAuthStateListener : public firebase::auth::AuthStateListener { void OnAuthStateChanged(Auth* auth) override { // Generate your ID Token firebase::auth::User user = auth->current_user(); - PigeonUserDetails userDetails = FirebaseAuthPlugin::ParseUserDetails(user); + InternalUserDetails userDetails = + FirebaseAuthPlugin::ParseUserDetails(user); using flutter::EncodableList; using flutter::EncodableMap; @@ -503,7 +505,7 @@ void FirebaseAuthPlugin::ApplyActionCode( void FirebaseAuthPlugin::CheckActionCode( const AuthPigeonFirebaseApp& app, const std::string& code, - std::function reply)> result) { + std::function reply)> result) { result(FlutterError("unimplemented", "CheckActionCode is not available on this platform yet.", nullptr)); @@ -521,7 +523,7 @@ void FirebaseAuthPlugin::ConfirmPasswordReset( void FirebaseAuthPlugin::CreateUserWithEmailAndPassword( const AuthPigeonFirebaseApp& app, const std::string& email, const std::string& password, - std::function reply)> result) { + std::function reply)> result) { firebase::auth::Auth* firebaseAuth = GetAuthFromPigeon(app); firebase::Future createUserFuture = @@ -533,7 +535,7 @@ void FirebaseAuthPlugin::CreateUserWithEmailAndPassword( completed_future) { // We are probably in a different thread right now. if (completed_future.error() == 0) { - PigeonUserCredential credential = + InternalUserCredential credential = ParseAuthResult(completed_future.result()); result(credential); } else { @@ -544,7 +546,7 @@ void FirebaseAuthPlugin::CreateUserWithEmailAndPassword( void FirebaseAuthPlugin::SignInAnonymously( const AuthPigeonFirebaseApp& app, - std::function reply)> result) { + std::function reply)> result) { firebase::auth::Auth* firebaseAuth = GetAuthFromPigeon(app); firebase::Future signInFuture = @@ -555,7 +557,7 @@ void FirebaseAuthPlugin::SignInAnonymously( completed_future) { // We are probably in a different thread right now. if (completed_future.error() == 0) { - PigeonUserCredential credential = + InternalUserCredential credential = ParseAuthResult(completed_future.result()); result(credential); } else { @@ -689,7 +691,7 @@ firebase::auth::Credential getCredentialFromArguments( void FirebaseAuthPlugin::SignInWithCredential( const AuthPigeonFirebaseApp& app, const flutter::EncodableMap& input, - std::function reply)> result) { + std::function reply)> result) { firebase::auth::Auth* firebaseAuth = GetAuthFromPigeon(app); firebase::Future signInFuture = @@ -700,10 +702,11 @@ void FirebaseAuthPlugin::SignInWithCredential( [result](const firebase::Future& completed_future) { if (completed_future.error() == 0) { // TODO: not the right return type from C++ SDK - PigeonUserInfo credential = ParseUserInfo(completed_future.result()); - PigeonUserCredential userCredential = PigeonUserCredential(); - PigeonUserDetails user = - PigeonUserDetails(credential, flutter::EncodableList()); + InternalUserInfo credential = + ParseUserInfo(completed_future.result()); + InternalUserCredential userCredential = InternalUserCredential(); + InternalUserDetails user = + InternalUserDetails(credential, flutter::EncodableList()); userCredential.set_user(user); result(userCredential); } else { @@ -714,7 +717,7 @@ void FirebaseAuthPlugin::SignInWithCredential( void FirebaseAuthPlugin::SignInWithCustomToken( const AuthPigeonFirebaseApp& app, const std::string& token, - std::function reply)> result) { + std::function reply)> result) { firebase::auth::Auth* firebaseAuth = GetAuthFromPigeon(app); firebase::Future signInFuture = @@ -725,7 +728,7 @@ void FirebaseAuthPlugin::SignInWithCustomToken( completed_future) { // We are probably in a different thread right now. if (completed_future.error() == 0) { - PigeonUserCredential credential = + InternalUserCredential credential = ParseAuthResult(completed_future.result()); result(credential); } else { @@ -737,7 +740,7 @@ void FirebaseAuthPlugin::SignInWithCustomToken( void FirebaseAuthPlugin::SignInWithEmailAndPassword( const AuthPigeonFirebaseApp& app, const std::string& email, const std::string& password, - std::function reply)> result) { + std::function reply)> result) { firebase::auth::Auth* firebaseAuth = GetAuthFromPigeon(app); firebase::Future signInFuture = @@ -748,7 +751,7 @@ void FirebaseAuthPlugin::SignInWithEmailAndPassword( completed_future) { // We are probably in a different thread right now. if (completed_future.error() == 0) { - PigeonUserCredential credential = + InternalUserCredential credential = ParseAuthResult(completed_future.result()); result(credential); } else { @@ -760,7 +763,7 @@ void FirebaseAuthPlugin::SignInWithEmailAndPassword( void FirebaseAuthPlugin::SignInWithEmailLink( const AuthPigeonFirebaseApp& app, const std::string& email, const std::string& email_link, - std::function reply)> result) { + std::function reply)> result) { result(FlutterError( "unimplemented", "SignInWithEmailLink is not available on this platform yet.", nullptr)); @@ -795,7 +798,7 @@ std::map TransformEncodableMap( } firebase::auth::FederatedOAuthProvider getProviderFromArguments( - const PigeonSignInProvider& sign_in_provider) { + const InternalSignInProvider& sign_in_provider) { firebase::auth::FederatedOAuthProviderData federatedOAuthProviderData = firebase::auth::FederatedOAuthProviderData( sign_in_provider.provider_id().c_str(), @@ -809,8 +812,8 @@ firebase::auth::FederatedOAuthProvider getProviderFromArguments( void FirebaseAuthPlugin::SignInWithProvider( const AuthPigeonFirebaseApp& app, - const PigeonSignInProvider& sign_in_provider, - std::function reply)> result) { + const InternalSignInProvider& sign_in_provider, + std::function reply)> result) { firebase::auth::Auth* firebaseAuth = GetAuthFromPigeon(app); firebase::Future signInFuture = @@ -822,7 +825,7 @@ void FirebaseAuthPlugin::SignInWithProvider( completed_future) { // We are probably in a different thread right now. if (completed_future.error() == 0) { - PigeonUserCredential credential = + InternalUserCredential credential = ParseAuthResult(completed_future.result()); result(credential); } else { @@ -875,7 +878,7 @@ void FirebaseAuthPlugin::FetchSignInMethodsForEmail( void FirebaseAuthPlugin::SendPasswordResetEmail( const AuthPigeonFirebaseApp& app, const std::string& email, - const PigeonActionCodeSettings* action_code_settings, + const InternalActionCodeSettings* action_code_settings, std::function reply)> result) { firebase::auth::Auth* firebaseAuth = GetAuthFromPigeon(app); @@ -895,7 +898,7 @@ void FirebaseAuthPlugin::SendPasswordResetEmail( void FirebaseAuthPlugin::SendSignInLinkToEmail( const AuthPigeonFirebaseApp& app, const std::string& email, - const PigeonActionCodeSettings& action_code_settings, + const InternalActionCodeSettings& action_code_settings, std::function reply)> result) { result(FlutterError( "unimplemented", @@ -920,7 +923,7 @@ void FirebaseAuthPlugin::SetLanguageCode( void FirebaseAuthPlugin::SetSettings( const AuthPigeonFirebaseApp& app, - const PigeonFirebaseAuthSettings& settings, + const InternalFirebaseAuthSettings& settings, std::function reply)> result) { result(FlutterError("unimplemented", "SetSettings is not available on this platform yet.", @@ -938,7 +941,7 @@ void FirebaseAuthPlugin::VerifyPasswordResetCode( void FirebaseAuthPlugin::VerifyPhoneNumber( const AuthPigeonFirebaseApp& app, - const PigeonVerifyPhoneNumberRequest& request, + const InternalVerifyPhoneNumberRequest& request, std::function reply)> result) { result(FlutterError( "unimplemented", @@ -965,7 +968,7 @@ void FirebaseAuthPlugin::Delete( void FirebaseAuthPlugin::GetIdToken( const AuthPigeonFirebaseApp& app, bool force_refresh, - std::function reply)> result) { + std::function reply)> result) { firebase::auth::Auth* firebaseAuth = GetAuthFromPigeon(app); firebase::auth::User user = firebaseAuth->current_user(); @@ -975,7 +978,7 @@ void FirebaseAuthPlugin::GetIdToken( [result](const firebase::Future& completed_future) { // We are probably in a different thread right now. if (completed_future.error() == 0) { - PigeonIdTokenResult token_result; + InternalIdTokenResult token_result; std::string_view sv(*completed_future.result()); token_result.set_token(sv); result(token_result); @@ -987,7 +990,7 @@ void FirebaseAuthPlugin::GetIdToken( void FirebaseAuthPlugin::LinkWithCredential( const AuthPigeonFirebaseApp& app, const flutter::EncodableMap& input, - std::function reply)> result) { + std::function reply)> result) { firebase::auth::Auth* firebaseAuth = GetAuthFromPigeon(app); firebase::auth::User user = firebaseAuth->current_user(); @@ -999,7 +1002,7 @@ void FirebaseAuthPlugin::LinkWithCredential( completed_future) { // We are probably in a different thread right now. if (completed_future.error() == 0) { - PigeonUserCredential credential = + InternalUserCredential credential = ParseAuthResult(completed_future.result()); result(credential); } else { @@ -1010,8 +1013,8 @@ void FirebaseAuthPlugin::LinkWithCredential( void FirebaseAuthPlugin::LinkWithProvider( const AuthPigeonFirebaseApp& app, - const PigeonSignInProvider& sign_in_provider, - std::function reply)> result) { + const InternalSignInProvider& sign_in_provider, + std::function reply)> result) { firebase::auth::Auth* firebaseAuth = GetAuthFromPigeon(app); firebase::auth::User user = firebaseAuth->current_user(); @@ -1023,7 +1026,7 @@ void FirebaseAuthPlugin::LinkWithProvider( completed_future) { // We are probably in a different thread right now. if (completed_future.error() == 0) { - PigeonUserCredential credential = + InternalUserCredential credential = ParseAuthResult(completed_future.result()); result(credential); } else { @@ -1034,7 +1037,7 @@ void FirebaseAuthPlugin::LinkWithProvider( void FirebaseAuthPlugin::ReauthenticateWithCredential( const AuthPigeonFirebaseApp& app, const flutter::EncodableMap& input, - std::function reply)> result) { + std::function reply)> result) { firebase::auth::Auth* firebaseAuth = GetAuthFromPigeon(app); firebase::auth::User user = firebaseAuth->current_user(); @@ -1053,8 +1056,8 @@ void FirebaseAuthPlugin::ReauthenticateWithCredential( void FirebaseAuthPlugin::ReauthenticateWithProvider( const AuthPigeonFirebaseApp& app, - const PigeonSignInProvider& sign_in_provider, - std::function reply)> result) { + const InternalSignInProvider& sign_in_provider, + std::function reply)> result) { firebase::auth::Auth* firebaseAuth = GetAuthFromPigeon(app); firebase::auth::User user = firebaseAuth->current_user(); @@ -1067,7 +1070,7 @@ void FirebaseAuthPlugin::ReauthenticateWithProvider( completed_future) { // We are probably in a different thread right now. if (completed_future.error() == 0) { - PigeonUserCredential credential = + InternalUserCredential credential = ParseAuthResult(completed_future.result()); result(credential); } else { @@ -1078,7 +1081,7 @@ void FirebaseAuthPlugin::ReauthenticateWithProvider( void FirebaseAuthPlugin::Reload( const AuthPigeonFirebaseApp& app, - std::function reply)> result) { + std::function reply)> result) { firebase::auth::Auth* firebaseAuth = GetAuthFromPigeon(app); firebase::auth::User user = firebaseAuth->current_user(); @@ -1088,7 +1091,7 @@ void FirebaseAuthPlugin::Reload( const firebase::Future& completed_future) { // We are probably in a different thread right now. if (completed_future.error() == 0) { - PigeonUserDetails user = ParseUserDetails(firebaseAuth->current_user()); + InternalUserDetails user = ParseUserDetails(firebaseAuth->current_user()); result(user); } else { result(FirebaseAuthPlugin::ParseError(completed_future)); @@ -1098,7 +1101,7 @@ void FirebaseAuthPlugin::Reload( void FirebaseAuthPlugin::SendEmailVerification( const AuthPigeonFirebaseApp& app, - const PigeonActionCodeSettings* action_code_settings, + const InternalActionCodeSettings* action_code_settings, std::function reply)> result) { firebase::auth::Auth* firebaseAuth = GetAuthFromPigeon(app); firebase::auth::User user = firebaseAuth->current_user(); @@ -1117,7 +1120,7 @@ void FirebaseAuthPlugin::SendEmailVerification( void FirebaseAuthPlugin::Unlink( const AuthPigeonFirebaseApp& app, const std::string& provider_id, - std::function reply)> result) { + std::function reply)> result) { firebase::auth::Auth* firebaseAuth = GetAuthFromPigeon(app); firebase::auth::User user = firebaseAuth->current_user(); @@ -1129,7 +1132,7 @@ void FirebaseAuthPlugin::Unlink( completed_future) { // We are probably in a different thread right now. if (completed_future.error() == 0) { - PigeonUserCredential credential = + InternalUserCredential credential = ParseAuthResult(completed_future.result()); result(credential); } else { @@ -1140,7 +1143,7 @@ void FirebaseAuthPlugin::Unlink( void FirebaseAuthPlugin::UpdateEmail( const AuthPigeonFirebaseApp& app, const std::string& new_email, - std::function reply)> result) { + std::function reply)> result) { firebase::auth::Auth* firebaseAuth = GetAuthFromPigeon(app); firebase::auth::User user = firebaseAuth->current_user(); @@ -1151,7 +1154,7 @@ void FirebaseAuthPlugin::UpdateEmail( const firebase::Future& completed_future) { // We are probably in a different thread right now. if (completed_future.error() == 0) { - PigeonUserDetails user = ParseUserDetails(firebaseAuth->current_user()); + InternalUserDetails user = ParseUserDetails(firebaseAuth->current_user()); result(user); } else { result(FirebaseAuthPlugin::ParseError(completed_future)); @@ -1161,7 +1164,7 @@ void FirebaseAuthPlugin::UpdateEmail( void FirebaseAuthPlugin::UpdatePassword( const AuthPigeonFirebaseApp& app, const std::string& new_password, - std::function reply)> result) { + std::function reply)> result) { firebase::auth::Auth* firebaseAuth = GetAuthFromPigeon(app); firebase::auth::User user = firebaseAuth->current_user(); @@ -1171,7 +1174,7 @@ void FirebaseAuthPlugin::UpdatePassword( const firebase::Future& completed_future) { // We are probably in a different thread right now. if (completed_future.error() == 0) { - PigeonUserDetails user = ParseUserDetails(firebaseAuth->current_user()); + InternalUserDetails user = ParseUserDetails(firebaseAuth->current_user()); result(user); } else { result(FirebaseAuthPlugin::ParseError(completed_future)); @@ -1202,7 +1205,7 @@ firebase::auth::PhoneAuthCredential getPhoneCredentialFromArguments( void FirebaseAuthPlugin::UpdatePhoneNumber( const AuthPigeonFirebaseApp& app, const flutter::EncodableMap& input, - std::function reply)> result) { + std::function reply)> result) { firebase::auth::Auth* firebaseAuth = GetAuthFromPigeon(app); firebase::auth::User user = firebaseAuth->current_user(); @@ -1214,7 +1217,8 @@ void FirebaseAuthPlugin::UpdatePhoneNumber( [result](const firebase::Future& completed_future) { // We are probably in a different thread right now. if (completed_future.error() == 0) { - PigeonUserDetails user = ParseUserDetails(*completed_future.result()); + InternalUserDetails user = + ParseUserDetails(*completed_future.result()); result(user); } else { result(FirebaseAuthPlugin::ParseError(completed_future)); @@ -1223,8 +1227,8 @@ void FirebaseAuthPlugin::UpdatePhoneNumber( } void FirebaseAuthPlugin::UpdateProfile( - const AuthPigeonFirebaseApp& app, const PigeonUserProfile& profile, - std::function reply)> result) { + const AuthPigeonFirebaseApp& app, const InternalUserProfile& profile, + std::function reply)> result) { firebase::auth::Auth* firebaseAuth = GetAuthFromPigeon(app); firebase::auth::User user = firebaseAuth->current_user(); @@ -1243,7 +1247,7 @@ void FirebaseAuthPlugin::UpdateProfile( const firebase::Future& completed_future) { // We are probably in a different thread right now. if (completed_future.error() == 0) { - PigeonUserDetails user = ParseUserDetails(firebaseAuth->current_user()); + InternalUserDetails user = ParseUserDetails(firebaseAuth->current_user()); result(user); } else { result(FirebaseAuthPlugin::ParseError(completed_future)); @@ -1253,7 +1257,7 @@ void FirebaseAuthPlugin::UpdateProfile( void FirebaseAuthPlugin::VerifyBeforeUpdateEmail( const AuthPigeonFirebaseApp& app, const std::string& new_email, - const PigeonActionCodeSettings* action_code_settings, + const InternalActionCodeSettings* action_code_settings, std::function reply)> result) { firebase::auth::Auth* firebaseAuth = GetAuthFromPigeon(app); firebase::auth::User user = firebaseAuth->current_user(); @@ -1286,6 +1290,23 @@ void FirebaseAuthPlugin::RevokeTokenWithAuthorizationCode( nullptr)); } +void FirebaseAuthPlugin::RevokeAccessToken( + const AuthPigeonFirebaseApp& app, const std::string& access_token, + std::function reply)> result) { + result(FlutterError("unimplemented", + "RevokeAccessToken is not available on this platform.", + nullptr)); +} + +void FirebaseAuthPlugin::InitializeRecaptchaConfig( + const AuthPigeonFirebaseApp& app, + std::function reply)> result) { + result(FlutterError( + "unimplemented", + "InitializeRecaptchaConfig is not available on this platform yet.", + nullptr)); +} + flutter::EncodableMap FirebaseAuthPlugin::GetPluginConstantsForFirebaseApp( const firebase::App& app) { flutter::EncodableMap constants; @@ -1294,7 +1315,7 @@ flutter::EncodableMap FirebaseAuthPlugin::GetPluginConstantsForFirebaseApp( firebase::auth::User user = auth->current_user(); if (user.is_valid()) { - PigeonUserDetails userDetails = ParseUserDetails(user); + InternalUserDetails userDetails = ParseUserDetails(user); flutter::EncodableList userDetailsList; userDetailsList.push_back( flutter::EncodableValue(userDetails.user_info().ToEncodableList())); diff --git a/packages/firebase_auth/firebase_auth/windows/firebase_auth_plugin.h b/packages/firebase_auth/firebase_auth/windows/firebase_auth_plugin.h index a75ff33e6cf5..575e201ff355 100644 --- a/packages/firebase_auth/firebase_auth/windows/firebase_auth_plugin.h +++ b/packages/firebase_auth/firebase_auth/windows/firebase_auth_plugin.h @@ -42,14 +42,14 @@ class FirebaseAuthPlugin : public flutter::Plugin, static std::string GetAuthErrorCode(AuthError authError); static FlutterError ParseError(const firebase::FutureBase& future); - static PigeonUserDetails ParseUserDetails(const firebase::auth::User user); - static PigeonAdditionalUserInfo ParseAdditionalUserInfo( + static InternalUserDetails ParseUserDetails(const firebase::auth::User user); + static InternalAdditionalUserInfo ParseAdditionalUserInfo( const firebase::auth::AdditionalUserInfo user); static flutter::EncodableMap ConvertToEncodableMap( const std::map& originalMap); static flutter::EncodableValue ConvertToEncodableValue( const firebase::Variant& variant); - static PigeonUserInfo ParseUserInfo(const firebase::auth::User* user); + static InternalUserInfo ParseUserInfo(const firebase::auth::User* user); static flutter::EncodableList ParseProviderData( const firebase::auth::User* user); static flutter::EncodableValue ParseUserInfoToMap( @@ -70,7 +70,8 @@ class FirebaseAuthPlugin : public flutter::Plugin, std::function reply)> result) override; virtual void CheckActionCode( const AuthPigeonFirebaseApp& app, const std::string& code, - std::function reply)> result) override; + std::function reply)> result) + override; virtual void ConfirmPasswordReset( const AuthPigeonFirebaseApp& app, const std::string& code, const std::string& new_password, @@ -78,28 +79,35 @@ class FirebaseAuthPlugin : public flutter::Plugin, virtual void CreateUserWithEmailAndPassword( const AuthPigeonFirebaseApp& app, const std::string& email, const std::string& password, - std::function reply)> result) override; + std::function reply)> result) + override; virtual void SignInAnonymously( const AuthPigeonFirebaseApp& app, - std::function reply)> result) override; + std::function reply)> result) + override; virtual void SignInWithCredential( const AuthPigeonFirebaseApp& app, const flutter::EncodableMap& input, - std::function reply)> result) override; + std::function reply)> result) + override; virtual void SignInWithCustomToken( const AuthPigeonFirebaseApp& app, const std::string& token, - std::function reply)> result) override; + std::function reply)> result) + override; virtual void SignInWithEmailAndPassword( const AuthPigeonFirebaseApp& app, const std::string& email, const std::string& password, - std::function reply)> result) override; + std::function reply)> result) + override; virtual void SignInWithEmailLink( const AuthPigeonFirebaseApp& app, const std::string& email, const std::string& email_link, - std::function reply)> result) override; + std::function reply)> result) + override; virtual void SignInWithProvider( const AuthPigeonFirebaseApp& app, - const PigeonSignInProvider& sign_in_provider, - std::function reply)> result) override; + const InternalSignInProvider& sign_in_provider, + std::function reply)> result) + override; virtual void SignOut( const AuthPigeonFirebaseApp& app, std::function reply)> result) override; @@ -109,25 +117,25 @@ class FirebaseAuthPlugin : public flutter::Plugin, override; virtual void SendPasswordResetEmail( const AuthPigeonFirebaseApp& app, const std::string& email, - const PigeonActionCodeSettings* action_code_settings, + const InternalActionCodeSettings* action_code_settings, std::function reply)> result) override; virtual void SendSignInLinkToEmail( const AuthPigeonFirebaseApp& app, const std::string& email, - const PigeonActionCodeSettings& action_code_settings, + const InternalActionCodeSettings& action_code_settings, std::function reply)> result) override; virtual void SetLanguageCode( const AuthPigeonFirebaseApp& app, const std::string* language_code, std::function reply)> result) override; virtual void SetSettings( const AuthPigeonFirebaseApp& app, - const PigeonFirebaseAuthSettings& settings, + const InternalFirebaseAuthSettings& settings, std::function reply)> result) override; virtual void VerifyPasswordResetCode( const AuthPigeonFirebaseApp& app, const std::string& code, std::function reply)> result) override; virtual void VerifyPhoneNumber( const AuthPigeonFirebaseApp& app, - const PigeonVerifyPhoneNumberRequest& request, + const InternalVerifyPhoneNumberRequest& request, std::function reply)> result) override; // FirebaseAuthUserHostApi methods. @@ -136,52 +144,66 @@ class FirebaseAuthPlugin : public flutter::Plugin, std::function reply)> result) override; virtual void GetIdToken( const AuthPigeonFirebaseApp& app, bool force_refresh, - std::function reply)> result) override; + std::function reply)> result) + override; virtual void LinkWithCredential( const AuthPigeonFirebaseApp& app, const flutter::EncodableMap& input, - std::function reply)> result) override; + std::function reply)> result) + override; virtual void LinkWithProvider( const AuthPigeonFirebaseApp& app, - const PigeonSignInProvider& sign_in_provider, - std::function reply)> result) override; + const InternalSignInProvider& sign_in_provider, + std::function reply)> result) + override; virtual void ReauthenticateWithCredential( const AuthPigeonFirebaseApp& app, const flutter::EncodableMap& input, - std::function reply)> result) override; + std::function reply)> result) + override; virtual void ReauthenticateWithProvider( const AuthPigeonFirebaseApp& app, - const PigeonSignInProvider& sign_in_provider, - std::function reply)> result) override; + const InternalSignInProvider& sign_in_provider, + std::function reply)> result) + override; virtual void Reload( const AuthPigeonFirebaseApp& app, - std::function reply)> result) override; + std::function reply)> result) override; virtual void SendEmailVerification( const AuthPigeonFirebaseApp& app, - const PigeonActionCodeSettings* action_code_settings, + const InternalActionCodeSettings* action_code_settings, std::function reply)> result) override; - virtual void Unlink( - const AuthPigeonFirebaseApp& app, const std::string& provider_id, - std::function reply)> result) override; + virtual void Unlink(const AuthPigeonFirebaseApp& app, + const std::string& provider_id, + std::function reply)> + result) override; virtual void UpdateEmail( const AuthPigeonFirebaseApp& app, const std::string& new_email, - std::function reply)> result) override; + std::function reply)> result) override; virtual void UpdatePassword( const AuthPigeonFirebaseApp& app, const std::string& new_password, - std::function reply)> result) override; + std::function reply)> result) override; virtual void UpdatePhoneNumber( const AuthPigeonFirebaseApp& app, const flutter::EncodableMap& input, - std::function reply)> result) override; + std::function reply)> result) override; virtual void UpdateProfile( - const AuthPigeonFirebaseApp& app, const PigeonUserProfile& profile, - std::function reply)> result) override; + const AuthPigeonFirebaseApp& app, const InternalUserProfile& profile, + std::function reply)> result) override; virtual void VerifyBeforeUpdateEmail( const AuthPigeonFirebaseApp& app, const std::string& new_email, - const PigeonActionCodeSettings* action_code_settings, + const InternalActionCodeSettings* action_code_settings, std::function reply)> result) override; virtual void RevokeTokenWithAuthorizationCode( const AuthPigeonFirebaseApp& app, const std::string& authorization_code, std::function reply)> result) override; + virtual void RevokeAccessToken( + const AuthPigeonFirebaseApp& app, const std::string& access_token, + std::function reply)> result) override; + + virtual void InitializeRecaptchaConfig( + const AuthPigeonFirebaseApp& app, + std::function reply)> result) override; + // FlutterFirebasePlugin methods. flutter::EncodableMap GetPluginConstantsForFirebaseApp( const firebase::App& app) override; diff --git a/packages/firebase_auth/firebase_auth/windows/messages.g.cpp b/packages/firebase_auth/firebase_auth/windows/messages.g.cpp index 59043185cf1b..ea2200e617b2 100644 --- a/packages/firebase_auth/firebase_auth/windows/messages.g.cpp +++ b/packages/firebase_auth/firebase_auth/windows/messages.g.cpp @@ -1,7 +1,7 @@ // Copyright 2023, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v19.0.0), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), do not edit directly. // See also: https://pub.dev/packages/pigeon #undef _HAS_EXCEPTIONS @@ -13,16 +13,18 @@ #include #include +#include +#include #include #include #include namespace firebase_auth_windows { -using flutter::BasicMessageChannel; -using flutter::CustomEncodableValue; -using flutter::EncodableList; -using flutter::EncodableMap; -using flutter::EncodableValue; +using ::flutter::BasicMessageChannel; +using ::flutter::CustomEncodableValue; +using ::flutter::EncodableList; +using ::flutter::EncodableMap; +using ::flutter::EncodableValue; FlutterError CreateConnectionError(const std::string channel_name) { return FlutterError( @@ -31,56 +33,283 @@ FlutterError CreateConnectionError(const std::string channel_name) { EncodableValue("")); } -// PigeonMultiFactorSession +namespace { +template +bool PigeonInternalDeepEquals(const T& a, const T& b); -PigeonMultiFactorSession::PigeonMultiFactorSession(const std::string& id) +bool PigeonInternalDeepEquals(const double& a, const double& b); + +template +bool PigeonInternalDeepEquals(const std::vector& a, const std::vector& b); + +template +bool PigeonInternalDeepEquals(const std::map& a, const std::map& b); + +template +bool PigeonInternalDeepEquals(const std::optional& a, + const std::optional& b); + +template +bool PigeonInternalDeepEquals(const std::unique_ptr& a, + const std::unique_ptr& b); + +bool PigeonInternalDeepEquals(const ::flutter::EncodableValue& a, + const ::flutter::EncodableValue& b); + +template +bool PigeonInternalDeepEquals(const T& a, const T& b) { + return a == b; +} + +template +bool PigeonInternalDeepEquals(const std::vector& a, + const std::vector& b) { + if (a.size() != b.size()) { + return false; + } + for (size_t i = 0; i < a.size(); ++i) { + if (!PigeonInternalDeepEquals(a[i], b[i])) { + return false; + } + } + return true; +} + +template +bool PigeonInternalDeepEquals(const std::map& a, + const std::map& b) { + if (a.size() != b.size()) { + return false; + } + for (const auto& kv : a) { + bool found = false; + for (const auto& b_kv : b) { + if (PigeonInternalDeepEquals(kv.first, b_kv.first)) { + if (PigeonInternalDeepEquals(kv.second, b_kv.second)) { + found = true; + break; + } else { + return false; + } + } + } + if (!found) { + return false; + } + } + return true; +} + +bool PigeonInternalDeepEquals(const double& a, const double& b) { + // Normalize -0.0 to 0.0 and handle NaN equality. + return (a == b) || (std::isnan(a) && std::isnan(b)); +} + +template +bool PigeonInternalDeepEquals(const std::optional& a, + const std::optional& b) { + if (!a && !b) { + return true; + } + if (!a || !b) { + return false; + } + return PigeonInternalDeepEquals(*a, *b); +} + +template +bool PigeonInternalDeepEquals(const std::unique_ptr& a, + const std::unique_ptr& b) { + if (a.get() == b.get()) { + return true; + } + if (!a || !b) { + return false; + } + return PigeonInternalDeepEquals(*a, *b); +} + +bool PigeonInternalDeepEquals(const ::flutter::EncodableValue& a, + const ::flutter::EncodableValue& b) { + if (a.index() != b.index()) { + return false; + } + if (const double* da = std::get_if(&a)) { + return PigeonInternalDeepEquals(*da, std::get(b)); + } else if (const ::flutter::EncodableList* la = + std::get_if<::flutter::EncodableList>(&a)) { + return PigeonInternalDeepEquals(*la, std::get<::flutter::EncodableList>(b)); + } else if (const ::flutter::EncodableMap* ma = + std::get_if<::flutter::EncodableMap>(&a)) { + return PigeonInternalDeepEquals(*ma, std::get<::flutter::EncodableMap>(b)); + } + return a == b; +} + +template +size_t PigeonInternalDeepHash(const T& v); + +size_t PigeonInternalDeepHash(const double& v); + +template +size_t PigeonInternalDeepHash(const std::vector& v); + +template +size_t PigeonInternalDeepHash(const std::map& v); + +template +size_t PigeonInternalDeepHash(const std::optional& v); + +template +size_t PigeonInternalDeepHash(const std::unique_ptr& v); + +size_t PigeonInternalDeepHash(const ::flutter::EncodableValue& v); + +template +size_t PigeonInternalDeepHash(const T& v) { + return std::hash()(v); +} + +template +size_t PigeonInternalDeepHash(const std::vector& v) { + size_t result = 1; + for (const auto& item : v) { + result = result * 31 + PigeonInternalDeepHash(item); + } + return result; +} + +template +size_t PigeonInternalDeepHash(const std::map& v) { + size_t result = 0; + for (const auto& kv : v) { + result += ((PigeonInternalDeepHash(kv.first) * 31) ^ + PigeonInternalDeepHash(kv.second)); + } + return result; +} + +size_t PigeonInternalDeepHash(const double& v) { + if (std::isnan(v)) { + // Normalize NaN to a consistent hash. + return std::hash()(std::numeric_limits::quiet_NaN()); + } + if (v == 0.0) { + // Normalize -0.0 to 0.0 so they have the same hash code. + return std::hash()(0.0); + } + return std::hash()(v); +} + +template +size_t PigeonInternalDeepHash(const std::optional& v) { + return v ? PigeonInternalDeepHash(*v) : 0; +} + +template +size_t PigeonInternalDeepHash(const std::unique_ptr& v) { + return v ? PigeonInternalDeepHash(*v) : 0; +} + +size_t PigeonInternalDeepHash(const ::flutter::EncodableValue& v) { + size_t result = v.index(); + if (const double* dv = std::get_if(&v)) { + result = result * 31 + PigeonInternalDeepHash(*dv); + } else if (const ::flutter::EncodableList* lv = + std::get_if<::flutter::EncodableList>(&v)) { + result = result * 31 + PigeonInternalDeepHash(*lv); + } else if (const ::flutter::EncodableMap* mv = + std::get_if<::flutter::EncodableMap>(&v)) { + result = result * 31 + PigeonInternalDeepHash(*mv); + } else { + std::visit( + [&result](const auto& val) { + using T = std::decay_t; + if constexpr (!std::is_same_v && + !std::is_same_v && + !std::is_same_v && + !std::is_same_v && + !std::is_same_v) { + result = result * 31 + PigeonInternalDeepHash(val); + } + }, + v); + } + return result; +} + +} // namespace +// InternalMultiFactorSession + +InternalMultiFactorSession::InternalMultiFactorSession(const std::string& id) : id_(id) {} -const std::string& PigeonMultiFactorSession::id() const { return id_; } +const std::string& InternalMultiFactorSession::id() const { return id_; } -void PigeonMultiFactorSession::set_id(std::string_view value_arg) { +void InternalMultiFactorSession::set_id(std::string_view value_arg) { id_ = value_arg; } -EncodableList PigeonMultiFactorSession::ToEncodableList() const { +EncodableList InternalMultiFactorSession::ToEncodableList() const { EncodableList list; list.reserve(1); list.push_back(EncodableValue(id_)); return list; } -PigeonMultiFactorSession PigeonMultiFactorSession::FromEncodableList( +InternalMultiFactorSession InternalMultiFactorSession::FromEncodableList( const EncodableList& list) { - PigeonMultiFactorSession decoded(std::get(list[0])); + InternalMultiFactorSession decoded(std::get(list[0])); return decoded; } -// PigeonPhoneMultiFactorAssertion +bool InternalMultiFactorSession::operator==( + const InternalMultiFactorSession& other) const { + return PigeonInternalDeepEquals(id_, other.id_); +} + +bool InternalMultiFactorSession::operator!=( + const InternalMultiFactorSession& other) const { + return !(*this == other); +} + +size_t InternalMultiFactorSession::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(id_); + return result; +} + +size_t PigeonInternalDeepHash(const InternalMultiFactorSession& v) { + return v.Hash(); +} + +// InternalPhoneMultiFactorAssertion -PigeonPhoneMultiFactorAssertion::PigeonPhoneMultiFactorAssertion( +InternalPhoneMultiFactorAssertion::InternalPhoneMultiFactorAssertion( const std::string& verification_id, const std::string& verification_code) : verification_id_(verification_id), verification_code_(verification_code) {} -const std::string& PigeonPhoneMultiFactorAssertion::verification_id() const { +const std::string& InternalPhoneMultiFactorAssertion::verification_id() const { return verification_id_; } -void PigeonPhoneMultiFactorAssertion::set_verification_id( +void InternalPhoneMultiFactorAssertion::set_verification_id( std::string_view value_arg) { verification_id_ = value_arg; } -const std::string& PigeonPhoneMultiFactorAssertion::verification_code() const { +const std::string& InternalPhoneMultiFactorAssertion::verification_code() + const { return verification_code_; } -void PigeonPhoneMultiFactorAssertion::set_verification_code( +void InternalPhoneMultiFactorAssertion::set_verification_code( std::string_view value_arg) { verification_code_ = value_arg; } -EncodableList PigeonPhoneMultiFactorAssertion::ToEncodableList() const { +EncodableList InternalPhoneMultiFactorAssertion::ToEncodableList() const { EncodableList list; list.reserve(2); list.push_back(EncodableValue(verification_id_)); @@ -88,24 +317,46 @@ EncodableList PigeonPhoneMultiFactorAssertion::ToEncodableList() const { return list; } -PigeonPhoneMultiFactorAssertion -PigeonPhoneMultiFactorAssertion::FromEncodableList(const EncodableList& list) { - PigeonPhoneMultiFactorAssertion decoded(std::get(list[0]), - std::get(list[1])); +InternalPhoneMultiFactorAssertion +InternalPhoneMultiFactorAssertion::FromEncodableList( + const EncodableList& list) { + InternalPhoneMultiFactorAssertion decoded(std::get(list[0]), + std::get(list[1])); return decoded; } -// PigeonMultiFactorInfo +bool InternalPhoneMultiFactorAssertion::operator==( + const InternalPhoneMultiFactorAssertion& other) const { + return PigeonInternalDeepEquals(verification_id_, other.verification_id_) && + PigeonInternalDeepEquals(verification_code_, other.verification_code_); +} + +bool InternalPhoneMultiFactorAssertion::operator!=( + const InternalPhoneMultiFactorAssertion& other) const { + return !(*this == other); +} + +size_t InternalPhoneMultiFactorAssertion::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(verification_id_); + result = result * 31 + PigeonInternalDeepHash(verification_code_); + return result; +} + +size_t PigeonInternalDeepHash(const InternalPhoneMultiFactorAssertion& v) { + return v.Hash(); +} + +// InternalMultiFactorInfo -PigeonMultiFactorInfo::PigeonMultiFactorInfo(double enrollment_timestamp, - const std::string& uid) +InternalMultiFactorInfo::InternalMultiFactorInfo(double enrollment_timestamp, + const std::string& uid) : enrollment_timestamp_(enrollment_timestamp), uid_(uid) {} -PigeonMultiFactorInfo::PigeonMultiFactorInfo(const std::string* display_name, - double enrollment_timestamp, - const std::string* factor_id, - const std::string& uid, - const std::string* phone_number) +InternalMultiFactorInfo::InternalMultiFactorInfo( + const std::string* display_name, double enrollment_timestamp, + const std::string* factor_id, const std::string& uid, + const std::string* phone_number) : display_name_(display_name ? std::optional(*display_name) : std::nullopt), enrollment_timestamp_(enrollment_timestamp), @@ -115,62 +366,62 @@ PigeonMultiFactorInfo::PigeonMultiFactorInfo(const std::string* display_name, phone_number_(phone_number ? std::optional(*phone_number) : std::nullopt) {} -const std::string* PigeonMultiFactorInfo::display_name() const { +const std::string* InternalMultiFactorInfo::display_name() const { return display_name_ ? &(*display_name_) : nullptr; } -void PigeonMultiFactorInfo::set_display_name( +void InternalMultiFactorInfo::set_display_name( const std::string_view* value_arg) { display_name_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonMultiFactorInfo::set_display_name(std::string_view value_arg) { +void InternalMultiFactorInfo::set_display_name(std::string_view value_arg) { display_name_ = value_arg; } -double PigeonMultiFactorInfo::enrollment_timestamp() const { +double InternalMultiFactorInfo::enrollment_timestamp() const { return enrollment_timestamp_; } -void PigeonMultiFactorInfo::set_enrollment_timestamp(double value_arg) { +void InternalMultiFactorInfo::set_enrollment_timestamp(double value_arg) { enrollment_timestamp_ = value_arg; } -const std::string* PigeonMultiFactorInfo::factor_id() const { +const std::string* InternalMultiFactorInfo::factor_id() const { return factor_id_ ? &(*factor_id_) : nullptr; } -void PigeonMultiFactorInfo::set_factor_id(const std::string_view* value_arg) { +void InternalMultiFactorInfo::set_factor_id(const std::string_view* value_arg) { factor_id_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonMultiFactorInfo::set_factor_id(std::string_view value_arg) { +void InternalMultiFactorInfo::set_factor_id(std::string_view value_arg) { factor_id_ = value_arg; } -const std::string& PigeonMultiFactorInfo::uid() const { return uid_; } +const std::string& InternalMultiFactorInfo::uid() const { return uid_; } -void PigeonMultiFactorInfo::set_uid(std::string_view value_arg) { +void InternalMultiFactorInfo::set_uid(std::string_view value_arg) { uid_ = value_arg; } -const std::string* PigeonMultiFactorInfo::phone_number() const { +const std::string* InternalMultiFactorInfo::phone_number() const { return phone_number_ ? &(*phone_number_) : nullptr; } -void PigeonMultiFactorInfo::set_phone_number( +void InternalMultiFactorInfo::set_phone_number( const std::string_view* value_arg) { phone_number_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonMultiFactorInfo::set_phone_number(std::string_view value_arg) { +void InternalMultiFactorInfo::set_phone_number(std::string_view value_arg) { phone_number_ = value_arg; } -EncodableList PigeonMultiFactorInfo::ToEncodableList() const { +EncodableList InternalMultiFactorInfo::ToEncodableList() const { EncodableList list; list.reserve(5); list.push_back(display_name_ ? EncodableValue(*display_name_) @@ -183,10 +434,10 @@ EncodableList PigeonMultiFactorInfo::ToEncodableList() const { return list; } -PigeonMultiFactorInfo PigeonMultiFactorInfo::FromEncodableList( +InternalMultiFactorInfo InternalMultiFactorInfo::FromEncodableList( const EncodableList& list) { - PigeonMultiFactorInfo decoded(std::get(list[1]), - std::get(list[3])); + InternalMultiFactorInfo decoded(std::get(list[1]), + std::get(list[3])); auto& encodable_display_name = list[0]; if (!encodable_display_name.IsNull()) { decoded.set_display_name(std::get(encodable_display_name)); @@ -202,6 +453,35 @@ PigeonMultiFactorInfo PigeonMultiFactorInfo::FromEncodableList( return decoded; } +bool InternalMultiFactorInfo::operator==( + const InternalMultiFactorInfo& other) const { + return PigeonInternalDeepEquals(display_name_, other.display_name_) && + PigeonInternalDeepEquals(enrollment_timestamp_, + other.enrollment_timestamp_) && + PigeonInternalDeepEquals(factor_id_, other.factor_id_) && + PigeonInternalDeepEquals(uid_, other.uid_) && + PigeonInternalDeepEquals(phone_number_, other.phone_number_); +} + +bool InternalMultiFactorInfo::operator!=( + const InternalMultiFactorInfo& other) const { + return !(*this == other); +} + +size_t InternalMultiFactorInfo::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(display_name_); + result = result * 31 + PigeonInternalDeepHash(enrollment_timestamp_); + result = result * 31 + PigeonInternalDeepHash(factor_id_); + result = result * 31 + PigeonInternalDeepHash(uid_); + result = result * 31 + PigeonInternalDeepHash(phone_number_); + return result; +} + +size_t PigeonInternalDeepHash(const InternalMultiFactorInfo& v) { + return v.Hash(); +} + // AuthPigeonFirebaseApp AuthPigeonFirebaseApp::AuthPigeonFirebaseApp(const std::string& app_name) @@ -275,44 +555,70 @@ AuthPigeonFirebaseApp AuthPigeonFirebaseApp::FromEncodableList( return decoded; } -// PigeonActionCodeInfoData +bool AuthPigeonFirebaseApp::operator==( + const AuthPigeonFirebaseApp& other) const { + return PigeonInternalDeepEquals(app_name_, other.app_name_) && + PigeonInternalDeepEquals(tenant_id_, other.tenant_id_) && + PigeonInternalDeepEquals(custom_auth_domain_, + other.custom_auth_domain_); +} + +bool AuthPigeonFirebaseApp::operator!=( + const AuthPigeonFirebaseApp& other) const { + return !(*this == other); +} + +size_t AuthPigeonFirebaseApp::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(app_name_); + result = result * 31 + PigeonInternalDeepHash(tenant_id_); + result = result * 31 + PigeonInternalDeepHash(custom_auth_domain_); + return result; +} + +size_t PigeonInternalDeepHash(const AuthPigeonFirebaseApp& v) { + return v.Hash(); +} + +// InternalActionCodeInfoData -PigeonActionCodeInfoData::PigeonActionCodeInfoData() {} +InternalActionCodeInfoData::InternalActionCodeInfoData() {} -PigeonActionCodeInfoData::PigeonActionCodeInfoData( +InternalActionCodeInfoData::InternalActionCodeInfoData( const std::string* email, const std::string* previous_email) : email_(email ? std::optional(*email) : std::nullopt), previous_email_(previous_email ? std::optional(*previous_email) : std::nullopt) {} -const std::string* PigeonActionCodeInfoData::email() const { +const std::string* InternalActionCodeInfoData::email() const { return email_ ? &(*email_) : nullptr; } -void PigeonActionCodeInfoData::set_email(const std::string_view* value_arg) { +void InternalActionCodeInfoData::set_email(const std::string_view* value_arg) { email_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonActionCodeInfoData::set_email(std::string_view value_arg) { +void InternalActionCodeInfoData::set_email(std::string_view value_arg) { email_ = value_arg; } -const std::string* PigeonActionCodeInfoData::previous_email() const { +const std::string* InternalActionCodeInfoData::previous_email() const { return previous_email_ ? &(*previous_email_) : nullptr; } -void PigeonActionCodeInfoData::set_previous_email( +void InternalActionCodeInfoData::set_previous_email( const std::string_view* value_arg) { previous_email_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonActionCodeInfoData::set_previous_email(std::string_view value_arg) { +void InternalActionCodeInfoData::set_previous_email( + std::string_view value_arg) { previous_email_ = value_arg; } -EncodableList PigeonActionCodeInfoData::ToEncodableList() const { +EncodableList InternalActionCodeInfoData::ToEncodableList() const { EncodableList list; list.reserve(2); list.push_back(email_ ? EncodableValue(*email_) : EncodableValue()); @@ -321,9 +627,9 @@ EncodableList PigeonActionCodeInfoData::ToEncodableList() const { return list; } -PigeonActionCodeInfoData PigeonActionCodeInfoData::FromEncodableList( +InternalActionCodeInfoData InternalActionCodeInfoData::FromEncodableList( const EncodableList& list) { - PigeonActionCodeInfoData decoded; + InternalActionCodeInfoData decoded; auto& encodable_email = list[0]; if (!encodable_email.IsNull()) { decoded.set_email(std::get(encodable_email)); @@ -335,65 +641,112 @@ PigeonActionCodeInfoData PigeonActionCodeInfoData::FromEncodableList( return decoded; } -// PigeonActionCodeInfo +bool InternalActionCodeInfoData::operator==( + const InternalActionCodeInfoData& other) const { + return PigeonInternalDeepEquals(email_, other.email_) && + PigeonInternalDeepEquals(previous_email_, other.previous_email_); +} + +bool InternalActionCodeInfoData::operator!=( + const InternalActionCodeInfoData& other) const { + return !(*this == other); +} + +size_t InternalActionCodeInfoData::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(email_); + result = result * 31 + PigeonInternalDeepHash(previous_email_); + return result; +} + +size_t PigeonInternalDeepHash(const InternalActionCodeInfoData& v) { + return v.Hash(); +} + +// InternalActionCodeInfo -PigeonActionCodeInfo::PigeonActionCodeInfo( +InternalActionCodeInfo::InternalActionCodeInfo( const ActionCodeInfoOperation& operation, - const PigeonActionCodeInfoData& data) + const InternalActionCodeInfoData& data) : operation_(operation), - data_(std::make_unique(data)) {} + data_(std::make_unique(data)) {} -PigeonActionCodeInfo::PigeonActionCodeInfo(const PigeonActionCodeInfo& other) +InternalActionCodeInfo::InternalActionCodeInfo( + const InternalActionCodeInfo& other) : operation_(other.operation_), - data_(std::make_unique(*other.data_)) {} + data_(std::make_unique(*other.data_)) {} -PigeonActionCodeInfo& PigeonActionCodeInfo::operator=( - const PigeonActionCodeInfo& other) { +InternalActionCodeInfo& InternalActionCodeInfo::operator=( + const InternalActionCodeInfo& other) { operation_ = other.operation_; - data_ = std::make_unique(*other.data_); + data_ = std::make_unique(*other.data_); return *this; } -const ActionCodeInfoOperation& PigeonActionCodeInfo::operation() const { +const ActionCodeInfoOperation& InternalActionCodeInfo::operation() const { return operation_; } -void PigeonActionCodeInfo::set_operation( +void InternalActionCodeInfo::set_operation( const ActionCodeInfoOperation& value_arg) { operation_ = value_arg; } -const PigeonActionCodeInfoData& PigeonActionCodeInfo::data() const { +const InternalActionCodeInfoData& InternalActionCodeInfo::data() const { return *data_; } -void PigeonActionCodeInfo::set_data(const PigeonActionCodeInfoData& value_arg) { - data_ = std::make_unique(value_arg); +void InternalActionCodeInfo::set_data( + const InternalActionCodeInfoData& value_arg) { + data_ = std::make_unique(value_arg); } -EncodableList PigeonActionCodeInfo::ToEncodableList() const { +EncodableList InternalActionCodeInfo::ToEncodableList() const { EncodableList list; list.reserve(2); - list.push_back(EncodableValue((int)operation_)); + list.push_back(CustomEncodableValue(operation_)); list.push_back(CustomEncodableValue(*data_)); return list; } -PigeonActionCodeInfo PigeonActionCodeInfo::FromEncodableList( +InternalActionCodeInfo InternalActionCodeInfo::FromEncodableList( const EncodableList& list) { - PigeonActionCodeInfo decoded( - (ActionCodeInfoOperation)(std::get(list[0])), - std::any_cast( + InternalActionCodeInfo decoded( + std::any_cast( + std::get(list[0])), + std::any_cast( std::get(list[1]))); return decoded; } -// PigeonAdditionalUserInfo +bool InternalActionCodeInfo::operator==( + const InternalActionCodeInfo& other) const { + return PigeonInternalDeepEquals(operation_, other.operation_) && + PigeonInternalDeepEquals(data_, other.data_); +} + +bool InternalActionCodeInfo::operator!=( + const InternalActionCodeInfo& other) const { + return !(*this == other); +} + +size_t InternalActionCodeInfo::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(operation_); + result = result * 31 + PigeonInternalDeepHash(data_); + return result; +} + +size_t PigeonInternalDeepHash(const InternalActionCodeInfo& v) { + return v.Hash(); +} + +// InternalAdditionalUserInfo -PigeonAdditionalUserInfo::PigeonAdditionalUserInfo(bool is_new_user) +InternalAdditionalUserInfo::InternalAdditionalUserInfo(bool is_new_user) : is_new_user_(is_new_user) {} -PigeonAdditionalUserInfo::PigeonAdditionalUserInfo( +InternalAdditionalUserInfo::InternalAdditionalUserInfo( bool is_new_user, const std::string* provider_id, const std::string* username, const std::string* authorization_code, const EncodableMap* profile) @@ -408,66 +761,67 @@ PigeonAdditionalUserInfo::PigeonAdditionalUserInfo( profile_(profile ? std::optional(*profile) : std::nullopt) { } -bool PigeonAdditionalUserInfo::is_new_user() const { return is_new_user_; } +bool InternalAdditionalUserInfo::is_new_user() const { return is_new_user_; } -void PigeonAdditionalUserInfo::set_is_new_user(bool value_arg) { +void InternalAdditionalUserInfo::set_is_new_user(bool value_arg) { is_new_user_ = value_arg; } -const std::string* PigeonAdditionalUserInfo::provider_id() const { +const std::string* InternalAdditionalUserInfo::provider_id() const { return provider_id_ ? &(*provider_id_) : nullptr; } -void PigeonAdditionalUserInfo::set_provider_id( +void InternalAdditionalUserInfo::set_provider_id( const std::string_view* value_arg) { provider_id_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonAdditionalUserInfo::set_provider_id(std::string_view value_arg) { +void InternalAdditionalUserInfo::set_provider_id(std::string_view value_arg) { provider_id_ = value_arg; } -const std::string* PigeonAdditionalUserInfo::username() const { +const std::string* InternalAdditionalUserInfo::username() const { return username_ ? &(*username_) : nullptr; } -void PigeonAdditionalUserInfo::set_username(const std::string_view* value_arg) { +void InternalAdditionalUserInfo::set_username( + const std::string_view* value_arg) { username_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonAdditionalUserInfo::set_username(std::string_view value_arg) { +void InternalAdditionalUserInfo::set_username(std::string_view value_arg) { username_ = value_arg; } -const std::string* PigeonAdditionalUserInfo::authorization_code() const { +const std::string* InternalAdditionalUserInfo::authorization_code() const { return authorization_code_ ? &(*authorization_code_) : nullptr; } -void PigeonAdditionalUserInfo::set_authorization_code( +void InternalAdditionalUserInfo::set_authorization_code( const std::string_view* value_arg) { authorization_code_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonAdditionalUserInfo::set_authorization_code( +void InternalAdditionalUserInfo::set_authorization_code( std::string_view value_arg) { authorization_code_ = value_arg; } -const EncodableMap* PigeonAdditionalUserInfo::profile() const { +const EncodableMap* InternalAdditionalUserInfo::profile() const { return profile_ ? &(*profile_) : nullptr; } -void PigeonAdditionalUserInfo::set_profile(const EncodableMap* value_arg) { +void InternalAdditionalUserInfo::set_profile(const EncodableMap* value_arg) { profile_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonAdditionalUserInfo::set_profile(const EncodableMap& value_arg) { +void InternalAdditionalUserInfo::set_profile(const EncodableMap& value_arg) { profile_ = value_arg; } -EncodableList PigeonAdditionalUserInfo::ToEncodableList() const { +EncodableList InternalAdditionalUserInfo::ToEncodableList() const { EncodableList list; list.reserve(5); list.push_back(EncodableValue(is_new_user_)); @@ -480,9 +834,9 @@ EncodableList PigeonAdditionalUserInfo::ToEncodableList() const { return list; } -PigeonAdditionalUserInfo PigeonAdditionalUserInfo::FromEncodableList( +InternalAdditionalUserInfo InternalAdditionalUserInfo::FromEncodableList( const EncodableList& list) { - PigeonAdditionalUserInfo decoded(std::get(list[0])); + InternalAdditionalUserInfo decoded(std::get(list[0])); auto& encodable_provider_id = list[1]; if (!encodable_provider_id.IsNull()) { decoded.set_provider_id(std::get(encodable_provider_id)); @@ -503,61 +857,90 @@ PigeonAdditionalUserInfo PigeonAdditionalUserInfo::FromEncodableList( return decoded; } -// PigeonAuthCredential +bool InternalAdditionalUserInfo::operator==( + const InternalAdditionalUserInfo& other) const { + return PigeonInternalDeepEquals(is_new_user_, other.is_new_user_) && + PigeonInternalDeepEquals(provider_id_, other.provider_id_) && + PigeonInternalDeepEquals(username_, other.username_) && + PigeonInternalDeepEquals(authorization_code_, + other.authorization_code_) && + PigeonInternalDeepEquals(profile_, other.profile_); +} + +bool InternalAdditionalUserInfo::operator!=( + const InternalAdditionalUserInfo& other) const { + return !(*this == other); +} + +size_t InternalAdditionalUserInfo::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(is_new_user_); + result = result * 31 + PigeonInternalDeepHash(provider_id_); + result = result * 31 + PigeonInternalDeepHash(username_); + result = result * 31 + PigeonInternalDeepHash(authorization_code_); + result = result * 31 + PigeonInternalDeepHash(profile_); + return result; +} + +size_t PigeonInternalDeepHash(const InternalAdditionalUserInfo& v) { + return v.Hash(); +} + +// InternalAuthCredential -PigeonAuthCredential::PigeonAuthCredential(const std::string& provider_id, - const std::string& sign_in_method, - int64_t native_id) +InternalAuthCredential::InternalAuthCredential( + const std::string& provider_id, const std::string& sign_in_method, + int64_t native_id) : provider_id_(provider_id), sign_in_method_(sign_in_method), native_id_(native_id) {} -PigeonAuthCredential::PigeonAuthCredential(const std::string& provider_id, - const std::string& sign_in_method, - int64_t native_id, - const std::string* access_token) +InternalAuthCredential::InternalAuthCredential( + const std::string& provider_id, const std::string& sign_in_method, + int64_t native_id, const std::string* access_token) : provider_id_(provider_id), sign_in_method_(sign_in_method), native_id_(native_id), access_token_(access_token ? std::optional(*access_token) : std::nullopt) {} -const std::string& PigeonAuthCredential::provider_id() const { +const std::string& InternalAuthCredential::provider_id() const { return provider_id_; } -void PigeonAuthCredential::set_provider_id(std::string_view value_arg) { +void InternalAuthCredential::set_provider_id(std::string_view value_arg) { provider_id_ = value_arg; } -const std::string& PigeonAuthCredential::sign_in_method() const { +const std::string& InternalAuthCredential::sign_in_method() const { return sign_in_method_; } -void PigeonAuthCredential::set_sign_in_method(std::string_view value_arg) { +void InternalAuthCredential::set_sign_in_method(std::string_view value_arg) { sign_in_method_ = value_arg; } -int64_t PigeonAuthCredential::native_id() const { return native_id_; } +int64_t InternalAuthCredential::native_id() const { return native_id_; } -void PigeonAuthCredential::set_native_id(int64_t value_arg) { +void InternalAuthCredential::set_native_id(int64_t value_arg) { native_id_ = value_arg; } -const std::string* PigeonAuthCredential::access_token() const { +const std::string* InternalAuthCredential::access_token() const { return access_token_ ? &(*access_token_) : nullptr; } -void PigeonAuthCredential::set_access_token(const std::string_view* value_arg) { +void InternalAuthCredential::set_access_token( + const std::string_view* value_arg) { access_token_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonAuthCredential::set_access_token(std::string_view value_arg) { +void InternalAuthCredential::set_access_token(std::string_view value_arg) { access_token_ = value_arg; } -EncodableList PigeonAuthCredential::ToEncodableList() const { +EncodableList InternalAuthCredential::ToEncodableList() const { EncodableList list; list.reserve(4); list.push_back(EncodableValue(provider_id_)); @@ -568,11 +951,11 @@ EncodableList PigeonAuthCredential::ToEncodableList() const { return list; } -PigeonAuthCredential PigeonAuthCredential::FromEncodableList( +InternalAuthCredential InternalAuthCredential::FromEncodableList( const EncodableList& list) { - PigeonAuthCredential decoded(std::get(list[0]), - std::get(list[1]), - list[2].LongValue()); + InternalAuthCredential decoded(std::get(list[0]), + std::get(list[1]), + std::get(list[2])); auto& encodable_access_token = list[3]; if (!encodable_access_token.IsNull()) { decoded.set_access_token(std::get(encodable_access_token)); @@ -580,15 +963,41 @@ PigeonAuthCredential PigeonAuthCredential::FromEncodableList( return decoded; } -// PigeonUserInfo +bool InternalAuthCredential::operator==( + const InternalAuthCredential& other) const { + return PigeonInternalDeepEquals(provider_id_, other.provider_id_) && + PigeonInternalDeepEquals(sign_in_method_, other.sign_in_method_) && + PigeonInternalDeepEquals(native_id_, other.native_id_) && + PigeonInternalDeepEquals(access_token_, other.access_token_); +} + +bool InternalAuthCredential::operator!=( + const InternalAuthCredential& other) const { + return !(*this == other); +} + +size_t InternalAuthCredential::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(provider_id_); + result = result * 31 + PigeonInternalDeepHash(sign_in_method_); + result = result * 31 + PigeonInternalDeepHash(native_id_); + result = result * 31 + PigeonInternalDeepHash(access_token_); + return result; +} + +size_t PigeonInternalDeepHash(const InternalAuthCredential& v) { + return v.Hash(); +} + +// InternalUserInfo -PigeonUserInfo::PigeonUserInfo(const std::string& uid, bool is_anonymous, - bool is_email_verified) +InternalUserInfo::InternalUserInfo(const std::string& uid, bool is_anonymous, + bool is_email_verified) : uid_(uid), is_anonymous_(is_anonymous), is_email_verified_(is_email_verified) {} -PigeonUserInfo::PigeonUserInfo( +InternalUserInfo::InternalUserInfo( const std::string& uid, const std::string* email, const std::string* display_name, const std::string* photo_url, const std::string* phone_number, bool is_anonymous, bool is_email_verified, @@ -619,139 +1028,139 @@ PigeonUserInfo::PigeonUserInfo( ? std::optional(*last_sign_in_timestamp) : std::nullopt) {} -const std::string& PigeonUserInfo::uid() const { return uid_; } +const std::string& InternalUserInfo::uid() const { return uid_; } -void PigeonUserInfo::set_uid(std::string_view value_arg) { uid_ = value_arg; } +void InternalUserInfo::set_uid(std::string_view value_arg) { uid_ = value_arg; } -const std::string* PigeonUserInfo::email() const { +const std::string* InternalUserInfo::email() const { return email_ ? &(*email_) : nullptr; } -void PigeonUserInfo::set_email(const std::string_view* value_arg) { +void InternalUserInfo::set_email(const std::string_view* value_arg) { email_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonUserInfo::set_email(std::string_view value_arg) { +void InternalUserInfo::set_email(std::string_view value_arg) { email_ = value_arg; } -const std::string* PigeonUserInfo::display_name() const { +const std::string* InternalUserInfo::display_name() const { return display_name_ ? &(*display_name_) : nullptr; } -void PigeonUserInfo::set_display_name(const std::string_view* value_arg) { +void InternalUserInfo::set_display_name(const std::string_view* value_arg) { display_name_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonUserInfo::set_display_name(std::string_view value_arg) { +void InternalUserInfo::set_display_name(std::string_view value_arg) { display_name_ = value_arg; } -const std::string* PigeonUserInfo::photo_url() const { +const std::string* InternalUserInfo::photo_url() const { return photo_url_ ? &(*photo_url_) : nullptr; } -void PigeonUserInfo::set_photo_url(const std::string_view* value_arg) { +void InternalUserInfo::set_photo_url(const std::string_view* value_arg) { photo_url_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonUserInfo::set_photo_url(std::string_view value_arg) { +void InternalUserInfo::set_photo_url(std::string_view value_arg) { photo_url_ = value_arg; } -const std::string* PigeonUserInfo::phone_number() const { +const std::string* InternalUserInfo::phone_number() const { return phone_number_ ? &(*phone_number_) : nullptr; } -void PigeonUserInfo::set_phone_number(const std::string_view* value_arg) { +void InternalUserInfo::set_phone_number(const std::string_view* value_arg) { phone_number_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonUserInfo::set_phone_number(std::string_view value_arg) { +void InternalUserInfo::set_phone_number(std::string_view value_arg) { phone_number_ = value_arg; } -bool PigeonUserInfo::is_anonymous() const { return is_anonymous_; } +bool InternalUserInfo::is_anonymous() const { return is_anonymous_; } -void PigeonUserInfo::set_is_anonymous(bool value_arg) { +void InternalUserInfo::set_is_anonymous(bool value_arg) { is_anonymous_ = value_arg; } -bool PigeonUserInfo::is_email_verified() const { return is_email_verified_; } +bool InternalUserInfo::is_email_verified() const { return is_email_verified_; } -void PigeonUserInfo::set_is_email_verified(bool value_arg) { +void InternalUserInfo::set_is_email_verified(bool value_arg) { is_email_verified_ = value_arg; } -const std::string* PigeonUserInfo::provider_id() const { +const std::string* InternalUserInfo::provider_id() const { return provider_id_ ? &(*provider_id_) : nullptr; } -void PigeonUserInfo::set_provider_id(const std::string_view* value_arg) { +void InternalUserInfo::set_provider_id(const std::string_view* value_arg) { provider_id_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonUserInfo::set_provider_id(std::string_view value_arg) { +void InternalUserInfo::set_provider_id(std::string_view value_arg) { provider_id_ = value_arg; } -const std::string* PigeonUserInfo::tenant_id() const { +const std::string* InternalUserInfo::tenant_id() const { return tenant_id_ ? &(*tenant_id_) : nullptr; } -void PigeonUserInfo::set_tenant_id(const std::string_view* value_arg) { +void InternalUserInfo::set_tenant_id(const std::string_view* value_arg) { tenant_id_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonUserInfo::set_tenant_id(std::string_view value_arg) { +void InternalUserInfo::set_tenant_id(std::string_view value_arg) { tenant_id_ = value_arg; } -const std::string* PigeonUserInfo::refresh_token() const { +const std::string* InternalUserInfo::refresh_token() const { return refresh_token_ ? &(*refresh_token_) : nullptr; } -void PigeonUserInfo::set_refresh_token(const std::string_view* value_arg) { +void InternalUserInfo::set_refresh_token(const std::string_view* value_arg) { refresh_token_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonUserInfo::set_refresh_token(std::string_view value_arg) { +void InternalUserInfo::set_refresh_token(std::string_view value_arg) { refresh_token_ = value_arg; } -const int64_t* PigeonUserInfo::creation_timestamp() const { +const int64_t* InternalUserInfo::creation_timestamp() const { return creation_timestamp_ ? &(*creation_timestamp_) : nullptr; } -void PigeonUserInfo::set_creation_timestamp(const int64_t* value_arg) { +void InternalUserInfo::set_creation_timestamp(const int64_t* value_arg) { creation_timestamp_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonUserInfo::set_creation_timestamp(int64_t value_arg) { +void InternalUserInfo::set_creation_timestamp(int64_t value_arg) { creation_timestamp_ = value_arg; } -const int64_t* PigeonUserInfo::last_sign_in_timestamp() const { +const int64_t* InternalUserInfo::last_sign_in_timestamp() const { return last_sign_in_timestamp_ ? &(*last_sign_in_timestamp_) : nullptr; } -void PigeonUserInfo::set_last_sign_in_timestamp(const int64_t* value_arg) { +void InternalUserInfo::set_last_sign_in_timestamp(const int64_t* value_arg) { last_sign_in_timestamp_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonUserInfo::set_last_sign_in_timestamp(int64_t value_arg) { +void InternalUserInfo::set_last_sign_in_timestamp(int64_t value_arg) { last_sign_in_timestamp_ = value_arg; } -EncodableList PigeonUserInfo::ToEncodableList() const { +EncodableList InternalUserInfo::ToEncodableList() const { EncodableList list; list.reserve(12); list.push_back(EncodableValue(uid_)); @@ -776,9 +1185,10 @@ EncodableList PigeonUserInfo::ToEncodableList() const { return list; } -PigeonUserInfo PigeonUserInfo::FromEncodableList(const EncodableList& list) { - PigeonUserInfo decoded(std::get(list[0]), - std::get(list[5]), std::get(list[6])); +InternalUserInfo InternalUserInfo::FromEncodableList( + const EncodableList& list) { + InternalUserInfo decoded(std::get(list[0]), + std::get(list[5]), std::get(list[6])); auto& encodable_email = list[1]; if (!encodable_email.IsNull()) { decoded.set_email(std::get(encodable_email)); @@ -809,51 +1219,93 @@ PigeonUserInfo PigeonUserInfo::FromEncodableList(const EncodableList& list) { } auto& encodable_creation_timestamp = list[10]; if (!encodable_creation_timestamp.IsNull()) { - decoded.set_creation_timestamp(encodable_creation_timestamp.LongValue()); + decoded.set_creation_timestamp( + std::get(encodable_creation_timestamp)); } auto& encodable_last_sign_in_timestamp = list[11]; if (!encodable_last_sign_in_timestamp.IsNull()) { decoded.set_last_sign_in_timestamp( - encodable_last_sign_in_timestamp.LongValue()); + std::get(encodable_last_sign_in_timestamp)); } return decoded; } -// PigeonUserDetails - -PigeonUserDetails::PigeonUserDetails(const PigeonUserInfo& user_info, - const EncodableList& provider_data) - : user_info_(std::make_unique(user_info)), +bool InternalUserInfo::operator==(const InternalUserInfo& other) const { + return PigeonInternalDeepEquals(uid_, other.uid_) && + PigeonInternalDeepEquals(email_, other.email_) && + PigeonInternalDeepEquals(display_name_, other.display_name_) && + PigeonInternalDeepEquals(photo_url_, other.photo_url_) && + PigeonInternalDeepEquals(phone_number_, other.phone_number_) && + PigeonInternalDeepEquals(is_anonymous_, other.is_anonymous_) && + PigeonInternalDeepEquals(is_email_verified_, + other.is_email_verified_) && + PigeonInternalDeepEquals(provider_id_, other.provider_id_) && + PigeonInternalDeepEquals(tenant_id_, other.tenant_id_) && + PigeonInternalDeepEquals(refresh_token_, other.refresh_token_) && + PigeonInternalDeepEquals(creation_timestamp_, + other.creation_timestamp_) && + PigeonInternalDeepEquals(last_sign_in_timestamp_, + other.last_sign_in_timestamp_); +} + +bool InternalUserInfo::operator!=(const InternalUserInfo& other) const { + return !(*this == other); +} + +size_t InternalUserInfo::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(uid_); + result = result * 31 + PigeonInternalDeepHash(email_); + result = result * 31 + PigeonInternalDeepHash(display_name_); + result = result * 31 + PigeonInternalDeepHash(photo_url_); + result = result * 31 + PigeonInternalDeepHash(phone_number_); + result = result * 31 + PigeonInternalDeepHash(is_anonymous_); + result = result * 31 + PigeonInternalDeepHash(is_email_verified_); + result = result * 31 + PigeonInternalDeepHash(provider_id_); + result = result * 31 + PigeonInternalDeepHash(tenant_id_); + result = result * 31 + PigeonInternalDeepHash(refresh_token_); + result = result * 31 + PigeonInternalDeepHash(creation_timestamp_); + result = result * 31 + PigeonInternalDeepHash(last_sign_in_timestamp_); + return result; +} + +size_t PigeonInternalDeepHash(const InternalUserInfo& v) { return v.Hash(); } + +// InternalUserDetails + +InternalUserDetails::InternalUserDetails(const InternalUserInfo& user_info, + const EncodableList& provider_data) + : user_info_(std::make_unique(user_info)), provider_data_(provider_data) {} -PigeonUserDetails::PigeonUserDetails(const PigeonUserDetails& other) - : user_info_(std::make_unique(*other.user_info_)), +InternalUserDetails::InternalUserDetails(const InternalUserDetails& other) + : user_info_(std::make_unique(*other.user_info_)), provider_data_(other.provider_data_) {} -PigeonUserDetails& PigeonUserDetails::operator=( - const PigeonUserDetails& other) { - user_info_ = std::make_unique(*other.user_info_); +InternalUserDetails& InternalUserDetails::operator=( + const InternalUserDetails& other) { + user_info_ = std::make_unique(*other.user_info_); provider_data_ = other.provider_data_; return *this; } -const PigeonUserInfo& PigeonUserDetails::user_info() const { +const InternalUserInfo& InternalUserDetails::user_info() const { return *user_info_; } -void PigeonUserDetails::set_user_info(const PigeonUserInfo& value_arg) { - user_info_ = std::make_unique(value_arg); +void InternalUserDetails::set_user_info(const InternalUserInfo& value_arg) { + user_info_ = std::make_unique(value_arg); } -const EncodableList& PigeonUserDetails::provider_data() const { +const EncodableList& InternalUserDetails::provider_data() const { return provider_data_; } -void PigeonUserDetails::set_provider_data(const EncodableList& value_arg) { +void InternalUserDetails::set_provider_data(const EncodableList& value_arg) { provider_data_ = value_arg; } -EncodableList PigeonUserDetails::ToEncodableList() const { +EncodableList InternalUserDetails::ToEncodableList() const { EncodableList list; list.reserve(2); list.push_back(CustomEncodableValue(*user_info_)); @@ -861,101 +1313,123 @@ EncodableList PigeonUserDetails::ToEncodableList() const { return list; } -PigeonUserDetails PigeonUserDetails::FromEncodableList( +InternalUserDetails InternalUserDetails::FromEncodableList( const EncodableList& list) { - PigeonUserDetails decoded(std::any_cast( - std::get(list[0])), - std::get(list[1])); + InternalUserDetails decoded(std::any_cast( + std::get(list[0])), + std::get(list[1])); return decoded; } -// PigeonUserCredential +bool InternalUserDetails::operator==(const InternalUserDetails& other) const { + return PigeonInternalDeepEquals(user_info_, other.user_info_) && + PigeonInternalDeepEquals(provider_data_, other.provider_data_); +} + +bool InternalUserDetails::operator!=(const InternalUserDetails& other) const { + return !(*this == other); +} + +size_t InternalUserDetails::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(user_info_); + result = result * 31 + PigeonInternalDeepHash(provider_data_); + return result; +} + +size_t PigeonInternalDeepHash(const InternalUserDetails& v) { return v.Hash(); } + +// InternalUserCredential -PigeonUserCredential::PigeonUserCredential() {} +InternalUserCredential::InternalUserCredential() {} -PigeonUserCredential::PigeonUserCredential( - const PigeonUserDetails* user, - const PigeonAdditionalUserInfo* additional_user_info, - const PigeonAuthCredential* credential) - : user_(user ? std::make_unique(*user) : nullptr), +InternalUserCredential::InternalUserCredential( + const InternalUserDetails* user, + const InternalAdditionalUserInfo* additional_user_info, + const InternalAuthCredential* credential) + : user_(user ? std::make_unique(*user) : nullptr), additional_user_info_(additional_user_info - ? std::make_unique( + ? std::make_unique( *additional_user_info) : nullptr), credential_(credential - ? std::make_unique(*credential) + ? std::make_unique(*credential) : nullptr) {} -PigeonUserCredential::PigeonUserCredential(const PigeonUserCredential& other) - : user_(other.user_ ? std::make_unique(*other.user_) +InternalUserCredential::InternalUserCredential( + const InternalUserCredential& other) + : user_(other.user_ ? std::make_unique(*other.user_) : nullptr), additional_user_info_(other.additional_user_info_ - ? std::make_unique( + ? std::make_unique( *other.additional_user_info_) : nullptr), - credential_(other.credential_ ? std::make_unique( + credential_(other.credential_ ? std::make_unique( *other.credential_) : nullptr) {} -PigeonUserCredential& PigeonUserCredential::operator=( - const PigeonUserCredential& other) { - user_ = - other.user_ ? std::make_unique(*other.user_) : nullptr; +InternalUserCredential& InternalUserCredential::operator=( + const InternalUserCredential& other) { + user_ = other.user_ ? std::make_unique(*other.user_) + : nullptr; additional_user_info_ = other.additional_user_info_ - ? std::make_unique( + ? std::make_unique( *other.additional_user_info_) : nullptr; - credential_ = other.credential_ - ? std::make_unique(*other.credential_) - : nullptr; + credential_ = + other.credential_ + ? std::make_unique(*other.credential_) + : nullptr; return *this; } -const PigeonUserDetails* PigeonUserCredential::user() const { +const InternalUserDetails* InternalUserCredential::user() const { return user_.get(); } -void PigeonUserCredential::set_user(const PigeonUserDetails* value_arg) { - user_ = value_arg ? std::make_unique(*value_arg) : nullptr; +void InternalUserCredential::set_user(const InternalUserDetails* value_arg) { + user_ = + value_arg ? std::make_unique(*value_arg) : nullptr; } -void PigeonUserCredential::set_user(const PigeonUserDetails& value_arg) { - user_ = std::make_unique(value_arg); +void InternalUserCredential::set_user(const InternalUserDetails& value_arg) { + user_ = std::make_unique(value_arg); } -const PigeonAdditionalUserInfo* PigeonUserCredential::additional_user_info() +const InternalAdditionalUserInfo* InternalUserCredential::additional_user_info() const { return additional_user_info_.get(); } -void PigeonUserCredential::set_additional_user_info( - const PigeonAdditionalUserInfo* value_arg) { +void InternalUserCredential::set_additional_user_info( + const InternalAdditionalUserInfo* value_arg) { additional_user_info_ = - value_arg ? std::make_unique(*value_arg) + value_arg ? std::make_unique(*value_arg) : nullptr; } -void PigeonUserCredential::set_additional_user_info( - const PigeonAdditionalUserInfo& value_arg) { - additional_user_info_ = std::make_unique(value_arg); +void InternalUserCredential::set_additional_user_info( + const InternalAdditionalUserInfo& value_arg) { + additional_user_info_ = + std::make_unique(value_arg); } -const PigeonAuthCredential* PigeonUserCredential::credential() const { +const InternalAuthCredential* InternalUserCredential::credential() const { return credential_.get(); } -void PigeonUserCredential::set_credential( - const PigeonAuthCredential* value_arg) { - credential_ = - value_arg ? std::make_unique(*value_arg) : nullptr; +void InternalUserCredential::set_credential( + const InternalAuthCredential* value_arg) { + credential_ = value_arg ? std::make_unique(*value_arg) + : nullptr; } -void PigeonUserCredential::set_credential( - const PigeonAuthCredential& value_arg) { - credential_ = std::make_unique(value_arg); +void InternalUserCredential::set_credential( + const InternalAuthCredential& value_arg) { + credential_ = std::make_unique(value_arg); } -EncodableList PigeonUserCredential::ToEncodableList() const { +EncodableList InternalUserCredential::ToEncodableList() const { EncodableList list; list.reserve(3); list.push_back(user_ ? CustomEncodableValue(*user_) : EncodableValue()); @@ -967,38 +1441,173 @@ EncodableList PigeonUserCredential::ToEncodableList() const { return list; } -PigeonUserCredential PigeonUserCredential::FromEncodableList( +InternalUserCredential InternalUserCredential::FromEncodableList( const EncodableList& list) { - PigeonUserCredential decoded; + InternalUserCredential decoded; auto& encodable_user = list[0]; if (!encodable_user.IsNull()) { - decoded.set_user(std::any_cast( + decoded.set_user(std::any_cast( std::get(encodable_user))); } auto& encodable_additional_user_info = list[1]; if (!encodable_additional_user_info.IsNull()) { decoded.set_additional_user_info( - std::any_cast( + std::any_cast( std::get(encodable_additional_user_info))); } auto& encodable_credential = list[2]; if (!encodable_credential.IsNull()) { - decoded.set_credential(std::any_cast( + decoded.set_credential(std::any_cast( std::get(encodable_credential))); } return decoded; } -// PigeonActionCodeSettings +bool InternalUserCredential::operator==( + const InternalUserCredential& other) const { + return PigeonInternalDeepEquals(user_, other.user_) && + PigeonInternalDeepEquals(additional_user_info_, + other.additional_user_info_) && + PigeonInternalDeepEquals(credential_, other.credential_); +} + +bool InternalUserCredential::operator!=( + const InternalUserCredential& other) const { + return !(*this == other); +} + +size_t InternalUserCredential::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(user_); + result = result * 31 + PigeonInternalDeepHash(additional_user_info_); + result = result * 31 + PigeonInternalDeepHash(credential_); + return result; +} + +size_t PigeonInternalDeepHash(const InternalUserCredential& v) { + return v.Hash(); +} + +// InternalAuthCredentialInput + +InternalAuthCredentialInput::InternalAuthCredentialInput( + const std::string& provider_id, const std::string& sign_in_method) + : provider_id_(provider_id), sign_in_method_(sign_in_method) {} + +InternalAuthCredentialInput::InternalAuthCredentialInput( + const std::string& provider_id, const std::string& sign_in_method, + const std::string* token, const std::string* access_token) + : provider_id_(provider_id), + sign_in_method_(sign_in_method), + token_(token ? std::optional(*token) : std::nullopt), + access_token_(access_token ? std::optional(*access_token) + : std::nullopt) {} + +const std::string& InternalAuthCredentialInput::provider_id() const { + return provider_id_; +} + +void InternalAuthCredentialInput::set_provider_id(std::string_view value_arg) { + provider_id_ = value_arg; +} + +const std::string& InternalAuthCredentialInput::sign_in_method() const { + return sign_in_method_; +} + +void InternalAuthCredentialInput::set_sign_in_method( + std::string_view value_arg) { + sign_in_method_ = value_arg; +} + +const std::string* InternalAuthCredentialInput::token() const { + return token_ ? &(*token_) : nullptr; +} + +void InternalAuthCredentialInput::set_token(const std::string_view* value_arg) { + token_ = value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void InternalAuthCredentialInput::set_token(std::string_view value_arg) { + token_ = value_arg; +} + +const std::string* InternalAuthCredentialInput::access_token() const { + return access_token_ ? &(*access_token_) : nullptr; +} + +void InternalAuthCredentialInput::set_access_token( + const std::string_view* value_arg) { + access_token_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void InternalAuthCredentialInput::set_access_token(std::string_view value_arg) { + access_token_ = value_arg; +} + +EncodableList InternalAuthCredentialInput::ToEncodableList() const { + EncodableList list; + list.reserve(4); + list.push_back(EncodableValue(provider_id_)); + list.push_back(EncodableValue(sign_in_method_)); + list.push_back(token_ ? EncodableValue(*token_) : EncodableValue()); + list.push_back(access_token_ ? EncodableValue(*access_token_) + : EncodableValue()); + return list; +} + +InternalAuthCredentialInput InternalAuthCredentialInput::FromEncodableList( + const EncodableList& list) { + InternalAuthCredentialInput decoded(std::get(list[0]), + std::get(list[1])); + auto& encodable_token = list[2]; + if (!encodable_token.IsNull()) { + decoded.set_token(std::get(encodable_token)); + } + auto& encodable_access_token = list[3]; + if (!encodable_access_token.IsNull()) { + decoded.set_access_token(std::get(encodable_access_token)); + } + return decoded; +} + +bool InternalAuthCredentialInput::operator==( + const InternalAuthCredentialInput& other) const { + return PigeonInternalDeepEquals(provider_id_, other.provider_id_) && + PigeonInternalDeepEquals(sign_in_method_, other.sign_in_method_) && + PigeonInternalDeepEquals(token_, other.token_) && + PigeonInternalDeepEquals(access_token_, other.access_token_); +} + +bool InternalAuthCredentialInput::operator!=( + const InternalAuthCredentialInput& other) const { + return !(*this == other); +} + +size_t InternalAuthCredentialInput::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(provider_id_); + result = result * 31 + PigeonInternalDeepHash(sign_in_method_); + result = result * 31 + PigeonInternalDeepHash(token_); + result = result * 31 + PigeonInternalDeepHash(access_token_); + return result; +} + +size_t PigeonInternalDeepHash(const InternalAuthCredentialInput& v) { + return v.Hash(); +} + +// InternalActionCodeSettings -PigeonActionCodeSettings::PigeonActionCodeSettings(const std::string& url, - bool handle_code_in_app, - bool android_install_app) +InternalActionCodeSettings::InternalActionCodeSettings(const std::string& url, + bool handle_code_in_app, + bool android_install_app) : url_(url), handle_code_in_app_(handle_code_in_app), android_install_app_(android_install_app) {} -PigeonActionCodeSettings::PigeonActionCodeSettings( +InternalActionCodeSettings::InternalActionCodeSettings( const std::string& url, const std::string* dynamic_link_domain, bool handle_code_in_app, const std::string* i_o_s_bundle_id, const std::string* android_package_name, bool android_install_app, @@ -1022,102 +1631,103 @@ PigeonActionCodeSettings::PigeonActionCodeSettings( link_domain_(link_domain ? std::optional(*link_domain) : std::nullopt) {} -const std::string& PigeonActionCodeSettings::url() const { return url_; } +const std::string& InternalActionCodeSettings::url() const { return url_; } -void PigeonActionCodeSettings::set_url(std::string_view value_arg) { +void InternalActionCodeSettings::set_url(std::string_view value_arg) { url_ = value_arg; } -const std::string* PigeonActionCodeSettings::dynamic_link_domain() const { +const std::string* InternalActionCodeSettings::dynamic_link_domain() const { return dynamic_link_domain_ ? &(*dynamic_link_domain_) : nullptr; } -void PigeonActionCodeSettings::set_dynamic_link_domain( +void InternalActionCodeSettings::set_dynamic_link_domain( const std::string_view* value_arg) { dynamic_link_domain_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonActionCodeSettings::set_dynamic_link_domain( +void InternalActionCodeSettings::set_dynamic_link_domain( std::string_view value_arg) { dynamic_link_domain_ = value_arg; } -bool PigeonActionCodeSettings::handle_code_in_app() const { +bool InternalActionCodeSettings::handle_code_in_app() const { return handle_code_in_app_; } -void PigeonActionCodeSettings::set_handle_code_in_app(bool value_arg) { +void InternalActionCodeSettings::set_handle_code_in_app(bool value_arg) { handle_code_in_app_ = value_arg; } -const std::string* PigeonActionCodeSettings::i_o_s_bundle_id() const { +const std::string* InternalActionCodeSettings::i_o_s_bundle_id() const { return i_o_s_bundle_id_ ? &(*i_o_s_bundle_id_) : nullptr; } -void PigeonActionCodeSettings::set_i_o_s_bundle_id( +void InternalActionCodeSettings::set_i_o_s_bundle_id( const std::string_view* value_arg) { i_o_s_bundle_id_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonActionCodeSettings::set_i_o_s_bundle_id(std::string_view value_arg) { +void InternalActionCodeSettings::set_i_o_s_bundle_id( + std::string_view value_arg) { i_o_s_bundle_id_ = value_arg; } -const std::string* PigeonActionCodeSettings::android_package_name() const { +const std::string* InternalActionCodeSettings::android_package_name() const { return android_package_name_ ? &(*android_package_name_) : nullptr; } -void PigeonActionCodeSettings::set_android_package_name( +void InternalActionCodeSettings::set_android_package_name( const std::string_view* value_arg) { android_package_name_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonActionCodeSettings::set_android_package_name( +void InternalActionCodeSettings::set_android_package_name( std::string_view value_arg) { android_package_name_ = value_arg; } -bool PigeonActionCodeSettings::android_install_app() const { +bool InternalActionCodeSettings::android_install_app() const { return android_install_app_; } -void PigeonActionCodeSettings::set_android_install_app(bool value_arg) { +void InternalActionCodeSettings::set_android_install_app(bool value_arg) { android_install_app_ = value_arg; } -const std::string* PigeonActionCodeSettings::android_minimum_version() const { +const std::string* InternalActionCodeSettings::android_minimum_version() const { return android_minimum_version_ ? &(*android_minimum_version_) : nullptr; } -void PigeonActionCodeSettings::set_android_minimum_version( +void InternalActionCodeSettings::set_android_minimum_version( const std::string_view* value_arg) { android_minimum_version_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonActionCodeSettings::set_android_minimum_version( +void InternalActionCodeSettings::set_android_minimum_version( std::string_view value_arg) { android_minimum_version_ = value_arg; } -const std::string* PigeonActionCodeSettings::link_domain() const { +const std::string* InternalActionCodeSettings::link_domain() const { return link_domain_ ? &(*link_domain_) : nullptr; } -void PigeonActionCodeSettings::set_link_domain( +void InternalActionCodeSettings::set_link_domain( const std::string_view* value_arg) { link_domain_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonActionCodeSettings::set_link_domain(std::string_view value_arg) { +void InternalActionCodeSettings::set_link_domain(std::string_view value_arg) { link_domain_ = value_arg; } -EncodableList PigeonActionCodeSettings::ToEncodableList() const { +EncodableList InternalActionCodeSettings::ToEncodableList() const { EncodableList list; list.reserve(8); list.push_back(EncodableValue(url_)); @@ -1137,11 +1747,11 @@ EncodableList PigeonActionCodeSettings::ToEncodableList() const { return list; } -PigeonActionCodeSettings PigeonActionCodeSettings::FromEncodableList( +InternalActionCodeSettings InternalActionCodeSettings::FromEncodableList( const EncodableList& list) { - PigeonActionCodeSettings decoded(std::get(list[0]), - std::get(list[2]), - std::get(list[5])); + InternalActionCodeSettings decoded(std::get(list[0]), + std::get(list[2]), + std::get(list[5])); auto& encodable_dynamic_link_domain = list[1]; if (!encodable_dynamic_link_domain.IsNull()) { decoded.set_dynamic_link_domain( @@ -1169,14 +1779,53 @@ PigeonActionCodeSettings PigeonActionCodeSettings::FromEncodableList( return decoded; } -// PigeonFirebaseAuthSettings +bool InternalActionCodeSettings::operator==( + const InternalActionCodeSettings& other) const { + return PigeonInternalDeepEquals(url_, other.url_) && + PigeonInternalDeepEquals(dynamic_link_domain_, + other.dynamic_link_domain_) && + PigeonInternalDeepEquals(handle_code_in_app_, + other.handle_code_in_app_) && + PigeonInternalDeepEquals(i_o_s_bundle_id_, other.i_o_s_bundle_id_) && + PigeonInternalDeepEquals(android_package_name_, + other.android_package_name_) && + PigeonInternalDeepEquals(android_install_app_, + other.android_install_app_) && + PigeonInternalDeepEquals(android_minimum_version_, + other.android_minimum_version_) && + PigeonInternalDeepEquals(link_domain_, other.link_domain_); +} + +bool InternalActionCodeSettings::operator!=( + const InternalActionCodeSettings& other) const { + return !(*this == other); +} + +size_t InternalActionCodeSettings::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(url_); + result = result * 31 + PigeonInternalDeepHash(dynamic_link_domain_); + result = result * 31 + PigeonInternalDeepHash(handle_code_in_app_); + result = result * 31 + PigeonInternalDeepHash(i_o_s_bundle_id_); + result = result * 31 + PigeonInternalDeepHash(android_package_name_); + result = result * 31 + PigeonInternalDeepHash(android_install_app_); + result = result * 31 + PigeonInternalDeepHash(android_minimum_version_); + result = result * 31 + PigeonInternalDeepHash(link_domain_); + return result; +} + +size_t PigeonInternalDeepHash(const InternalActionCodeSettings& v) { + return v.Hash(); +} + +// InternalFirebaseAuthSettings -PigeonFirebaseAuthSettings::PigeonFirebaseAuthSettings( +InternalFirebaseAuthSettings::InternalFirebaseAuthSettings( bool app_verification_disabled_for_testing) : app_verification_disabled_for_testing_( app_verification_disabled_for_testing) {} -PigeonFirebaseAuthSettings::PigeonFirebaseAuthSettings( +InternalFirebaseAuthSettings::InternalFirebaseAuthSettings( bool app_verification_disabled_for_testing, const std::string* user_access_group, const std::string* phone_number, const std::string* sms_code, const bool* force_recaptcha_flow) @@ -1193,72 +1842,74 @@ PigeonFirebaseAuthSettings::PigeonFirebaseAuthSettings( ? std::optional(*force_recaptcha_flow) : std::nullopt) {} -bool PigeonFirebaseAuthSettings::app_verification_disabled_for_testing() const { +bool InternalFirebaseAuthSettings::app_verification_disabled_for_testing() + const { return app_verification_disabled_for_testing_; } -void PigeonFirebaseAuthSettings::set_app_verification_disabled_for_testing( +void InternalFirebaseAuthSettings::set_app_verification_disabled_for_testing( bool value_arg) { app_verification_disabled_for_testing_ = value_arg; } -const std::string* PigeonFirebaseAuthSettings::user_access_group() const { +const std::string* InternalFirebaseAuthSettings::user_access_group() const { return user_access_group_ ? &(*user_access_group_) : nullptr; } -void PigeonFirebaseAuthSettings::set_user_access_group( +void InternalFirebaseAuthSettings::set_user_access_group( const std::string_view* value_arg) { user_access_group_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonFirebaseAuthSettings::set_user_access_group( +void InternalFirebaseAuthSettings::set_user_access_group( std::string_view value_arg) { user_access_group_ = value_arg; } -const std::string* PigeonFirebaseAuthSettings::phone_number() const { +const std::string* InternalFirebaseAuthSettings::phone_number() const { return phone_number_ ? &(*phone_number_) : nullptr; } -void PigeonFirebaseAuthSettings::set_phone_number( +void InternalFirebaseAuthSettings::set_phone_number( const std::string_view* value_arg) { phone_number_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonFirebaseAuthSettings::set_phone_number(std::string_view value_arg) { +void InternalFirebaseAuthSettings::set_phone_number( + std::string_view value_arg) { phone_number_ = value_arg; } -const std::string* PigeonFirebaseAuthSettings::sms_code() const { +const std::string* InternalFirebaseAuthSettings::sms_code() const { return sms_code_ ? &(*sms_code_) : nullptr; } -void PigeonFirebaseAuthSettings::set_sms_code( +void InternalFirebaseAuthSettings::set_sms_code( const std::string_view* value_arg) { sms_code_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonFirebaseAuthSettings::set_sms_code(std::string_view value_arg) { +void InternalFirebaseAuthSettings::set_sms_code(std::string_view value_arg) { sms_code_ = value_arg; } -const bool* PigeonFirebaseAuthSettings::force_recaptcha_flow() const { +const bool* InternalFirebaseAuthSettings::force_recaptcha_flow() const { return force_recaptcha_flow_ ? &(*force_recaptcha_flow_) : nullptr; } -void PigeonFirebaseAuthSettings::set_force_recaptcha_flow( +void InternalFirebaseAuthSettings::set_force_recaptcha_flow( const bool* value_arg) { force_recaptcha_flow_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonFirebaseAuthSettings::set_force_recaptcha_flow(bool value_arg) { +void InternalFirebaseAuthSettings::set_force_recaptcha_flow(bool value_arg) { force_recaptcha_flow_ = value_arg; } -EncodableList PigeonFirebaseAuthSettings::ToEncodableList() const { +EncodableList InternalFirebaseAuthSettings::ToEncodableList() const { EncodableList list; list.reserve(5); list.push_back(EncodableValue(app_verification_disabled_for_testing_)); @@ -1272,9 +1923,9 @@ EncodableList PigeonFirebaseAuthSettings::ToEncodableList() const { return list; } -PigeonFirebaseAuthSettings PigeonFirebaseAuthSettings::FromEncodableList( +InternalFirebaseAuthSettings InternalFirebaseAuthSettings::FromEncodableList( const EncodableList& list) { - PigeonFirebaseAuthSettings decoded(std::get(list[0])); + InternalFirebaseAuthSettings decoded(std::get(list[0])); auto& encodable_user_access_group = list[1]; if (!encodable_user_access_group.IsNull()) { decoded.set_user_access_group( @@ -1296,12 +1947,45 @@ PigeonFirebaseAuthSettings PigeonFirebaseAuthSettings::FromEncodableList( return decoded; } -// PigeonSignInProvider +bool InternalFirebaseAuthSettings::operator==( + const InternalFirebaseAuthSettings& other) const { + return PigeonInternalDeepEquals( + app_verification_disabled_for_testing_, + other.app_verification_disabled_for_testing_) && + PigeonInternalDeepEquals(user_access_group_, + other.user_access_group_) && + PigeonInternalDeepEquals(phone_number_, other.phone_number_) && + PigeonInternalDeepEquals(sms_code_, other.sms_code_) && + PigeonInternalDeepEquals(force_recaptcha_flow_, + other.force_recaptcha_flow_); +} + +bool InternalFirebaseAuthSettings::operator!=( + const InternalFirebaseAuthSettings& other) const { + return !(*this == other); +} + +size_t InternalFirebaseAuthSettings::Hash() const { + size_t result = 1; + result = result * 31 + + PigeonInternalDeepHash(app_verification_disabled_for_testing_); + result = result * 31 + PigeonInternalDeepHash(user_access_group_); + result = result * 31 + PigeonInternalDeepHash(phone_number_); + result = result * 31 + PigeonInternalDeepHash(sms_code_); + result = result * 31 + PigeonInternalDeepHash(force_recaptcha_flow_); + return result; +} + +size_t PigeonInternalDeepHash(const InternalFirebaseAuthSettings& v) { + return v.Hash(); +} + +// InternalSignInProvider -PigeonSignInProvider::PigeonSignInProvider(const std::string& provider_id) +InternalSignInProvider::InternalSignInProvider(const std::string& provider_id) : provider_id_(provider_id) {} -PigeonSignInProvider::PigeonSignInProvider( +InternalSignInProvider::InternalSignInProvider( const std::string& provider_id, const EncodableList* scopes, const EncodableMap* custom_parameters) : provider_id_(provider_id), @@ -1310,42 +1994,42 @@ PigeonSignInProvider::PigeonSignInProvider( ? std::optional(*custom_parameters) : std::nullopt) {} -const std::string& PigeonSignInProvider::provider_id() const { +const std::string& InternalSignInProvider::provider_id() const { return provider_id_; } -void PigeonSignInProvider::set_provider_id(std::string_view value_arg) { +void InternalSignInProvider::set_provider_id(std::string_view value_arg) { provider_id_ = value_arg; } -const EncodableList* PigeonSignInProvider::scopes() const { +const EncodableList* InternalSignInProvider::scopes() const { return scopes_ ? &(*scopes_) : nullptr; } -void PigeonSignInProvider::set_scopes(const EncodableList* value_arg) { +void InternalSignInProvider::set_scopes(const EncodableList* value_arg) { scopes_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonSignInProvider::set_scopes(const EncodableList& value_arg) { +void InternalSignInProvider::set_scopes(const EncodableList& value_arg) { scopes_ = value_arg; } -const EncodableMap* PigeonSignInProvider::custom_parameters() const { +const EncodableMap* InternalSignInProvider::custom_parameters() const { return custom_parameters_ ? &(*custom_parameters_) : nullptr; } -void PigeonSignInProvider::set_custom_parameters( +void InternalSignInProvider::set_custom_parameters( const EncodableMap* value_arg) { custom_parameters_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonSignInProvider::set_custom_parameters( +void InternalSignInProvider::set_custom_parameters( const EncodableMap& value_arg) { custom_parameters_ = value_arg; } -EncodableList PigeonSignInProvider::ToEncodableList() const { +EncodableList InternalSignInProvider::ToEncodableList() const { EncodableList list; list.reserve(3); list.push_back(EncodableValue(provider_id_)); @@ -1355,9 +2039,9 @@ EncodableList PigeonSignInProvider::ToEncodableList() const { return list; } -PigeonSignInProvider PigeonSignInProvider::FromEncodableList( +InternalSignInProvider InternalSignInProvider::FromEncodableList( const EncodableList& list) { - PigeonSignInProvider decoded(std::get(list[0])); + InternalSignInProvider decoded(std::get(list[0])); auto& encodable_scopes = list[1]; if (!encodable_scopes.IsNull()) { decoded.set_scopes(std::get(encodable_scopes)); @@ -1370,12 +2054,37 @@ PigeonSignInProvider PigeonSignInProvider::FromEncodableList( return decoded; } -// PigeonVerifyPhoneNumberRequest +bool InternalSignInProvider::operator==( + const InternalSignInProvider& other) const { + return PigeonInternalDeepEquals(provider_id_, other.provider_id_) && + PigeonInternalDeepEquals(scopes_, other.scopes_) && + PigeonInternalDeepEquals(custom_parameters_, other.custom_parameters_); +} + +bool InternalSignInProvider::operator!=( + const InternalSignInProvider& other) const { + return !(*this == other); +} + +size_t InternalSignInProvider::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(provider_id_); + result = result * 31 + PigeonInternalDeepHash(scopes_); + result = result * 31 + PigeonInternalDeepHash(custom_parameters_); + return result; +} + +size_t PigeonInternalDeepHash(const InternalSignInProvider& v) { + return v.Hash(); +} + +// InternalVerifyPhoneNumberRequest -PigeonVerifyPhoneNumberRequest::PigeonVerifyPhoneNumberRequest(int64_t timeout) +InternalVerifyPhoneNumberRequest::InternalVerifyPhoneNumberRequest( + int64_t timeout) : timeout_(timeout) {} -PigeonVerifyPhoneNumberRequest::PigeonVerifyPhoneNumberRequest( +InternalVerifyPhoneNumberRequest::InternalVerifyPhoneNumberRequest( const std::string* phone_number, int64_t timeout, const int64_t* force_resending_token, const std::string* auto_retrieved_sms_code_for_testing, @@ -1399,93 +2108,93 @@ PigeonVerifyPhoneNumberRequest::PigeonVerifyPhoneNumberRequest( ? std::optional(*multi_factor_session_id) : std::nullopt) {} -const std::string* PigeonVerifyPhoneNumberRequest::phone_number() const { +const std::string* InternalVerifyPhoneNumberRequest::phone_number() const { return phone_number_ ? &(*phone_number_) : nullptr; } -void PigeonVerifyPhoneNumberRequest::set_phone_number( +void InternalVerifyPhoneNumberRequest::set_phone_number( const std::string_view* value_arg) { phone_number_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonVerifyPhoneNumberRequest::set_phone_number( +void InternalVerifyPhoneNumberRequest::set_phone_number( std::string_view value_arg) { phone_number_ = value_arg; } -int64_t PigeonVerifyPhoneNumberRequest::timeout() const { return timeout_; } +int64_t InternalVerifyPhoneNumberRequest::timeout() const { return timeout_; } -void PigeonVerifyPhoneNumberRequest::set_timeout(int64_t value_arg) { +void InternalVerifyPhoneNumberRequest::set_timeout(int64_t value_arg) { timeout_ = value_arg; } -const int64_t* PigeonVerifyPhoneNumberRequest::force_resending_token() const { +const int64_t* InternalVerifyPhoneNumberRequest::force_resending_token() const { return force_resending_token_ ? &(*force_resending_token_) : nullptr; } -void PigeonVerifyPhoneNumberRequest::set_force_resending_token( +void InternalVerifyPhoneNumberRequest::set_force_resending_token( const int64_t* value_arg) { force_resending_token_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonVerifyPhoneNumberRequest::set_force_resending_token( +void InternalVerifyPhoneNumberRequest::set_force_resending_token( int64_t value_arg) { force_resending_token_ = value_arg; } const std::string* -PigeonVerifyPhoneNumberRequest::auto_retrieved_sms_code_for_testing() const { +InternalVerifyPhoneNumberRequest::auto_retrieved_sms_code_for_testing() const { return auto_retrieved_sms_code_for_testing_ ? &(*auto_retrieved_sms_code_for_testing_) : nullptr; } -void PigeonVerifyPhoneNumberRequest::set_auto_retrieved_sms_code_for_testing( +void InternalVerifyPhoneNumberRequest::set_auto_retrieved_sms_code_for_testing( const std::string_view* value_arg) { auto_retrieved_sms_code_for_testing_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonVerifyPhoneNumberRequest::set_auto_retrieved_sms_code_for_testing( +void InternalVerifyPhoneNumberRequest::set_auto_retrieved_sms_code_for_testing( std::string_view value_arg) { auto_retrieved_sms_code_for_testing_ = value_arg; } -const std::string* PigeonVerifyPhoneNumberRequest::multi_factor_info_id() +const std::string* InternalVerifyPhoneNumberRequest::multi_factor_info_id() const { return multi_factor_info_id_ ? &(*multi_factor_info_id_) : nullptr; } -void PigeonVerifyPhoneNumberRequest::set_multi_factor_info_id( +void InternalVerifyPhoneNumberRequest::set_multi_factor_info_id( const std::string_view* value_arg) { multi_factor_info_id_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonVerifyPhoneNumberRequest::set_multi_factor_info_id( +void InternalVerifyPhoneNumberRequest::set_multi_factor_info_id( std::string_view value_arg) { multi_factor_info_id_ = value_arg; } -const std::string* PigeonVerifyPhoneNumberRequest::multi_factor_session_id() +const std::string* InternalVerifyPhoneNumberRequest::multi_factor_session_id() const { return multi_factor_session_id_ ? &(*multi_factor_session_id_) : nullptr; } -void PigeonVerifyPhoneNumberRequest::set_multi_factor_session_id( +void InternalVerifyPhoneNumberRequest::set_multi_factor_session_id( const std::string_view* value_arg) { multi_factor_session_id_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonVerifyPhoneNumberRequest::set_multi_factor_session_id( +void InternalVerifyPhoneNumberRequest::set_multi_factor_session_id( std::string_view value_arg) { multi_factor_session_id_ = value_arg; } -EncodableList PigeonVerifyPhoneNumberRequest::ToEncodableList() const { +EncodableList InternalVerifyPhoneNumberRequest::ToEncodableList() const { EncodableList list; list.reserve(6); list.push_back(phone_number_ ? EncodableValue(*phone_number_) @@ -1505,9 +2214,9 @@ EncodableList PigeonVerifyPhoneNumberRequest::ToEncodableList() const { return list; } -PigeonVerifyPhoneNumberRequest -PigeonVerifyPhoneNumberRequest::FromEncodableList(const EncodableList& list) { - PigeonVerifyPhoneNumberRequest decoded(list[1].LongValue()); +InternalVerifyPhoneNumberRequest +InternalVerifyPhoneNumberRequest::FromEncodableList(const EncodableList& list) { + InternalVerifyPhoneNumberRequest decoded(std::get(list[1])); auto& encodable_phone_number = list[0]; if (!encodable_phone_number.IsNull()) { decoded.set_phone_number(std::get(encodable_phone_number)); @@ -1515,7 +2224,7 @@ PigeonVerifyPhoneNumberRequest::FromEncodableList(const EncodableList& list) { auto& encodable_force_resending_token = list[2]; if (!encodable_force_resending_token.IsNull()) { decoded.set_force_resending_token( - encodable_force_resending_token.LongValue()); + std::get(encodable_force_resending_token)); } auto& encodable_auto_retrieved_sms_code_for_testing = list[3]; if (!encodable_auto_retrieved_sms_code_for_testing.IsNull()) { @@ -1535,11 +2244,46 @@ PigeonVerifyPhoneNumberRequest::FromEncodableList(const EncodableList& list) { return decoded; } -// PigeonIdTokenResult +bool InternalVerifyPhoneNumberRequest::operator==( + const InternalVerifyPhoneNumberRequest& other) const { + return PigeonInternalDeepEquals(phone_number_, other.phone_number_) && + PigeonInternalDeepEquals(timeout_, other.timeout_) && + PigeonInternalDeepEquals(force_resending_token_, + other.force_resending_token_) && + PigeonInternalDeepEquals(auto_retrieved_sms_code_for_testing_, + other.auto_retrieved_sms_code_for_testing_) && + PigeonInternalDeepEquals(multi_factor_info_id_, + other.multi_factor_info_id_) && + PigeonInternalDeepEquals(multi_factor_session_id_, + other.multi_factor_session_id_); +} + +bool InternalVerifyPhoneNumberRequest::operator!=( + const InternalVerifyPhoneNumberRequest& other) const { + return !(*this == other); +} + +size_t InternalVerifyPhoneNumberRequest::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(phone_number_); + result = result * 31 + PigeonInternalDeepHash(timeout_); + result = result * 31 + PigeonInternalDeepHash(force_resending_token_); + result = result * 31 + + PigeonInternalDeepHash(auto_retrieved_sms_code_for_testing_); + result = result * 31 + PigeonInternalDeepHash(multi_factor_info_id_); + result = result * 31 + PigeonInternalDeepHash(multi_factor_session_id_); + return result; +} + +size_t PigeonInternalDeepHash(const InternalVerifyPhoneNumberRequest& v) { + return v.Hash(); +} + +// InternalIdTokenResult -PigeonIdTokenResult::PigeonIdTokenResult() {} +InternalIdTokenResult::InternalIdTokenResult() {} -PigeonIdTokenResult::PigeonIdTokenResult( +InternalIdTokenResult::InternalIdTokenResult( const std::string* token, const int64_t* expiration_timestamp, const int64_t* auth_timestamp, const int64_t* issued_at_timestamp, const std::string* sign_in_provider, const EncodableMap* claims, @@ -1561,99 +2305,99 @@ PigeonIdTokenResult::PigeonIdTokenResult( *sign_in_second_factor) : std::nullopt) {} -const std::string* PigeonIdTokenResult::token() const { +const std::string* InternalIdTokenResult::token() const { return token_ ? &(*token_) : nullptr; } -void PigeonIdTokenResult::set_token(const std::string_view* value_arg) { +void InternalIdTokenResult::set_token(const std::string_view* value_arg) { token_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonIdTokenResult::set_token(std::string_view value_arg) { +void InternalIdTokenResult::set_token(std::string_view value_arg) { token_ = value_arg; } -const int64_t* PigeonIdTokenResult::expiration_timestamp() const { +const int64_t* InternalIdTokenResult::expiration_timestamp() const { return expiration_timestamp_ ? &(*expiration_timestamp_) : nullptr; } -void PigeonIdTokenResult::set_expiration_timestamp(const int64_t* value_arg) { +void InternalIdTokenResult::set_expiration_timestamp(const int64_t* value_arg) { expiration_timestamp_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonIdTokenResult::set_expiration_timestamp(int64_t value_arg) { +void InternalIdTokenResult::set_expiration_timestamp(int64_t value_arg) { expiration_timestamp_ = value_arg; } -const int64_t* PigeonIdTokenResult::auth_timestamp() const { +const int64_t* InternalIdTokenResult::auth_timestamp() const { return auth_timestamp_ ? &(*auth_timestamp_) : nullptr; } -void PigeonIdTokenResult::set_auth_timestamp(const int64_t* value_arg) { +void InternalIdTokenResult::set_auth_timestamp(const int64_t* value_arg) { auth_timestamp_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonIdTokenResult::set_auth_timestamp(int64_t value_arg) { +void InternalIdTokenResult::set_auth_timestamp(int64_t value_arg) { auth_timestamp_ = value_arg; } -const int64_t* PigeonIdTokenResult::issued_at_timestamp() const { +const int64_t* InternalIdTokenResult::issued_at_timestamp() const { return issued_at_timestamp_ ? &(*issued_at_timestamp_) : nullptr; } -void PigeonIdTokenResult::set_issued_at_timestamp(const int64_t* value_arg) { +void InternalIdTokenResult::set_issued_at_timestamp(const int64_t* value_arg) { issued_at_timestamp_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonIdTokenResult::set_issued_at_timestamp(int64_t value_arg) { +void InternalIdTokenResult::set_issued_at_timestamp(int64_t value_arg) { issued_at_timestamp_ = value_arg; } -const std::string* PigeonIdTokenResult::sign_in_provider() const { +const std::string* InternalIdTokenResult::sign_in_provider() const { return sign_in_provider_ ? &(*sign_in_provider_) : nullptr; } -void PigeonIdTokenResult::set_sign_in_provider( +void InternalIdTokenResult::set_sign_in_provider( const std::string_view* value_arg) { sign_in_provider_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonIdTokenResult::set_sign_in_provider(std::string_view value_arg) { +void InternalIdTokenResult::set_sign_in_provider(std::string_view value_arg) { sign_in_provider_ = value_arg; } -const EncodableMap* PigeonIdTokenResult::claims() const { +const EncodableMap* InternalIdTokenResult::claims() const { return claims_ ? &(*claims_) : nullptr; } -void PigeonIdTokenResult::set_claims(const EncodableMap* value_arg) { +void InternalIdTokenResult::set_claims(const EncodableMap* value_arg) { claims_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonIdTokenResult::set_claims(const EncodableMap& value_arg) { +void InternalIdTokenResult::set_claims(const EncodableMap& value_arg) { claims_ = value_arg; } -const std::string* PigeonIdTokenResult::sign_in_second_factor() const { +const std::string* InternalIdTokenResult::sign_in_second_factor() const { return sign_in_second_factor_ ? &(*sign_in_second_factor_) : nullptr; } -void PigeonIdTokenResult::set_sign_in_second_factor( +void InternalIdTokenResult::set_sign_in_second_factor( const std::string_view* value_arg) { sign_in_second_factor_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonIdTokenResult::set_sign_in_second_factor( +void InternalIdTokenResult::set_sign_in_second_factor( std::string_view value_arg) { sign_in_second_factor_ = value_arg; } -EncodableList PigeonIdTokenResult::ToEncodableList() const { +EncodableList InternalIdTokenResult::ToEncodableList() const { EncodableList list; list.reserve(7); list.push_back(token_ ? EncodableValue(*token_) : EncodableValue()); @@ -1672,9 +2416,9 @@ EncodableList PigeonIdTokenResult::ToEncodableList() const { return list; } -PigeonIdTokenResult PigeonIdTokenResult::FromEncodableList( +InternalIdTokenResult InternalIdTokenResult::FromEncodableList( const EncodableList& list) { - PigeonIdTokenResult decoded; + InternalIdTokenResult decoded; auto& encodable_token = list[0]; if (!encodable_token.IsNull()) { decoded.set_token(std::get(encodable_token)); @@ -1682,15 +2426,16 @@ PigeonIdTokenResult PigeonIdTokenResult::FromEncodableList( auto& encodable_expiration_timestamp = list[1]; if (!encodable_expiration_timestamp.IsNull()) { decoded.set_expiration_timestamp( - encodable_expiration_timestamp.LongValue()); + std::get(encodable_expiration_timestamp)); } auto& encodable_auth_timestamp = list[2]; if (!encodable_auth_timestamp.IsNull()) { - decoded.set_auth_timestamp(encodable_auth_timestamp.LongValue()); + decoded.set_auth_timestamp(std::get(encodable_auth_timestamp)); } auto& encodable_issued_at_timestamp = list[3]; if (!encodable_issued_at_timestamp.IsNull()) { - decoded.set_issued_at_timestamp(encodable_issued_at_timestamp.LongValue()); + decoded.set_issued_at_timestamp( + std::get(encodable_issued_at_timestamp)); } auto& encodable_sign_in_provider = list[4]; if (!encodable_sign_in_provider.IsNull()) { @@ -1709,65 +2454,102 @@ PigeonIdTokenResult PigeonIdTokenResult::FromEncodableList( return decoded; } -// PigeonUserProfile +bool InternalIdTokenResult::operator==( + const InternalIdTokenResult& other) const { + return PigeonInternalDeepEquals(token_, other.token_) && + PigeonInternalDeepEquals(expiration_timestamp_, + other.expiration_timestamp_) && + PigeonInternalDeepEquals(auth_timestamp_, other.auth_timestamp_) && + PigeonInternalDeepEquals(issued_at_timestamp_, + other.issued_at_timestamp_) && + PigeonInternalDeepEquals(sign_in_provider_, other.sign_in_provider_) && + PigeonInternalDeepEquals(claims_, other.claims_) && + PigeonInternalDeepEquals(sign_in_second_factor_, + other.sign_in_second_factor_); +} -PigeonUserProfile::PigeonUserProfile(bool display_name_changed, - bool photo_url_changed) - : display_name_changed_(display_name_changed), - photo_url_changed_(photo_url_changed) {} +bool InternalIdTokenResult::operator!=( + const InternalIdTokenResult& other) const { + return !(*this == other); +} -PigeonUserProfile::PigeonUserProfile(const std::string* display_name, - const std::string* photo_url, - bool display_name_changed, - bool photo_url_changed) - : display_name_(display_name ? std::optional(*display_name) - : std::nullopt), - photo_url_(photo_url ? std::optional(*photo_url) +size_t InternalIdTokenResult::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(token_); + result = result * 31 + PigeonInternalDeepHash(expiration_timestamp_); + result = result * 31 + PigeonInternalDeepHash(auth_timestamp_); + result = result * 31 + PigeonInternalDeepHash(issued_at_timestamp_); + result = result * 31 + PigeonInternalDeepHash(sign_in_provider_); + result = result * 31 + PigeonInternalDeepHash(claims_); + result = result * 31 + PigeonInternalDeepHash(sign_in_second_factor_); + return result; +} + +size_t PigeonInternalDeepHash(const InternalIdTokenResult& v) { + return v.Hash(); +} + +// InternalUserProfile + +InternalUserProfile::InternalUserProfile(bool display_name_changed, + bool photo_url_changed) + : display_name_changed_(display_name_changed), + photo_url_changed_(photo_url_changed) {} + +InternalUserProfile::InternalUserProfile(const std::string* display_name, + const std::string* photo_url, + bool display_name_changed, + bool photo_url_changed) + : display_name_(display_name ? std::optional(*display_name) + : std::nullopt), + photo_url_(photo_url ? std::optional(*photo_url) : std::nullopt), display_name_changed_(display_name_changed), photo_url_changed_(photo_url_changed) {} -const std::string* PigeonUserProfile::display_name() const { +const std::string* InternalUserProfile::display_name() const { return display_name_ ? &(*display_name_) : nullptr; } -void PigeonUserProfile::set_display_name(const std::string_view* value_arg) { +void InternalUserProfile::set_display_name(const std::string_view* value_arg) { display_name_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonUserProfile::set_display_name(std::string_view value_arg) { +void InternalUserProfile::set_display_name(std::string_view value_arg) { display_name_ = value_arg; } -const std::string* PigeonUserProfile::photo_url() const { +const std::string* InternalUserProfile::photo_url() const { return photo_url_ ? &(*photo_url_) : nullptr; } -void PigeonUserProfile::set_photo_url(const std::string_view* value_arg) { +void InternalUserProfile::set_photo_url(const std::string_view* value_arg) { photo_url_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonUserProfile::set_photo_url(std::string_view value_arg) { +void InternalUserProfile::set_photo_url(std::string_view value_arg) { photo_url_ = value_arg; } -bool PigeonUserProfile::display_name_changed() const { +bool InternalUserProfile::display_name_changed() const { return display_name_changed_; } -void PigeonUserProfile::set_display_name_changed(bool value_arg) { +void InternalUserProfile::set_display_name_changed(bool value_arg) { display_name_changed_ = value_arg; } -bool PigeonUserProfile::photo_url_changed() const { return photo_url_changed_; } +bool InternalUserProfile::photo_url_changed() const { + return photo_url_changed_; +} -void PigeonUserProfile::set_photo_url_changed(bool value_arg) { +void InternalUserProfile::set_photo_url_changed(bool value_arg) { photo_url_changed_ = value_arg; } -EncodableList PigeonUserProfile::ToEncodableList() const { +EncodableList InternalUserProfile::ToEncodableList() const { EncodableList list; list.reserve(4); list.push_back(display_name_ ? EncodableValue(*display_name_) @@ -1778,9 +2560,9 @@ EncodableList PigeonUserProfile::ToEncodableList() const { return list; } -PigeonUserProfile PigeonUserProfile::FromEncodableList( +InternalUserProfile InternalUserProfile::FromEncodableList( const EncodableList& list) { - PigeonUserProfile decoded(std::get(list[2]), std::get(list[3])); + InternalUserProfile decoded(std::get(list[2]), std::get(list[3])); auto& encodable_display_name = list[0]; if (!encodable_display_name.IsNull()) { decoded.set_display_name(std::get(encodable_display_name)); @@ -1792,12 +2574,35 @@ PigeonUserProfile PigeonUserProfile::FromEncodableList( return decoded; } -// PigeonTotpSecret +bool InternalUserProfile::operator==(const InternalUserProfile& other) const { + return PigeonInternalDeepEquals(display_name_, other.display_name_) && + PigeonInternalDeepEquals(photo_url_, other.photo_url_) && + PigeonInternalDeepEquals(display_name_changed_, + other.display_name_changed_) && + PigeonInternalDeepEquals(photo_url_changed_, other.photo_url_changed_); +} + +bool InternalUserProfile::operator!=(const InternalUserProfile& other) const { + return !(*this == other); +} + +size_t InternalUserProfile::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(display_name_); + result = result * 31 + PigeonInternalDeepHash(photo_url_); + result = result * 31 + PigeonInternalDeepHash(display_name_changed_); + result = result * 31 + PigeonInternalDeepHash(photo_url_changed_); + return result; +} + +size_t PigeonInternalDeepHash(const InternalUserProfile& v) { return v.Hash(); } -PigeonTotpSecret::PigeonTotpSecret(const std::string& secret_key) +// InternalTotpSecret + +InternalTotpSecret::InternalTotpSecret(const std::string& secret_key) : secret_key_(secret_key) {} -PigeonTotpSecret::PigeonTotpSecret( +InternalTotpSecret::InternalTotpSecret( const int64_t* code_interval_seconds, const int64_t* code_length, const int64_t* enrollment_completion_deadline, const std::string* hashing_algorithm, const std::string& secret_key) @@ -1815,67 +2620,69 @@ PigeonTotpSecret::PigeonTotpSecret( : std::nullopt), secret_key_(secret_key) {} -const int64_t* PigeonTotpSecret::code_interval_seconds() const { +const int64_t* InternalTotpSecret::code_interval_seconds() const { return code_interval_seconds_ ? &(*code_interval_seconds_) : nullptr; } -void PigeonTotpSecret::set_code_interval_seconds(const int64_t* value_arg) { +void InternalTotpSecret::set_code_interval_seconds(const int64_t* value_arg) { code_interval_seconds_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonTotpSecret::set_code_interval_seconds(int64_t value_arg) { +void InternalTotpSecret::set_code_interval_seconds(int64_t value_arg) { code_interval_seconds_ = value_arg; } -const int64_t* PigeonTotpSecret::code_length() const { +const int64_t* InternalTotpSecret::code_length() const { return code_length_ ? &(*code_length_) : nullptr; } -void PigeonTotpSecret::set_code_length(const int64_t* value_arg) { +void InternalTotpSecret::set_code_length(const int64_t* value_arg) { code_length_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonTotpSecret::set_code_length(int64_t value_arg) { +void InternalTotpSecret::set_code_length(int64_t value_arg) { code_length_ = value_arg; } -const int64_t* PigeonTotpSecret::enrollment_completion_deadline() const { +const int64_t* InternalTotpSecret::enrollment_completion_deadline() const { return enrollment_completion_deadline_ ? &(*enrollment_completion_deadline_) : nullptr; } -void PigeonTotpSecret::set_enrollment_completion_deadline( +void InternalTotpSecret::set_enrollment_completion_deadline( const int64_t* value_arg) { enrollment_completion_deadline_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonTotpSecret::set_enrollment_completion_deadline(int64_t value_arg) { +void InternalTotpSecret::set_enrollment_completion_deadline(int64_t value_arg) { enrollment_completion_deadline_ = value_arg; } -const std::string* PigeonTotpSecret::hashing_algorithm() const { +const std::string* InternalTotpSecret::hashing_algorithm() const { return hashing_algorithm_ ? &(*hashing_algorithm_) : nullptr; } -void PigeonTotpSecret::set_hashing_algorithm( +void InternalTotpSecret::set_hashing_algorithm( const std::string_view* value_arg) { hashing_algorithm_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonTotpSecret::set_hashing_algorithm(std::string_view value_arg) { +void InternalTotpSecret::set_hashing_algorithm(std::string_view value_arg) { hashing_algorithm_ = value_arg; } -const std::string& PigeonTotpSecret::secret_key() const { return secret_key_; } +const std::string& InternalTotpSecret::secret_key() const { + return secret_key_; +} -void PigeonTotpSecret::set_secret_key(std::string_view value_arg) { +void InternalTotpSecret::set_secret_key(std::string_view value_arg) { secret_key_ = value_arg; } -EncodableList PigeonTotpSecret::ToEncodableList() const { +EncodableList InternalTotpSecret::ToEncodableList() const { EncodableList list; list.reserve(5); list.push_back(code_interval_seconds_ @@ -1892,22 +2699,22 @@ EncodableList PigeonTotpSecret::ToEncodableList() const { return list; } -PigeonTotpSecret PigeonTotpSecret::FromEncodableList( +InternalTotpSecret InternalTotpSecret::FromEncodableList( const EncodableList& list) { - PigeonTotpSecret decoded(std::get(list[4])); + InternalTotpSecret decoded(std::get(list[4])); auto& encodable_code_interval_seconds = list[0]; if (!encodable_code_interval_seconds.IsNull()) { decoded.set_code_interval_seconds( - encodable_code_interval_seconds.LongValue()); + std::get(encodable_code_interval_seconds)); } auto& encodable_code_length = list[1]; if (!encodable_code_length.IsNull()) { - decoded.set_code_length(encodable_code_length.LongValue()); + decoded.set_code_length(std::get(encodable_code_length)); } auto& encodable_enrollment_completion_deadline = list[2]; if (!encodable_enrollment_completion_deadline.IsNull()) { decoded.set_enrollment_completion_deadline( - encodable_enrollment_completion_deadline.LongValue()); + std::get(encodable_enrollment_completion_deadline)); } auto& encodable_hashing_algorithm = list[3]; if (!encodable_hashing_algorithm.IsNull()) { @@ -1917,236 +2724,314 @@ PigeonTotpSecret PigeonTotpSecret::FromEncodableList( return decoded; } -FirebaseAuthHostApiCodecSerializer::FirebaseAuthHostApiCodecSerializer() {} +bool InternalTotpSecret::operator==(const InternalTotpSecret& other) const { + return PigeonInternalDeepEquals(code_interval_seconds_, + other.code_interval_seconds_) && + PigeonInternalDeepEquals(code_length_, other.code_length_) && + PigeonInternalDeepEquals(enrollment_completion_deadline_, + other.enrollment_completion_deadline_) && + PigeonInternalDeepEquals(hashing_algorithm_, + other.hashing_algorithm_) && + PigeonInternalDeepEquals(secret_key_, other.secret_key_); +} + +bool InternalTotpSecret::operator!=(const InternalTotpSecret& other) const { + return !(*this == other); +} + +size_t InternalTotpSecret::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(code_interval_seconds_); + result = result * 31 + PigeonInternalDeepHash(code_length_); + result = + result * 31 + PigeonInternalDeepHash(enrollment_completion_deadline_); + result = result * 31 + PigeonInternalDeepHash(hashing_algorithm_); + result = result * 31 + PigeonInternalDeepHash(secret_key_); + return result; +} + +size_t PigeonInternalDeepHash(const InternalTotpSecret& v) { return v.Hash(); } -EncodableValue FirebaseAuthHostApiCodecSerializer::ReadValueOfType( - uint8_t type, flutter::ByteStreamReader* stream) const { +PigeonInternalCodecSerializer::PigeonInternalCodecSerializer() {} + +EncodableValue PigeonInternalCodecSerializer::ReadValueOfType( + uint8_t type, ::flutter::ByteStreamReader* stream) const { switch (type) { - case 128: - return CustomEncodableValue(AuthPigeonFirebaseApp::FromEncodableList( + case 129: { + const auto& encodable_enum_arg = ReadValue(stream); + const int64_t enum_arg_value = + encodable_enum_arg.IsNull() ? 0 : encodable_enum_arg.LongValue(); + return encodable_enum_arg.IsNull() + ? EncodableValue() + : CustomEncodableValue( + static_cast(enum_arg_value)); + } + case 130: { + return CustomEncodableValue(InternalMultiFactorSession::FromEncodableList( std::get(ReadValue(stream)))); - case 129: - return CustomEncodableValue(PigeonActionCodeInfo::FromEncodableList( + } + case 131: { + return CustomEncodableValue( + InternalPhoneMultiFactorAssertion::FromEncodableList( + std::get(ReadValue(stream)))); + } + case 132: { + return CustomEncodableValue(InternalMultiFactorInfo::FromEncodableList( std::get(ReadValue(stream)))); - case 130: - return CustomEncodableValue(PigeonActionCodeInfoData::FromEncodableList( + } + case 133: { + return CustomEncodableValue(AuthPigeonFirebaseApp::FromEncodableList( std::get(ReadValue(stream)))); - case 131: - return CustomEncodableValue(PigeonActionCodeSettings::FromEncodableList( + } + case 134: { + return CustomEncodableValue(InternalActionCodeInfoData::FromEncodableList( std::get(ReadValue(stream)))); - case 132: - return CustomEncodableValue(PigeonAdditionalUserInfo::FromEncodableList( + } + case 135: { + return CustomEncodableValue(InternalActionCodeInfo::FromEncodableList( std::get(ReadValue(stream)))); - case 133: - return CustomEncodableValue(PigeonAuthCredential::FromEncodableList( + } + case 136: { + return CustomEncodableValue(InternalAdditionalUserInfo::FromEncodableList( std::get(ReadValue(stream)))); - case 134: - return CustomEncodableValue(PigeonFirebaseAuthSettings::FromEncodableList( + } + case 137: { + return CustomEncodableValue(InternalAuthCredential::FromEncodableList( std::get(ReadValue(stream)))); - case 135: - return CustomEncodableValue(PigeonIdTokenResult::FromEncodableList( + } + case 138: { + return CustomEncodableValue(InternalUserInfo::FromEncodableList( std::get(ReadValue(stream)))); - case 136: - return CustomEncodableValue(PigeonMultiFactorInfo::FromEncodableList( + } + case 139: { + return CustomEncodableValue(InternalUserDetails::FromEncodableList( std::get(ReadValue(stream)))); - case 137: - return CustomEncodableValue(PigeonMultiFactorSession::FromEncodableList( + } + case 140: { + return CustomEncodableValue(InternalUserCredential::FromEncodableList( std::get(ReadValue(stream)))); - case 138: + } + case 141: { return CustomEncodableValue( - PigeonPhoneMultiFactorAssertion::FromEncodableList( + InternalAuthCredentialInput::FromEncodableList( std::get(ReadValue(stream)))); - case 139: - return CustomEncodableValue(PigeonSignInProvider::FromEncodableList( - std::get(ReadValue(stream)))); - case 140: - return CustomEncodableValue(PigeonTotpSecret::FromEncodableList( + } + case 142: { + return CustomEncodableValue(InternalActionCodeSettings::FromEncodableList( std::get(ReadValue(stream)))); - case 141: - return CustomEncodableValue(PigeonUserCredential::FromEncodableList( + } + case 143: { + return CustomEncodableValue( + InternalFirebaseAuthSettings::FromEncodableList( + std::get(ReadValue(stream)))); + } + case 144: { + return CustomEncodableValue(InternalSignInProvider::FromEncodableList( std::get(ReadValue(stream)))); - case 142: - return CustomEncodableValue(PigeonUserDetails::FromEncodableList( + } + case 145: { + return CustomEncodableValue( + InternalVerifyPhoneNumberRequest::FromEncodableList( + std::get(ReadValue(stream)))); + } + case 146: { + return CustomEncodableValue(InternalIdTokenResult::FromEncodableList( std::get(ReadValue(stream)))); - case 143: - return CustomEncodableValue(PigeonUserInfo::FromEncodableList( + } + case 147: { + return CustomEncodableValue(InternalUserProfile::FromEncodableList( std::get(ReadValue(stream)))); - case 144: - return CustomEncodableValue(PigeonUserProfile::FromEncodableList( + } + case 148: { + return CustomEncodableValue(InternalTotpSecret::FromEncodableList( std::get(ReadValue(stream)))); - case 145: - return CustomEncodableValue( - PigeonVerifyPhoneNumberRequest::FromEncodableList( - std::get(ReadValue(stream)))); + } default: - return flutter::StandardCodecSerializer::ReadValueOfType(type, stream); + return ::flutter::StandardCodecSerializer::ReadValueOfType(type, stream); } } -void FirebaseAuthHostApiCodecSerializer::WriteValue( - const EncodableValue& value, flutter::ByteStreamWriter* stream) const { +void PigeonInternalCodecSerializer::WriteValue( + const EncodableValue& value, ::flutter::ByteStreamWriter* stream) const { if (const CustomEncodableValue* custom_value = std::get_if(&value)) { - if (custom_value->type() == typeid(AuthPigeonFirebaseApp)) { - stream->WriteByte(128); - WriteValue( - EncodableValue(std::any_cast(*custom_value) - .ToEncodableList()), - stream); - return; - } - if (custom_value->type() == typeid(PigeonActionCodeInfo)) { + if (custom_value->type() == typeid(ActionCodeInfoOperation)) { stream->WriteByte(129); - WriteValue( - EncodableValue(std::any_cast(*custom_value) - .ToEncodableList()), - stream); + WriteValue(EncodableValue(static_cast( + std::any_cast(*custom_value))), + stream); return; } - if (custom_value->type() == typeid(PigeonActionCodeInfoData)) { + if (custom_value->type() == typeid(InternalMultiFactorSession)) { stream->WriteByte(130); - WriteValue( - EncodableValue(std::any_cast(*custom_value) - .ToEncodableList()), - stream); + WriteValue(EncodableValue( + std::any_cast(*custom_value) + .ToEncodableList()), + stream); return; } - if (custom_value->type() == typeid(PigeonActionCodeSettings)) { + if (custom_value->type() == typeid(InternalPhoneMultiFactorAssertion)) { stream->WriteByte(131); WriteValue( - EncodableValue(std::any_cast(*custom_value) - .ToEncodableList()), + EncodableValue( + std::any_cast(*custom_value) + .ToEncodableList()), stream); return; } - if (custom_value->type() == typeid(PigeonAdditionalUserInfo)) { + if (custom_value->type() == typeid(InternalMultiFactorInfo)) { stream->WriteByte(132); WriteValue( - EncodableValue(std::any_cast(*custom_value) + EncodableValue(std::any_cast(*custom_value) .ToEncodableList()), stream); return; } - if (custom_value->type() == typeid(PigeonAuthCredential)) { + if (custom_value->type() == typeid(AuthPigeonFirebaseApp)) { stream->WriteByte(133); WriteValue( - EncodableValue(std::any_cast(*custom_value) + EncodableValue(std::any_cast(*custom_value) .ToEncodableList()), stream); return; } - if (custom_value->type() == typeid(PigeonFirebaseAuthSettings)) { + if (custom_value->type() == typeid(InternalActionCodeInfoData)) { stream->WriteByte(134); WriteValue(EncodableValue( - std::any_cast(*custom_value) + std::any_cast(*custom_value) .ToEncodableList()), stream); return; } - if (custom_value->type() == typeid(PigeonIdTokenResult)) { + if (custom_value->type() == typeid(InternalActionCodeInfo)) { stream->WriteByte(135); WriteValue( - EncodableValue(std::any_cast(*custom_value) + EncodableValue(std::any_cast(*custom_value) .ToEncodableList()), stream); return; } - if (custom_value->type() == typeid(PigeonMultiFactorInfo)) { + if (custom_value->type() == typeid(InternalAdditionalUserInfo)) { stream->WriteByte(136); - WriteValue( - EncodableValue(std::any_cast(*custom_value) - .ToEncodableList()), - stream); + WriteValue(EncodableValue( + std::any_cast(*custom_value) + .ToEncodableList()), + stream); return; } - if (custom_value->type() == typeid(PigeonMultiFactorSession)) { + if (custom_value->type() == typeid(InternalAuthCredential)) { stream->WriteByte(137); WriteValue( - EncodableValue(std::any_cast(*custom_value) + EncodableValue(std::any_cast(*custom_value) .ToEncodableList()), stream); return; } - if (custom_value->type() == typeid(PigeonPhoneMultiFactorAssertion)) { + if (custom_value->type() == typeid(InternalUserInfo)) { stream->WriteByte(138); - WriteValue(EncodableValue(std::any_cast( - *custom_value) - .ToEncodableList()), - stream); + WriteValue( + EncodableValue( + std::any_cast(*custom_value).ToEncodableList()), + stream); return; } - if (custom_value->type() == typeid(PigeonSignInProvider)) { + if (custom_value->type() == typeid(InternalUserDetails)) { stream->WriteByte(139); WriteValue( - EncodableValue(std::any_cast(*custom_value) + EncodableValue(std::any_cast(*custom_value) .ToEncodableList()), stream); return; } - if (custom_value->type() == typeid(PigeonTotpSecret)) { + if (custom_value->type() == typeid(InternalUserCredential)) { stream->WriteByte(140); WriteValue( - EncodableValue( - std::any_cast(*custom_value).ToEncodableList()), + EncodableValue(std::any_cast(*custom_value) + .ToEncodableList()), stream); return; } - if (custom_value->type() == typeid(PigeonUserCredential)) { + if (custom_value->type() == typeid(InternalAuthCredentialInput)) { stream->WriteByte(141); - WriteValue( - EncodableValue(std::any_cast(*custom_value) - .ToEncodableList()), - stream); + WriteValue(EncodableValue( + std::any_cast(*custom_value) + .ToEncodableList()), + stream); return; } - if (custom_value->type() == typeid(PigeonUserDetails)) { + if (custom_value->type() == typeid(InternalActionCodeSettings)) { stream->WriteByte(142); - WriteValue(EncodableValue(std::any_cast(*custom_value) - .ToEncodableList()), + WriteValue(EncodableValue( + std::any_cast(*custom_value) + .ToEncodableList()), stream); return; } - if (custom_value->type() == typeid(PigeonUserInfo)) { + if (custom_value->type() == typeid(InternalFirebaseAuthSettings)) { stream->WriteByte(143); + WriteValue(EncodableValue( + std::any_cast(*custom_value) + .ToEncodableList()), + stream); + return; + } + if (custom_value->type() == typeid(InternalSignInProvider)) { + stream->WriteByte(144); WriteValue( - EncodableValue( - std::any_cast(*custom_value).ToEncodableList()), + EncodableValue(std::any_cast(*custom_value) + .ToEncodableList()), stream); return; } - if (custom_value->type() == typeid(PigeonUserProfile)) { - stream->WriteByte(144); - WriteValue(EncodableValue(std::any_cast(*custom_value) + if (custom_value->type() == typeid(InternalVerifyPhoneNumberRequest)) { + stream->WriteByte(145); + WriteValue(EncodableValue(std::any_cast( + *custom_value) .ToEncodableList()), stream); return; } - if (custom_value->type() == typeid(PigeonVerifyPhoneNumberRequest)) { - stream->WriteByte(145); - WriteValue(EncodableValue(std::any_cast( - *custom_value) + if (custom_value->type() == typeid(InternalIdTokenResult)) { + stream->WriteByte(146); + WriteValue( + EncodableValue(std::any_cast(*custom_value) + .ToEncodableList()), + stream); + return; + } + if (custom_value->type() == typeid(InternalUserProfile)) { + stream->WriteByte(147); + WriteValue( + EncodableValue(std::any_cast(*custom_value) + .ToEncodableList()), + stream); + return; + } + if (custom_value->type() == typeid(InternalTotpSecret)) { + stream->WriteByte(148); + WriteValue(EncodableValue(std::any_cast(*custom_value) .ToEncodableList()), stream); return; } } - flutter::StandardCodecSerializer::WriteValue(value, stream); + ::flutter::StandardCodecSerializer::WriteValue(value, stream); } /// The codec used by FirebaseAuthHostApi. -const flutter::StandardMessageCodec& FirebaseAuthHostApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance( - &FirebaseAuthHostApiCodecSerializer::GetInstance()); +const ::flutter::StandardMessageCodec& FirebaseAuthHostApi::GetCodec() { + return ::flutter::StandardMessageCodec::GetInstance( + &PigeonInternalCodecSerializer::GetInstance()); } // Sets up an instance of `FirebaseAuthHostApi` to handle messages through the // `binary_messenger`. -void FirebaseAuthHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, +void FirebaseAuthHostApi::SetUp(::flutter::BinaryMessenger* binary_messenger, FirebaseAuthHostApi* api) { FirebaseAuthHostApi::SetUp(binary_messenger, api, ""); } -void FirebaseAuthHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, +void FirebaseAuthHostApi::SetUp(::flutter::BinaryMessenger* binary_messenger, FirebaseAuthHostApi* api, const std::string& message_channel_suffix) { const std::string prepended_suffix = @@ -2163,7 +3048,7 @@ void FirebaseAuthHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -2202,7 +3087,7 @@ void FirebaseAuthHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -2240,7 +3125,7 @@ void FirebaseAuthHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -2290,7 +3175,7 @@ void FirebaseAuthHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -2335,7 +3220,7 @@ void FirebaseAuthHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -2353,7 +3238,7 @@ void FirebaseAuthHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, const auto& code_arg = std::get(encodable_code_arg); api->CheckActionCode( app_arg, code_arg, - [reply](ErrorOr&& output) { + [reply](ErrorOr&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; @@ -2381,7 +3266,7 @@ void FirebaseAuthHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -2433,7 +3318,7 @@ void FirebaseAuthHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -2459,7 +3344,7 @@ void FirebaseAuthHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, std::get(encodable_password_arg); api->CreateUserWithEmailAndPassword( app_arg, email_arg, password_arg, - [reply](ErrorOr&& output) { + [reply](ErrorOr&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; @@ -2487,7 +3372,7 @@ void FirebaseAuthHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -2498,7 +3383,7 @@ void FirebaseAuthHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, const auto& app_arg = std::any_cast( std::get(encodable_app_arg)); api->SignInAnonymously( - app_arg, [reply](ErrorOr&& output) { + app_arg, [reply](ErrorOr&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; @@ -2526,7 +3411,7 @@ void FirebaseAuthHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -2545,7 +3430,7 @@ void FirebaseAuthHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, std::get(encodable_input_arg); api->SignInWithCredential( app_arg, input_arg, - [reply](ErrorOr&& output) { + [reply](ErrorOr&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; @@ -2573,7 +3458,7 @@ void FirebaseAuthHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -2592,7 +3477,7 @@ void FirebaseAuthHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, std::get(encodable_token_arg); api->SignInWithCustomToken( app_arg, token_arg, - [reply](ErrorOr&& output) { + [reply](ErrorOr&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; @@ -2620,7 +3505,7 @@ void FirebaseAuthHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -2646,7 +3531,7 @@ void FirebaseAuthHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, std::get(encodable_password_arg); api->SignInWithEmailAndPassword( app_arg, email_arg, password_arg, - [reply](ErrorOr&& output) { + [reply](ErrorOr&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; @@ -2674,7 +3559,7 @@ void FirebaseAuthHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -2700,7 +3585,7 @@ void FirebaseAuthHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, std::get(encodable_email_link_arg); api->SignInWithEmailLink( app_arg, email_arg, email_link_arg, - [reply](ErrorOr&& output) { + [reply](ErrorOr&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; @@ -2728,7 +3613,7 @@ void FirebaseAuthHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -2744,12 +3629,12 @@ void FirebaseAuthHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, return; } const auto& sign_in_provider_arg = - std::any_cast( + std::any_cast( std::get( encodable_sign_in_provider_arg)); api->SignInWithProvider( app_arg, sign_in_provider_arg, - [reply](ErrorOr&& output) { + [reply](ErrorOr&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; @@ -2776,7 +3661,7 @@ void FirebaseAuthHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -2814,7 +3699,7 @@ void FirebaseAuthHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -2860,7 +3745,7 @@ void FirebaseAuthHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -2878,16 +3763,12 @@ void FirebaseAuthHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, const auto& email_arg = std::get(encodable_email_arg); const auto& encodable_action_code_settings_arg = args.at(2); - // IF CODE REGENERATED, PLEASE REINSERT THIS. IF ARG IS NULL, APP - // CRASHES - const PigeonActionCodeSettings* action_code_settings_arg = - nullptr; - if (!encodable_action_code_settings_arg.IsNull()) { - action_code_settings_arg = - &(std::any_cast( - std::get( - encodable_action_code_settings_arg))); - } + const auto* action_code_settings_arg = + encodable_action_code_settings_arg.IsNull() + ? nullptr + : &(std::any_cast( + std::get( + encodable_action_code_settings_arg))); api->SendPasswordResetEmail( app_arg, email_arg, action_code_settings_arg, [reply](std::optional&& output) { @@ -2917,7 +3798,7 @@ void FirebaseAuthHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -2940,7 +3821,7 @@ void FirebaseAuthHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, return; } const auto& action_code_settings_arg = - std::any_cast( + std::any_cast( std::get( encodable_action_code_settings_arg)); api->SendSignInLinkToEmail( @@ -2972,7 +3853,7 @@ void FirebaseAuthHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -3013,7 +3894,7 @@ void FirebaseAuthHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -3029,7 +3910,7 @@ void FirebaseAuthHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, return; } const auto& settings_arg = - std::any_cast( + std::any_cast( std::get(encodable_settings_arg)); api->SetSettings(app_arg, settings_arg, [reply](std::optional&& output) { @@ -3059,7 +3940,7 @@ void FirebaseAuthHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -3104,7 +3985,7 @@ void FirebaseAuthHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -3120,7 +4001,7 @@ void FirebaseAuthHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, return; } const auto& request_arg = - std::any_cast( + std::any_cast( std::get(encodable_request_arg)); api->VerifyPhoneNumber( app_arg, request_arg, [reply](ErrorOr&& output) { @@ -3151,7 +4032,7 @@ void FirebaseAuthHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -3187,6 +4068,90 @@ void FirebaseAuthHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, channel.SetMessageHandler(nullptr); } } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.firebase_auth_platform_interface." + "FirebaseAuthHostApi.revokeAccessToken" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const ::flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_app_arg = args.at(0); + if (encodable_app_arg.IsNull()) { + reply(WrapError("app_arg unexpectedly null.")); + return; + } + const auto& app_arg = std::any_cast( + std::get(encodable_app_arg)); + const auto& encodable_access_token_arg = args.at(1); + if (encodable_access_token_arg.IsNull()) { + reply(WrapError("access_token_arg unexpectedly null.")); + return; + } + const auto& access_token_arg = + std::get(encodable_access_token_arg); + api->RevokeAccessToken( + app_arg, access_token_arg, + [reply](std::optional&& output) { + if (output.has_value()) { + reply(WrapError(output.value())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue()); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.firebase_auth_platform_interface." + "FirebaseAuthHostApi.initializeRecaptchaConfig" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const ::flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_app_arg = args.at(0); + if (encodable_app_arg.IsNull()) { + reply(WrapError("app_arg unexpectedly null.")); + return; + } + const auto& app_arg = std::any_cast( + std::get(encodable_app_arg)); + api->InitializeRecaptchaConfig( + app_arg, [reply](std::optional&& output) { + if (output.has_value()) { + reply(WrapError(output.value())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue()); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } } EncodableValue FirebaseAuthHostApi::WrapError(std::string_view error_message) { @@ -3201,239 +4166,23 @@ EncodableValue FirebaseAuthHostApi::WrapError(const FlutterError& error) { error.details()}); } -FirebaseAuthUserHostApiCodecSerializer:: - FirebaseAuthUserHostApiCodecSerializer() {} - -EncodableValue FirebaseAuthUserHostApiCodecSerializer::ReadValueOfType( - uint8_t type, flutter::ByteStreamReader* stream) const { - switch (type) { - case 128: - return CustomEncodableValue(AuthPigeonFirebaseApp::FromEncodableList( - std::get(ReadValue(stream)))); - case 129: - return CustomEncodableValue(PigeonActionCodeInfo::FromEncodableList( - std::get(ReadValue(stream)))); - case 130: - return CustomEncodableValue(PigeonActionCodeInfoData::FromEncodableList( - std::get(ReadValue(stream)))); - case 131: - return CustomEncodableValue(PigeonActionCodeSettings::FromEncodableList( - std::get(ReadValue(stream)))); - case 132: - return CustomEncodableValue(PigeonAdditionalUserInfo::FromEncodableList( - std::get(ReadValue(stream)))); - case 133: - return CustomEncodableValue(PigeonAuthCredential::FromEncodableList( - std::get(ReadValue(stream)))); - case 134: - return CustomEncodableValue(PigeonFirebaseAuthSettings::FromEncodableList( - std::get(ReadValue(stream)))); - case 135: - return CustomEncodableValue(PigeonIdTokenResult::FromEncodableList( - std::get(ReadValue(stream)))); - case 136: - return CustomEncodableValue(PigeonMultiFactorInfo::FromEncodableList( - std::get(ReadValue(stream)))); - case 137: - return CustomEncodableValue(PigeonMultiFactorSession::FromEncodableList( - std::get(ReadValue(stream)))); - case 138: - return CustomEncodableValue( - PigeonPhoneMultiFactorAssertion::FromEncodableList( - std::get(ReadValue(stream)))); - case 139: - return CustomEncodableValue(PigeonSignInProvider::FromEncodableList( - std::get(ReadValue(stream)))); - case 140: - return CustomEncodableValue(PigeonTotpSecret::FromEncodableList( - std::get(ReadValue(stream)))); - case 141: - return CustomEncodableValue(PigeonUserCredential::FromEncodableList( - std::get(ReadValue(stream)))); - case 142: - return CustomEncodableValue(PigeonUserDetails::FromEncodableList( - std::get(ReadValue(stream)))); - case 143: - return CustomEncodableValue(PigeonUserInfo::FromEncodableList( - std::get(ReadValue(stream)))); - case 144: - return CustomEncodableValue(PigeonUserProfile::FromEncodableList( - std::get(ReadValue(stream)))); - case 145: - return CustomEncodableValue( - PigeonVerifyPhoneNumberRequest::FromEncodableList( - std::get(ReadValue(stream)))); - default: - return flutter::StandardCodecSerializer::ReadValueOfType(type, stream); - } -} - -void FirebaseAuthUserHostApiCodecSerializer::WriteValue( - const EncodableValue& value, flutter::ByteStreamWriter* stream) const { - if (const CustomEncodableValue* custom_value = - std::get_if(&value)) { - if (custom_value->type() == typeid(AuthPigeonFirebaseApp)) { - stream->WriteByte(128); - WriteValue( - EncodableValue(std::any_cast(*custom_value) - .ToEncodableList()), - stream); - return; - } - if (custom_value->type() == typeid(PigeonActionCodeInfo)) { - stream->WriteByte(129); - WriteValue( - EncodableValue(std::any_cast(*custom_value) - .ToEncodableList()), - stream); - return; - } - if (custom_value->type() == typeid(PigeonActionCodeInfoData)) { - stream->WriteByte(130); - WriteValue( - EncodableValue(std::any_cast(*custom_value) - .ToEncodableList()), - stream); - return; - } - if (custom_value->type() == typeid(PigeonActionCodeSettings)) { - stream->WriteByte(131); - WriteValue( - EncodableValue(std::any_cast(*custom_value) - .ToEncodableList()), - stream); - return; - } - if (custom_value->type() == typeid(PigeonAdditionalUserInfo)) { - stream->WriteByte(132); - WriteValue( - EncodableValue(std::any_cast(*custom_value) - .ToEncodableList()), - stream); - return; - } - if (custom_value->type() == typeid(PigeonAuthCredential)) { - stream->WriteByte(133); - WriteValue( - EncodableValue(std::any_cast(*custom_value) - .ToEncodableList()), - stream); - return; - } - if (custom_value->type() == typeid(PigeonFirebaseAuthSettings)) { - stream->WriteByte(134); - WriteValue(EncodableValue( - std::any_cast(*custom_value) - .ToEncodableList()), - stream); - return; - } - if (custom_value->type() == typeid(PigeonIdTokenResult)) { - stream->WriteByte(135); - WriteValue( - EncodableValue(std::any_cast(*custom_value) - .ToEncodableList()), - stream); - return; - } - if (custom_value->type() == typeid(PigeonMultiFactorInfo)) { - stream->WriteByte(136); - WriteValue( - EncodableValue(std::any_cast(*custom_value) - .ToEncodableList()), - stream); - return; - } - if (custom_value->type() == typeid(PigeonMultiFactorSession)) { - stream->WriteByte(137); - WriteValue( - EncodableValue(std::any_cast(*custom_value) - .ToEncodableList()), - stream); - return; - } - if (custom_value->type() == typeid(PigeonPhoneMultiFactorAssertion)) { - stream->WriteByte(138); - WriteValue(EncodableValue(std::any_cast( - *custom_value) - .ToEncodableList()), - stream); - return; - } - if (custom_value->type() == typeid(PigeonSignInProvider)) { - stream->WriteByte(139); - WriteValue( - EncodableValue(std::any_cast(*custom_value) - .ToEncodableList()), - stream); - return; - } - if (custom_value->type() == typeid(PigeonTotpSecret)) { - stream->WriteByte(140); - WriteValue( - EncodableValue( - std::any_cast(*custom_value).ToEncodableList()), - stream); - return; - } - if (custom_value->type() == typeid(PigeonUserCredential)) { - stream->WriteByte(141); - WriteValue( - EncodableValue(std::any_cast(*custom_value) - .ToEncodableList()), - stream); - return; - } - if (custom_value->type() == typeid(PigeonUserDetails)) { - stream->WriteByte(142); - WriteValue(EncodableValue(std::any_cast(*custom_value) - .ToEncodableList()), - stream); - return; - } - if (custom_value->type() == typeid(PigeonUserInfo)) { - stream->WriteByte(143); - WriteValue( - EncodableValue( - std::any_cast(*custom_value).ToEncodableList()), - stream); - return; - } - if (custom_value->type() == typeid(PigeonUserProfile)) { - stream->WriteByte(144); - WriteValue(EncodableValue(std::any_cast(*custom_value) - .ToEncodableList()), - stream); - return; - } - if (custom_value->type() == typeid(PigeonVerifyPhoneNumberRequest)) { - stream->WriteByte(145); - WriteValue(EncodableValue(std::any_cast( - *custom_value) - .ToEncodableList()), - stream); - return; - } - } - flutter::StandardCodecSerializer::WriteValue(value, stream); -} - /// The codec used by FirebaseAuthUserHostApi. -const flutter::StandardMessageCodec& FirebaseAuthUserHostApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance( - &FirebaseAuthUserHostApiCodecSerializer::GetInstance()); +const ::flutter::StandardMessageCodec& FirebaseAuthUserHostApi::GetCodec() { + return ::flutter::StandardMessageCodec::GetInstance( + &PigeonInternalCodecSerializer::GetInstance()); } // Sets up an instance of `FirebaseAuthUserHostApi` to handle messages through // the `binary_messenger`. -void FirebaseAuthUserHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, - FirebaseAuthUserHostApi* api) { +void FirebaseAuthUserHostApi::SetUp( + ::flutter::BinaryMessenger* binary_messenger, + FirebaseAuthUserHostApi* api) { FirebaseAuthUserHostApi::SetUp(binary_messenger, api, ""); } -void FirebaseAuthUserHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, - FirebaseAuthUserHostApi* api, - const std::string& message_channel_suffix) { +void FirebaseAuthUserHostApi::SetUp( + ::flutter::BinaryMessenger* binary_messenger, FirebaseAuthUserHostApi* api, + const std::string& message_channel_suffix) { const std::string prepended_suffix = message_channel_suffix.length() > 0 ? std::string(".") + message_channel_suffix @@ -3447,7 +4196,7 @@ void FirebaseAuthUserHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -3485,7 +4234,7 @@ void FirebaseAuthUserHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -3503,7 +4252,7 @@ void FirebaseAuthUserHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, const auto& force_refresh_arg = std::get(encodable_force_refresh_arg); api->GetIdToken(app_arg, force_refresh_arg, - [reply](ErrorOr&& output) { + [reply](ErrorOr&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; @@ -3531,7 +4280,7 @@ void FirebaseAuthUserHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -3550,7 +4299,7 @@ void FirebaseAuthUserHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, std::get(encodable_input_arg); api->LinkWithCredential( app_arg, input_arg, - [reply](ErrorOr&& output) { + [reply](ErrorOr&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; @@ -3578,7 +4327,7 @@ void FirebaseAuthUserHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -3594,12 +4343,12 @@ void FirebaseAuthUserHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, return; } const auto& sign_in_provider_arg = - std::any_cast( + std::any_cast( std::get( encodable_sign_in_provider_arg)); api->LinkWithProvider( app_arg, sign_in_provider_arg, - [reply](ErrorOr&& output) { + [reply](ErrorOr&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; @@ -3627,7 +4376,7 @@ void FirebaseAuthUserHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -3646,7 +4395,7 @@ void FirebaseAuthUserHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, std::get(encodable_input_arg); api->ReauthenticateWithCredential( app_arg, input_arg, - [reply](ErrorOr&& output) { + [reply](ErrorOr&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; @@ -3674,7 +4423,7 @@ void FirebaseAuthUserHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -3690,12 +4439,12 @@ void FirebaseAuthUserHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, return; } const auto& sign_in_provider_arg = - std::any_cast( + std::any_cast( std::get( encodable_sign_in_provider_arg)); api->ReauthenticateWithProvider( app_arg, sign_in_provider_arg, - [reply](ErrorOr&& output) { + [reply](ErrorOr&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; @@ -3722,7 +4471,7 @@ void FirebaseAuthUserHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -3733,7 +4482,7 @@ void FirebaseAuthUserHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, const auto& app_arg = std::any_cast( std::get(encodable_app_arg)); api->Reload( - app_arg, [reply](ErrorOr&& output) { + app_arg, [reply](ErrorOr&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; @@ -3761,7 +4510,7 @@ void FirebaseAuthUserHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -3772,16 +4521,12 @@ void FirebaseAuthUserHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, const auto& app_arg = std::any_cast( std::get(encodable_app_arg)); const auto& encodable_action_code_settings_arg = args.at(1); - // IF CODE REGENERATED, PLEASE REINSERT THIS. IF ARG IS NULL, APP - // CRASHES - const PigeonActionCodeSettings* action_code_settings_arg = - nullptr; - if (!encodable_action_code_settings_arg.IsNull()) { - action_code_settings_arg = - &(std::any_cast( - std::get( - encodable_action_code_settings_arg))); - } + const auto* action_code_settings_arg = + encodable_action_code_settings_arg.IsNull() + ? nullptr + : &(std::any_cast( + std::get( + encodable_action_code_settings_arg))); api->SendEmailVerification( app_arg, action_code_settings_arg, [reply](std::optional&& output) { @@ -3810,7 +4555,7 @@ void FirebaseAuthUserHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -3828,7 +4573,7 @@ void FirebaseAuthUserHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, const auto& provider_id_arg = std::get(encodable_provider_id_arg); api->Unlink(app_arg, provider_id_arg, - [reply](ErrorOr&& output) { + [reply](ErrorOr&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; @@ -3856,7 +4601,7 @@ void FirebaseAuthUserHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -3874,7 +4619,7 @@ void FirebaseAuthUserHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, const auto& new_email_arg = std::get(encodable_new_email_arg); api->UpdateEmail(app_arg, new_email_arg, - [reply](ErrorOr&& output) { + [reply](ErrorOr&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; @@ -3902,7 +4647,7 @@ void FirebaseAuthUserHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -3919,17 +4664,18 @@ void FirebaseAuthUserHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, } const auto& new_password_arg = std::get(encodable_new_password_arg); - api->UpdatePassword(app_arg, new_password_arg, - [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(CustomEncodableValue( - std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - }); + api->UpdatePassword( + app_arg, new_password_arg, + [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + CustomEncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); } catch (const std::exception& exception) { reply(WrapError(exception.what())); } @@ -3948,7 +4694,7 @@ void FirebaseAuthUserHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -3967,7 +4713,7 @@ void FirebaseAuthUserHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, std::get(encodable_input_arg); api->UpdatePhoneNumber( app_arg, input_arg, - [reply](ErrorOr&& output) { + [reply](ErrorOr&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; @@ -3995,7 +4741,7 @@ void FirebaseAuthUserHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -4010,19 +4756,21 @@ void FirebaseAuthUserHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, reply(WrapError("profile_arg unexpectedly null.")); return; } - const auto& profile_arg = std::any_cast( - std::get(encodable_profile_arg)); - api->UpdateProfile(app_arg, profile_arg, - [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(CustomEncodableValue( - std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - }); + const auto& profile_arg = + std::any_cast( + std::get(encodable_profile_arg)); + api->UpdateProfile( + app_arg, profile_arg, + [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + CustomEncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); } catch (const std::exception& exception) { reply(WrapError(exception.what())); } @@ -4041,7 +4789,7 @@ void FirebaseAuthUserHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -4059,16 +4807,12 @@ void FirebaseAuthUserHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, const auto& new_email_arg = std::get(encodable_new_email_arg); const auto& encodable_action_code_settings_arg = args.at(2); - // IF CODE REGENERATED, PLEASE REINSERT THIS. IF ARG IS NULL, APP - // CRASHES - const PigeonActionCodeSettings* action_code_settings_arg = - nullptr; - if (!encodable_action_code_settings_arg.IsNull()) { - action_code_settings_arg = - &(std::any_cast( - std::get( - encodable_action_code_settings_arg))); - } + const auto* action_code_settings_arg = + encodable_action_code_settings_arg.IsNull() + ? nullptr + : &(std::any_cast( + std::get( + encodable_action_code_settings_arg))); api->VerifyBeforeUpdateEmail( app_arg, new_email_arg, action_code_settings_arg, [reply](std::optional&& output) { @@ -4103,84 +4847,20 @@ EncodableValue FirebaseAuthUserHostApi::WrapError(const FlutterError& error) { error.details()}); } -MultiFactorUserHostApiCodecSerializer::MultiFactorUserHostApiCodecSerializer() { -} - -EncodableValue MultiFactorUserHostApiCodecSerializer::ReadValueOfType( - uint8_t type, flutter::ByteStreamReader* stream) const { - switch (type) { - case 128: - return CustomEncodableValue(AuthPigeonFirebaseApp::FromEncodableList( - std::get(ReadValue(stream)))); - case 129: - return CustomEncodableValue(PigeonMultiFactorInfo::FromEncodableList( - std::get(ReadValue(stream)))); - case 130: - return CustomEncodableValue(PigeonMultiFactorSession::FromEncodableList( - std::get(ReadValue(stream)))); - case 131: - return CustomEncodableValue( - PigeonPhoneMultiFactorAssertion::FromEncodableList( - std::get(ReadValue(stream)))); - default: - return flutter::StandardCodecSerializer::ReadValueOfType(type, stream); - } -} - -void MultiFactorUserHostApiCodecSerializer::WriteValue( - const EncodableValue& value, flutter::ByteStreamWriter* stream) const { - if (const CustomEncodableValue* custom_value = - std::get_if(&value)) { - if (custom_value->type() == typeid(AuthPigeonFirebaseApp)) { - stream->WriteByte(128); - WriteValue( - EncodableValue(std::any_cast(*custom_value) - .ToEncodableList()), - stream); - return; - } - if (custom_value->type() == typeid(PigeonMultiFactorInfo)) { - stream->WriteByte(129); - WriteValue( - EncodableValue(std::any_cast(*custom_value) - .ToEncodableList()), - stream); - return; - } - if (custom_value->type() == typeid(PigeonMultiFactorSession)) { - stream->WriteByte(130); - WriteValue( - EncodableValue(std::any_cast(*custom_value) - .ToEncodableList()), - stream); - return; - } - if (custom_value->type() == typeid(PigeonPhoneMultiFactorAssertion)) { - stream->WriteByte(131); - WriteValue(EncodableValue(std::any_cast( - *custom_value) - .ToEncodableList()), - stream); - return; - } - } - flutter::StandardCodecSerializer::WriteValue(value, stream); -} - /// The codec used by MultiFactorUserHostApi. -const flutter::StandardMessageCodec& MultiFactorUserHostApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance( - &MultiFactorUserHostApiCodecSerializer::GetInstance()); +const ::flutter::StandardMessageCodec& MultiFactorUserHostApi::GetCodec() { + return ::flutter::StandardMessageCodec::GetInstance( + &PigeonInternalCodecSerializer::GetInstance()); } // Sets up an instance of `MultiFactorUserHostApi` to handle messages through // the `binary_messenger`. -void MultiFactorUserHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, +void MultiFactorUserHostApi::SetUp(::flutter::BinaryMessenger* binary_messenger, MultiFactorUserHostApi* api) { MultiFactorUserHostApi::SetUp(binary_messenger, api, ""); } -void MultiFactorUserHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, +void MultiFactorUserHostApi::SetUp(::flutter::BinaryMessenger* binary_messenger, MultiFactorUserHostApi* api, const std::string& message_channel_suffix) { const std::string prepended_suffix = @@ -4197,7 +4877,7 @@ void MultiFactorUserHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -4213,7 +4893,7 @@ void MultiFactorUserHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, return; } const auto& assertion_arg = - std::any_cast( + std::any_cast( std::get(encodable_assertion_arg)); const auto& encodable_display_name_arg = args.at(2); const auto* display_name_arg = @@ -4246,7 +4926,7 @@ void MultiFactorUserHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -4294,7 +4974,7 @@ void MultiFactorUserHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -4305,7 +4985,8 @@ void MultiFactorUserHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, const auto& app_arg = std::any_cast( std::get(encodable_app_arg)); api->GetSession( - app_arg, [reply](ErrorOr&& output) { + app_arg, + [reply](ErrorOr&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; @@ -4332,7 +5013,7 @@ void MultiFactorUserHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -4377,7 +5058,7 @@ void MultiFactorUserHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -4421,108 +5102,23 @@ EncodableValue MultiFactorUserHostApi::WrapError(const FlutterError& error) { error.details()}); } -MultiFactoResolverHostApiCodecSerializer:: - MultiFactoResolverHostApiCodecSerializer() {} - -EncodableValue MultiFactoResolverHostApiCodecSerializer::ReadValueOfType( - uint8_t type, flutter::ByteStreamReader* stream) const { - switch (type) { - case 128: - return CustomEncodableValue(PigeonAdditionalUserInfo::FromEncodableList( - std::get(ReadValue(stream)))); - case 129: - return CustomEncodableValue(PigeonAuthCredential::FromEncodableList( - std::get(ReadValue(stream)))); - case 130: - return CustomEncodableValue( - PigeonPhoneMultiFactorAssertion::FromEncodableList( - std::get(ReadValue(stream)))); - case 131: - return CustomEncodableValue(PigeonUserCredential::FromEncodableList( - std::get(ReadValue(stream)))); - case 132: - return CustomEncodableValue(PigeonUserDetails::FromEncodableList( - std::get(ReadValue(stream)))); - case 133: - return CustomEncodableValue(PigeonUserInfo::FromEncodableList( - std::get(ReadValue(stream)))); - default: - return flutter::StandardCodecSerializer::ReadValueOfType(type, stream); - } -} - -void MultiFactoResolverHostApiCodecSerializer::WriteValue( - const EncodableValue& value, flutter::ByteStreamWriter* stream) const { - if (const CustomEncodableValue* custom_value = - std::get_if(&value)) { - if (custom_value->type() == typeid(PigeonAdditionalUserInfo)) { - stream->WriteByte(128); - WriteValue( - EncodableValue(std::any_cast(*custom_value) - .ToEncodableList()), - stream); - return; - } - if (custom_value->type() == typeid(PigeonAuthCredential)) { - stream->WriteByte(129); - WriteValue( - EncodableValue(std::any_cast(*custom_value) - .ToEncodableList()), - stream); - return; - } - if (custom_value->type() == typeid(PigeonPhoneMultiFactorAssertion)) { - stream->WriteByte(130); - WriteValue(EncodableValue(std::any_cast( - *custom_value) - .ToEncodableList()), - stream); - return; - } - if (custom_value->type() == typeid(PigeonUserCredential)) { - stream->WriteByte(131); - WriteValue( - EncodableValue(std::any_cast(*custom_value) - .ToEncodableList()), - stream); - return; - } - if (custom_value->type() == typeid(PigeonUserDetails)) { - stream->WriteByte(132); - WriteValue(EncodableValue(std::any_cast(*custom_value) - .ToEncodableList()), - stream); - return; - } - if (custom_value->type() == typeid(PigeonUserInfo)) { - stream->WriteByte(133); - WriteValue( - EncodableValue( - std::any_cast(*custom_value).ToEncodableList()), - stream); - return; - } - } - flutter::StandardCodecSerializer::WriteValue(value, stream); -} - /// The codec used by MultiFactoResolverHostApi. -const flutter::StandardMessageCodec& MultiFactoResolverHostApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance( - &MultiFactoResolverHostApiCodecSerializer::GetInstance()); +const ::flutter::StandardMessageCodec& MultiFactoResolverHostApi::GetCodec() { + return ::flutter::StandardMessageCodec::GetInstance( + &PigeonInternalCodecSerializer::GetInstance()); } // Sets up an instance of `MultiFactoResolverHostApi` to handle messages through // the `binary_messenger`. void MultiFactoResolverHostApi::SetUp( - flutter::BinaryMessenger* binary_messenger, + ::flutter::BinaryMessenger* binary_messenger, MultiFactoResolverHostApi* api) { MultiFactoResolverHostApi::SetUp(binary_messenger, api, ""); } void MultiFactoResolverHostApi::SetUp( - flutter::BinaryMessenger* binary_messenger, MultiFactoResolverHostApi* api, - const std::string& message_channel_suffix) { + ::flutter::BinaryMessenger* binary_messenger, + MultiFactoResolverHostApi* api, const std::string& message_channel_suffix) { const std::string prepended_suffix = message_channel_suffix.length() > 0 ? std::string(".") + message_channel_suffix @@ -4535,41 +5131,44 @@ void MultiFactoResolverHostApi::SetUp( prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_resolver_id_arg = args.at(0); - if (encodable_resolver_id_arg.IsNull()) { - reply(WrapError("resolver_id_arg unexpectedly null.")); - return; - } - const auto& resolver_id_arg = - std::get(encodable_resolver_id_arg); - const auto& encodable_assertion_arg = args.at(1); - const auto* assertion_arg = - &(std::any_cast( - std::get(encodable_assertion_arg))); - const auto& encodable_totp_assertion_id_arg = args.at(2); - const auto* totp_assertion_id_arg = - std::get_if(&encodable_totp_assertion_id_arg); - api->ResolveSignIn( - resolver_id_arg, assertion_arg, totp_assertion_id_arg, - [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - CustomEncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler([api](const EncodableValue& message, + const ::flutter::MessageReply< + EncodableValue>& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_resolver_id_arg = args.at(0); + if (encodable_resolver_id_arg.IsNull()) { + reply(WrapError("resolver_id_arg unexpectedly null.")); + return; + } + const auto& resolver_id_arg = + std::get(encodable_resolver_id_arg); + const auto& encodable_assertion_arg = args.at(1); + const auto* assertion_arg = + encodable_assertion_arg.IsNull() + ? nullptr + : &(std::any_cast( + std::get( + encodable_assertion_arg))); + const auto& encodable_totp_assertion_id_arg = args.at(2); + const auto* totp_assertion_id_arg = + std::get_if(&encodable_totp_assertion_id_arg); + api->ResolveSignIn( + resolver_id_arg, assertion_arg, totp_assertion_id_arg, + [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + CustomEncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } @@ -4589,50 +5188,20 @@ EncodableValue MultiFactoResolverHostApi::WrapError(const FlutterError& error) { error.details()}); } -MultiFactorTotpHostApiCodecSerializer::MultiFactorTotpHostApiCodecSerializer() { -} - -EncodableValue MultiFactorTotpHostApiCodecSerializer::ReadValueOfType( - uint8_t type, flutter::ByteStreamReader* stream) const { - switch (type) { - case 128: - return CustomEncodableValue(PigeonTotpSecret::FromEncodableList( - std::get(ReadValue(stream)))); - default: - return flutter::StandardCodecSerializer::ReadValueOfType(type, stream); - } -} - -void MultiFactorTotpHostApiCodecSerializer::WriteValue( - const EncodableValue& value, flutter::ByteStreamWriter* stream) const { - if (const CustomEncodableValue* custom_value = - std::get_if(&value)) { - if (custom_value->type() == typeid(PigeonTotpSecret)) { - stream->WriteByte(128); - WriteValue( - EncodableValue( - std::any_cast(*custom_value).ToEncodableList()), - stream); - return; - } - } - flutter::StandardCodecSerializer::WriteValue(value, stream); -} - /// The codec used by MultiFactorTotpHostApi. -const flutter::StandardMessageCodec& MultiFactorTotpHostApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance( - &MultiFactorTotpHostApiCodecSerializer::GetInstance()); +const ::flutter::StandardMessageCodec& MultiFactorTotpHostApi::GetCodec() { + return ::flutter::StandardMessageCodec::GetInstance( + &PigeonInternalCodecSerializer::GetInstance()); } // Sets up an instance of `MultiFactorTotpHostApi` to handle messages through // the `binary_messenger`. -void MultiFactorTotpHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, +void MultiFactorTotpHostApi::SetUp(::flutter::BinaryMessenger* binary_messenger, MultiFactorTotpHostApi* api) { MultiFactorTotpHostApi::SetUp(binary_messenger, api, ""); } -void MultiFactorTotpHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, +void MultiFactorTotpHostApi::SetUp(::flutter::BinaryMessenger* binary_messenger, MultiFactorTotpHostApi* api, const std::string& message_channel_suffix) { const std::string prepended_suffix = @@ -4649,7 +5218,7 @@ void MultiFactorTotpHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_session_id_arg = args.at(0); @@ -4660,7 +5229,8 @@ void MultiFactorTotpHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, const auto& session_id_arg = std::get(encodable_session_id_arg); api->GenerateSecret( - session_id_arg, [reply](ErrorOr&& output) { + session_id_arg, + [reply](ErrorOr&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; @@ -4688,7 +5258,7 @@ void MultiFactorTotpHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_secret_key_arg = args.at(0); @@ -4735,7 +5305,7 @@ void MultiFactorTotpHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_enrollment_id_arg = args.at(0); @@ -4788,21 +5358,22 @@ EncodableValue MultiFactorTotpHostApi::WrapError(const FlutterError& error) { } /// The codec used by MultiFactorTotpSecretHostApi. -const flutter::StandardMessageCodec& MultiFactorTotpSecretHostApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance( - &flutter::StandardCodecSerializer::GetInstance()); +const ::flutter::StandardMessageCodec& +MultiFactorTotpSecretHostApi::GetCodec() { + return ::flutter::StandardMessageCodec::GetInstance( + &PigeonInternalCodecSerializer::GetInstance()); } // Sets up an instance of `MultiFactorTotpSecretHostApi` to handle messages // through the `binary_messenger`. void MultiFactorTotpSecretHostApi::SetUp( - flutter::BinaryMessenger* binary_messenger, + ::flutter::BinaryMessenger* binary_messenger, MultiFactorTotpSecretHostApi* api) { MultiFactorTotpSecretHostApi::SetUp(binary_messenger, api, ""); } void MultiFactorTotpSecretHostApi::SetUp( - flutter::BinaryMessenger* binary_messenger, + ::flutter::BinaryMessenger* binary_messenger, MultiFactorTotpSecretHostApi* api, const std::string& message_channel_suffix) { const std::string prepended_suffix = @@ -4819,7 +5390,7 @@ void MultiFactorTotpSecretHostApi::SetUp( if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_secret_key_arg = args.at(0); @@ -4865,7 +5436,7 @@ void MultiFactorTotpSecretHostApi::SetUp( if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_secret_key_arg = args.at(0); @@ -4916,49 +5487,20 @@ EncodableValue MultiFactorTotpSecretHostApi::WrapError( error.details()}); } -GenerateInterfacesCodecSerializer::GenerateInterfacesCodecSerializer() {} - -EncodableValue GenerateInterfacesCodecSerializer::ReadValueOfType( - uint8_t type, flutter::ByteStreamReader* stream) const { - switch (type) { - case 128: - return CustomEncodableValue(PigeonMultiFactorInfo::FromEncodableList( - std::get(ReadValue(stream)))); - default: - return flutter::StandardCodecSerializer::ReadValueOfType(type, stream); - } -} - -void GenerateInterfacesCodecSerializer::WriteValue( - const EncodableValue& value, flutter::ByteStreamWriter* stream) const { - if (const CustomEncodableValue* custom_value = - std::get_if(&value)) { - if (custom_value->type() == typeid(PigeonMultiFactorInfo)) { - stream->WriteByte(128); - WriteValue( - EncodableValue(std::any_cast(*custom_value) - .ToEncodableList()), - stream); - return; - } - } - flutter::StandardCodecSerializer::WriteValue(value, stream); -} - /// The codec used by GenerateInterfaces. -const flutter::StandardMessageCodec& GenerateInterfaces::GetCodec() { - return flutter::StandardMessageCodec::GetInstance( - &GenerateInterfacesCodecSerializer::GetInstance()); +const ::flutter::StandardMessageCodec& GenerateInterfaces::GetCodec() { + return ::flutter::StandardMessageCodec::GetInstance( + &PigeonInternalCodecSerializer::GetInstance()); } // Sets up an instance of `GenerateInterfaces` to handle messages through the // `binary_messenger`. -void GenerateInterfaces::SetUp(flutter::BinaryMessenger* binary_messenger, +void GenerateInterfaces::SetUp(::flutter::BinaryMessenger* binary_messenger, GenerateInterfaces* api) { GenerateInterfaces::SetUp(binary_messenger, api, ""); } -void GenerateInterfaces::SetUp(flutter::BinaryMessenger* binary_messenger, +void GenerateInterfaces::SetUp(::flutter::BinaryMessenger* binary_messenger, GenerateInterfaces* api, const std::string& message_channel_suffix) { const std::string prepended_suffix = @@ -4975,7 +5517,7 @@ void GenerateInterfaces::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_info_arg = args.at(0); @@ -4984,7 +5526,7 @@ void GenerateInterfaces::SetUp(flutter::BinaryMessenger* binary_messenger, return; } const auto& info_arg = - std::any_cast( + std::any_cast( std::get(encodable_info_arg)); std::optional output = api->PigeonInterface(info_arg); diff --git a/packages/firebase_auth/firebase_auth/windows/messages.g.h b/packages/firebase_auth/firebase_auth/windows/messages.g.h index 91fe62cbaa74..e1e1af028fbc 100644 --- a/packages/firebase_auth/firebase_auth/windows/messages.g.h +++ b/packages/firebase_auth/firebase_auth/windows/messages.g.h @@ -1,7 +1,7 @@ // Copyright 2023, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v19.0.0), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), do not edit directly. // See also: https://pub.dev/packages/pigeon #ifndef PIGEON_MESSAGES_G_H_ @@ -25,17 +25,17 @@ class FlutterError { explicit FlutterError(const std::string& code, const std::string& message) : code_(code), message_(message) {} explicit FlutterError(const std::string& code, const std::string& message, - const flutter::EncodableValue& details) + const ::flutter::EncodableValue& details) : code_(code), message_(message), details_(details) {} const std::string& code() const { return code_; } const std::string& message() const { return message_; } - const flutter::EncodableValue& details() const { return details_; } + const ::flutter::EncodableValue& details() const { return details_; } private: std::string code_; std::string message_; - flutter::EncodableValue details_; + ::flutter::EncodableValue details_; }; template @@ -68,56 +68,60 @@ class ErrorOr { // [checkActionCode]. enum class ActionCodeInfoOperation { // Unknown operation. - unknown = 0, + kUnknown = 0, // Password reset code generated via [sendPasswordResetEmail]. - passwordReset = 1, + kPasswordReset = 1, // Email verification code generated via [User.sendEmailVerification]. - verifyEmail = 2, + kVerifyEmail = 2, // Email change revocation code generated via [User.updateEmail]. - recoverEmail = 3, + kRecoverEmail = 3, // Email sign in code generated via [sendSignInLinkToEmail]. - emailSignIn = 4, + kEmailSignIn = 4, // Verify and change email code generated via [User.verifyBeforeUpdateEmail]. - verifyAndChangeEmail = 5, + kVerifyAndChangeEmail = 5, // Action code for reverting second factor addition. - revertSecondFactorAddition = 6 + kRevertSecondFactorAddition = 6 }; // Generated class from Pigeon that represents data sent in messages. -class PigeonMultiFactorSession { +class InternalMultiFactorSession { public: // Constructs an object setting all fields. - explicit PigeonMultiFactorSession(const std::string& id); + explicit InternalMultiFactorSession(const std::string& id); const std::string& id() const; void set_id(std::string_view value_arg); + bool operator==(const InternalMultiFactorSession& other) const; + bool operator!=(const InternalMultiFactorSession& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + + private: + static InternalMultiFactorSession FromEncodableList( + const ::flutter::EncodableList& list); + + public: + ::flutter::EncodableList ToEncodableList() const; + private: - static PigeonMultiFactorSession FromEncodableList( - const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; friend class FirebaseAuthHostApi; - friend class FirebaseAuthHostApiCodecSerializer; friend class FirebaseAuthUserHostApi; - friend class FirebaseAuthUserHostApiCodecSerializer; friend class MultiFactorUserHostApi; - friend class MultiFactorUserHostApiCodecSerializer; friend class MultiFactoResolverHostApi; - friend class MultiFactoResolverHostApiCodecSerializer; friend class MultiFactorTotpHostApi; - friend class MultiFactorTotpHostApiCodecSerializer; friend class MultiFactorTotpSecretHostApi; - friend class MultiFactorTotpSecretHostApiCodecSerializer; friend class GenerateInterfaces; - friend class GenerateInterfacesCodecSerializer; + friend class PigeonInternalCodecSerializer; std::string id_; }; // Generated class from Pigeon that represents data sent in messages. -class PigeonPhoneMultiFactorAssertion { +class InternalPhoneMultiFactorAssertion { public: // Constructs an object setting all fields. - explicit PigeonPhoneMultiFactorAssertion( + explicit InternalPhoneMultiFactorAssertion( const std::string& verification_id, const std::string& verification_code); const std::string& verification_id() const; @@ -126,41 +130,45 @@ class PigeonPhoneMultiFactorAssertion { const std::string& verification_code() const; void set_verification_code(std::string_view value_arg); + bool operator==(const InternalPhoneMultiFactorAssertion& other) const; + bool operator!=(const InternalPhoneMultiFactorAssertion& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + + private: + static InternalPhoneMultiFactorAssertion FromEncodableList( + const ::flutter::EncodableList& list); + + public: + ::flutter::EncodableList ToEncodableList() const; + private: - static PigeonPhoneMultiFactorAssertion FromEncodableList( - const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; friend class FirebaseAuthHostApi; - friend class FirebaseAuthHostApiCodecSerializer; friend class FirebaseAuthUserHostApi; - friend class FirebaseAuthUserHostApiCodecSerializer; friend class MultiFactorUserHostApi; - friend class MultiFactorUserHostApiCodecSerializer; friend class MultiFactoResolverHostApi; - friend class MultiFactoResolverHostApiCodecSerializer; friend class MultiFactorTotpHostApi; - friend class MultiFactorTotpHostApiCodecSerializer; friend class MultiFactorTotpSecretHostApi; - friend class MultiFactorTotpSecretHostApiCodecSerializer; friend class GenerateInterfaces; - friend class GenerateInterfacesCodecSerializer; + friend class PigeonInternalCodecSerializer; std::string verification_id_; std::string verification_code_; }; // Generated class from Pigeon that represents data sent in messages. -class PigeonMultiFactorInfo { +class InternalMultiFactorInfo { public: // Constructs an object setting all non-nullable fields. - explicit PigeonMultiFactorInfo(double enrollment_timestamp, - const std::string& uid); + explicit InternalMultiFactorInfo(double enrollment_timestamp, + const std::string& uid); // Constructs an object setting all fields. - explicit PigeonMultiFactorInfo(const std::string* display_name, - double enrollment_timestamp, - const std::string* factor_id, - const std::string& uid, - const std::string* phone_number); + explicit InternalMultiFactorInfo(const std::string* display_name, + double enrollment_timestamp, + const std::string* factor_id, + const std::string& uid, + const std::string* phone_number); const std::string* display_name() const; void set_display_name(const std::string_view* value_arg); @@ -180,24 +188,28 @@ class PigeonMultiFactorInfo { void set_phone_number(const std::string_view* value_arg); void set_phone_number(std::string_view value_arg); + bool operator==(const InternalMultiFactorInfo& other) const; + bool operator!=(const InternalMultiFactorInfo& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + + private: + static InternalMultiFactorInfo FromEncodableList( + const ::flutter::EncodableList& list); + + public: + ::flutter::EncodableList ToEncodableList() const; + private: - static PigeonMultiFactorInfo FromEncodableList( - const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; friend class FirebaseAuthHostApi; - friend class FirebaseAuthHostApiCodecSerializer; friend class FirebaseAuthUserHostApi; - friend class FirebaseAuthUserHostApiCodecSerializer; friend class MultiFactorUserHostApi; - friend class MultiFactorUserHostApiCodecSerializer; friend class MultiFactoResolverHostApi; - friend class MultiFactoResolverHostApiCodecSerializer; friend class MultiFactorTotpHostApi; - friend class MultiFactorTotpHostApiCodecSerializer; friend class MultiFactorTotpSecretHostApi; - friend class MultiFactorTotpSecretHostApiCodecSerializer; friend class GenerateInterfaces; - friend class GenerateInterfacesCodecSerializer; + friend class PigeonInternalCodecSerializer; std::optional display_name_; double enrollment_timestamp_; std::optional factor_id_; @@ -227,38 +239,42 @@ class AuthPigeonFirebaseApp { void set_custom_auth_domain(const std::string_view* value_arg); void set_custom_auth_domain(std::string_view value_arg); + bool operator==(const AuthPigeonFirebaseApp& other) const; + bool operator!=(const AuthPigeonFirebaseApp& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + private: static AuthPigeonFirebaseApp FromEncodableList( - const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; + const ::flutter::EncodableList& list); + + public: + ::flutter::EncodableList ToEncodableList() const; + + private: friend class FirebaseAuthHostApi; - friend class FirebaseAuthHostApiCodecSerializer; friend class FirebaseAuthUserHostApi; - friend class FirebaseAuthUserHostApiCodecSerializer; friend class MultiFactorUserHostApi; - friend class MultiFactorUserHostApiCodecSerializer; friend class MultiFactoResolverHostApi; - friend class MultiFactoResolverHostApiCodecSerializer; friend class MultiFactorTotpHostApi; - friend class MultiFactorTotpHostApiCodecSerializer; friend class MultiFactorTotpSecretHostApi; - friend class MultiFactorTotpSecretHostApiCodecSerializer; friend class GenerateInterfaces; - friend class GenerateInterfacesCodecSerializer; + friend class PigeonInternalCodecSerializer; std::string app_name_; std::optional tenant_id_; std::optional custom_auth_domain_; }; // Generated class from Pigeon that represents data sent in messages. -class PigeonActionCodeInfoData { +class InternalActionCodeInfoData { public: // Constructs an object setting all non-nullable fields. - PigeonActionCodeInfoData(); + InternalActionCodeInfoData(); // Constructs an object setting all fields. - explicit PigeonActionCodeInfoData(const std::string* email, - const std::string* previous_email); + explicit InternalActionCodeInfoData(const std::string* email, + const std::string* previous_email); const std::string* email() const; void set_email(const std::string_view* value_arg); @@ -268,82 +284,90 @@ class PigeonActionCodeInfoData { void set_previous_email(const std::string_view* value_arg); void set_previous_email(std::string_view value_arg); + bool operator==(const InternalActionCodeInfoData& other) const; + bool operator!=(const InternalActionCodeInfoData& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + private: - static PigeonActionCodeInfoData FromEncodableList( - const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; - friend class PigeonActionCodeInfo; + static InternalActionCodeInfoData FromEncodableList( + const ::flutter::EncodableList& list); + + public: + ::flutter::EncodableList ToEncodableList() const; + + private: + friend class InternalActionCodeInfo; friend class FirebaseAuthHostApi; - friend class FirebaseAuthHostApiCodecSerializer; friend class FirebaseAuthUserHostApi; - friend class FirebaseAuthUserHostApiCodecSerializer; friend class MultiFactorUserHostApi; - friend class MultiFactorUserHostApiCodecSerializer; friend class MultiFactoResolverHostApi; - friend class MultiFactoResolverHostApiCodecSerializer; friend class MultiFactorTotpHostApi; - friend class MultiFactorTotpHostApiCodecSerializer; friend class MultiFactorTotpSecretHostApi; - friend class MultiFactorTotpSecretHostApiCodecSerializer; friend class GenerateInterfaces; - friend class GenerateInterfacesCodecSerializer; + friend class PigeonInternalCodecSerializer; std::optional email_; std::optional previous_email_; }; // Generated class from Pigeon that represents data sent in messages. -class PigeonActionCodeInfo { +class InternalActionCodeInfo { public: // Constructs an object setting all fields. - explicit PigeonActionCodeInfo(const ActionCodeInfoOperation& operation, - const PigeonActionCodeInfoData& data); - - ~PigeonActionCodeInfo() = default; - PigeonActionCodeInfo(const PigeonActionCodeInfo& other); - PigeonActionCodeInfo& operator=(const PigeonActionCodeInfo& other); - PigeonActionCodeInfo(PigeonActionCodeInfo&& other) = default; - PigeonActionCodeInfo& operator=(PigeonActionCodeInfo&& other) noexcept = + explicit InternalActionCodeInfo(const ActionCodeInfoOperation& operation, + const InternalActionCodeInfoData& data); + + ~InternalActionCodeInfo() = default; + InternalActionCodeInfo(const InternalActionCodeInfo& other); + InternalActionCodeInfo& operator=(const InternalActionCodeInfo& other); + InternalActionCodeInfo(InternalActionCodeInfo&& other) = default; + InternalActionCodeInfo& operator=(InternalActionCodeInfo&& other) noexcept = default; const ActionCodeInfoOperation& operation() const; void set_operation(const ActionCodeInfoOperation& value_arg); - const PigeonActionCodeInfoData& data() const; - void set_data(const PigeonActionCodeInfoData& value_arg); + const InternalActionCodeInfoData& data() const; + void set_data(const InternalActionCodeInfoData& value_arg); + + bool operator==(const InternalActionCodeInfo& other) const; + bool operator!=(const InternalActionCodeInfo& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + + private: + static InternalActionCodeInfo FromEncodableList( + const ::flutter::EncodableList& list); + + public: + ::flutter::EncodableList ToEncodableList() const; private: - static PigeonActionCodeInfo FromEncodableList( - const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; friend class FirebaseAuthHostApi; - friend class FirebaseAuthHostApiCodecSerializer; friend class FirebaseAuthUserHostApi; - friend class FirebaseAuthUserHostApiCodecSerializer; friend class MultiFactorUserHostApi; - friend class MultiFactorUserHostApiCodecSerializer; friend class MultiFactoResolverHostApi; - friend class MultiFactoResolverHostApiCodecSerializer; friend class MultiFactorTotpHostApi; - friend class MultiFactorTotpHostApiCodecSerializer; friend class MultiFactorTotpSecretHostApi; - friend class MultiFactorTotpSecretHostApiCodecSerializer; friend class GenerateInterfaces; - friend class GenerateInterfacesCodecSerializer; + friend class PigeonInternalCodecSerializer; ActionCodeInfoOperation operation_; - std::unique_ptr data_; + std::unique_ptr data_; }; // Generated class from Pigeon that represents data sent in messages. -class PigeonAdditionalUserInfo { +class InternalAdditionalUserInfo { public: // Constructs an object setting all non-nullable fields. - explicit PigeonAdditionalUserInfo(bool is_new_user); + explicit InternalAdditionalUserInfo(bool is_new_user); // Constructs an object setting all fields. - explicit PigeonAdditionalUserInfo(bool is_new_user, - const std::string* provider_id, - const std::string* username, - const std::string* authorization_code, - const flutter::EncodableMap* profile); + explicit InternalAdditionalUserInfo(bool is_new_user, + const std::string* provider_id, + const std::string* username, + const std::string* authorization_code, + const ::flutter::EncodableMap* profile); bool is_new_user() const; void set_is_new_user(bool value_arg); @@ -360,49 +384,53 @@ class PigeonAdditionalUserInfo { void set_authorization_code(const std::string_view* value_arg); void set_authorization_code(std::string_view value_arg); - const flutter::EncodableMap* profile() const; - void set_profile(const flutter::EncodableMap* value_arg); - void set_profile(const flutter::EncodableMap& value_arg); + const ::flutter::EncodableMap* profile() const; + void set_profile(const ::flutter::EncodableMap* value_arg); + void set_profile(const ::flutter::EncodableMap& value_arg); + + bool operator==(const InternalAdditionalUserInfo& other) const; + bool operator!=(const InternalAdditionalUserInfo& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; private: - static PigeonAdditionalUserInfo FromEncodableList( - const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; - friend class PigeonUserCredential; + static InternalAdditionalUserInfo FromEncodableList( + const ::flutter::EncodableList& list); + + public: + ::flutter::EncodableList ToEncodableList() const; + + private: + friend class InternalUserCredential; friend class FirebaseAuthHostApi; - friend class FirebaseAuthHostApiCodecSerializer; friend class FirebaseAuthUserHostApi; - friend class FirebaseAuthUserHostApiCodecSerializer; friend class MultiFactorUserHostApi; - friend class MultiFactorUserHostApiCodecSerializer; friend class MultiFactoResolverHostApi; - friend class MultiFactoResolverHostApiCodecSerializer; friend class MultiFactorTotpHostApi; - friend class MultiFactorTotpHostApiCodecSerializer; friend class MultiFactorTotpSecretHostApi; - friend class MultiFactorTotpSecretHostApiCodecSerializer; friend class GenerateInterfaces; - friend class GenerateInterfacesCodecSerializer; + friend class PigeonInternalCodecSerializer; bool is_new_user_; std::optional provider_id_; std::optional username_; std::optional authorization_code_; - std::optional profile_; + std::optional<::flutter::EncodableMap> profile_; }; // Generated class from Pigeon that represents data sent in messages. -class PigeonAuthCredential { +class InternalAuthCredential { public: // Constructs an object setting all non-nullable fields. - explicit PigeonAuthCredential(const std::string& provider_id, - const std::string& sign_in_method, - int64_t native_id); + explicit InternalAuthCredential(const std::string& provider_id, + const std::string& sign_in_method, + int64_t native_id); // Constructs an object setting all fields. - explicit PigeonAuthCredential(const std::string& provider_id, - const std::string& sign_in_method, - int64_t native_id, - const std::string* access_token); + explicit InternalAuthCredential(const std::string& provider_id, + const std::string& sign_in_method, + int64_t native_id, + const std::string* access_token); const std::string& provider_id() const; void set_provider_id(std::string_view value_arg); @@ -417,25 +445,29 @@ class PigeonAuthCredential { void set_access_token(const std::string_view* value_arg); void set_access_token(std::string_view value_arg); + bool operator==(const InternalAuthCredential& other) const; + bool operator!=(const InternalAuthCredential& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + + private: + static InternalAuthCredential FromEncodableList( + const ::flutter::EncodableList& list); + + public: + ::flutter::EncodableList ToEncodableList() const; + private: - static PigeonAuthCredential FromEncodableList( - const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; - friend class PigeonUserCredential; + friend class InternalUserCredential; friend class FirebaseAuthHostApi; - friend class FirebaseAuthHostApiCodecSerializer; friend class FirebaseAuthUserHostApi; - friend class FirebaseAuthUserHostApiCodecSerializer; friend class MultiFactorUserHostApi; - friend class MultiFactorUserHostApiCodecSerializer; friend class MultiFactoResolverHostApi; - friend class MultiFactoResolverHostApiCodecSerializer; friend class MultiFactorTotpHostApi; - friend class MultiFactorTotpHostApiCodecSerializer; friend class MultiFactorTotpSecretHostApi; - friend class MultiFactorTotpSecretHostApiCodecSerializer; friend class GenerateInterfaces; - friend class GenerateInterfacesCodecSerializer; + friend class PigeonInternalCodecSerializer; std::string provider_id_; std::string sign_in_method_; int64_t native_id_; @@ -443,14 +475,14 @@ class PigeonAuthCredential { }; // Generated class from Pigeon that represents data sent in messages. -class PigeonUserInfo { +class InternalUserInfo { public: // Constructs an object setting all non-nullable fields. - explicit PigeonUserInfo(const std::string& uid, bool is_anonymous, - bool is_email_verified); + explicit InternalUserInfo(const std::string& uid, bool is_anonymous, + bool is_email_verified); // Constructs an object setting all fields. - explicit PigeonUserInfo( + explicit InternalUserInfo( const std::string& uid, const std::string* email, const std::string* display_name, const std::string* photo_url, const std::string* phone_number, bool is_anonymous, @@ -503,25 +535,29 @@ class PigeonUserInfo { void set_last_sign_in_timestamp(const int64_t* value_arg); void set_last_sign_in_timestamp(int64_t value_arg); - flutter::EncodableList ToEncodableList() const; + bool operator==(const InternalUserInfo& other) const; + bool operator!=(const InternalUserInfo& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; private: - static PigeonUserInfo FromEncodableList(const flutter::EncodableList& list); - friend class PigeonUserDetails; + static InternalUserInfo FromEncodableList( + const ::flutter::EncodableList& list); + + public: + ::flutter::EncodableList ToEncodableList() const; + + private: + friend class InternalUserDetails; friend class FirebaseAuthHostApi; - friend class FirebaseAuthHostApiCodecSerializer; friend class FirebaseAuthUserHostApi; - friend class FirebaseAuthUserHostApiCodecSerializer; friend class MultiFactorUserHostApi; - friend class MultiFactorUserHostApiCodecSerializer; friend class MultiFactoResolverHostApi; - friend class MultiFactoResolverHostApiCodecSerializer; friend class MultiFactorTotpHostApi; - friend class MultiFactorTotpHostApiCodecSerializer; friend class MultiFactorTotpSecretHostApi; - friend class MultiFactorTotpSecretHostApiCodecSerializer; friend class GenerateInterfaces; - friend class GenerateInterfacesCodecSerializer; + friend class PigeonInternalCodecSerializer; std::string uid_; std::optional email_; std::optional display_name_; @@ -537,117 +573,178 @@ class PigeonUserInfo { }; // Generated class from Pigeon that represents data sent in messages. -class PigeonUserDetails { +class InternalUserDetails { public: // Constructs an object setting all fields. - explicit PigeonUserDetails(const PigeonUserInfo& user_info, - const flutter::EncodableList& provider_data); + explicit InternalUserDetails(const InternalUserInfo& user_info, + const ::flutter::EncodableList& provider_data); + + ~InternalUserDetails() = default; + InternalUserDetails(const InternalUserDetails& other); + InternalUserDetails& operator=(const InternalUserDetails& other); + InternalUserDetails(InternalUserDetails&& other) = default; + InternalUserDetails& operator=(InternalUserDetails&& other) noexcept = + default; + const InternalUserInfo& user_info() const; + void set_user_info(const InternalUserInfo& value_arg); + + const ::flutter::EncodableList& provider_data() const; + void set_provider_data(const ::flutter::EncodableList& value_arg); - ~PigeonUserDetails() = default; - PigeonUserDetails(const PigeonUserDetails& other); - PigeonUserDetails& operator=(const PigeonUserDetails& other); - PigeonUserDetails(PigeonUserDetails&& other) = default; - PigeonUserDetails& operator=(PigeonUserDetails&& other) noexcept = default; - const PigeonUserInfo& user_info() const; - void set_user_info(const PigeonUserInfo& value_arg); + bool operator==(const InternalUserDetails& other) const; + bool operator!=(const InternalUserDetails& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; - const flutter::EncodableList& provider_data() const; - void set_provider_data(const flutter::EncodableList& value_arg); + private: + static InternalUserDetails FromEncodableList( + const ::flutter::EncodableList& list); - static PigeonUserDetails FromEncodableList( - const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; + public: + ::flutter::EncodableList ToEncodableList() const; private: - friend class PigeonUserCredential; + friend class InternalUserCredential; friend class FirebaseAuthHostApi; - friend class FirebaseAuthHostApiCodecSerializer; friend class FirebaseAuthUserHostApi; - friend class FirebaseAuthUserHostApiCodecSerializer; friend class MultiFactorUserHostApi; - friend class MultiFactorUserHostApiCodecSerializer; friend class MultiFactoResolverHostApi; - friend class MultiFactoResolverHostApiCodecSerializer; friend class MultiFactorTotpHostApi; - friend class MultiFactorTotpHostApiCodecSerializer; friend class MultiFactorTotpSecretHostApi; - friend class MultiFactorTotpSecretHostApiCodecSerializer; friend class GenerateInterfaces; - friend class GenerateInterfacesCodecSerializer; - std::unique_ptr user_info_; - flutter::EncodableList provider_data_; + friend class PigeonInternalCodecSerializer; + std::unique_ptr user_info_; + ::flutter::EncodableList provider_data_; }; // Generated class from Pigeon that represents data sent in messages. -class PigeonUserCredential { +class InternalUserCredential { public: // Constructs an object setting all non-nullable fields. - PigeonUserCredential(); + InternalUserCredential(); // Constructs an object setting all fields. - explicit PigeonUserCredential( - const PigeonUserDetails* user, - const PigeonAdditionalUserInfo* additional_user_info, - const PigeonAuthCredential* credential); - - ~PigeonUserCredential() = default; - PigeonUserCredential(const PigeonUserCredential& other); - PigeonUserCredential& operator=(const PigeonUserCredential& other); - PigeonUserCredential(PigeonUserCredential&& other) = default; - PigeonUserCredential& operator=(PigeonUserCredential&& other) noexcept = + explicit InternalUserCredential( + const InternalUserDetails* user, + const InternalAdditionalUserInfo* additional_user_info, + const InternalAuthCredential* credential); + + ~InternalUserCredential() = default; + InternalUserCredential(const InternalUserCredential& other); + InternalUserCredential& operator=(const InternalUserCredential& other); + InternalUserCredential(InternalUserCredential&& other) = default; + InternalUserCredential& operator=(InternalUserCredential&& other) noexcept = default; - const PigeonUserDetails* user() const; - void set_user(const PigeonUserDetails* value_arg); - void set_user(const PigeonUserDetails& value_arg); + const InternalUserDetails* user() const; + void set_user(const InternalUserDetails* value_arg); + void set_user(const InternalUserDetails& value_arg); + + const InternalAdditionalUserInfo* additional_user_info() const; + void set_additional_user_info(const InternalAdditionalUserInfo* value_arg); + void set_additional_user_info(const InternalAdditionalUserInfo& value_arg); + + const InternalAuthCredential* credential() const; + void set_credential(const InternalAuthCredential* value_arg); + void set_credential(const InternalAuthCredential& value_arg); + + bool operator==(const InternalUserCredential& other) const; + bool operator!=(const InternalUserCredential& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + + private: + static InternalUserCredential FromEncodableList( + const ::flutter::EncodableList& list); + + public: + ::flutter::EncodableList ToEncodableList() const; + + private: + friend class FirebaseAuthHostApi; + friend class FirebaseAuthUserHostApi; + friend class MultiFactorUserHostApi; + friend class MultiFactoResolverHostApi; + friend class MultiFactorTotpHostApi; + friend class MultiFactorTotpSecretHostApi; + friend class GenerateInterfaces; + friend class PigeonInternalCodecSerializer; + std::unique_ptr user_; + std::unique_ptr additional_user_info_; + std::unique_ptr credential_; +}; + +// Generated class from Pigeon that represents data sent in messages. +class InternalAuthCredentialInput { + public: + // Constructs an object setting all non-nullable fields. + explicit InternalAuthCredentialInput(const std::string& provider_id, + const std::string& sign_in_method); + + // Constructs an object setting all fields. + explicit InternalAuthCredentialInput(const std::string& provider_id, + const std::string& sign_in_method, + const std::string* token, + const std::string* access_token); + + const std::string& provider_id() const; + void set_provider_id(std::string_view value_arg); + + const std::string& sign_in_method() const; + void set_sign_in_method(std::string_view value_arg); + + const std::string* token() const; + void set_token(const std::string_view* value_arg); + void set_token(std::string_view value_arg); + + const std::string* access_token() const; + void set_access_token(const std::string_view* value_arg); + void set_access_token(std::string_view value_arg); - const PigeonAdditionalUserInfo* additional_user_info() const; - void set_additional_user_info(const PigeonAdditionalUserInfo* value_arg); - void set_additional_user_info(const PigeonAdditionalUserInfo& value_arg); + bool operator==(const InternalAuthCredentialInput& other) const; + bool operator!=(const InternalAuthCredentialInput& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; - const PigeonAuthCredential* credential() const; - void set_credential(const PigeonAuthCredential* value_arg); - void set_credential(const PigeonAuthCredential& value_arg); + private: + static InternalAuthCredentialInput FromEncodableList( + const ::flutter::EncodableList& list); + + public: + ::flutter::EncodableList ToEncodableList() const; private: - static PigeonUserCredential FromEncodableList( - const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; friend class FirebaseAuthHostApi; - friend class FirebaseAuthHostApiCodecSerializer; friend class FirebaseAuthUserHostApi; - friend class FirebaseAuthUserHostApiCodecSerializer; friend class MultiFactorUserHostApi; - friend class MultiFactorUserHostApiCodecSerializer; friend class MultiFactoResolverHostApi; - friend class MultiFactoResolverHostApiCodecSerializer; friend class MultiFactorTotpHostApi; - friend class MultiFactorTotpHostApiCodecSerializer; friend class MultiFactorTotpSecretHostApi; - friend class MultiFactorTotpSecretHostApiCodecSerializer; friend class GenerateInterfaces; - friend class GenerateInterfacesCodecSerializer; - std::unique_ptr user_; - std::unique_ptr additional_user_info_; - std::unique_ptr credential_; + friend class PigeonInternalCodecSerializer; + std::string provider_id_; + std::string sign_in_method_; + std::optional token_; + std::optional access_token_; }; // Generated class from Pigeon that represents data sent in messages. -class PigeonActionCodeSettings { +class InternalActionCodeSettings { public: // Constructs an object setting all non-nullable fields. - explicit PigeonActionCodeSettings(const std::string& url, - bool handle_code_in_app, - bool android_install_app); + explicit InternalActionCodeSettings(const std::string& url, + bool handle_code_in_app, + bool android_install_app); // Constructs an object setting all fields. - explicit PigeonActionCodeSettings(const std::string& url, - const std::string* dynamic_link_domain, - bool handle_code_in_app, - const std::string* i_o_s_bundle_id, - const std::string* android_package_name, - bool android_install_app, - const std::string* android_minimum_version, - const std::string* link_domain); + explicit InternalActionCodeSettings( + const std::string& url, const std::string* dynamic_link_domain, + bool handle_code_in_app, const std::string* i_o_s_bundle_id, + const std::string* android_package_name, bool android_install_app, + const std::string* android_minimum_version, + const std::string* link_domain); const std::string& url() const; void set_url(std::string_view value_arg); @@ -678,24 +775,28 @@ class PigeonActionCodeSettings { void set_link_domain(const std::string_view* value_arg); void set_link_domain(std::string_view value_arg); + bool operator==(const InternalActionCodeSettings& other) const; + bool operator!=(const InternalActionCodeSettings& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + + private: + static InternalActionCodeSettings FromEncodableList( + const ::flutter::EncodableList& list); + + public: + ::flutter::EncodableList ToEncodableList() const; + private: - static PigeonActionCodeSettings FromEncodableList( - const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; friend class FirebaseAuthHostApi; - friend class FirebaseAuthHostApiCodecSerializer; friend class FirebaseAuthUserHostApi; - friend class FirebaseAuthUserHostApiCodecSerializer; friend class MultiFactorUserHostApi; - friend class MultiFactorUserHostApiCodecSerializer; friend class MultiFactoResolverHostApi; - friend class MultiFactoResolverHostApiCodecSerializer; friend class MultiFactorTotpHostApi; - friend class MultiFactorTotpHostApiCodecSerializer; friend class MultiFactorTotpSecretHostApi; - friend class MultiFactorTotpSecretHostApiCodecSerializer; friend class GenerateInterfaces; - friend class GenerateInterfacesCodecSerializer; + friend class PigeonInternalCodecSerializer; std::string url_; std::optional dynamic_link_domain_; bool handle_code_in_app_; @@ -707,14 +808,14 @@ class PigeonActionCodeSettings { }; // Generated class from Pigeon that represents data sent in messages. -class PigeonFirebaseAuthSettings { +class InternalFirebaseAuthSettings { public: // Constructs an object setting all non-nullable fields. - explicit PigeonFirebaseAuthSettings( + explicit InternalFirebaseAuthSettings( bool app_verification_disabled_for_testing); // Constructs an object setting all fields. - explicit PigeonFirebaseAuthSettings( + explicit InternalFirebaseAuthSettings( bool app_verification_disabled_for_testing, const std::string* user_access_group, const std::string* phone_number, const std::string* sms_code, const bool* force_recaptcha_flow); @@ -738,24 +839,28 @@ class PigeonFirebaseAuthSettings { void set_force_recaptcha_flow(const bool* value_arg); void set_force_recaptcha_flow(bool value_arg); + bool operator==(const InternalFirebaseAuthSettings& other) const; + bool operator!=(const InternalFirebaseAuthSettings& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + + private: + static InternalFirebaseAuthSettings FromEncodableList( + const ::flutter::EncodableList& list); + + public: + ::flutter::EncodableList ToEncodableList() const; + private: - static PigeonFirebaseAuthSettings FromEncodableList( - const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; friend class FirebaseAuthHostApi; - friend class FirebaseAuthHostApiCodecSerializer; friend class FirebaseAuthUserHostApi; - friend class FirebaseAuthUserHostApiCodecSerializer; friend class MultiFactorUserHostApi; - friend class MultiFactorUserHostApiCodecSerializer; friend class MultiFactoResolverHostApi; - friend class MultiFactoResolverHostApiCodecSerializer; friend class MultiFactorTotpHostApi; - friend class MultiFactorTotpHostApiCodecSerializer; friend class MultiFactorTotpSecretHostApi; - friend class MultiFactorTotpSecretHostApiCodecSerializer; friend class GenerateInterfaces; - friend class GenerateInterfacesCodecSerializer; + friend class PigeonInternalCodecSerializer; bool app_verification_disabled_for_testing_; std::optional user_access_group_; std::optional phone_number_; @@ -764,58 +869,62 @@ class PigeonFirebaseAuthSettings { }; // Generated class from Pigeon that represents data sent in messages. -class PigeonSignInProvider { +class InternalSignInProvider { public: // Constructs an object setting all non-nullable fields. - explicit PigeonSignInProvider(const std::string& provider_id); + explicit InternalSignInProvider(const std::string& provider_id); // Constructs an object setting all fields. - explicit PigeonSignInProvider(const std::string& provider_id, - const flutter::EncodableList* scopes, - const flutter::EncodableMap* custom_parameters); + explicit InternalSignInProvider( + const std::string& provider_id, const ::flutter::EncodableList* scopes, + const ::flutter::EncodableMap* custom_parameters); const std::string& provider_id() const; void set_provider_id(std::string_view value_arg); - const flutter::EncodableList* scopes() const; - void set_scopes(const flutter::EncodableList* value_arg); - void set_scopes(const flutter::EncodableList& value_arg); + const ::flutter::EncodableList* scopes() const; + void set_scopes(const ::flutter::EncodableList* value_arg); + void set_scopes(const ::flutter::EncodableList& value_arg); - const flutter::EncodableMap* custom_parameters() const; - void set_custom_parameters(const flutter::EncodableMap* value_arg); - void set_custom_parameters(const flutter::EncodableMap& value_arg); + const ::flutter::EncodableMap* custom_parameters() const; + void set_custom_parameters(const ::flutter::EncodableMap* value_arg); + void set_custom_parameters(const ::flutter::EncodableMap& value_arg); + + bool operator==(const InternalSignInProvider& other) const; + bool operator!=(const InternalSignInProvider& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + + private: + static InternalSignInProvider FromEncodableList( + const ::flutter::EncodableList& list); + + public: + ::flutter::EncodableList ToEncodableList() const; private: - static PigeonSignInProvider FromEncodableList( - const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; friend class FirebaseAuthHostApi; - friend class FirebaseAuthHostApiCodecSerializer; friend class FirebaseAuthUserHostApi; - friend class FirebaseAuthUserHostApiCodecSerializer; friend class MultiFactorUserHostApi; - friend class MultiFactorUserHostApiCodecSerializer; friend class MultiFactoResolverHostApi; - friend class MultiFactoResolverHostApiCodecSerializer; friend class MultiFactorTotpHostApi; - friend class MultiFactorTotpHostApiCodecSerializer; friend class MultiFactorTotpSecretHostApi; - friend class MultiFactorTotpSecretHostApiCodecSerializer; friend class GenerateInterfaces; - friend class GenerateInterfacesCodecSerializer; + friend class PigeonInternalCodecSerializer; std::string provider_id_; - std::optional scopes_; - std::optional custom_parameters_; + std::optional<::flutter::EncodableList> scopes_; + std::optional<::flutter::EncodableMap> custom_parameters_; }; // Generated class from Pigeon that represents data sent in messages. -class PigeonVerifyPhoneNumberRequest { +class InternalVerifyPhoneNumberRequest { public: // Constructs an object setting all non-nullable fields. - explicit PigeonVerifyPhoneNumberRequest(int64_t timeout); + explicit InternalVerifyPhoneNumberRequest(int64_t timeout); // Constructs an object setting all fields. - explicit PigeonVerifyPhoneNumberRequest( + explicit InternalVerifyPhoneNumberRequest( const std::string* phone_number, int64_t timeout, const int64_t* force_resending_token, const std::string* auto_retrieved_sms_code_for_testing, @@ -846,24 +955,28 @@ class PigeonVerifyPhoneNumberRequest { void set_multi_factor_session_id(const std::string_view* value_arg); void set_multi_factor_session_id(std::string_view value_arg); + bool operator==(const InternalVerifyPhoneNumberRequest& other) const; + bool operator!=(const InternalVerifyPhoneNumberRequest& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + + private: + static InternalVerifyPhoneNumberRequest FromEncodableList( + const ::flutter::EncodableList& list); + + public: + ::flutter::EncodableList ToEncodableList() const; + private: - static PigeonVerifyPhoneNumberRequest FromEncodableList( - const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; friend class FirebaseAuthHostApi; - friend class FirebaseAuthHostApiCodecSerializer; friend class FirebaseAuthUserHostApi; - friend class FirebaseAuthUserHostApiCodecSerializer; friend class MultiFactorUserHostApi; - friend class MultiFactorUserHostApiCodecSerializer; friend class MultiFactoResolverHostApi; - friend class MultiFactoResolverHostApiCodecSerializer; friend class MultiFactorTotpHostApi; - friend class MultiFactorTotpHostApiCodecSerializer; friend class MultiFactorTotpSecretHostApi; - friend class MultiFactorTotpSecretHostApiCodecSerializer; friend class GenerateInterfaces; - friend class GenerateInterfacesCodecSerializer; + friend class PigeonInternalCodecSerializer; std::optional phone_number_; int64_t timeout_; std::optional force_resending_token_; @@ -873,19 +986,19 @@ class PigeonVerifyPhoneNumberRequest { }; // Generated class from Pigeon that represents data sent in messages. -class PigeonIdTokenResult { +class InternalIdTokenResult { public: // Constructs an object setting all non-nullable fields. - PigeonIdTokenResult(); + InternalIdTokenResult(); // Constructs an object setting all fields. - explicit PigeonIdTokenResult(const std::string* token, - const int64_t* expiration_timestamp, - const int64_t* auth_timestamp, - const int64_t* issued_at_timestamp, - const std::string* sign_in_provider, - const flutter::EncodableMap* claims, - const std::string* sign_in_second_factor); + explicit InternalIdTokenResult(const std::string* token, + const int64_t* expiration_timestamp, + const int64_t* auth_timestamp, + const int64_t* issued_at_timestamp, + const std::string* sign_in_provider, + const ::flutter::EncodableMap* claims, + const std::string* sign_in_second_factor); const std::string* token() const; void set_token(const std::string_view* value_arg); @@ -907,51 +1020,57 @@ class PigeonIdTokenResult { void set_sign_in_provider(const std::string_view* value_arg); void set_sign_in_provider(std::string_view value_arg); - const flutter::EncodableMap* claims() const; - void set_claims(const flutter::EncodableMap* value_arg); - void set_claims(const flutter::EncodableMap& value_arg); + const ::flutter::EncodableMap* claims() const; + void set_claims(const ::flutter::EncodableMap* value_arg); + void set_claims(const ::flutter::EncodableMap& value_arg); const std::string* sign_in_second_factor() const; void set_sign_in_second_factor(const std::string_view* value_arg); void set_sign_in_second_factor(std::string_view value_arg); + bool operator==(const InternalIdTokenResult& other) const; + bool operator!=(const InternalIdTokenResult& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + + private: + static InternalIdTokenResult FromEncodableList( + const ::flutter::EncodableList& list); + + public: + ::flutter::EncodableList ToEncodableList() const; + private: - static PigeonIdTokenResult FromEncodableList( - const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; friend class FirebaseAuthHostApi; - friend class FirebaseAuthHostApiCodecSerializer; friend class FirebaseAuthUserHostApi; - friend class FirebaseAuthUserHostApiCodecSerializer; friend class MultiFactorUserHostApi; - friend class MultiFactorUserHostApiCodecSerializer; friend class MultiFactoResolverHostApi; - friend class MultiFactoResolverHostApiCodecSerializer; friend class MultiFactorTotpHostApi; - friend class MultiFactorTotpHostApiCodecSerializer; friend class MultiFactorTotpSecretHostApi; - friend class MultiFactorTotpSecretHostApiCodecSerializer; friend class GenerateInterfaces; - friend class GenerateInterfacesCodecSerializer; + friend class PigeonInternalCodecSerializer; std::optional token_; std::optional expiration_timestamp_; std::optional auth_timestamp_; std::optional issued_at_timestamp_; std::optional sign_in_provider_; - std::optional claims_; + std::optional<::flutter::EncodableMap> claims_; std::optional sign_in_second_factor_; }; // Generated class from Pigeon that represents data sent in messages. -class PigeonUserProfile { +class InternalUserProfile { public: // Constructs an object setting all non-nullable fields. - explicit PigeonUserProfile(bool display_name_changed, bool photo_url_changed); + explicit InternalUserProfile(bool display_name_changed, + bool photo_url_changed); // Constructs an object setting all fields. - explicit PigeonUserProfile(const std::string* display_name, - const std::string* photo_url, - bool display_name_changed, bool photo_url_changed); + explicit InternalUserProfile(const std::string* display_name, + const std::string* photo_url, + bool display_name_changed, + bool photo_url_changed); const std::string* display_name() const; void set_display_name(const std::string_view* value_arg); @@ -967,24 +1086,28 @@ class PigeonUserProfile { bool photo_url_changed() const; void set_photo_url_changed(bool value_arg); + bool operator==(const InternalUserProfile& other) const; + bool operator!=(const InternalUserProfile& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + + private: + static InternalUserProfile FromEncodableList( + const ::flutter::EncodableList& list); + + public: + ::flutter::EncodableList ToEncodableList() const; + private: - static PigeonUserProfile FromEncodableList( - const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; friend class FirebaseAuthHostApi; - friend class FirebaseAuthHostApiCodecSerializer; friend class FirebaseAuthUserHostApi; - friend class FirebaseAuthUserHostApiCodecSerializer; friend class MultiFactorUserHostApi; - friend class MultiFactorUserHostApiCodecSerializer; friend class MultiFactoResolverHostApi; - friend class MultiFactoResolverHostApiCodecSerializer; friend class MultiFactorTotpHostApi; - friend class MultiFactorTotpHostApiCodecSerializer; friend class MultiFactorTotpSecretHostApi; - friend class MultiFactorTotpSecretHostApiCodecSerializer; friend class GenerateInterfaces; - friend class GenerateInterfacesCodecSerializer; + friend class PigeonInternalCodecSerializer; std::optional display_name_; std::optional photo_url_; bool display_name_changed_; @@ -992,17 +1115,17 @@ class PigeonUserProfile { }; // Generated class from Pigeon that represents data sent in messages. -class PigeonTotpSecret { +class InternalTotpSecret { public: // Constructs an object setting all non-nullable fields. - explicit PigeonTotpSecret(const std::string& secret_key); + explicit InternalTotpSecret(const std::string& secret_key); // Constructs an object setting all fields. - explicit PigeonTotpSecret(const int64_t* code_interval_seconds, - const int64_t* code_length, - const int64_t* enrollment_completion_deadline, - const std::string* hashing_algorithm, - const std::string& secret_key); + explicit InternalTotpSecret(const int64_t* code_interval_seconds, + const int64_t* code_length, + const int64_t* enrollment_completion_deadline, + const std::string* hashing_algorithm, + const std::string& secret_key); const int64_t* code_interval_seconds() const; void set_code_interval_seconds(const int64_t* value_arg); @@ -1023,23 +1146,28 @@ class PigeonTotpSecret { const std::string& secret_key() const; void set_secret_key(std::string_view value_arg); + bool operator==(const InternalTotpSecret& other) const; + bool operator!=(const InternalTotpSecret& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + + private: + static InternalTotpSecret FromEncodableList( + const ::flutter::EncodableList& list); + + public: + ::flutter::EncodableList ToEncodableList() const; + private: - static PigeonTotpSecret FromEncodableList(const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; friend class FirebaseAuthHostApi; - friend class FirebaseAuthHostApiCodecSerializer; friend class FirebaseAuthUserHostApi; - friend class FirebaseAuthUserHostApiCodecSerializer; friend class MultiFactorUserHostApi; - friend class MultiFactorUserHostApiCodecSerializer; friend class MultiFactoResolverHostApi; - friend class MultiFactoResolverHostApiCodecSerializer; friend class MultiFactorTotpHostApi; - friend class MultiFactorTotpHostApiCodecSerializer; friend class MultiFactorTotpSecretHostApi; - friend class MultiFactorTotpSecretHostApiCodecSerializer; friend class GenerateInterfaces; - friend class GenerateInterfacesCodecSerializer; + friend class PigeonInternalCodecSerializer; std::optional code_interval_seconds_; std::optional code_length_; std::optional enrollment_completion_deadline_; @@ -1047,21 +1175,21 @@ class PigeonTotpSecret { std::string secret_key_; }; -class FirebaseAuthHostApiCodecSerializer - : public flutter::StandardCodecSerializer { +class PigeonInternalCodecSerializer + : public ::flutter::StandardCodecSerializer { public: - FirebaseAuthHostApiCodecSerializer(); - inline static FirebaseAuthHostApiCodecSerializer& GetInstance() { - static FirebaseAuthHostApiCodecSerializer sInstance; + PigeonInternalCodecSerializer(); + inline static PigeonInternalCodecSerializer& GetInstance() { + static PigeonInternalCodecSerializer sInstance; return sInstance; } - void WriteValue(const flutter::EncodableValue& value, - flutter::ByteStreamWriter* stream) const override; + void WriteValue(const ::flutter::EncodableValue& value, + ::flutter::ByteStreamWriter* stream) const override; protected: - flutter::EncodableValue ReadValueOfType( - uint8_t type, flutter::ByteStreamReader* stream) const override; + ::flutter::EncodableValue ReadValueOfType( + uint8_t type, ::flutter::ByteStreamReader* stream) const override; }; // Generated interface from Pigeon that represents a handler of messages from @@ -1085,7 +1213,7 @@ class FirebaseAuthHostApi { std::function reply)> result) = 0; virtual void CheckActionCode( const AuthPigeonFirebaseApp& app, const std::string& code, - std::function reply)> result) = 0; + std::function reply)> result) = 0; virtual void ConfirmPasswordReset( const AuthPigeonFirebaseApp& app, const std::string& code, const std::string& new_password, @@ -1093,92 +1221,81 @@ class FirebaseAuthHostApi { virtual void CreateUserWithEmailAndPassword( const AuthPigeonFirebaseApp& app, const std::string& email, const std::string& password, - std::function reply)> result) = 0; + std::function reply)> result) = 0; virtual void SignInAnonymously( const AuthPigeonFirebaseApp& app, - std::function reply)> result) = 0; + std::function reply)> result) = 0; virtual void SignInWithCredential( - const AuthPigeonFirebaseApp& app, const flutter::EncodableMap& input, - std::function reply)> result) = 0; + const AuthPigeonFirebaseApp& app, const ::flutter::EncodableMap& input, + std::function reply)> result) = 0; virtual void SignInWithCustomToken( const AuthPigeonFirebaseApp& app, const std::string& token, - std::function reply)> result) = 0; + std::function reply)> result) = 0; virtual void SignInWithEmailAndPassword( const AuthPigeonFirebaseApp& app, const std::string& email, const std::string& password, - std::function reply)> result) = 0; + std::function reply)> result) = 0; virtual void SignInWithEmailLink( const AuthPigeonFirebaseApp& app, const std::string& email, const std::string& email_link, - std::function reply)> result) = 0; + std::function reply)> result) = 0; virtual void SignInWithProvider( const AuthPigeonFirebaseApp& app, - const PigeonSignInProvider& sign_in_provider, - std::function reply)> result) = 0; + const InternalSignInProvider& sign_in_provider, + std::function reply)> result) = 0; virtual void SignOut( const AuthPigeonFirebaseApp& app, std::function reply)> result) = 0; virtual void FetchSignInMethodsForEmail( const AuthPigeonFirebaseApp& app, const std::string& email, - std::function reply)> result) = 0; + std::function reply)> result) = 0; virtual void SendPasswordResetEmail( const AuthPigeonFirebaseApp& app, const std::string& email, - const PigeonActionCodeSettings* action_code_settings, + const InternalActionCodeSettings* action_code_settings, std::function reply)> result) = 0; virtual void SendSignInLinkToEmail( const AuthPigeonFirebaseApp& app, const std::string& email, - const PigeonActionCodeSettings& action_code_settings, + const InternalActionCodeSettings& action_code_settings, std::function reply)> result) = 0; virtual void SetLanguageCode( const AuthPigeonFirebaseApp& app, const std::string* language_code, std::function reply)> result) = 0; virtual void SetSettings( const AuthPigeonFirebaseApp& app, - const PigeonFirebaseAuthSettings& settings, + const InternalFirebaseAuthSettings& settings, std::function reply)> result) = 0; virtual void VerifyPasswordResetCode( const AuthPigeonFirebaseApp& app, const std::string& code, std::function reply)> result) = 0; virtual void VerifyPhoneNumber( const AuthPigeonFirebaseApp& app, - const PigeonVerifyPhoneNumberRequest& request, + const InternalVerifyPhoneNumberRequest& request, std::function reply)> result) = 0; virtual void RevokeTokenWithAuthorizationCode( const AuthPigeonFirebaseApp& app, const std::string& authorization_code, std::function reply)> result) = 0; + virtual void RevokeAccessToken( + const AuthPigeonFirebaseApp& app, const std::string& access_token, + std::function reply)> result) = 0; + virtual void InitializeRecaptchaConfig( + const AuthPigeonFirebaseApp& app, + std::function reply)> result) = 0; // The codec used by FirebaseAuthHostApi. - static const flutter::StandardMessageCodec& GetCodec(); + static const ::flutter::StandardMessageCodec& GetCodec(); // Sets up an instance of `FirebaseAuthHostApi` to handle messages through the // `binary_messenger`. - static void SetUp(flutter::BinaryMessenger* binary_messenger, + static void SetUp(::flutter::BinaryMessenger* binary_messenger, FirebaseAuthHostApi* api); - static void SetUp(flutter::BinaryMessenger* binary_messenger, + static void SetUp(::flutter::BinaryMessenger* binary_messenger, FirebaseAuthHostApi* api, const std::string& message_channel_suffix); - static flutter::EncodableValue WrapError(std::string_view error_message); - static flutter::EncodableValue WrapError(const FlutterError& error); + static ::flutter::EncodableValue WrapError(std::string_view error_message); + static ::flutter::EncodableValue WrapError(const FlutterError& error); protected: FirebaseAuthHostApi() = default; }; -class FirebaseAuthUserHostApiCodecSerializer - : public flutter::StandardCodecSerializer { - public: - FirebaseAuthUserHostApiCodecSerializer(); - inline static FirebaseAuthUserHostApiCodecSerializer& GetInstance() { - static FirebaseAuthUserHostApiCodecSerializer sInstance; - return sInstance; - } - - void WriteValue(const flutter::EncodableValue& value, - flutter::ByteStreamWriter* stream) const override; - - protected: - flutter::EncodableValue ReadValueOfType( - uint8_t type, flutter::ByteStreamReader* stream) const override; -}; - // Generated interface from Pigeon that represents a handler of messages from // Flutter. class FirebaseAuthUserHostApi { @@ -1191,80 +1308,63 @@ class FirebaseAuthUserHostApi { std::function reply)> result) = 0; virtual void GetIdToken( const AuthPigeonFirebaseApp& app, bool force_refresh, - std::function reply)> result) = 0; + std::function reply)> result) = 0; virtual void LinkWithCredential( - const AuthPigeonFirebaseApp& app, const flutter::EncodableMap& input, - std::function reply)> result) = 0; + const AuthPigeonFirebaseApp& app, const ::flutter::EncodableMap& input, + std::function reply)> result) = 0; virtual void LinkWithProvider( const AuthPigeonFirebaseApp& app, - const PigeonSignInProvider& sign_in_provider, - std::function reply)> result) = 0; + const InternalSignInProvider& sign_in_provider, + std::function reply)> result) = 0; virtual void ReauthenticateWithCredential( - const AuthPigeonFirebaseApp& app, const flutter::EncodableMap& input, - std::function reply)> result) = 0; + const AuthPigeonFirebaseApp& app, const ::flutter::EncodableMap& input, + std::function reply)> result) = 0; virtual void ReauthenticateWithProvider( const AuthPigeonFirebaseApp& app, - const PigeonSignInProvider& sign_in_provider, - std::function reply)> result) = 0; + const InternalSignInProvider& sign_in_provider, + std::function reply)> result) = 0; virtual void Reload( const AuthPigeonFirebaseApp& app, - std::function reply)> result) = 0; + std::function reply)> result) = 0; virtual void SendEmailVerification( const AuthPigeonFirebaseApp& app, - const PigeonActionCodeSettings* action_code_settings, + const InternalActionCodeSettings* action_code_settings, std::function reply)> result) = 0; virtual void Unlink( const AuthPigeonFirebaseApp& app, const std::string& provider_id, - std::function reply)> result) = 0; + std::function reply)> result) = 0; virtual void UpdateEmail( const AuthPigeonFirebaseApp& app, const std::string& new_email, - std::function reply)> result) = 0; + std::function reply)> result) = 0; virtual void UpdatePassword( const AuthPigeonFirebaseApp& app, const std::string& new_password, - std::function reply)> result) = 0; + std::function reply)> result) = 0; virtual void UpdatePhoneNumber( - const AuthPigeonFirebaseApp& app, const flutter::EncodableMap& input, - std::function reply)> result) = 0; + const AuthPigeonFirebaseApp& app, const ::flutter::EncodableMap& input, + std::function reply)> result) = 0; virtual void UpdateProfile( - const AuthPigeonFirebaseApp& app, const PigeonUserProfile& profile, - std::function reply)> result) = 0; + const AuthPigeonFirebaseApp& app, const InternalUserProfile& profile, + std::function reply)> result) = 0; virtual void VerifyBeforeUpdateEmail( const AuthPigeonFirebaseApp& app, const std::string& new_email, - const PigeonActionCodeSettings* action_code_settings, + const InternalActionCodeSettings* action_code_settings, std::function reply)> result) = 0; // The codec used by FirebaseAuthUserHostApi. - static const flutter::StandardMessageCodec& GetCodec(); + static const ::flutter::StandardMessageCodec& GetCodec(); // Sets up an instance of `FirebaseAuthUserHostApi` to handle messages through // the `binary_messenger`. - static void SetUp(flutter::BinaryMessenger* binary_messenger, + static void SetUp(::flutter::BinaryMessenger* binary_messenger, FirebaseAuthUserHostApi* api); - static void SetUp(flutter::BinaryMessenger* binary_messenger, + static void SetUp(::flutter::BinaryMessenger* binary_messenger, FirebaseAuthUserHostApi* api, const std::string& message_channel_suffix); - static flutter::EncodableValue WrapError(std::string_view error_message); - static flutter::EncodableValue WrapError(const FlutterError& error); + static ::flutter::EncodableValue WrapError(std::string_view error_message); + static ::flutter::EncodableValue WrapError(const FlutterError& error); protected: FirebaseAuthUserHostApi() = default; }; -class MultiFactorUserHostApiCodecSerializer - : public flutter::StandardCodecSerializer { - public: - MultiFactorUserHostApiCodecSerializer(); - inline static MultiFactorUserHostApiCodecSerializer& GetInstance() { - static MultiFactorUserHostApiCodecSerializer sInstance; - return sInstance; - } - - void WriteValue(const flutter::EncodableValue& value, - flutter::ByteStreamWriter* stream) const override; - - protected: - flutter::EncodableValue ReadValueOfType( - uint8_t type, flutter::ByteStreamReader* stream) const override; -}; - // Generated interface from Pigeon that represents a handler of messages from // Flutter. class MultiFactorUserHostApi { @@ -1274,7 +1374,7 @@ class MultiFactorUserHostApi { virtual ~MultiFactorUserHostApi() {} virtual void EnrollPhone( const AuthPigeonFirebaseApp& app, - const PigeonPhoneMultiFactorAssertion& assertion, + const InternalPhoneMultiFactorAssertion& assertion, const std::string* display_name, std::function reply)> result) = 0; virtual void EnrollTotp( @@ -1283,46 +1383,30 @@ class MultiFactorUserHostApi { std::function reply)> result) = 0; virtual void GetSession( const AuthPigeonFirebaseApp& app, - std::function reply)> result) = 0; + std::function reply)> + result) = 0; virtual void Unenroll( const AuthPigeonFirebaseApp& app, const std::string& factor_uid, std::function reply)> result) = 0; virtual void GetEnrolledFactors( const AuthPigeonFirebaseApp& app, - std::function reply)> result) = 0; + std::function reply)> result) = 0; // The codec used by MultiFactorUserHostApi. - static const flutter::StandardMessageCodec& GetCodec(); + static const ::flutter::StandardMessageCodec& GetCodec(); // Sets up an instance of `MultiFactorUserHostApi` to handle messages through // the `binary_messenger`. - static void SetUp(flutter::BinaryMessenger* binary_messenger, + static void SetUp(::flutter::BinaryMessenger* binary_messenger, MultiFactorUserHostApi* api); - static void SetUp(flutter::BinaryMessenger* binary_messenger, + static void SetUp(::flutter::BinaryMessenger* binary_messenger, MultiFactorUserHostApi* api, const std::string& message_channel_suffix); - static flutter::EncodableValue WrapError(std::string_view error_message); - static flutter::EncodableValue WrapError(const FlutterError& error); + static ::flutter::EncodableValue WrapError(std::string_view error_message); + static ::flutter::EncodableValue WrapError(const FlutterError& error); protected: MultiFactorUserHostApi() = default; }; -class MultiFactoResolverHostApiCodecSerializer - : public flutter::StandardCodecSerializer { - public: - MultiFactoResolverHostApiCodecSerializer(); - inline static MultiFactoResolverHostApiCodecSerializer& GetInstance() { - static MultiFactoResolverHostApiCodecSerializer sInstance; - return sInstance; - } - - void WriteValue(const flutter::EncodableValue& value, - flutter::ByteStreamWriter* stream) const override; - - protected: - flutter::EncodableValue ReadValueOfType( - uint8_t type, flutter::ByteStreamReader* stream) const override; -}; - // Generated interface from Pigeon that represents a handler of messages from // Flutter. class MultiFactoResolverHostApi { @@ -1333,42 +1417,25 @@ class MultiFactoResolverHostApi { virtual ~MultiFactoResolverHostApi() {} virtual void ResolveSignIn( const std::string& resolver_id, - const PigeonPhoneMultiFactorAssertion* assertion, + const InternalPhoneMultiFactorAssertion* assertion, const std::string* totp_assertion_id, - std::function reply)> result) = 0; + std::function reply)> result) = 0; // The codec used by MultiFactoResolverHostApi. - static const flutter::StandardMessageCodec& GetCodec(); + static const ::flutter::StandardMessageCodec& GetCodec(); // Sets up an instance of `MultiFactoResolverHostApi` to handle messages // through the `binary_messenger`. - static void SetUp(flutter::BinaryMessenger* binary_messenger, + static void SetUp(::flutter::BinaryMessenger* binary_messenger, MultiFactoResolverHostApi* api); - static void SetUp(flutter::BinaryMessenger* binary_messenger, + static void SetUp(::flutter::BinaryMessenger* binary_messenger, MultiFactoResolverHostApi* api, const std::string& message_channel_suffix); - static flutter::EncodableValue WrapError(std::string_view error_message); - static flutter::EncodableValue WrapError(const FlutterError& error); + static ::flutter::EncodableValue WrapError(std::string_view error_message); + static ::flutter::EncodableValue WrapError(const FlutterError& error); protected: MultiFactoResolverHostApi() = default; }; -class MultiFactorTotpHostApiCodecSerializer - : public flutter::StandardCodecSerializer { - public: - MultiFactorTotpHostApiCodecSerializer(); - inline static MultiFactorTotpHostApiCodecSerializer& GetInstance() { - static MultiFactorTotpHostApiCodecSerializer sInstance; - return sInstance; - } - - void WriteValue(const flutter::EncodableValue& value, - flutter::ByteStreamWriter* stream) const override; - - protected: - flutter::EncodableValue ReadValueOfType( - uint8_t type, flutter::ByteStreamReader* stream) const override; -}; - // Generated interface from Pigeon that represents a handler of messages from // Flutter. class MultiFactorTotpHostApi { @@ -1378,7 +1445,7 @@ class MultiFactorTotpHostApi { virtual ~MultiFactorTotpHostApi() {} virtual void GenerateSecret( const std::string& session_id, - std::function reply)> result) = 0; + std::function reply)> result) = 0; virtual void GetAssertionForEnrollment( const std::string& secret_key, const std::string& one_time_password, std::function reply)> result) = 0; @@ -1387,16 +1454,16 @@ class MultiFactorTotpHostApi { std::function reply)> result) = 0; // The codec used by MultiFactorTotpHostApi. - static const flutter::StandardMessageCodec& GetCodec(); + static const ::flutter::StandardMessageCodec& GetCodec(); // Sets up an instance of `MultiFactorTotpHostApi` to handle messages through // the `binary_messenger`. - static void SetUp(flutter::BinaryMessenger* binary_messenger, + static void SetUp(::flutter::BinaryMessenger* binary_messenger, MultiFactorTotpHostApi* api); - static void SetUp(flutter::BinaryMessenger* binary_messenger, + static void SetUp(::flutter::BinaryMessenger* binary_messenger, MultiFactorTotpHostApi* api, const std::string& message_channel_suffix); - static flutter::EncodableValue WrapError(std::string_view error_message); - static flutter::EncodableValue WrapError(const FlutterError& error); + static ::flutter::EncodableValue WrapError(std::string_view error_message); + static ::flutter::EncodableValue WrapError(const FlutterError& error); protected: MultiFactorTotpHostApi() = default; @@ -1418,37 +1485,20 @@ class MultiFactorTotpSecretHostApi { std::function reply)> result) = 0; // The codec used by MultiFactorTotpSecretHostApi. - static const flutter::StandardMessageCodec& GetCodec(); + static const ::flutter::StandardMessageCodec& GetCodec(); // Sets up an instance of `MultiFactorTotpSecretHostApi` to handle messages // through the `binary_messenger`. - static void SetUp(flutter::BinaryMessenger* binary_messenger, + static void SetUp(::flutter::BinaryMessenger* binary_messenger, MultiFactorTotpSecretHostApi* api); - static void SetUp(flutter::BinaryMessenger* binary_messenger, + static void SetUp(::flutter::BinaryMessenger* binary_messenger, MultiFactorTotpSecretHostApi* api, const std::string& message_channel_suffix); - static flutter::EncodableValue WrapError(std::string_view error_message); - static flutter::EncodableValue WrapError(const FlutterError& error); + static ::flutter::EncodableValue WrapError(std::string_view error_message); + static ::flutter::EncodableValue WrapError(const FlutterError& error); protected: MultiFactorTotpSecretHostApi() = default; }; -class GenerateInterfacesCodecSerializer - : public flutter::StandardCodecSerializer { - public: - GenerateInterfacesCodecSerializer(); - inline static GenerateInterfacesCodecSerializer& GetInstance() { - static GenerateInterfacesCodecSerializer sInstance; - return sInstance; - } - - void WriteValue(const flutter::EncodableValue& value, - flutter::ByteStreamWriter* stream) const override; - - protected: - flutter::EncodableValue ReadValueOfType( - uint8_t type, flutter::ByteStreamReader* stream) const override; -}; - // Only used to generate the object interface that are use outside of the Pigeon // interface // @@ -1460,19 +1510,19 @@ class GenerateInterfaces { GenerateInterfaces& operator=(const GenerateInterfaces&) = delete; virtual ~GenerateInterfaces() {} virtual std::optional PigeonInterface( - const PigeonMultiFactorInfo& info) = 0; + const InternalMultiFactorInfo& info) = 0; // The codec used by GenerateInterfaces. - static const flutter::StandardMessageCodec& GetCodec(); + static const ::flutter::StandardMessageCodec& GetCodec(); // Sets up an instance of `GenerateInterfaces` to handle messages through the // `binary_messenger`. - static void SetUp(flutter::BinaryMessenger* binary_messenger, + static void SetUp(::flutter::BinaryMessenger* binary_messenger, GenerateInterfaces* api); - static void SetUp(flutter::BinaryMessenger* binary_messenger, + static void SetUp(::flutter::BinaryMessenger* binary_messenger, GenerateInterfaces* api, const std::string& message_channel_suffix); - static flutter::EncodableValue WrapError(std::string_view error_message); - static flutter::EncodableValue WrapError(const FlutterError& error); + static ::flutter::EncodableValue WrapError(std::string_view error_message); + static ::flutter::EncodableValue WrapError(const FlutterError& error); protected: GenerateInterfaces() = default; diff --git a/packages/firebase_auth/firebase_auth_platform_interface/lib/firebase_auth_platform_interface.dart b/packages/firebase_auth/firebase_auth_platform_interface/lib/firebase_auth_platform_interface.dart index e373d6935fbf..783afa3774a6 100644 --- a/packages/firebase_auth/firebase_auth_platform_interface/lib/firebase_auth_platform_interface.dart +++ b/packages/firebase_auth/firebase_auth_platform_interface/lib/firebase_auth_platform_interface.dart @@ -13,10 +13,10 @@ export 'src/firebase_auth_multi_factor_exception.dart'; export 'src/id_token_result.dart'; export 'src/pigeon/messages.pigeon.dart' show - PigeonUserDetails, - PigeonUserInfo, + InternalUserDetails, + InternalUserInfo, ActionCodeInfoOperation, - PigeonIdTokenResult; + InternalIdTokenResult; export 'src/platform_interface/platform_interface_confirmation_result.dart'; export 'src/platform_interface/platform_interface_firebase_auth.dart'; export 'src/platform_interface/platform_interface_multi_factor.dart'; diff --git a/packages/firebase_auth/firebase_auth_platform_interface/lib/src/id_token_result.dart b/packages/firebase_auth/firebase_auth_platform_interface/lib/src/id_token_result.dart index d58bc4f09b3d..e323a6f6c194 100644 --- a/packages/firebase_auth/firebase_auth_platform_interface/lib/src/id_token_result.dart +++ b/packages/firebase_auth/firebase_auth_platform_interface/lib/src/id_token_result.dart @@ -19,7 +19,7 @@ class IdTokenResult { @protected IdTokenResult(this._data); - final PigeonIdTokenResult _data; + final InternalIdTokenResult _data; /// The authentication time formatted as UTC string. This is the time the user /// authenticated (signed in) and not the time the token was refreshed. diff --git a/packages/firebase_auth/firebase_auth_platform_interface/lib/src/method_channel/method_channel_firebase_auth.dart b/packages/firebase_auth/firebase_auth_platform_interface/lib/src/method_channel/method_channel_firebase_auth.dart index 28338f32cf8d..8944b736ad51 100644 --- a/packages/firebase_auth/firebase_auth_platform_interface/lib/src/method_channel/method_channel_firebase_auth.dart +++ b/packages/firebase_auth/firebase_auth_platform_interface/lib/src/method_channel/method_channel_firebase_auth.dart @@ -143,8 +143,8 @@ class MethodChannelFirebaseAuth extends FirebaseAuthPlatform { final MethodChannelUser user = MethodChannelUser( instance, multiFactorInstance, - PigeonUserDetails.decode( - [PigeonUserInfo.decode(userList[0]!), userList[1]], + InternalUserDetails.decode( + [InternalUserInfo.decode(userList[0]!), userList[1]], ), ); @@ -183,8 +183,8 @@ class MethodChannelFirebaseAuth extends FirebaseAuthPlatform { final MethodChannelUser user = MethodChannelUser( instance, multiFactorInstance, - PigeonUserDetails.decode( - [PigeonUserInfo.decode(userList[0]!), userList[1]], + InternalUserDetails.decode( + [InternalUserInfo.decode(userList[0]!), userList[1]], ), ); @@ -207,7 +207,7 @@ class MethodChannelFirebaseAuth extends FirebaseAuthPlatform { @override MethodChannelFirebaseAuth setInitialValues({ - PigeonUserDetails? currentUser, + InternalUserDetails? currentUser, String? languageCode, }) { if (currentUser != null) { @@ -385,7 +385,7 @@ class MethodChannelFirebaseAuth extends FirebaseAuthPlatform { final result = await _api.signInWithProvider( pigeonDefault, - PigeonSignInProvider( + InternalSignInProvider( providerId: convertedProvider.providerId, scopes: convertedProvider is OAuthProvider ? convertedProvider.scopes @@ -475,7 +475,7 @@ class MethodChannelFirebaseAuth extends FirebaseAuthPlatform { email, actionCodeSettings == null ? null - : PigeonActionCodeSettings( + : InternalActionCodeSettings( url: actionCodeSettings.url, handleCodeInApp: actionCodeSettings.handleCodeInApp, iOSBundleId: actionCodeSettings.iOSBundleId, @@ -499,7 +499,7 @@ class MethodChannelFirebaseAuth extends FirebaseAuthPlatform { await _api.sendSignInLinkToEmail( pigeonDefault, email, - PigeonActionCodeSettings( + InternalActionCodeSettings( url: actionCodeSettings.url, handleCodeInApp: actionCodeSettings.handleCodeInApp, iOSBundleId: actionCodeSettings.iOSBundleId, @@ -544,7 +544,7 @@ class MethodChannelFirebaseAuth extends FirebaseAuthPlatform { try { await _api.setSettings( pigeonDefault, - PigeonFirebaseAuthSettings( + InternalFirebaseAuthSettings( appVerificationDisabledForTesting: appVerificationDisabledForTesting, userAccessGroup: userAccessGroup, @@ -597,7 +597,7 @@ class MethodChannelFirebaseAuth extends FirebaseAuthPlatform { try { final eventChannelName = await _api.verifyPhoneNumber( pigeonDefault, - PigeonVerifyPhoneNumberRequest( + InternalVerifyPhoneNumberRequest( phoneNumber: phoneNumber, multiFactorInfoId: multiFactorInfo?.uid, timeout: timeout.inMilliseconds, diff --git a/packages/firebase_auth/firebase_auth_platform_interface/lib/src/method_channel/method_channel_multi_factor.dart b/packages/firebase_auth/firebase_auth_platform_interface/lib/src/method_channel/method_channel_multi_factor.dart index 988ef141ce2c..f0a438aeb0b7 100644 --- a/packages/firebase_auth/firebase_auth_platform_interface/lib/src/method_channel/method_channel_multi_factor.dart +++ b/packages/firebase_auth/firebase_auth_platform_interface/lib/src/method_channel/method_channel_multi_factor.dart @@ -55,7 +55,7 @@ class MethodChannelMultiFactor extends MultiFactorPlatform { try { await _api.enrollPhone( pigeonDefault, - PigeonPhoneMultiFactorAssertion( + InternalPhoneMultiFactorAssertion( verificationId: verificationId, verificationCode: verificationCode, ), @@ -150,7 +150,7 @@ class MethodChannelMultiFactorResolver extends MultiFactorResolverPlatform { try { final result = await _api.resolveSignIn( _resolverId, - PigeonPhoneMultiFactorAssertion( + InternalPhoneMultiFactorAssertion( verificationId: verificationId, verificationCode: verificationCode, ), diff --git a/packages/firebase_auth/firebase_auth_platform_interface/lib/src/method_channel/method_channel_user.dart b/packages/firebase_auth/firebase_auth_platform_interface/lib/src/method_channel/method_channel_user.dart index 977d1736898e..e6a627f8017b 100644 --- a/packages/firebase_auth/firebase_auth_platform_interface/lib/src/method_channel/method_channel_user.dart +++ b/packages/firebase_auth/firebase_auth_platform_interface/lib/src/method_channel/method_channel_user.dart @@ -16,7 +16,7 @@ import 'utils/exception.dart'; class MethodChannelUser extends UserPlatform { /// Constructs a new [MethodChannelUser] instance. MethodChannelUser(FirebaseAuthPlatform auth, MultiFactorPlatform multiFactor, - PigeonUserDetails data) + InternalUserDetails data) : super(auth, multiFactor, data); final _api = FirebaseAuthUserHostApi(); @@ -96,7 +96,7 @@ class MethodChannelUser extends UserPlatform { final result = await _api.linkWithProvider( pigeonDefault, - PigeonSignInProvider( + InternalSignInProvider( providerId: convertedProvider.providerId, scopes: convertedProvider is OAuthProvider ? convertedProvider.scopes @@ -147,7 +147,7 @@ class MethodChannelUser extends UserPlatform { final result = await _api.reauthenticateWithProvider( pigeonDefault, - PigeonSignInProvider( + InternalSignInProvider( providerId: convertedProvider.providerId, scopes: convertedProvider is OAuthProvider ? convertedProvider.scopes @@ -191,7 +191,7 @@ class MethodChannelUser extends UserPlatform { pigeonDefault, actionCodeSettings == null ? null - : PigeonActionCodeSettings( + : InternalActionCodeSettings( url: actionCodeSettings.url, handleCodeInApp: actionCodeSettings.handleCodeInApp, iOSBundleId: actionCodeSettings.iOSBundleId, @@ -274,7 +274,7 @@ class MethodChannelUser extends UserPlatform { try { final result = await _api.updateProfile( pigeonDefault, - PigeonUserProfile( + InternalUserProfile( displayName: profile['displayName'], photoUrl: profile['photoURL'], displayNameChanged: profile.containsKey('displayName'), @@ -301,7 +301,7 @@ class MethodChannelUser extends UserPlatform { newEmail, actionCodeSettings == null ? null - : PigeonActionCodeSettings( + : InternalActionCodeSettings( url: actionCodeSettings.url, handleCodeInApp: actionCodeSettings.handleCodeInApp, iOSBundleId: actionCodeSettings.iOSBundleId, diff --git a/packages/firebase_auth/firebase_auth_platform_interface/lib/src/method_channel/method_channel_user_credential.dart b/packages/firebase_auth/firebase_auth_platform_interface/lib/src/method_channel/method_channel_user_credential.dart index 35482d624798..7b65930754a9 100644 --- a/packages/firebase_auth/firebase_auth_platform_interface/lib/src/method_channel/method_channel_user_credential.dart +++ b/packages/firebase_auth/firebase_auth_platform_interface/lib/src/method_channel/method_channel_user_credential.dart @@ -12,7 +12,7 @@ import 'package:firebase_auth_platform_interface/src/pigeon/messages.pigeon.dart class MethodChannelUserCredential extends UserCredentialPlatform { // ignore: public_member_api_docs MethodChannelUserCredential( - FirebaseAuthPlatform auth, PigeonUserCredential data) + FirebaseAuthPlatform auth, InternalUserCredential data) : super( auth: auth, additionalUserInfo: data.additionalUserInfo == null diff --git a/packages/firebase_auth/firebase_auth_platform_interface/lib/src/method_channel/utils/exception.dart b/packages/firebase_auth/firebase_auth_platform_interface/lib/src/method_channel/utils/exception.dart index f78a4e99669d..e1f83202ff97 100644 --- a/packages/firebase_auth/firebase_auth_platform_interface/lib/src/method_channel/utils/exception.dart +++ b/packages/firebase_auth/firebase_auth_platform_interface/lib/src/method_channel/utils/exception.dart @@ -62,8 +62,9 @@ FirebaseException platformExceptionToFirebaseAuthException( if (platformException.details != null) { if (platformException.details['authCredential'] != null && - platformException.details['authCredential'] is PigeonAuthCredential) { - PigeonAuthCredential pigeonAuthCredential = + platformException.details['authCredential'] + is InternalAuthCredential) { + InternalAuthCredential pigeonAuthCredential = platformException.details['authCredential']; credential = AuthCredential( @@ -180,7 +181,7 @@ FirebaseAuthMultiFactorExceptionPlatform parseMultiFactorError( (additionalData['multiFactorHints'] as List? ?? []) .nonNulls .map( - PigeonMultiFactorInfo.decode, + InternalMultiFactorInfo.decode, ) .toList(); diff --git a/packages/firebase_auth/firebase_auth_platform_interface/lib/src/method_channel/utils/pigeon_helper.dart b/packages/firebase_auth/firebase_auth_platform_interface/lib/src/method_channel/utils/pigeon_helper.dart index 7b3377c3bf69..66ed6e508946 100644 --- a/packages/firebase_auth/firebase_auth_platform_interface/lib/src/method_channel/utils/pigeon_helper.dart +++ b/packages/firebase_auth/firebase_auth_platform_interface/lib/src/method_channel/utils/pigeon_helper.dart @@ -6,7 +6,7 @@ import 'package:firebase_auth_platform_interface/firebase_auth_platform_interfac import 'package:firebase_auth_platform_interface/src/pigeon/messages.pigeon.dart'; List multiFactorInfoPigeonToObject( - List pigeonMultiFactorInfo, + List pigeonMultiFactorInfo, ) { return pigeonMultiFactorInfo.nonNulls.map((e) { if (e.phoneNumber != null) { diff --git a/packages/firebase_auth/firebase_auth_platform_interface/lib/src/pigeon/messages.pigeon.dart b/packages/firebase_auth/firebase_auth_platform_interface/lib/src/pigeon/messages.pigeon.dart index dac092cd499f..60844c34575c 100644 --- a/packages/firebase_auth/firebase_auth_platform_interface/lib/src/pigeon/messages.pigeon.dart +++ b/packages/firebase_auth/firebase_auth_platform_interface/lib/src/pigeon/messages.pigeon.dart @@ -1,21 +1,40 @@ // Copyright 2023, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v19.0.0), do not edit directly. +// Autogenerated from Pigeon (v26.3.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, no_leading_underscores_for_local_identifiers +// ignore_for_file: unused_import, unused_shown_name +// ignore_for_file: type=lint import 'dart:async'; -import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; +import 'dart:typed_data' show Float64List, Int32List, Int64List; -import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer; import 'package:flutter/services.dart'; - -PlatformException _createConnectionError(String channelName) { - return PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel: "$channelName".', - ); +import 'package:meta/meta.dart' show immutable, protected, visibleForTesting; + +Object? _extractReplyValueOrThrow( + List? replyList, + String channelName, { + required bool isNullValid, +}) { + if (replyList == null) { + throw PlatformException( + code: 'channel-error', + message: 'Unable to establish connection on channel: "$channelName".', + ); + } else if (replyList.length > 1) { + throw PlatformException( + code: replyList[0]! as String, + message: replyList[1] as String?, + details: replyList[2], + ); + } else if (!isNullValid && (replyList.isNotEmpty && replyList[0] == null)) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } + return replyList.firstOrNull; } List wrapResponse( @@ -29,6 +48,68 @@ List wrapResponse( return [error.code, error.message, error.details]; } +bool _deepEquals(Object? a, Object? b) { + if (identical(a, b)) { + return true; + } + if (a is double && b is double) { + if (a.isNaN && b.isNaN) { + return true; + } + return a == b; + } + if (a is List && b is List) { + return a.length == b.length && + a.indexed + .every(((int, dynamic) item) => _deepEquals(item.$2, b[item.$1])); + } + if (a is Map && b is Map) { + if (a.length != b.length) { + return false; + } + for (final MapEntry entryA in a.entries) { + bool found = false; + for (final MapEntry entryB in b.entries) { + if (_deepEquals(entryA.key, entryB.key)) { + if (_deepEquals(entryA.value, entryB.value)) { + found = true; + break; + } else { + return false; + } + } + } + if (!found) { + return false; + } + } + return true; + } + return a == b; +} + +int _deepHash(Object? value) { + if (value is List) { + return Object.hashAll(value.map(_deepHash)); + } + if (value is Map) { + int result = 0; + for (final MapEntry entry in value.entries) { + result += (_deepHash(entry.key) * 31) ^ _deepHash(entry.value); + } + return result; + } + if (value is double && value.isNaN) { + // Normalize NaN to a consistent hash. + return 0x7FF8000000000000.hashCode; + } + if (value is double && value == 0.0) { + // Normalize -0.0 to 0.0 so they have the same hash code. + return 0.0.hashCode; + } + return value.hashCode; +} + /// The type of operation that generated the action code from calling /// [checkActionCode]. enum ActionCodeInfoOperation { @@ -54,29 +135,50 @@ enum ActionCodeInfoOperation { revertSecondFactorAddition, } -class PigeonMultiFactorSession { - PigeonMultiFactorSession({ +class InternalMultiFactorSession { + InternalMultiFactorSession({ required this.id, }); String id; - Object encode() { + List _toList() { return [ id, ]; } - static PigeonMultiFactorSession decode(Object result) { + Object encode() { + return _toList(); + } + + static InternalMultiFactorSession decode(Object result) { result as List; - return PigeonMultiFactorSession( + return InternalMultiFactorSession( id: result[0]! as String, ); } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + bool operator ==(Object other) { + if (other is! InternalMultiFactorSession || + other.runtimeType != runtimeType) { + return false; + } + if (identical(this, other)) { + return true; + } + return _deepEquals(id, other.id); + } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + int get hashCode => _deepHash([runtimeType, ..._toList()]); } -class PigeonPhoneMultiFactorAssertion { - PigeonPhoneMultiFactorAssertion({ +class InternalPhoneMultiFactorAssertion { + InternalPhoneMultiFactorAssertion({ required this.verificationId, required this.verificationCode, }); @@ -85,24 +187,46 @@ class PigeonPhoneMultiFactorAssertion { String verificationCode; - Object encode() { + List _toList() { return [ verificationId, verificationCode, ]; } - static PigeonPhoneMultiFactorAssertion decode(Object result) { + Object encode() { + return _toList(); + } + + static InternalPhoneMultiFactorAssertion decode(Object result) { result as List; - return PigeonPhoneMultiFactorAssertion( + return InternalPhoneMultiFactorAssertion( verificationId: result[0]! as String, verificationCode: result[1]! as String, ); } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + bool operator ==(Object other) { + if (other is! InternalPhoneMultiFactorAssertion || + other.runtimeType != runtimeType) { + return false; + } + if (identical(this, other)) { + return true; + } + return _deepEquals(verificationId, other.verificationId) && + _deepEquals(verificationCode, other.verificationCode); + } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + int get hashCode => _deepHash([runtimeType, ..._toList()]); } -class PigeonMultiFactorInfo { - PigeonMultiFactorInfo({ +class InternalMultiFactorInfo { + InternalMultiFactorInfo({ this.displayName, required this.enrollmentTimestamp, this.factorId, @@ -120,7 +244,7 @@ class PigeonMultiFactorInfo { String? phoneNumber; - Object encode() { + List _toList() { return [ displayName, enrollmentTimestamp, @@ -130,9 +254,13 @@ class PigeonMultiFactorInfo { ]; } - static PigeonMultiFactorInfo decode(Object result) { + Object encode() { + return _toList(); + } + + static InternalMultiFactorInfo decode(Object result) { result as List; - return PigeonMultiFactorInfo( + return InternalMultiFactorInfo( displayName: result[0] as String?, enrollmentTimestamp: result[1]! as double, factorId: result[2] as String?, @@ -140,6 +268,26 @@ class PigeonMultiFactorInfo { phoneNumber: result[4] as String?, ); } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + bool operator ==(Object other) { + if (other is! InternalMultiFactorInfo || other.runtimeType != runtimeType) { + return false; + } + if (identical(this, other)) { + return true; + } + return _deepEquals(displayName, other.displayName) && + _deepEquals(enrollmentTimestamp, other.enrollmentTimestamp) && + _deepEquals(factorId, other.factorId) && + _deepEquals(uid, other.uid) && + _deepEquals(phoneNumber, other.phoneNumber); + } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class AuthPigeonFirebaseApp { @@ -155,7 +303,7 @@ class AuthPigeonFirebaseApp { String? customAuthDomain; - Object encode() { + List _toList() { return [ appName, tenantId, @@ -163,6 +311,10 @@ class AuthPigeonFirebaseApp { ]; } + Object encode() { + return _toList(); + } + static AuthPigeonFirebaseApp decode(Object result) { result as List; return AuthPigeonFirebaseApp( @@ -171,10 +323,28 @@ class AuthPigeonFirebaseApp { customAuthDomain: result[2] as String?, ); } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + bool operator ==(Object other) { + if (other is! AuthPigeonFirebaseApp || other.runtimeType != runtimeType) { + return false; + } + if (identical(this, other)) { + return true; + } + return _deepEquals(appName, other.appName) && + _deepEquals(tenantId, other.tenantId) && + _deepEquals(customAuthDomain, other.customAuthDomain); + } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + int get hashCode => _deepHash([runtimeType, ..._toList()]); } -class PigeonActionCodeInfoData { - PigeonActionCodeInfoData({ +class InternalActionCodeInfoData { + InternalActionCodeInfoData({ this.email, this.previousEmail, }); @@ -183,50 +353,93 @@ class PigeonActionCodeInfoData { String? previousEmail; - Object encode() { + List _toList() { return [ email, previousEmail, ]; } - static PigeonActionCodeInfoData decode(Object result) { + Object encode() { + return _toList(); + } + + static InternalActionCodeInfoData decode(Object result) { result as List; - return PigeonActionCodeInfoData( + return InternalActionCodeInfoData( email: result[0] as String?, previousEmail: result[1] as String?, ); } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + bool operator ==(Object other) { + if (other is! InternalActionCodeInfoData || + other.runtimeType != runtimeType) { + return false; + } + if (identical(this, other)) { + return true; + } + return _deepEquals(email, other.email) && + _deepEquals(previousEmail, other.previousEmail); + } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + int get hashCode => _deepHash([runtimeType, ..._toList()]); } -class PigeonActionCodeInfo { - PigeonActionCodeInfo({ +class InternalActionCodeInfo { + InternalActionCodeInfo({ required this.operation, required this.data, }); ActionCodeInfoOperation operation; - PigeonActionCodeInfoData data; + InternalActionCodeInfoData data; - Object encode() { + List _toList() { return [ - operation.index, + operation, data, ]; } - static PigeonActionCodeInfo decode(Object result) { + Object encode() { + return _toList(); + } + + static InternalActionCodeInfo decode(Object result) { result as List; - return PigeonActionCodeInfo( - operation: ActionCodeInfoOperation.values[result[0]! as int], - data: result[1]! as PigeonActionCodeInfoData, + return InternalActionCodeInfo( + operation: result[0]! as ActionCodeInfoOperation, + data: result[1]! as InternalActionCodeInfoData, ); } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + bool operator ==(Object other) { + if (other is! InternalActionCodeInfo || other.runtimeType != runtimeType) { + return false; + } + if (identical(this, other)) { + return true; + } + return _deepEquals(operation, other.operation) && + _deepEquals(data, other.data); + } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + int get hashCode => _deepHash([runtimeType, ..._toList()]); } -class PigeonAdditionalUserInfo { - PigeonAdditionalUserInfo({ +class InternalAdditionalUserInfo { + InternalAdditionalUserInfo({ required this.isNewUser, this.providerId, this.username, @@ -244,7 +457,7 @@ class PigeonAdditionalUserInfo { Map? profile; - Object encode() { + List _toList() { return [ isNewUser, providerId, @@ -254,9 +467,13 @@ class PigeonAdditionalUserInfo { ]; } - static PigeonAdditionalUserInfo decode(Object result) { + Object encode() { + return _toList(); + } + + static InternalAdditionalUserInfo decode(Object result) { result as List; - return PigeonAdditionalUserInfo( + return InternalAdditionalUserInfo( isNewUser: result[0]! as bool, providerId: result[1] as String?, username: result[2] as String?, @@ -264,10 +481,31 @@ class PigeonAdditionalUserInfo { profile: (result[4] as Map?)?.cast(), ); } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + bool operator ==(Object other) { + if (other is! InternalAdditionalUserInfo || + other.runtimeType != runtimeType) { + return false; + } + if (identical(this, other)) { + return true; + } + return _deepEquals(isNewUser, other.isNewUser) && + _deepEquals(providerId, other.providerId) && + _deepEquals(username, other.username) && + _deepEquals(authorizationCode, other.authorizationCode) && + _deepEquals(profile, other.profile); + } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + int get hashCode => _deepHash([runtimeType, ..._toList()]); } -class PigeonAuthCredential { - PigeonAuthCredential({ +class InternalAuthCredential { + InternalAuthCredential({ required this.providerId, required this.signInMethod, required this.nativeId, @@ -282,7 +520,7 @@ class PigeonAuthCredential { String? accessToken; - Object encode() { + List _toList() { return [ providerId, signInMethod, @@ -291,19 +529,42 @@ class PigeonAuthCredential { ]; } - static PigeonAuthCredential decode(Object result) { + Object encode() { + return _toList(); + } + + static InternalAuthCredential decode(Object result) { result as List; - return PigeonAuthCredential( + return InternalAuthCredential( providerId: result[0]! as String, signInMethod: result[1]! as String, nativeId: result[2]! as int, accessToken: result[3] as String?, ); } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + bool operator ==(Object other) { + if (other is! InternalAuthCredential || other.runtimeType != runtimeType) { + return false; + } + if (identical(this, other)) { + return true; + } + return _deepEquals(providerId, other.providerId) && + _deepEquals(signInMethod, other.signInMethod) && + _deepEquals(nativeId, other.nativeId) && + _deepEquals(accessToken, other.accessToken); + } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + int get hashCode => _deepHash([runtimeType, ..._toList()]); } -class PigeonUserInfo { - PigeonUserInfo({ +class InternalUserInfo { + InternalUserInfo({ required this.uid, this.email, this.displayName, @@ -342,7 +603,7 @@ class PigeonUserInfo { int? lastSignInTimestamp; - Object encode() { + List _toList() { return [ uid, email, @@ -359,9 +620,13 @@ class PigeonUserInfo { ]; } - static PigeonUserInfo decode(Object result) { + Object encode() { + return _toList(); + } + + static InternalUserInfo decode(Object result) { result as List; - return PigeonUserInfo( + return InternalUserInfo( uid: result[0]! as String, email: result[1] as String?, displayName: result[2] as String?, @@ -376,49 +641,97 @@ class PigeonUserInfo { lastSignInTimestamp: result[11] as int?, ); } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + bool operator ==(Object other) { + if (other is! InternalUserInfo || other.runtimeType != runtimeType) { + return false; + } + if (identical(this, other)) { + return true; + } + return _deepEquals(uid, other.uid) && + _deepEquals(email, other.email) && + _deepEquals(displayName, other.displayName) && + _deepEquals(photoUrl, other.photoUrl) && + _deepEquals(phoneNumber, other.phoneNumber) && + _deepEquals(isAnonymous, other.isAnonymous) && + _deepEquals(isEmailVerified, other.isEmailVerified) && + _deepEquals(providerId, other.providerId) && + _deepEquals(tenantId, other.tenantId) && + _deepEquals(refreshToken, other.refreshToken) && + _deepEquals(creationTimestamp, other.creationTimestamp) && + _deepEquals(lastSignInTimestamp, other.lastSignInTimestamp); + } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + int get hashCode => _deepHash([runtimeType, ..._toList()]); } -class PigeonUserDetails { - PigeonUserDetails({ +class InternalUserDetails { + InternalUserDetails({ required this.userInfo, required this.providerData, }); - PigeonUserInfo userInfo; + InternalUserInfo userInfo; List?> providerData; - Object encode() { + List _toList() { return [ userInfo, providerData, ]; } - static PigeonUserDetails decode(Object result) { + Object encode() { + return _toList(); + } + + static InternalUserDetails decode(Object result) { result as List; - return PigeonUserDetails( - userInfo: result[0]! as PigeonUserInfo, + return InternalUserDetails( + userInfo: result[0]! as InternalUserInfo, providerData: - (result[1] as List?)!.cast?>(), + (result[1]! as List).cast?>(), ); } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + bool operator ==(Object other) { + if (other is! InternalUserDetails || other.runtimeType != runtimeType) { + return false; + } + if (identical(this, other)) { + return true; + } + return _deepEquals(userInfo, other.userInfo) && + _deepEquals(providerData, other.providerData); + } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + int get hashCode => _deepHash([runtimeType, ..._toList()]); } -class PigeonUserCredential { - PigeonUserCredential({ +class InternalUserCredential { + InternalUserCredential({ this.user, this.additionalUserInfo, this.credential, }); - PigeonUserDetails? user; + InternalUserDetails? user; - PigeonAdditionalUserInfo? additionalUserInfo; + InternalAdditionalUserInfo? additionalUserInfo; - PigeonAuthCredential? credential; + InternalAuthCredential? credential; - Object encode() { + List _toList() { return [ user, additionalUserInfo, @@ -426,18 +739,100 @@ class PigeonUserCredential { ]; } - static PigeonUserCredential decode(Object result) { + Object encode() { + return _toList(); + } + + static InternalUserCredential decode(Object result) { + result as List; + return InternalUserCredential( + user: result[0] as InternalUserDetails?, + additionalUserInfo: result[1] as InternalAdditionalUserInfo?, + credential: result[2] as InternalAuthCredential?, + ); + } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + bool operator ==(Object other) { + if (other is! InternalUserCredential || other.runtimeType != runtimeType) { + return false; + } + if (identical(this, other)) { + return true; + } + return _deepEquals(user, other.user) && + _deepEquals(additionalUserInfo, other.additionalUserInfo) && + _deepEquals(credential, other.credential); + } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + int get hashCode => _deepHash([runtimeType, ..._toList()]); +} + +class InternalAuthCredentialInput { + InternalAuthCredentialInput({ + required this.providerId, + required this.signInMethod, + this.token, + this.accessToken, + }); + + String providerId; + + String signInMethod; + + String? token; + + String? accessToken; + + List _toList() { + return [ + providerId, + signInMethod, + token, + accessToken, + ]; + } + + Object encode() { + return _toList(); + } + + static InternalAuthCredentialInput decode(Object result) { result as List; - return PigeonUserCredential( - user: result[0] as PigeonUserDetails?, - additionalUserInfo: result[1] as PigeonAdditionalUserInfo?, - credential: result[2] as PigeonAuthCredential?, + return InternalAuthCredentialInput( + providerId: result[0]! as String, + signInMethod: result[1]! as String, + token: result[2] as String?, + accessToken: result[3] as String?, ); } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + bool operator ==(Object other) { + if (other is! InternalAuthCredentialInput || + other.runtimeType != runtimeType) { + return false; + } + if (identical(this, other)) { + return true; + } + return _deepEquals(providerId, other.providerId) && + _deepEquals(signInMethod, other.signInMethod) && + _deepEquals(token, other.token) && + _deepEquals(accessToken, other.accessToken); + } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + int get hashCode => _deepHash([runtimeType, ..._toList()]); } -class PigeonActionCodeSettings { - PigeonActionCodeSettings({ +class InternalActionCodeSettings { + InternalActionCodeSettings({ required this.url, this.dynamicLinkDomain, required this.handleCodeInApp, @@ -464,7 +859,7 @@ class PigeonActionCodeSettings { String? linkDomain; - Object encode() { + List _toList() { return [ url, dynamicLinkDomain, @@ -477,9 +872,13 @@ class PigeonActionCodeSettings { ]; } - static PigeonActionCodeSettings decode(Object result) { + Object encode() { + return _toList(); + } + + static InternalActionCodeSettings decode(Object result) { result as List; - return PigeonActionCodeSettings( + return InternalActionCodeSettings( url: result[0]! as String, dynamicLinkDomain: result[1] as String?, handleCodeInApp: result[2]! as bool, @@ -490,10 +889,34 @@ class PigeonActionCodeSettings { linkDomain: result[7] as String?, ); } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + bool operator ==(Object other) { + if (other is! InternalActionCodeSettings || + other.runtimeType != runtimeType) { + return false; + } + if (identical(this, other)) { + return true; + } + return _deepEquals(url, other.url) && + _deepEquals(dynamicLinkDomain, other.dynamicLinkDomain) && + _deepEquals(handleCodeInApp, other.handleCodeInApp) && + _deepEquals(iOSBundleId, other.iOSBundleId) && + _deepEquals(androidPackageName, other.androidPackageName) && + _deepEquals(androidInstallApp, other.androidInstallApp) && + _deepEquals(androidMinimumVersion, other.androidMinimumVersion) && + _deepEquals(linkDomain, other.linkDomain); + } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + int get hashCode => _deepHash([runtimeType, ..._toList()]); } -class PigeonFirebaseAuthSettings { - PigeonFirebaseAuthSettings({ +class InternalFirebaseAuthSettings { + InternalFirebaseAuthSettings({ required this.appVerificationDisabledForTesting, this.userAccessGroup, this.phoneNumber, @@ -511,7 +934,7 @@ class PigeonFirebaseAuthSettings { bool? forceRecaptchaFlow; - Object encode() { + List _toList() { return [ appVerificationDisabledForTesting, userAccessGroup, @@ -521,9 +944,13 @@ class PigeonFirebaseAuthSettings { ]; } - static PigeonFirebaseAuthSettings decode(Object result) { + Object encode() { + return _toList(); + } + + static InternalFirebaseAuthSettings decode(Object result) { result as List; - return PigeonFirebaseAuthSettings( + return InternalFirebaseAuthSettings( appVerificationDisabledForTesting: result[0]! as bool, userAccessGroup: result[1] as String?, phoneNumber: result[2] as String?, @@ -531,10 +958,32 @@ class PigeonFirebaseAuthSettings { forceRecaptchaFlow: result[4] as bool?, ); } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + bool operator ==(Object other) { + if (other is! InternalFirebaseAuthSettings || + other.runtimeType != runtimeType) { + return false; + } + if (identical(this, other)) { + return true; + } + return _deepEquals(appVerificationDisabledForTesting, + other.appVerificationDisabledForTesting) && + _deepEquals(userAccessGroup, other.userAccessGroup) && + _deepEquals(phoneNumber, other.phoneNumber) && + _deepEquals(smsCode, other.smsCode) && + _deepEquals(forceRecaptchaFlow, other.forceRecaptchaFlow); + } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + int get hashCode => _deepHash([runtimeType, ..._toList()]); } -class PigeonSignInProvider { - PigeonSignInProvider({ +class InternalSignInProvider { + InternalSignInProvider({ required this.providerId, this.scopes, this.customParameters, @@ -546,7 +995,7 @@ class PigeonSignInProvider { Map? customParameters; - Object encode() { + List _toList() { return [ providerId, scopes, @@ -554,19 +1003,41 @@ class PigeonSignInProvider { ]; } - static PigeonSignInProvider decode(Object result) { + Object encode() { + return _toList(); + } + + static InternalSignInProvider decode(Object result) { result as List; - return PigeonSignInProvider( + return InternalSignInProvider( providerId: result[0]! as String, scopes: (result[1] as List?)?.cast(), customParameters: (result[2] as Map?)?.cast(), ); } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + bool operator ==(Object other) { + if (other is! InternalSignInProvider || other.runtimeType != runtimeType) { + return false; + } + if (identical(this, other)) { + return true; + } + return _deepEquals(providerId, other.providerId) && + _deepEquals(scopes, other.scopes) && + _deepEquals(customParameters, other.customParameters); + } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + int get hashCode => _deepHash([runtimeType, ..._toList()]); } -class PigeonVerifyPhoneNumberRequest { - PigeonVerifyPhoneNumberRequest({ +class InternalVerifyPhoneNumberRequest { + InternalVerifyPhoneNumberRequest({ this.phoneNumber, required this.timeout, this.forceResendingToken, @@ -587,7 +1058,7 @@ class PigeonVerifyPhoneNumberRequest { String? multiFactorSessionId; - Object encode() { + List _toList() { return [ phoneNumber, timeout, @@ -598,9 +1069,13 @@ class PigeonVerifyPhoneNumberRequest { ]; } - static PigeonVerifyPhoneNumberRequest decode(Object result) { + Object encode() { + return _toList(); + } + + static InternalVerifyPhoneNumberRequest decode(Object result) { result as List; - return PigeonVerifyPhoneNumberRequest( + return InternalVerifyPhoneNumberRequest( phoneNumber: result[0] as String?, timeout: result[1]! as int, forceResendingToken: result[2] as int?, @@ -609,10 +1084,33 @@ class PigeonVerifyPhoneNumberRequest { multiFactorSessionId: result[5] as String?, ); } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + bool operator ==(Object other) { + if (other is! InternalVerifyPhoneNumberRequest || + other.runtimeType != runtimeType) { + return false; + } + if (identical(this, other)) { + return true; + } + return _deepEquals(phoneNumber, other.phoneNumber) && + _deepEquals(timeout, other.timeout) && + _deepEquals(forceResendingToken, other.forceResendingToken) && + _deepEquals(autoRetrievedSmsCodeForTesting, + other.autoRetrievedSmsCodeForTesting) && + _deepEquals(multiFactorInfoId, other.multiFactorInfoId) && + _deepEquals(multiFactorSessionId, other.multiFactorSessionId); + } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + int get hashCode => _deepHash([runtimeType, ..._toList()]); } -class PigeonIdTokenResult { - PigeonIdTokenResult({ +class InternalIdTokenResult { + InternalIdTokenResult({ this.token, this.expirationTimestamp, this.authTimestamp, @@ -636,7 +1134,7 @@ class PigeonIdTokenResult { String? signInSecondFactor; - Object encode() { + List _toList() { return [ token, expirationTimestamp, @@ -648,9 +1146,13 @@ class PigeonIdTokenResult { ]; } - static PigeonIdTokenResult decode(Object result) { + Object encode() { + return _toList(); + } + + static InternalIdTokenResult decode(Object result) { result as List; - return PigeonIdTokenResult( + return InternalIdTokenResult( token: result[0] as String?, expirationTimestamp: result[1] as int?, authTimestamp: result[2] as int?, @@ -660,10 +1162,32 @@ class PigeonIdTokenResult { signInSecondFactor: result[6] as String?, ); } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + bool operator ==(Object other) { + if (other is! InternalIdTokenResult || other.runtimeType != runtimeType) { + return false; + } + if (identical(this, other)) { + return true; + } + return _deepEquals(token, other.token) && + _deepEquals(expirationTimestamp, other.expirationTimestamp) && + _deepEquals(authTimestamp, other.authTimestamp) && + _deepEquals(issuedAtTimestamp, other.issuedAtTimestamp) && + _deepEquals(signInProvider, other.signInProvider) && + _deepEquals(claims, other.claims) && + _deepEquals(signInSecondFactor, other.signInSecondFactor); + } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + int get hashCode => _deepHash([runtimeType, ..._toList()]); } -class PigeonUserProfile { - PigeonUserProfile({ +class InternalUserProfile { + InternalUserProfile({ this.displayName, this.photoUrl, required this.displayNameChanged, @@ -678,7 +1202,7 @@ class PigeonUserProfile { bool photoUrlChanged; - Object encode() { + List _toList() { return [ displayName, photoUrl, @@ -687,19 +1211,42 @@ class PigeonUserProfile { ]; } - static PigeonUserProfile decode(Object result) { + Object encode() { + return _toList(); + } + + static InternalUserProfile decode(Object result) { result as List; - return PigeonUserProfile( + return InternalUserProfile( displayName: result[0] as String?, photoUrl: result[1] as String?, displayNameChanged: result[2]! as bool, photoUrlChanged: result[3]! as bool, ); } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + bool operator ==(Object other) { + if (other is! InternalUserProfile || other.runtimeType != runtimeType) { + return false; + } + if (identical(this, other)) { + return true; + } + return _deepEquals(displayName, other.displayName) && + _deepEquals(photoUrl, other.photoUrl) && + _deepEquals(displayNameChanged, other.displayNameChanged) && + _deepEquals(photoUrlChanged, other.photoUrlChanged); + } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + int get hashCode => _deepHash([runtimeType, ..._toList()]); } -class PigeonTotpSecret { - PigeonTotpSecret({ +class InternalTotpSecret { + InternalTotpSecret({ this.codeIntervalSeconds, this.codeLength, this.enrollmentCompletionDeadline, @@ -717,7 +1264,7 @@ class PigeonTotpSecret { String secretKey; - Object encode() { + List _toList() { return [ codeIntervalSeconds, codeLength, @@ -727,9 +1274,13 @@ class PigeonTotpSecret { ]; } - static PigeonTotpSecret decode(Object result) { + Object encode() { + return _toList(); + } + + static InternalTotpSecret decode(Object result) { result as List; - return PigeonTotpSecret( + return InternalTotpSecret( codeIntervalSeconds: result[0] as int?, codeLength: result[1] as int?, enrollmentCompletionDeadline: result[2] as int?, @@ -737,66 +1288,96 @@ class PigeonTotpSecret { secretKey: result[4]! as String, ); } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + bool operator ==(Object other) { + if (other is! InternalTotpSecret || other.runtimeType != runtimeType) { + return false; + } + if (identical(this, other)) { + return true; + } + return _deepEquals(codeIntervalSeconds, other.codeIntervalSeconds) && + _deepEquals(codeLength, other.codeLength) && + _deepEquals( + enrollmentCompletionDeadline, other.enrollmentCompletionDeadline) && + _deepEquals(hashingAlgorithm, other.hashingAlgorithm) && + _deepEquals(secretKey, other.secretKey); + } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + int get hashCode => _deepHash([runtimeType, ..._toList()]); } -class _FirebaseAuthHostApiCodec extends StandardMessageCodec { - const _FirebaseAuthHostApiCodec(); +class _PigeonCodec extends StandardMessageCodec { + const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is AuthPigeonFirebaseApp) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else if (value is PigeonActionCodeInfo) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is ActionCodeInfoOperation) { buffer.putUint8(129); - writeValue(buffer, value.encode()); - } else if (value is PigeonActionCodeInfoData) { + writeValue(buffer, value.index); + } else if (value is InternalMultiFactorSession) { buffer.putUint8(130); writeValue(buffer, value.encode()); - } else if (value is PigeonActionCodeSettings) { + } else if (value is InternalPhoneMultiFactorAssertion) { buffer.putUint8(131); writeValue(buffer, value.encode()); - } else if (value is PigeonAdditionalUserInfo) { + } else if (value is InternalMultiFactorInfo) { buffer.putUint8(132); writeValue(buffer, value.encode()); - } else if (value is PigeonAuthCredential) { + } else if (value is AuthPigeonFirebaseApp) { buffer.putUint8(133); writeValue(buffer, value.encode()); - } else if (value is PigeonFirebaseAuthSettings) { + } else if (value is InternalActionCodeInfoData) { buffer.putUint8(134); writeValue(buffer, value.encode()); - } else if (value is PigeonIdTokenResult) { + } else if (value is InternalActionCodeInfo) { buffer.putUint8(135); writeValue(buffer, value.encode()); - } else if (value is PigeonMultiFactorInfo) { + } else if (value is InternalAdditionalUserInfo) { buffer.putUint8(136); writeValue(buffer, value.encode()); - } else if (value is PigeonMultiFactorSession) { + } else if (value is InternalAuthCredential) { buffer.putUint8(137); writeValue(buffer, value.encode()); - } else if (value is PigeonPhoneMultiFactorAssertion) { + } else if (value is InternalUserInfo) { buffer.putUint8(138); writeValue(buffer, value.encode()); - } else if (value is PigeonSignInProvider) { + } else if (value is InternalUserDetails) { buffer.putUint8(139); writeValue(buffer, value.encode()); - } else if (value is PigeonTotpSecret) { + } else if (value is InternalUserCredential) { buffer.putUint8(140); writeValue(buffer, value.encode()); - } else if (value is PigeonUserCredential) { + } else if (value is InternalAuthCredentialInput) { buffer.putUint8(141); writeValue(buffer, value.encode()); - } else if (value is PigeonUserDetails) { + } else if (value is InternalActionCodeSettings) { buffer.putUint8(142); writeValue(buffer, value.encode()); - } else if (value is PigeonUserInfo) { + } else if (value is InternalFirebaseAuthSettings) { buffer.putUint8(143); writeValue(buffer, value.encode()); - } else if (value is PigeonUserProfile) { + } else if (value is InternalSignInProvider) { buffer.putUint8(144); writeValue(buffer, value.encode()); - } else if (value is PigeonVerifyPhoneNumberRequest) { + } else if (value is InternalVerifyPhoneNumberRequest) { buffer.putUint8(145); writeValue(buffer, value.encode()); + } else if (value is InternalIdTokenResult) { + buffer.putUint8(146); + writeValue(buffer, value.encode()); + } else if (value is InternalUserProfile) { + buffer.putUint8(147); + writeValue(buffer, value.encode()); + } else if (value is InternalTotpSecret) { + buffer.putUint8(148); + writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); } @@ -805,42 +1386,47 @@ class _FirebaseAuthHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: - return AuthPigeonFirebaseApp.decode(readValue(buffer)!); case 129: - return PigeonActionCodeInfo.decode(readValue(buffer)!); + final value = readValue(buffer) as int?; + return value == null ? null : ActionCodeInfoOperation.values[value]; case 130: - return PigeonActionCodeInfoData.decode(readValue(buffer)!); + return InternalMultiFactorSession.decode(readValue(buffer)!); case 131: - return PigeonActionCodeSettings.decode(readValue(buffer)!); + return InternalPhoneMultiFactorAssertion.decode(readValue(buffer)!); case 132: - return PigeonAdditionalUserInfo.decode(readValue(buffer)!); + return InternalMultiFactorInfo.decode(readValue(buffer)!); case 133: - return PigeonAuthCredential.decode(readValue(buffer)!); + return AuthPigeonFirebaseApp.decode(readValue(buffer)!); case 134: - return PigeonFirebaseAuthSettings.decode(readValue(buffer)!); + return InternalActionCodeInfoData.decode(readValue(buffer)!); case 135: - return PigeonIdTokenResult.decode(readValue(buffer)!); + return InternalActionCodeInfo.decode(readValue(buffer)!); case 136: - return PigeonMultiFactorInfo.decode(readValue(buffer)!); + return InternalAdditionalUserInfo.decode(readValue(buffer)!); case 137: - return PigeonMultiFactorSession.decode(readValue(buffer)!); + return InternalAuthCredential.decode(readValue(buffer)!); case 138: - return PigeonPhoneMultiFactorAssertion.decode(readValue(buffer)!); + return InternalUserInfo.decode(readValue(buffer)!); case 139: - return PigeonSignInProvider.decode(readValue(buffer)!); + return InternalUserDetails.decode(readValue(buffer)!); case 140: - return PigeonTotpSecret.decode(readValue(buffer)!); + return InternalUserCredential.decode(readValue(buffer)!); case 141: - return PigeonUserCredential.decode(readValue(buffer)!); + return InternalAuthCredentialInput.decode(readValue(buffer)!); case 142: - return PigeonUserDetails.decode(readValue(buffer)!); + return InternalActionCodeSettings.decode(readValue(buffer)!); case 143: - return PigeonUserInfo.decode(readValue(buffer)!); + return InternalFirebaseAuthSettings.decode(readValue(buffer)!); case 144: - return PigeonUserProfile.decode(readValue(buffer)!); + return InternalSignInProvider.decode(readValue(buffer)!); case 145: - return PigeonVerifyPhoneNumberRequest.decode(readValue(buffer)!); + return InternalVerifyPhoneNumberRequest.decode(readValue(buffer)!); + case 146: + return InternalIdTokenResult.decode(readValue(buffer)!); + case 147: + return InternalUserProfile.decode(readValue(buffer)!); + case 148: + return InternalTotpSecret.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); } @@ -853,787 +1439,502 @@ class FirebaseAuthHostApi { /// BinaryMessenger will be used which routes to the host platform. FirebaseAuthHostApi( {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) - : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = + : pigeonVar_binaryMessenger = binaryMessenger, + pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - final BinaryMessenger? __pigeon_binaryMessenger; + final BinaryMessenger? pigeonVar_binaryMessenger; - static const MessageCodec pigeonChannelCodec = - _FirebaseAuthHostApiCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); - final String __pigeon_messageChannelSuffix; + final String pigeonVar_messageChannelSuffix; Future registerIdTokenListener(AuthPigeonFirebaseApp app) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.registerIdTokenListener$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.registerIdTokenListener$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = - await __pigeon_channel.send([app]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else if (__pigeon_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (__pigeon_replyList[0] as String?)!; - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as String; } Future registerAuthStateListener(AuthPigeonFirebaseApp app) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.registerAuthStateListener$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.registerAuthStateListener$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = - await __pigeon_channel.send([app]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else if (__pigeon_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (__pigeon_replyList[0] as String?)!; - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as String; } Future useEmulator( AuthPigeonFirebaseApp app, String host, int port) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.useEmulator$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.useEmulator$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = await __pigeon_channel - .send([app, host, port]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else { - return; - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, host, port]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future applyActionCode(AuthPigeonFirebaseApp app, String code) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.applyActionCode$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.applyActionCode$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = - await __pigeon_channel.send([app, code]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else { - return; - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, code]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } - Future checkActionCode( + Future checkActionCode( AuthPigeonFirebaseApp app, String code) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.checkActionCode$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.checkActionCode$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = - await __pigeon_channel.send([app, code]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else if (__pigeon_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (__pigeon_replyList[0] as PigeonActionCodeInfo?)!; - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, code]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as InternalActionCodeInfo; } Future confirmPasswordReset( AuthPigeonFirebaseApp app, String code, String newPassword) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.confirmPasswordReset$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.confirmPasswordReset$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = await __pigeon_channel - .send([app, code, newPassword]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else { - return; - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, code, newPassword]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } - Future createUserWithEmailAndPassword( + Future createUserWithEmailAndPassword( AuthPigeonFirebaseApp app, String email, String password) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.createUserWithEmailAndPassword$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.createUserWithEmailAndPassword$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = await __pigeon_channel - .send([app, email, password]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else if (__pigeon_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (__pigeon_replyList[0] as PigeonUserCredential?)!; - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, email, password]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as InternalUserCredential; } - Future signInAnonymously( + Future signInAnonymously( AuthPigeonFirebaseApp app) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.signInAnonymously$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.signInAnonymously$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = - await __pigeon_channel.send([app]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else if (__pigeon_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (__pigeon_replyList[0] as PigeonUserCredential?)!; - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as InternalUserCredential; } - Future signInWithCredential( + Future signInWithCredential( AuthPigeonFirebaseApp app, Map input) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.signInWithCredential$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.signInWithCredential$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = - await __pigeon_channel.send([app, input]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else if (__pigeon_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (__pigeon_replyList[0] as PigeonUserCredential?)!; - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, input]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as InternalUserCredential; } - Future signInWithCustomToken( + Future signInWithCustomToken( AuthPigeonFirebaseApp app, String token) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.signInWithCustomToken$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.signInWithCustomToken$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = - await __pigeon_channel.send([app, token]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else if (__pigeon_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (__pigeon_replyList[0] as PigeonUserCredential?)!; - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, token]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as InternalUserCredential; } - Future signInWithEmailAndPassword( + Future signInWithEmailAndPassword( AuthPigeonFirebaseApp app, String email, String password) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.signInWithEmailAndPassword$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.signInWithEmailAndPassword$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = await __pigeon_channel - .send([app, email, password]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else if (__pigeon_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (__pigeon_replyList[0] as PigeonUserCredential?)!; - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, email, password]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as InternalUserCredential; } - Future signInWithEmailLink( + Future signInWithEmailLink( AuthPigeonFirebaseApp app, String email, String emailLink) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.signInWithEmailLink$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.signInWithEmailLink$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = await __pigeon_channel - .send([app, email, emailLink]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else if (__pigeon_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (__pigeon_replyList[0] as PigeonUserCredential?)!; - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, email, emailLink]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as InternalUserCredential; } - Future signInWithProvider( - AuthPigeonFirebaseApp app, PigeonSignInProvider signInProvider) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.signInWithProvider$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + Future signInWithProvider( + AuthPigeonFirebaseApp app, InternalSignInProvider signInProvider) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.signInWithProvider$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = await __pigeon_channel - .send([app, signInProvider]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else if (__pigeon_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (__pigeon_replyList[0] as PigeonUserCredential?)!; - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, signInProvider]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as InternalUserCredential; } Future signOut(AuthPigeonFirebaseApp app) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.signOut$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.signOut$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = - await __pigeon_channel.send([app]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else { - return; - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } - Future> fetchSignInMethodsForEmail( + Future> fetchSignInMethodsForEmail( AuthPigeonFirebaseApp app, String email) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.fetchSignInMethodsForEmail$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.fetchSignInMethodsForEmail$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = - await __pigeon_channel.send([app, email]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else if (__pigeon_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (__pigeon_replyList[0] as List?)!.cast(); - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, email]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return (pigeonVar_replyValue! as List).cast(); } Future sendPasswordResetEmail(AuthPigeonFirebaseApp app, String email, - PigeonActionCodeSettings? actionCodeSettings) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.sendPasswordResetEmail$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + InternalActionCodeSettings? actionCodeSettings) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.sendPasswordResetEmail$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = await __pigeon_channel - .send([app, email, actionCodeSettings]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else { - return; - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, email, actionCodeSettings]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future sendSignInLinkToEmail(AuthPigeonFirebaseApp app, String email, - PigeonActionCodeSettings actionCodeSettings) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.sendSignInLinkToEmail$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + InternalActionCodeSettings actionCodeSettings) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.sendSignInLinkToEmail$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = await __pigeon_channel - .send([app, email, actionCodeSettings]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else { - return; - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, email, actionCodeSettings]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future setLanguageCode( AuthPigeonFirebaseApp app, String? languageCode) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.setLanguageCode$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.setLanguageCode$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = await __pigeon_channel - .send([app, languageCode]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else if (__pigeon_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (__pigeon_replyList[0] as String?)!; - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, languageCode]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as String; } Future setSettings( - AuthPigeonFirebaseApp app, PigeonFirebaseAuthSettings settings) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.setSettings$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + AuthPigeonFirebaseApp app, InternalFirebaseAuthSettings settings) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.setSettings$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = - await __pigeon_channel.send([app, settings]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else { - return; - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, settings]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future verifyPasswordResetCode( AuthPigeonFirebaseApp app, String code) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.verifyPasswordResetCode$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.verifyPasswordResetCode$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = - await __pigeon_channel.send([app, code]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else if (__pigeon_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (__pigeon_replyList[0] as String?)!; - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, code]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as String; } - Future verifyPhoneNumber( - AuthPigeonFirebaseApp app, PigeonVerifyPhoneNumberRequest request) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.verifyPhoneNumber$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + Future verifyPhoneNumber(AuthPigeonFirebaseApp app, + InternalVerifyPhoneNumberRequest request) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.verifyPhoneNumber$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = - await __pigeon_channel.send([app, request]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else if (__pigeon_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (__pigeon_replyList[0] as String?)!; - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, request]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as String; } Future revokeTokenWithAuthorizationCode( AuthPigeonFirebaseApp app, String authorizationCode) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.revokeTokenWithAuthorizationCode$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.revokeTokenWithAuthorizationCode$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = await __pigeon_channel - .send([app, authorizationCode]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else { - return; - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, authorizationCode]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future revokeAccessToken( AuthPigeonFirebaseApp app, String accessToken) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.revokeAccessToken$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.revokeAccessToken$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = await __pigeon_channel - .send([app, accessToken]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else { - return; - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, accessToken]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future initializeRecaptchaConfig(AuthPigeonFirebaseApp app) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.initializeRecaptchaConfig$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.initializeRecaptchaConfig$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = - await __pigeon_channel.send([app]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else { - return; - } - } -} - -class _FirebaseAuthUserHostApiCodec extends StandardMessageCodec { - const _FirebaseAuthUserHostApiCodec(); - @override - void writeValue(WriteBuffer buffer, Object? value) { - if (value is AuthPigeonFirebaseApp) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else if (value is PigeonActionCodeInfo) { - buffer.putUint8(129); - writeValue(buffer, value.encode()); - } else if (value is PigeonActionCodeInfoData) { - buffer.putUint8(130); - writeValue(buffer, value.encode()); - } else if (value is PigeonActionCodeSettings) { - buffer.putUint8(131); - writeValue(buffer, value.encode()); - } else if (value is PigeonAdditionalUserInfo) { - buffer.putUint8(132); - writeValue(buffer, value.encode()); - } else if (value is PigeonAuthCredential) { - buffer.putUint8(133); - writeValue(buffer, value.encode()); - } else if (value is PigeonFirebaseAuthSettings) { - buffer.putUint8(134); - writeValue(buffer, value.encode()); - } else if (value is PigeonIdTokenResult) { - buffer.putUint8(135); - writeValue(buffer, value.encode()); - } else if (value is PigeonMultiFactorInfo) { - buffer.putUint8(136); - writeValue(buffer, value.encode()); - } else if (value is PigeonMultiFactorSession) { - buffer.putUint8(137); - writeValue(buffer, value.encode()); - } else if (value is PigeonPhoneMultiFactorAssertion) { - buffer.putUint8(138); - writeValue(buffer, value.encode()); - } else if (value is PigeonSignInProvider) { - buffer.putUint8(139); - writeValue(buffer, value.encode()); - } else if (value is PigeonTotpSecret) { - buffer.putUint8(140); - writeValue(buffer, value.encode()); - } else if (value is PigeonUserCredential) { - buffer.putUint8(141); - writeValue(buffer, value.encode()); - } else if (value is PigeonUserDetails) { - buffer.putUint8(142); - writeValue(buffer, value.encode()); - } else if (value is PigeonUserInfo) { - buffer.putUint8(143); - writeValue(buffer, value.encode()); - } else if (value is PigeonUserProfile) { - buffer.putUint8(144); - writeValue(buffer, value.encode()); - } else if (value is PigeonVerifyPhoneNumberRequest) { - buffer.putUint8(145); - writeValue(buffer, value.encode()); - } else { - super.writeValue(buffer, value); - } - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - @override - Object? readValueOfType(int type, ReadBuffer buffer) { - switch (type) { - case 128: - return AuthPigeonFirebaseApp.decode(readValue(buffer)!); - case 129: - return PigeonActionCodeInfo.decode(readValue(buffer)!); - case 130: - return PigeonActionCodeInfoData.decode(readValue(buffer)!); - case 131: - return PigeonActionCodeSettings.decode(readValue(buffer)!); - case 132: - return PigeonAdditionalUserInfo.decode(readValue(buffer)!); - case 133: - return PigeonAuthCredential.decode(readValue(buffer)!); - case 134: - return PigeonFirebaseAuthSettings.decode(readValue(buffer)!); - case 135: - return PigeonIdTokenResult.decode(readValue(buffer)!); - case 136: - return PigeonMultiFactorInfo.decode(readValue(buffer)!); - case 137: - return PigeonMultiFactorSession.decode(readValue(buffer)!); - case 138: - return PigeonPhoneMultiFactorAssertion.decode(readValue(buffer)!); - case 139: - return PigeonSignInProvider.decode(readValue(buffer)!); - case 140: - return PigeonTotpSecret.decode(readValue(buffer)!); - case 141: - return PigeonUserCredential.decode(readValue(buffer)!); - case 142: - return PigeonUserDetails.decode(readValue(buffer)!); - case 143: - return PigeonUserInfo.decode(readValue(buffer)!); - case 144: - return PigeonUserProfile.decode(readValue(buffer)!); - case 145: - return PigeonVerifyPhoneNumberRequest.decode(readValue(buffer)!); - default: - return super.readValueOfType(type, buffer); - } + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } } @@ -1643,455 +1944,302 @@ class FirebaseAuthUserHostApi { /// BinaryMessenger will be used which routes to the host platform. FirebaseAuthUserHostApi( {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) - : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = + : pigeonVar_binaryMessenger = binaryMessenger, + pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - final BinaryMessenger? __pigeon_binaryMessenger; + final BinaryMessenger? pigeonVar_binaryMessenger; - static const MessageCodec pigeonChannelCodec = - _FirebaseAuthUserHostApiCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); - final String __pigeon_messageChannelSuffix; + final String pigeonVar_messageChannelSuffix; Future delete(AuthPigeonFirebaseApp app) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.delete$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.delete$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = - await __pigeon_channel.send([app]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else { - return; - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } - Future getIdToken( + Future getIdToken( AuthPigeonFirebaseApp app, bool forceRefresh) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.getIdToken$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.getIdToken$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = await __pigeon_channel - .send([app, forceRefresh]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else if (__pigeon_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (__pigeon_replyList[0] as PigeonIdTokenResult?)!; - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, forceRefresh]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as InternalIdTokenResult; } - Future linkWithCredential( + Future linkWithCredential( AuthPigeonFirebaseApp app, Map input) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.linkWithCredential$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.linkWithCredential$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = - await __pigeon_channel.send([app, input]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else if (__pigeon_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (__pigeon_replyList[0] as PigeonUserCredential?)!; - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, input]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as InternalUserCredential; } - Future linkWithProvider( - AuthPigeonFirebaseApp app, PigeonSignInProvider signInProvider) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.linkWithProvider$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + Future linkWithProvider( + AuthPigeonFirebaseApp app, InternalSignInProvider signInProvider) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.linkWithProvider$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = await __pigeon_channel - .send([app, signInProvider]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else if (__pigeon_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (__pigeon_replyList[0] as PigeonUserCredential?)!; - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, signInProvider]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as InternalUserCredential; } - Future reauthenticateWithCredential( + Future reauthenticateWithCredential( AuthPigeonFirebaseApp app, Map input) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.reauthenticateWithCredential$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.reauthenticateWithCredential$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = - await __pigeon_channel.send([app, input]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else if (__pigeon_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (__pigeon_replyList[0] as PigeonUserCredential?)!; - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, input]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as InternalUserCredential; } - Future reauthenticateWithProvider( - AuthPigeonFirebaseApp app, PigeonSignInProvider signInProvider) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.reauthenticateWithProvider$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + Future reauthenticateWithProvider( + AuthPigeonFirebaseApp app, InternalSignInProvider signInProvider) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.reauthenticateWithProvider$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = await __pigeon_channel - .send([app, signInProvider]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else if (__pigeon_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (__pigeon_replyList[0] as PigeonUserCredential?)!; - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, signInProvider]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as InternalUserCredential; } - Future reload(AuthPigeonFirebaseApp app) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.reload$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + Future reload(AuthPigeonFirebaseApp app) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.reload$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = - await __pigeon_channel.send([app]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else if (__pigeon_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (__pigeon_replyList[0] as PigeonUserDetails?)!; - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as InternalUserDetails; } Future sendEmailVerification(AuthPigeonFirebaseApp app, - PigeonActionCodeSettings? actionCodeSettings) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.sendEmailVerification$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + InternalActionCodeSettings? actionCodeSettings) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.sendEmailVerification$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = await __pigeon_channel - .send([app, actionCodeSettings]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else { - return; - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, actionCodeSettings]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } - Future unlink( + Future unlink( AuthPigeonFirebaseApp app, String providerId) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.unlink$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.unlink$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = await __pigeon_channel - .send([app, providerId]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else if (__pigeon_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (__pigeon_replyList[0] as PigeonUserCredential?)!; - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, providerId]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as InternalUserCredential; } - Future updateEmail( + Future updateEmail( AuthPigeonFirebaseApp app, String newEmail) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.updateEmail$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.updateEmail$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = - await __pigeon_channel.send([app, newEmail]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else if (__pigeon_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (__pigeon_replyList[0] as PigeonUserDetails?)!; - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, newEmail]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as InternalUserDetails; } - Future updatePassword( + Future updatePassword( AuthPigeonFirebaseApp app, String newPassword) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.updatePassword$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.updatePassword$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = await __pigeon_channel - .send([app, newPassword]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else if (__pigeon_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (__pigeon_replyList[0] as PigeonUserDetails?)!; - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, newPassword]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as InternalUserDetails; } - Future updatePhoneNumber( + Future updatePhoneNumber( AuthPigeonFirebaseApp app, Map input) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.updatePhoneNumber$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.updatePhoneNumber$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = - await __pigeon_channel.send([app, input]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else if (__pigeon_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (__pigeon_replyList[0] as PigeonUserDetails?)!; - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, input]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as InternalUserDetails; } - Future updateProfile( - AuthPigeonFirebaseApp app, PigeonUserProfile profile) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.updateProfile$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + Future updateProfile( + AuthPigeonFirebaseApp app, InternalUserProfile profile) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.updateProfile$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = - await __pigeon_channel.send([app, profile]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else if (__pigeon_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (__pigeon_replyList[0] as PigeonUserDetails?)!; - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, profile]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as InternalUserDetails; } Future verifyBeforeUpdateEmail(AuthPigeonFirebaseApp app, - String newEmail, PigeonActionCodeSettings? actionCodeSettings) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.verifyBeforeUpdateEmail$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + String newEmail, InternalActionCodeSettings? actionCodeSettings) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.verifyBeforeUpdateEmail$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = await __pigeon_channel - .send([app, newEmail, actionCodeSettings]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else { - return; - } - } -} - -class _MultiFactorUserHostApiCodec extends StandardMessageCodec { - const _MultiFactorUserHostApiCodec(); - @override - void writeValue(WriteBuffer buffer, Object? value) { - if (value is AuthPigeonFirebaseApp) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else if (value is PigeonMultiFactorInfo) { - buffer.putUint8(129); - writeValue(buffer, value.encode()); - } else if (value is PigeonMultiFactorSession) { - buffer.putUint8(130); - writeValue(buffer, value.encode()); - } else if (value is PigeonPhoneMultiFactorAssertion) { - buffer.putUint8(131); - writeValue(buffer, value.encode()); - } else { - super.writeValue(buffer, value); - } - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, newEmail, actionCodeSettings]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - @override - Object? readValueOfType(int type, ReadBuffer buffer) { - switch (type) { - case 128: - return AuthPigeonFirebaseApp.decode(readValue(buffer)!); - case 129: - return PigeonMultiFactorInfo.decode(readValue(buffer)!); - case 130: - return PigeonMultiFactorSession.decode(readValue(buffer)!); - case 131: - return PigeonPhoneMultiFactorAssertion.decode(readValue(buffer)!); - default: - return super.readValueOfType(type, buffer); - } + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } } @@ -2101,196 +2249,115 @@ class MultiFactorUserHostApi { /// BinaryMessenger will be used which routes to the host platform. MultiFactorUserHostApi( {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) - : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = + : pigeonVar_binaryMessenger = binaryMessenger, + pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - final BinaryMessenger? __pigeon_binaryMessenger; + final BinaryMessenger? pigeonVar_binaryMessenger; - static const MessageCodec pigeonChannelCodec = - _MultiFactorUserHostApiCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); - final String __pigeon_messageChannelSuffix; + final String pigeonVar_messageChannelSuffix; Future enrollPhone(AuthPigeonFirebaseApp app, - PigeonPhoneMultiFactorAssertion assertion, String? displayName) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorUserHostApi.enrollPhone$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + InternalPhoneMultiFactorAssertion assertion, String? displayName) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorUserHostApi.enrollPhone$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = await __pigeon_channel - .send([app, assertion, displayName]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else { - return; - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, assertion, displayName]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future enrollTotp(AuthPigeonFirebaseApp app, String assertionId, String? displayName) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorUserHostApi.enrollTotp$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorUserHostApi.enrollTotp$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = await __pigeon_channel - .send([app, assertionId, displayName]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else { - return; - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, assertionId, displayName]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } - Future getSession(AuthPigeonFirebaseApp app) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorUserHostApi.getSession$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + Future getSession( + AuthPigeonFirebaseApp app) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorUserHostApi.getSession$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = - await __pigeon_channel.send([app]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else if (__pigeon_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (__pigeon_replyList[0] as PigeonMultiFactorSession?)!; - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as InternalMultiFactorSession; } Future unenroll(AuthPigeonFirebaseApp app, String factorUid) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorUserHostApi.unenroll$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorUserHostApi.unenroll$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = await __pigeon_channel - .send([app, factorUid]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else { - return; - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, factorUid]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } - Future> getEnrolledFactors( + Future> getEnrolledFactors( AuthPigeonFirebaseApp app) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorUserHostApi.getEnrolledFactors$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorUserHostApi.getEnrolledFactors$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = - await __pigeon_channel.send([app]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else if (__pigeon_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (__pigeon_replyList[0] as List?)! - .cast(); - } - } -} - -class _MultiFactoResolverHostApiCodec extends StandardMessageCodec { - const _MultiFactoResolverHostApiCodec(); - @override - void writeValue(WriteBuffer buffer, Object? value) { - if (value is PigeonAdditionalUserInfo) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else if (value is PigeonAuthCredential) { - buffer.putUint8(129); - writeValue(buffer, value.encode()); - } else if (value is PigeonPhoneMultiFactorAssertion) { - buffer.putUint8(130); - writeValue(buffer, value.encode()); - } else if (value is PigeonUserCredential) { - buffer.putUint8(131); - writeValue(buffer, value.encode()); - } else if (value is PigeonUserDetails) { - buffer.putUint8(132); - writeValue(buffer, value.encode()); - } else if (value is PigeonUserInfo) { - buffer.putUint8(133); - writeValue(buffer, value.encode()); - } else { - super.writeValue(buffer, value); - } - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - @override - Object? readValueOfType(int type, ReadBuffer buffer) { - switch (type) { - case 128: - return PigeonAdditionalUserInfo.decode(readValue(buffer)!); - case 129: - return PigeonAuthCredential.decode(readValue(buffer)!); - case 130: - return PigeonPhoneMultiFactorAssertion.decode(readValue(buffer)!); - case 131: - return PigeonUserCredential.decode(readValue(buffer)!); - case 132: - return PigeonUserDetails.decode(readValue(buffer)!); - case 133: - return PigeonUserInfo.decode(readValue(buffer)!); - default: - return super.readValueOfType(type, buffer); - } + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return (pigeonVar_replyValue! as List) + .cast(); } } @@ -2300,70 +2367,36 @@ class MultiFactoResolverHostApi { /// BinaryMessenger will be used which routes to the host platform. MultiFactoResolverHostApi( {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) - : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = + : pigeonVar_binaryMessenger = binaryMessenger, + pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - final BinaryMessenger? __pigeon_binaryMessenger; + final BinaryMessenger? pigeonVar_binaryMessenger; - static const MessageCodec pigeonChannelCodec = - _MultiFactoResolverHostApiCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); - final String __pigeon_messageChannelSuffix; + final String pigeonVar_messageChannelSuffix; - Future resolveSignIn( + Future resolveSignIn( String resolverId, - PigeonPhoneMultiFactorAssertion? assertion, + InternalPhoneMultiFactorAssertion? assertion, String? totpAssertionId) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactoResolverHostApi.resolveSignIn$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactoResolverHostApi.resolveSignIn$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = await __pigeon_channel - .send([resolverId, assertion, totpAssertionId]) - as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else if (__pigeon_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (__pigeon_replyList[0] as PigeonUserCredential?)!; - } - } -} - -class _MultiFactorTotpHostApiCodec extends StandardMessageCodec { - const _MultiFactorTotpHostApiCodec(); - @override - void writeValue(WriteBuffer buffer, Object? value) { - if (value is PigeonTotpSecret) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else { - super.writeValue(buffer, value); - } - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = pigeonVar_channel + .send([resolverId, assertion, totpAssertionId]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - @override - Object? readValueOfType(int type, ReadBuffer buffer) { - switch (type) { - case 128: - return PigeonTotpSecret.decode(readValue(buffer)!); - default: - return super.readValueOfType(type, buffer); - } + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as InternalUserCredential; } } @@ -2373,103 +2406,75 @@ class MultiFactorTotpHostApi { /// BinaryMessenger will be used which routes to the host platform. MultiFactorTotpHostApi( {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) - : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = + : pigeonVar_binaryMessenger = binaryMessenger, + pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - final BinaryMessenger? __pigeon_binaryMessenger; + final BinaryMessenger? pigeonVar_binaryMessenger; - static const MessageCodec pigeonChannelCodec = - _MultiFactorTotpHostApiCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); - final String __pigeon_messageChannelSuffix; + final String pigeonVar_messageChannelSuffix; - Future generateSecret(String sessionId) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorTotpHostApi.generateSecret$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + Future generateSecret(String sessionId) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorTotpHostApi.generateSecret$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = - await __pigeon_channel.send([sessionId]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else if (__pigeon_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (__pigeon_replyList[0] as PigeonTotpSecret?)!; - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([sessionId]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as InternalTotpSecret; } Future getAssertionForEnrollment( String secretKey, String oneTimePassword) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorTotpHostApi.getAssertionForEnrollment$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorTotpHostApi.getAssertionForEnrollment$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = await __pigeon_channel - .send([secretKey, oneTimePassword]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else if (__pigeon_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (__pigeon_replyList[0] as String?)!; - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([secretKey, oneTimePassword]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as String; } Future getAssertionForSignIn( String enrollmentId, String oneTimePassword) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorTotpHostApi.getAssertionForSignIn$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorTotpHostApi.getAssertionForSignIn$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = await __pigeon_channel - .send([enrollmentId, oneTimePassword]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else if (__pigeon_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (__pigeon_replyList[0] as String?)!; - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([enrollmentId, oneTimePassword]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as String; } } @@ -2479,91 +2484,53 @@ class MultiFactorTotpSecretHostApi { /// BinaryMessenger will be used which routes to the host platform. MultiFactorTotpSecretHostApi( {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) - : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = + : pigeonVar_binaryMessenger = binaryMessenger, + pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - final BinaryMessenger? __pigeon_binaryMessenger; + final BinaryMessenger? pigeonVar_binaryMessenger; - static const MessageCodec pigeonChannelCodec = - StandardMessageCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); - final String __pigeon_messageChannelSuffix; + final String pigeonVar_messageChannelSuffix; Future generateQrCodeUrl( String secretKey, String? accountName, String? issuer) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorTotpSecretHostApi.generateQrCodeUrl$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorTotpSecretHostApi.generateQrCodeUrl$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = await __pigeon_channel - .send([secretKey, accountName, issuer]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else if (__pigeon_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (__pigeon_replyList[0] as String?)!; - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([secretKey, accountName, issuer]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as String; } Future openInOtpApp(String secretKey, String qrCodeUrl) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorTotpSecretHostApi.openInOtpApp$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorTotpSecretHostApi.openInOtpApp$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = await __pigeon_channel - .send([secretKey, qrCodeUrl]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else { - return; - } - } -} - -class _GenerateInterfacesCodec extends StandardMessageCodec { - const _GenerateInterfacesCodec(); - @override - void writeValue(WriteBuffer buffer, Object? value) { - if (value is PigeonMultiFactorInfo) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else { - super.writeValue(buffer, value); - } - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([secretKey, qrCodeUrl]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - @override - Object? readValueOfType(int type, ReadBuffer buffer) { - switch (type) { - case 128: - return PigeonMultiFactorInfo.decode(readValue(buffer)!); - default: - return super.readValueOfType(type, buffer); - } + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } } @@ -2574,37 +2541,31 @@ class GenerateInterfaces { /// BinaryMessenger will be used which routes to the host platform. GenerateInterfaces( {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) - : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = + : pigeonVar_binaryMessenger = binaryMessenger, + pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - final BinaryMessenger? __pigeon_binaryMessenger; + final BinaryMessenger? pigeonVar_binaryMessenger; - static const MessageCodec pigeonChannelCodec = - _GenerateInterfacesCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); - final String __pigeon_messageChannelSuffix; + final String pigeonVar_messageChannelSuffix; - Future pigeonInterface(PigeonMultiFactorInfo info) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.firebase_auth_platform_interface.GenerateInterfaces.pigeonInterface$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, + Future pigeonInterface(InternalMultiFactorInfo info) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_auth_platform_interface.GenerateInterfaces.pigeonInterface$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = - await __pigeon_channel.send([info]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else { - return; - } + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([info]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } } diff --git a/packages/firebase_auth/firebase_auth_platform_interface/lib/src/platform_interface/platform_interface_firebase_auth.dart b/packages/firebase_auth/firebase_auth_platform_interface/lib/src/platform_interface/platform_interface_firebase_auth.dart index 7b5feff9d4e5..daa5b730a3b6 100644 --- a/packages/firebase_auth/firebase_auth_platform_interface/lib/src/platform_interface/platform_interface_firebase_auth.dart +++ b/packages/firebase_auth/firebase_auth_platform_interface/lib/src/platform_interface/platform_interface_firebase_auth.dart @@ -64,9 +64,9 @@ abstract class FirebaseAuthPlatform extends PlatformInterface { if (currentUser != null) { currentUser as List; - final firstElement = PigeonUserInfo.decode(currentUser[0]!); + final firstElement = InternalUserInfo.decode(currentUser[0]!); final secondElement = currentUser[1]!; - currentUser = PigeonUserDetails.decode([firstElement, secondElement]); + currentUser = InternalUserDetails.decode([firstElement, secondElement]); } return FirebaseAuthPlatform.instance.delegateFor(app: app).setInitialValues( languageCode: pluginConstants['APP_LANGUAGE_CODE'], @@ -107,7 +107,7 @@ abstract class FirebaseAuthPlatform extends PlatformInterface { /// calls. @protected FirebaseAuthPlatform setInitialValues({ - PigeonUserDetails? currentUser, + InternalUserDetails? currentUser, String? languageCode, }) { throw UnimplementedError('setInitialValues() is not implemented'); diff --git a/packages/firebase_auth/firebase_auth_platform_interface/lib/src/platform_interface/platform_interface_user.dart b/packages/firebase_auth/firebase_auth_platform_interface/lib/src/platform_interface/platform_interface_user.dart index 3d442b33b9af..52a5988059e0 100644 --- a/packages/firebase_auth/firebase_auth_platform_interface/lib/src/platform_interface/platform_interface_user.dart +++ b/packages/firebase_auth/firebase_auth_platform_interface/lib/src/platform_interface/platform_interface_user.dart @@ -11,7 +11,7 @@ import 'package:plugin_platform_interface/plugin_platform_interface.dart'; /// A user account. abstract class UserPlatform extends PlatformInterface { // ignore: public_member_api_docs - UserPlatform(this.auth, this.multiFactor, PigeonUserDetails user) + UserPlatform(this.auth, this.multiFactor, InternalUserDetails user) : _user = user, super(token: _token); @@ -27,7 +27,7 @@ abstract class UserPlatform extends PlatformInterface { final MultiFactorPlatform multiFactor; - final PigeonUserDetails _user; + final InternalUserDetails _user; /// The users display name. /// diff --git a/packages/firebase_auth/firebase_auth_platform_interface/lib/src/user_info.dart b/packages/firebase_auth/firebase_auth_platform_interface/lib/src/user_info.dart index ddccb0f8cded..b4936290a156 100644 --- a/packages/firebase_auth/firebase_auth_platform_interface/lib/src/user_info.dart +++ b/packages/firebase_auth/firebase_auth_platform_interface/lib/src/user_info.dart @@ -14,7 +14,7 @@ class UserInfo { @protected UserInfo.fromJson(Map data) - : _data = PigeonUserInfo( + : _data = InternalUserInfo( uid: data['uid'] as String, email: data['email'] as String?, displayName: data['displayName'] as String?, @@ -29,7 +29,7 @@ class UserInfo { lastSignInTimestamp: data['lastSignInTimestamp'] as int?, ); - final PigeonUserInfo _data; + final InternalUserInfo _data; /// The users display name. /// diff --git a/packages/firebase_auth/firebase_auth_platform_interface/pigeons/messages.dart b/packages/firebase_auth/firebase_auth_platform_interface/pigeons/messages.dart index 6a2e99337c5c..943fa1693b87 100644 --- a/packages/firebase_auth/firebase_auth_platform_interface/pigeons/messages.dart +++ b/packages/firebase_auth/firebase_auth_platform_interface/pigeons/messages.dart @@ -27,16 +27,16 @@ import 'package:pigeon/pigeon.dart'; copyrightHeader: 'pigeons/copyright.txt', ), ) -class PigeonMultiFactorSession { - const PigeonMultiFactorSession({ +class InternalMultiFactorSession { + const InternalMultiFactorSession({ required this.id, }); final String id; } -class PigeonPhoneMultiFactorAssertion { - const PigeonPhoneMultiFactorAssertion({ +class InternalPhoneMultiFactorAssertion { + const InternalPhoneMultiFactorAssertion({ required this.verificationId, required this.verificationCode, }); @@ -45,8 +45,8 @@ class PigeonPhoneMultiFactorAssertion { final String verificationCode; } -class PigeonMultiFactorInfo { - const PigeonMultiFactorInfo({ +class InternalMultiFactorInfo { + const InternalMultiFactorInfo({ this.displayName, required this.enrollmentTimestamp, this.factorId, @@ -100,8 +100,8 @@ enum ActionCodeInfoOperation { revertSecondFactorAddition, } -class PigeonActionCodeInfoData { - const PigeonActionCodeInfoData({ +class InternalActionCodeInfoData { + const InternalActionCodeInfoData({ this.email, this.previousEmail, }); @@ -110,18 +110,18 @@ class PigeonActionCodeInfoData { final String? previousEmail; } -class PigeonActionCodeInfo { - const PigeonActionCodeInfo({ +class InternalActionCodeInfo { + const InternalActionCodeInfo({ required this.operation, required this.data, }); final ActionCodeInfoOperation operation; - final PigeonActionCodeInfoData data; + final InternalActionCodeInfoData data; } -class PigeonAdditionalUserInfo { - const PigeonAdditionalUserInfo({ +class InternalAdditionalUserInfo { + const InternalAdditionalUserInfo({ required this.isNewUser, required this.providerId, required this.username, @@ -136,8 +136,8 @@ class PigeonAdditionalUserInfo { final Map? profile; } -class PigeonAuthCredential { - const PigeonAuthCredential({ +class InternalAuthCredential { + const InternalAuthCredential({ required this.providerId, required this.signInMethod, required this.nativeId, @@ -150,8 +150,8 @@ class PigeonAuthCredential { final String? accessToken; } -class PigeonUserInfo { - const PigeonUserInfo({ +class InternalUserInfo { + const InternalUserInfo({ required this.uid, required this.email, required this.displayName, @@ -180,30 +180,30 @@ class PigeonUserInfo { final int? lastSignInTimestamp; } -class PigeonUserDetails { - const PigeonUserDetails({ +class InternalUserDetails { + const InternalUserDetails({ required this.userInfo, required this.providerData, }); - final PigeonUserInfo userInfo; + final InternalUserInfo userInfo; final List?> providerData; } -class PigeonUserCredential { - const PigeonUserCredential({ +class InternalUserCredential { + const InternalUserCredential({ required this.user, required this.additionalUserInfo, required this.credential, }); - final PigeonUserDetails? user; - final PigeonAdditionalUserInfo? additionalUserInfo; - final PigeonAuthCredential? credential; + final InternalUserDetails? user; + final InternalAdditionalUserInfo? additionalUserInfo; + final InternalAuthCredential? credential; } -class PigeonAuthCredentialInput { - const PigeonAuthCredentialInput({ +class InternalAuthCredentialInput { + const InternalAuthCredentialInput({ required this.providerId, required this.signInMethod, required this.token, @@ -216,8 +216,8 @@ class PigeonAuthCredentialInput { final String? accessToken; } -class PigeonActionCodeSettings { - const PigeonActionCodeSettings({ +class InternalActionCodeSettings { + const InternalActionCodeSettings({ required this.url, required this.dynamicLinkDomain, required this.linkDomain, @@ -238,8 +238,8 @@ class PigeonActionCodeSettings { final String? linkDomain; } -class PigeonFirebaseAuthSettings { - const PigeonFirebaseAuthSettings({ +class InternalFirebaseAuthSettings { + const InternalFirebaseAuthSettings({ required this.appVerificationDisabledForTesting, required this.userAccessGroup, required this.phoneNumber, @@ -254,8 +254,8 @@ class PigeonFirebaseAuthSettings { final bool? forceRecaptchaFlow; } -class PigeonSignInProvider { - const PigeonSignInProvider({ +class InternalSignInProvider { + const InternalSignInProvider({ required this.providerId, required this.scopes, required this.customParameters, @@ -266,8 +266,8 @@ class PigeonSignInProvider { final Map? customParameters; } -class PigeonVerifyPhoneNumberRequest { - const PigeonVerifyPhoneNumberRequest({ +class InternalVerifyPhoneNumberRequest { + const InternalVerifyPhoneNumberRequest({ required this.phoneNumber, required this.timeout, required this.forceResendingToken, @@ -310,7 +310,7 @@ abstract class FirebaseAuthHostApi { ); @async - PigeonActionCodeInfo checkActionCode( + InternalActionCodeInfo checkActionCode( AuthPigeonFirebaseApp app, String code, ); @@ -323,47 +323,47 @@ abstract class FirebaseAuthHostApi { ); @async - PigeonUserCredential createUserWithEmailAndPassword( + InternalUserCredential createUserWithEmailAndPassword( AuthPigeonFirebaseApp app, String email, String password, ); @async - PigeonUserCredential signInAnonymously( + InternalUserCredential signInAnonymously( AuthPigeonFirebaseApp app, ); @async - PigeonUserCredential signInWithCredential( + InternalUserCredential signInWithCredential( AuthPigeonFirebaseApp app, - Map input, + Map input, ); @async - PigeonUserCredential signInWithCustomToken( + InternalUserCredential signInWithCustomToken( AuthPigeonFirebaseApp app, String token, ); @async - PigeonUserCredential signInWithEmailAndPassword( + InternalUserCredential signInWithEmailAndPassword( AuthPigeonFirebaseApp app, String email, String password, ); @async - PigeonUserCredential signInWithEmailLink( + InternalUserCredential signInWithEmailLink( AuthPigeonFirebaseApp app, String email, String emailLink, ); @async - PigeonUserCredential signInWithProvider( + InternalUserCredential signInWithProvider( AuthPigeonFirebaseApp app, - PigeonSignInProvider signInProvider, + InternalSignInProvider signInProvider, ); @async @@ -381,14 +381,14 @@ abstract class FirebaseAuthHostApi { void sendPasswordResetEmail( AuthPigeonFirebaseApp app, String email, - PigeonActionCodeSettings? actionCodeSettings, + InternalActionCodeSettings? actionCodeSettings, ); @async void sendSignInLinkToEmail( AuthPigeonFirebaseApp app, String email, - PigeonActionCodeSettings actionCodeSettings, + InternalActionCodeSettings actionCodeSettings, ); @async @@ -400,7 +400,7 @@ abstract class FirebaseAuthHostApi { @async void setSettings( AuthPigeonFirebaseApp app, - PigeonFirebaseAuthSettings settings, + InternalFirebaseAuthSettings settings, ); @async @@ -412,7 +412,7 @@ abstract class FirebaseAuthHostApi { @async String verifyPhoneNumber( AuthPigeonFirebaseApp app, - PigeonVerifyPhoneNumberRequest request, + InternalVerifyPhoneNumberRequest request, ); @async void revokeTokenWithAuthorizationCode( @@ -432,8 +432,8 @@ abstract class FirebaseAuthHostApi { ); } -class PigeonIdTokenResult { - const PigeonIdTokenResult({ +class InternalIdTokenResult { + const InternalIdTokenResult({ required this.token, required this.expirationTimestamp, required this.authTimestamp, @@ -452,8 +452,8 @@ class PigeonIdTokenResult { final String? signInSecondFactor; } -class PigeonUserProfile { - const PigeonUserProfile({ +class InternalUserProfile { + const InternalUserProfile({ required this.displayName, required this.photoUrl, required this.displayNameChanged, @@ -474,81 +474,81 @@ abstract class FirebaseAuthUserHostApi { ); @async - PigeonIdTokenResult getIdToken( + InternalIdTokenResult getIdToken( AuthPigeonFirebaseApp app, bool forceRefresh, ); @async - PigeonUserCredential linkWithCredential( + InternalUserCredential linkWithCredential( AuthPigeonFirebaseApp app, - Map input, + Map input, ); @async - PigeonUserCredential linkWithProvider( + InternalUserCredential linkWithProvider( AuthPigeonFirebaseApp app, - PigeonSignInProvider signInProvider, + InternalSignInProvider signInProvider, ); @async - PigeonUserCredential reauthenticateWithCredential( + InternalUserCredential reauthenticateWithCredential( AuthPigeonFirebaseApp app, - Map input, + Map input, ); @async - PigeonUserCredential reauthenticateWithProvider( + InternalUserCredential reauthenticateWithProvider( AuthPigeonFirebaseApp app, - PigeonSignInProvider signInProvider, + InternalSignInProvider signInProvider, ); @async - PigeonUserDetails reload( + InternalUserDetails reload( AuthPigeonFirebaseApp app, ); @async void sendEmailVerification( AuthPigeonFirebaseApp app, - PigeonActionCodeSettings? actionCodeSettings, + InternalActionCodeSettings? actionCodeSettings, ); @async - PigeonUserCredential unlink( + InternalUserCredential unlink( AuthPigeonFirebaseApp app, String providerId, ); @async - PigeonUserDetails updateEmail( + InternalUserDetails updateEmail( AuthPigeonFirebaseApp app, String newEmail, ); @async - PigeonUserDetails updatePassword( + InternalUserDetails updatePassword( AuthPigeonFirebaseApp app, String newPassword, ); @async - PigeonUserDetails updatePhoneNumber( + InternalUserDetails updatePhoneNumber( AuthPigeonFirebaseApp app, - Map input, + Map input, ); @async - PigeonUserDetails updateProfile( + InternalUserDetails updateProfile( AuthPigeonFirebaseApp app, - PigeonUserProfile profile, + InternalUserProfile profile, ); @async void verifyBeforeUpdateEmail( AuthPigeonFirebaseApp app, String newEmail, - PigeonActionCodeSettings? actionCodeSettings, + InternalActionCodeSettings? actionCodeSettings, ); } @@ -557,7 +557,7 @@ abstract class MultiFactorUserHostApi { @async void enrollPhone( AuthPigeonFirebaseApp app, - PigeonPhoneMultiFactorAssertion assertion, + InternalPhoneMultiFactorAssertion assertion, String? displayName, ); @@ -569,7 +569,7 @@ abstract class MultiFactorUserHostApi { ); @async - PigeonMultiFactorSession getSession( + InternalMultiFactorSession getSession( AuthPigeonFirebaseApp app, ); @@ -580,7 +580,7 @@ abstract class MultiFactorUserHostApi { ); @async - List getEnrolledFactors( + List getEnrolledFactors( AuthPigeonFirebaseApp app, ); } @@ -588,15 +588,15 @@ abstract class MultiFactorUserHostApi { @HostApi(dartHostTestHandler: 'TestMultiFactoResolverHostApi') abstract class MultiFactoResolverHostApi { @async - PigeonUserCredential resolveSignIn( + InternalUserCredential resolveSignIn( String resolverId, - PigeonPhoneMultiFactorAssertion? assertion, + InternalPhoneMultiFactorAssertion? assertion, String? totpAssertionId, ); } -class PigeonTotpSecret { - const PigeonTotpSecret({ +class InternalTotpSecret { + const InternalTotpSecret({ required this.codeIntervalSeconds, required this.codeLength, required this.enrollmentCompletionDeadline, @@ -614,7 +614,7 @@ class PigeonTotpSecret { @HostApi(dartHostTestHandler: 'TestMultiFactoResolverHostApi') abstract class MultiFactorTotpHostApi { @async - PigeonTotpSecret generateSecret( + InternalTotpSecret generateSecret( String sessionId, ); @@ -650,5 +650,5 @@ abstract class MultiFactorTotpSecretHostApi { /// Only used to generate the object interface that are use outside of the Pigeon interface @HostApi() abstract class GenerateInterfaces { - void pigeonInterface(PigeonMultiFactorInfo info); + void pigeonInterface(InternalMultiFactorInfo info); } diff --git a/packages/firebase_auth/firebase_auth_platform_interface/pubspec.yaml b/packages/firebase_auth/firebase_auth_platform_interface/pubspec.yaml index 5e6e5a694c1b..41c73626e13c 100644 --- a/packages/firebase_auth/firebase_auth_platform_interface/pubspec.yaml +++ b/packages/firebase_auth/firebase_auth_platform_interface/pubspec.yaml @@ -25,7 +25,7 @@ dev_dependencies: flutter_test: sdk: flutter mockito: ^5.4.0 - pigeon: 19.0.0 + pigeon: 26.3.4 # NOTE: This is a temporary workaround for Flutter 3.13 watcher: ^1.1.0 diff --git a/packages/firebase_auth/firebase_auth_platform_interface/test/id_token_result_test.dart b/packages/firebase_auth/firebase_auth_platform_interface/test/id_token_result_test.dart index 556f6645a33e..9a13f6b58be6 100644 --- a/packages/firebase_auth/firebase_auth_platform_interface/test/id_token_result_test.dart +++ b/packages/firebase_auth/firebase_auth_platform_interface/test/id_token_result_test.dart @@ -18,7 +18,7 @@ void main() { 'claim1': 'value1', }; - final kMockData = PigeonIdTokenResult( + final kMockData = InternalIdTokenResult( claims: kMockClaims, issuedAtTimestamp: kMockIssuedAtTimestamp, authTimestamp: kMockAuthTimestamp, @@ -52,7 +52,7 @@ void main() { }); test('returns null when data[claims] is null', () { - final kMockData = PigeonIdTokenResult( + final kMockData = InternalIdTokenResult( issuedAtTimestamp: kMockIssuedAtTimestamp, authTimestamp: kMockAuthTimestamp, expirationTimestamp: kMockExpirationTimestamp, diff --git a/packages/firebase_auth/firebase_auth_platform_interface/test/method_channel_tests/method_channel_user_credential_test.dart b/packages/firebase_auth/firebase_auth_platform_interface/test/method_channel_tests/method_channel_user_credential_test.dart index d35bcefe3bba..47fcbbd849d5 100644 --- a/packages/firebase_auth/firebase_auth_platform_interface/test/method_channel_tests/method_channel_user_credential_test.dart +++ b/packages/firebase_auth/firebase_auth_platform_interface/test/method_channel_tests/method_channel_user_credential_test.dart @@ -24,9 +24,9 @@ void main() { group('$MethodChannelUserCredential()', () { late MethodChannelUserCredential userCredential; - PigeonUserCredential userData = PigeonUserCredential( - user: PigeonUserDetails( - userInfo: PigeonUserInfo( + InternalUserCredential userData = InternalUserCredential( + user: InternalUserDetails( + userInfo: InternalUserInfo( uid: kMockUid, email: kMockEmail, isAnonymous: false, @@ -34,13 +34,13 @@ void main() { ), providerData: [], ), - additionalUserInfo: PigeonAdditionalUserInfo( + additionalUserInfo: InternalAdditionalUserInfo( isNewUser: true, profile: {'foo': 'bar'}, providerId: 'info$kMockProviderId', username: 'info$kMockUsername', ), - credential: PigeonAuthCredential( + credential: InternalAuthCredential( providerId: 'auth$kMockProviderId', signInMethod: kMockSignInMethod, nativeId: 0, @@ -55,9 +55,9 @@ void main() { }); setUp(() { - final kMockInitialUserData = PigeonUserCredential( - user: PigeonUserDetails( - userInfo: PigeonUserInfo( + final kMockInitialUserData = InternalUserCredential( + user: InternalUserDetails( + userInfo: InternalUserInfo( uid: kMockUid, email: kMockEmail, isAnonymous: false, @@ -65,13 +65,13 @@ void main() { ), providerData: [], ), - additionalUserInfo: PigeonAdditionalUserInfo( + additionalUserInfo: InternalAdditionalUserInfo( isNewUser: true, profile: {'foo': 'bar'}, providerId: 'info$kMockProviderId', username: 'info$kMockUsername', ), - credential: PigeonAuthCredential( + credential: InternalAuthCredential( providerId: 'auth$kMockProviderId', signInMethod: kMockSignInMethod, nativeId: 0, diff --git a/packages/firebase_auth/firebase_auth_platform_interface/test/pigeon/test_api.dart b/packages/firebase_auth/firebase_auth_platform_interface/test/pigeon/test_api.dart index b252487d4592..5dcc22207592 100644 --- a/packages/firebase_auth/firebase_auth_platform_interface/test/pigeon/test_api.dart +++ b/packages/firebase_auth/firebase_auth_platform_interface/test/pigeon/test_api.dart @@ -1,9 +1,9 @@ // Copyright 2023, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v19.0.0), do not edit directly. +// Autogenerated from Pigeon (v26.3.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, unnecessary_import, no_leading_underscores_for_local_identifiers +// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, unnecessary_import, no_leading_underscores_for_local_identifiers, omit_obvious_local_variable_types // ignore_for_file: avoid_relative_lib_imports import 'dart:async'; import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; @@ -13,64 +13,73 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:firebase_auth_platform_interface/src/pigeon/messages.pigeon.dart'; -class _TestFirebaseAuthHostApiCodec extends StandardMessageCodec { - const _TestFirebaseAuthHostApiCodec(); +class _PigeonCodec extends StandardMessageCodec { + const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is AuthPigeonFirebaseApp) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else if (value is PigeonActionCodeInfo) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is ActionCodeInfoOperation) { buffer.putUint8(129); - writeValue(buffer, value.encode()); - } else if (value is PigeonActionCodeInfoData) { + writeValue(buffer, value.index); + } else if (value is InternalMultiFactorSession) { buffer.putUint8(130); writeValue(buffer, value.encode()); - } else if (value is PigeonActionCodeSettings) { + } else if (value is InternalPhoneMultiFactorAssertion) { buffer.putUint8(131); writeValue(buffer, value.encode()); - } else if (value is PigeonAdditionalUserInfo) { + } else if (value is InternalMultiFactorInfo) { buffer.putUint8(132); writeValue(buffer, value.encode()); - } else if (value is PigeonAuthCredential) { + } else if (value is AuthPigeonFirebaseApp) { buffer.putUint8(133); writeValue(buffer, value.encode()); - } else if (value is PigeonFirebaseAuthSettings) { + } else if (value is InternalActionCodeInfoData) { buffer.putUint8(134); writeValue(buffer, value.encode()); - } else if (value is PigeonIdTokenResult) { + } else if (value is InternalActionCodeInfo) { buffer.putUint8(135); writeValue(buffer, value.encode()); - } else if (value is PigeonMultiFactorInfo) { + } else if (value is InternalAdditionalUserInfo) { buffer.putUint8(136); writeValue(buffer, value.encode()); - } else if (value is PigeonMultiFactorSession) { + } else if (value is InternalAuthCredential) { buffer.putUint8(137); writeValue(buffer, value.encode()); - } else if (value is PigeonPhoneMultiFactorAssertion) { + } else if (value is InternalUserInfo) { buffer.putUint8(138); writeValue(buffer, value.encode()); - } else if (value is PigeonSignInProvider) { + } else if (value is InternalUserDetails) { buffer.putUint8(139); writeValue(buffer, value.encode()); - } else if (value is PigeonTotpSecret) { + } else if (value is InternalUserCredential) { buffer.putUint8(140); writeValue(buffer, value.encode()); - } else if (value is PigeonUserCredential) { + } else if (value is InternalAuthCredentialInput) { buffer.putUint8(141); writeValue(buffer, value.encode()); - } else if (value is PigeonUserDetails) { + } else if (value is InternalActionCodeSettings) { buffer.putUint8(142); writeValue(buffer, value.encode()); - } else if (value is PigeonUserInfo) { + } else if (value is InternalFirebaseAuthSettings) { buffer.putUint8(143); writeValue(buffer, value.encode()); - } else if (value is PigeonUserProfile) { + } else if (value is InternalSignInProvider) { buffer.putUint8(144); writeValue(buffer, value.encode()); - } else if (value is PigeonVerifyPhoneNumberRequest) { + } else if (value is InternalVerifyPhoneNumberRequest) { buffer.putUint8(145); writeValue(buffer, value.encode()); + } else if (value is InternalIdTokenResult) { + buffer.putUint8(146); + writeValue(buffer, value.encode()); + } else if (value is InternalUserProfile) { + buffer.putUint8(147); + writeValue(buffer, value.encode()); + } else if (value is InternalTotpSecret) { + buffer.putUint8(148); + writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); } @@ -79,42 +88,47 @@ class _TestFirebaseAuthHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: - return AuthPigeonFirebaseApp.decode(readValue(buffer)!); case 129: - return PigeonActionCodeInfo.decode(readValue(buffer)!); + final value = readValue(buffer) as int?; + return value == null ? null : ActionCodeInfoOperation.values[value]; case 130: - return PigeonActionCodeInfoData.decode(readValue(buffer)!); + return InternalMultiFactorSession.decode(readValue(buffer)!); case 131: - return PigeonActionCodeSettings.decode(readValue(buffer)!); + return InternalPhoneMultiFactorAssertion.decode(readValue(buffer)!); case 132: - return PigeonAdditionalUserInfo.decode(readValue(buffer)!); + return InternalMultiFactorInfo.decode(readValue(buffer)!); case 133: - return PigeonAuthCredential.decode(readValue(buffer)!); + return AuthPigeonFirebaseApp.decode(readValue(buffer)!); case 134: - return PigeonFirebaseAuthSettings.decode(readValue(buffer)!); + return InternalActionCodeInfoData.decode(readValue(buffer)!); case 135: - return PigeonIdTokenResult.decode(readValue(buffer)!); + return InternalActionCodeInfo.decode(readValue(buffer)!); case 136: - return PigeonMultiFactorInfo.decode(readValue(buffer)!); + return InternalAdditionalUserInfo.decode(readValue(buffer)!); case 137: - return PigeonMultiFactorSession.decode(readValue(buffer)!); + return InternalAuthCredential.decode(readValue(buffer)!); case 138: - return PigeonPhoneMultiFactorAssertion.decode(readValue(buffer)!); + return InternalUserInfo.decode(readValue(buffer)!); case 139: - return PigeonSignInProvider.decode(readValue(buffer)!); + return InternalUserDetails.decode(readValue(buffer)!); case 140: - return PigeonTotpSecret.decode(readValue(buffer)!); + return InternalUserCredential.decode(readValue(buffer)!); case 141: - return PigeonUserCredential.decode(readValue(buffer)!); + return InternalAuthCredentialInput.decode(readValue(buffer)!); case 142: - return PigeonUserDetails.decode(readValue(buffer)!); + return InternalActionCodeSettings.decode(readValue(buffer)!); case 143: - return PigeonUserInfo.decode(readValue(buffer)!); + return InternalFirebaseAuthSettings.decode(readValue(buffer)!); case 144: - return PigeonUserProfile.decode(readValue(buffer)!); + return InternalSignInProvider.decode(readValue(buffer)!); case 145: - return PigeonVerifyPhoneNumberRequest.decode(readValue(buffer)!); + return InternalVerifyPhoneNumberRequest.decode(readValue(buffer)!); + case 146: + return InternalIdTokenResult.decode(readValue(buffer)!); + case 147: + return InternalUserProfile.decode(readValue(buffer)!); + case 148: + return InternalTotpSecret.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); } @@ -124,8 +138,7 @@ class _TestFirebaseAuthHostApiCodec extends StandardMessageCodec { abstract class TestFirebaseAuthHostApi { static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec pigeonChannelCodec = - _TestFirebaseAuthHostApiCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); Future registerIdTokenListener(AuthPigeonFirebaseApp app); @@ -135,54 +148,54 @@ abstract class TestFirebaseAuthHostApi { Future applyActionCode(AuthPigeonFirebaseApp app, String code); - Future checkActionCode( + Future checkActionCode( AuthPigeonFirebaseApp app, String code); Future confirmPasswordReset( AuthPigeonFirebaseApp app, String code, String newPassword); - Future createUserWithEmailAndPassword( + Future createUserWithEmailAndPassword( AuthPigeonFirebaseApp app, String email, String password); - Future signInAnonymously(AuthPigeonFirebaseApp app); + Future signInAnonymously(AuthPigeonFirebaseApp app); - Future signInWithCredential( + Future signInWithCredential( AuthPigeonFirebaseApp app, Map input); - Future signInWithCustomToken( + Future signInWithCustomToken( AuthPigeonFirebaseApp app, String token); - Future signInWithEmailAndPassword( + Future signInWithEmailAndPassword( AuthPigeonFirebaseApp app, String email, String password); - Future signInWithEmailLink( + Future signInWithEmailLink( AuthPigeonFirebaseApp app, String email, String emailLink); - Future signInWithProvider( - AuthPigeonFirebaseApp app, PigeonSignInProvider signInProvider); + Future signInWithProvider( + AuthPigeonFirebaseApp app, InternalSignInProvider signInProvider); Future signOut(AuthPigeonFirebaseApp app); - Future> fetchSignInMethodsForEmail( + Future> fetchSignInMethodsForEmail( AuthPigeonFirebaseApp app, String email); Future sendPasswordResetEmail(AuthPigeonFirebaseApp app, String email, - PigeonActionCodeSettings? actionCodeSettings); + InternalActionCodeSettings? actionCodeSettings); Future sendSignInLinkToEmail(AuthPigeonFirebaseApp app, String email, - PigeonActionCodeSettings actionCodeSettings); + InternalActionCodeSettings actionCodeSettings); Future setLanguageCode( AuthPigeonFirebaseApp app, String? languageCode); Future setSettings( - AuthPigeonFirebaseApp app, PigeonFirebaseAuthSettings settings); + AuthPigeonFirebaseApp app, InternalFirebaseAuthSettings settings); Future verifyPasswordResetCode( AuthPigeonFirebaseApp app, String code); Future verifyPhoneNumber( - AuthPigeonFirebaseApp app, PigeonVerifyPhoneNumberRequest request); + AuthPigeonFirebaseApp app, InternalVerifyPhoneNumberRequest request); Future revokeTokenWithAuthorizationCode( AuthPigeonFirebaseApp app, String authorizationCode); @@ -199,27 +212,22 @@ abstract class TestFirebaseAuthHostApi { messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.registerIdTokenListener$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.registerIdTokenListener was null.'); - final List args = (message as List?)!; - final AuthPigeonFirebaseApp? arg_app = - (args[0] as AuthPigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.registerIdTokenListener was null, expected non-null AuthPigeonFirebaseApp.'); + final List args = message! as List; + final AuthPigeonFirebaseApp arg_app = + args[0]! as AuthPigeonFirebaseApp; try { - final String output = await api.registerIdTokenListener(arg_app!); + final String output = await api.registerIdTokenListener(arg_app); return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); @@ -231,27 +239,22 @@ abstract class TestFirebaseAuthHostApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.registerAuthStateListener$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.registerAuthStateListener was null.'); - final List args = (message as List?)!; - final AuthPigeonFirebaseApp? arg_app = - (args[0] as AuthPigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.registerAuthStateListener was null, expected non-null AuthPigeonFirebaseApp.'); + final List args = message! as List; + final AuthPigeonFirebaseApp arg_app = + args[0]! as AuthPigeonFirebaseApp; try { - final String output = await api.registerAuthStateListener(arg_app!); + final String output = await api.registerAuthStateListener(arg_app); return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); @@ -263,33 +266,24 @@ abstract class TestFirebaseAuthHostApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.useEmulator$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.useEmulator was null.'); - final List args = (message as List?)!; - final AuthPigeonFirebaseApp? arg_app = - (args[0] as AuthPigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.useEmulator was null, expected non-null AuthPigeonFirebaseApp.'); - final String? arg_host = (args[1] as String?); - assert(arg_host != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.useEmulator was null, expected non-null String.'); - final int? arg_port = (args[2] as int?); - assert(arg_port != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.useEmulator was null, expected non-null int.'); + final List args = message! as List; + final AuthPigeonFirebaseApp arg_app = + args[0]! as AuthPigeonFirebaseApp; + final String arg_host = args[1]! as String; + final int arg_port = args[2]! as int; try { - await api.useEmulator(arg_app!, arg_host!, arg_port!); + await api.useEmulator(arg_app, arg_host, arg_port); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -301,30 +295,23 @@ abstract class TestFirebaseAuthHostApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.applyActionCode$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.applyActionCode was null.'); - final List args = (message as List?)!; - final AuthPigeonFirebaseApp? arg_app = - (args[0] as AuthPigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.applyActionCode was null, expected non-null AuthPigeonFirebaseApp.'); - final String? arg_code = (args[1] as String?); - assert(arg_code != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.applyActionCode was null, expected non-null String.'); + final List args = message! as List; + final AuthPigeonFirebaseApp arg_app = + args[0]! as AuthPigeonFirebaseApp; + final String arg_code = args[1]! as String; try { - await api.applyActionCode(arg_app!, arg_code!); + await api.applyActionCode(arg_app, arg_code); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -336,31 +323,24 @@ abstract class TestFirebaseAuthHostApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.checkActionCode$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.checkActionCode was null.'); - final List args = (message as List?)!; - final AuthPigeonFirebaseApp? arg_app = - (args[0] as AuthPigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.checkActionCode was null, expected non-null AuthPigeonFirebaseApp.'); - final String? arg_code = (args[1] as String?); - assert(arg_code != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.checkActionCode was null, expected non-null String.'); + final List args = message! as List; + final AuthPigeonFirebaseApp arg_app = + args[0]! as AuthPigeonFirebaseApp; + final String arg_code = args[1]! as String; try { - final PigeonActionCodeInfo output = - await api.checkActionCode(arg_app!, arg_code!); + final InternalActionCodeInfo output = + await api.checkActionCode(arg_app, arg_code); return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); @@ -372,34 +352,24 @@ abstract class TestFirebaseAuthHostApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.confirmPasswordReset$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.confirmPasswordReset was null.'); - final List args = (message as List?)!; - final AuthPigeonFirebaseApp? arg_app = - (args[0] as AuthPigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.confirmPasswordReset was null, expected non-null AuthPigeonFirebaseApp.'); - final String? arg_code = (args[1] as String?); - assert(arg_code != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.confirmPasswordReset was null, expected non-null String.'); - final String? arg_newPassword = (args[2] as String?); - assert(arg_newPassword != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.confirmPasswordReset was null, expected non-null String.'); + final List args = message! as List; + final AuthPigeonFirebaseApp arg_app = + args[0]! as AuthPigeonFirebaseApp; + final String arg_code = args[1]! as String; + final String arg_newPassword = args[2]! as String; try { - await api.confirmPasswordReset( - arg_app!, arg_code!, arg_newPassword!); + await api.confirmPasswordReset(arg_app, arg_code, arg_newPassword); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -411,35 +381,26 @@ abstract class TestFirebaseAuthHostApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.createUserWithEmailAndPassword$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.createUserWithEmailAndPassword was null.'); - final List args = (message as List?)!; - final AuthPigeonFirebaseApp? arg_app = - (args[0] as AuthPigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.createUserWithEmailAndPassword was null, expected non-null AuthPigeonFirebaseApp.'); - final String? arg_email = (args[1] as String?); - assert(arg_email != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.createUserWithEmailAndPassword was null, expected non-null String.'); - final String? arg_password = (args[2] as String?); - assert(arg_password != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.createUserWithEmailAndPassword was null, expected non-null String.'); + final List args = message! as List; + final AuthPigeonFirebaseApp arg_app = + args[0]! as AuthPigeonFirebaseApp; + final String arg_email = args[1]! as String; + final String arg_password = args[2]! as String; try { - final PigeonUserCredential output = + final InternalUserCredential output = await api.createUserWithEmailAndPassword( - arg_app!, arg_email!, arg_password!); + arg_app, arg_email, arg_password); return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); @@ -451,28 +412,23 @@ abstract class TestFirebaseAuthHostApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.signInAnonymously$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.signInAnonymously was null.'); - final List args = (message as List?)!; - final AuthPigeonFirebaseApp? arg_app = - (args[0] as AuthPigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.signInAnonymously was null, expected non-null AuthPigeonFirebaseApp.'); + final List args = message! as List; + final AuthPigeonFirebaseApp arg_app = + args[0]! as AuthPigeonFirebaseApp; try { - final PigeonUserCredential output = - await api.signInAnonymously(arg_app!); + final InternalUserCredential output = + await api.signInAnonymously(arg_app); return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); @@ -484,32 +440,25 @@ abstract class TestFirebaseAuthHostApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.signInWithCredential$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.signInWithCredential was null.'); - final List args = (message as List?)!; - final AuthPigeonFirebaseApp? arg_app = - (args[0] as AuthPigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.signInWithCredential was null, expected non-null AuthPigeonFirebaseApp.'); - final Map? arg_input = - (args[1] as Map?)?.cast(); - assert(arg_input != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.signInWithCredential was null, expected non-null Map.'); + final List args = message! as List; + final AuthPigeonFirebaseApp arg_app = + args[0]! as AuthPigeonFirebaseApp; + final Map arg_input = + (args[1]! as Map).cast(); try { - final PigeonUserCredential output = - await api.signInWithCredential(arg_app!, arg_input!); + final InternalUserCredential output = + await api.signInWithCredential(arg_app, arg_input); return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); @@ -521,31 +470,24 @@ abstract class TestFirebaseAuthHostApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.signInWithCustomToken$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.signInWithCustomToken was null.'); - final List args = (message as List?)!; - final AuthPigeonFirebaseApp? arg_app = - (args[0] as AuthPigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.signInWithCustomToken was null, expected non-null AuthPigeonFirebaseApp.'); - final String? arg_token = (args[1] as String?); - assert(arg_token != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.signInWithCustomToken was null, expected non-null String.'); + final List args = message! as List; + final AuthPigeonFirebaseApp arg_app = + args[0]! as AuthPigeonFirebaseApp; + final String arg_token = args[1]! as String; try { - final PigeonUserCredential output = - await api.signInWithCustomToken(arg_app!, arg_token!); + final InternalUserCredential output = + await api.signInWithCustomToken(arg_app, arg_token); return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); @@ -557,35 +499,25 @@ abstract class TestFirebaseAuthHostApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.signInWithEmailAndPassword$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.signInWithEmailAndPassword was null.'); - final List args = (message as List?)!; - final AuthPigeonFirebaseApp? arg_app = - (args[0] as AuthPigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.signInWithEmailAndPassword was null, expected non-null AuthPigeonFirebaseApp.'); - final String? arg_email = (args[1] as String?); - assert(arg_email != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.signInWithEmailAndPassword was null, expected non-null String.'); - final String? arg_password = (args[2] as String?); - assert(arg_password != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.signInWithEmailAndPassword was null, expected non-null String.'); + final List args = message! as List; + final AuthPigeonFirebaseApp arg_app = + args[0]! as AuthPigeonFirebaseApp; + final String arg_email = args[1]! as String; + final String arg_password = args[2]! as String; try { - final PigeonUserCredential output = - await api.signInWithEmailAndPassword( - arg_app!, arg_email!, arg_password!); + final InternalUserCredential output = await api + .signInWithEmailAndPassword(arg_app, arg_email, arg_password); return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); @@ -597,34 +529,25 @@ abstract class TestFirebaseAuthHostApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.signInWithEmailLink$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.signInWithEmailLink was null.'); - final List args = (message as List?)!; - final AuthPigeonFirebaseApp? arg_app = - (args[0] as AuthPigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.signInWithEmailLink was null, expected non-null AuthPigeonFirebaseApp.'); - final String? arg_email = (args[1] as String?); - assert(arg_email != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.signInWithEmailLink was null, expected non-null String.'); - final String? arg_emailLink = (args[2] as String?); - assert(arg_emailLink != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.signInWithEmailLink was null, expected non-null String.'); + final List args = message! as List; + final AuthPigeonFirebaseApp arg_app = + args[0]! as AuthPigeonFirebaseApp; + final String arg_email = args[1]! as String; + final String arg_emailLink = args[2]! as String; try { - final PigeonUserCredential output = await api.signInWithEmailLink( - arg_app!, arg_email!, arg_emailLink!); + final InternalUserCredential output = await api.signInWithEmailLink( + arg_app, arg_email, arg_emailLink); return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); @@ -636,32 +559,25 @@ abstract class TestFirebaseAuthHostApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.signInWithProvider$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.signInWithProvider was null.'); - final List args = (message as List?)!; - final AuthPigeonFirebaseApp? arg_app = - (args[0] as AuthPigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.signInWithProvider was null, expected non-null AuthPigeonFirebaseApp.'); - final PigeonSignInProvider? arg_signInProvider = - (args[1] as PigeonSignInProvider?); - assert(arg_signInProvider != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.signInWithProvider was null, expected non-null PigeonSignInProvider.'); + final List args = message! as List; + final AuthPigeonFirebaseApp arg_app = + args[0]! as AuthPigeonFirebaseApp; + final InternalSignInProvider arg_signInProvider = + args[1]! as InternalSignInProvider; try { - final PigeonUserCredential output = - await api.signInWithProvider(arg_app!, arg_signInProvider!); + final InternalUserCredential output = + await api.signInWithProvider(arg_app, arg_signInProvider); return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); @@ -673,27 +589,22 @@ abstract class TestFirebaseAuthHostApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.signOut$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.signOut was null.'); - final List args = (message as List?)!; - final AuthPigeonFirebaseApp? arg_app = - (args[0] as AuthPigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.signOut was null, expected non-null AuthPigeonFirebaseApp.'); + final List args = message! as List; + final AuthPigeonFirebaseApp arg_app = + args[0]! as AuthPigeonFirebaseApp; try { - await api.signOut(arg_app!); + await api.signOut(arg_app); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -705,31 +616,24 @@ abstract class TestFirebaseAuthHostApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.fetchSignInMethodsForEmail$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.fetchSignInMethodsForEmail was null.'); - final List args = (message as List?)!; - final AuthPigeonFirebaseApp? arg_app = - (args[0] as AuthPigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.fetchSignInMethodsForEmail was null, expected non-null AuthPigeonFirebaseApp.'); - final String? arg_email = (args[1] as String?); - assert(arg_email != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.fetchSignInMethodsForEmail was null, expected non-null String.'); + final List args = message! as List; + final AuthPigeonFirebaseApp arg_app = + args[0]! as AuthPigeonFirebaseApp; + final String arg_email = args[1]! as String; try { - final List output = - await api.fetchSignInMethodsForEmail(arg_app!, arg_email!); + final List output = + await api.fetchSignInMethodsForEmail(arg_app, arg_email); return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); @@ -741,33 +645,26 @@ abstract class TestFirebaseAuthHostApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.sendPasswordResetEmail$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.sendPasswordResetEmail was null.'); - final List args = (message as List?)!; - final AuthPigeonFirebaseApp? arg_app = - (args[0] as AuthPigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.sendPasswordResetEmail was null, expected non-null AuthPigeonFirebaseApp.'); - final String? arg_email = (args[1] as String?); - assert(arg_email != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.sendPasswordResetEmail was null, expected non-null String.'); - final PigeonActionCodeSettings? arg_actionCodeSettings = - (args[2] as PigeonActionCodeSettings?); + final List args = message! as List; + final AuthPigeonFirebaseApp arg_app = + args[0]! as AuthPigeonFirebaseApp; + final String arg_email = args[1]! as String; + final InternalActionCodeSettings? arg_actionCodeSettings = + args[2] as InternalActionCodeSettings?; try { await api.sendPasswordResetEmail( - arg_app!, arg_email!, arg_actionCodeSettings); + arg_app, arg_email, arg_actionCodeSettings); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -779,35 +676,26 @@ abstract class TestFirebaseAuthHostApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.sendSignInLinkToEmail$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.sendSignInLinkToEmail was null.'); - final List args = (message as List?)!; - final AuthPigeonFirebaseApp? arg_app = - (args[0] as AuthPigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.sendSignInLinkToEmail was null, expected non-null AuthPigeonFirebaseApp.'); - final String? arg_email = (args[1] as String?); - assert(arg_email != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.sendSignInLinkToEmail was null, expected non-null String.'); - final PigeonActionCodeSettings? arg_actionCodeSettings = - (args[2] as PigeonActionCodeSettings?); - assert(arg_actionCodeSettings != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.sendSignInLinkToEmail was null, expected non-null PigeonActionCodeSettings.'); + final List args = message! as List; + final AuthPigeonFirebaseApp arg_app = + args[0]! as AuthPigeonFirebaseApp; + final String arg_email = args[1]! as String; + final InternalActionCodeSettings arg_actionCodeSettings = + args[2]! as InternalActionCodeSettings; try { await api.sendSignInLinkToEmail( - arg_app!, arg_email!, arg_actionCodeSettings!); + arg_app, arg_email, arg_actionCodeSettings); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -819,29 +707,24 @@ abstract class TestFirebaseAuthHostApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.setLanguageCode$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.setLanguageCode was null.'); - final List args = (message as List?)!; - final AuthPigeonFirebaseApp? arg_app = - (args[0] as AuthPigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.setLanguageCode was null, expected non-null AuthPigeonFirebaseApp.'); - final String? arg_languageCode = (args[1] as String?); + final List args = message! as List; + final AuthPigeonFirebaseApp arg_app = + args[0]! as AuthPigeonFirebaseApp; + final String? arg_languageCode = args[1] as String?; try { final String output = - await api.setLanguageCode(arg_app!, arg_languageCode); + await api.setLanguageCode(arg_app, arg_languageCode); return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); @@ -853,31 +736,24 @@ abstract class TestFirebaseAuthHostApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.setSettings$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.setSettings was null.'); - final List args = (message as List?)!; - final AuthPigeonFirebaseApp? arg_app = - (args[0] as AuthPigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.setSettings was null, expected non-null AuthPigeonFirebaseApp.'); - final PigeonFirebaseAuthSettings? arg_settings = - (args[1] as PigeonFirebaseAuthSettings?); - assert(arg_settings != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.setSettings was null, expected non-null PigeonFirebaseAuthSettings.'); + final List args = message! as List; + final AuthPigeonFirebaseApp arg_app = + args[0]! as AuthPigeonFirebaseApp; + final InternalFirebaseAuthSettings arg_settings = + args[1]! as InternalFirebaseAuthSettings; try { - await api.setSettings(arg_app!, arg_settings!); + await api.setSettings(arg_app, arg_settings); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -889,31 +765,24 @@ abstract class TestFirebaseAuthHostApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.verifyPasswordResetCode$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.verifyPasswordResetCode was null.'); - final List args = (message as List?)!; - final AuthPigeonFirebaseApp? arg_app = - (args[0] as AuthPigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.verifyPasswordResetCode was null, expected non-null AuthPigeonFirebaseApp.'); - final String? arg_code = (args[1] as String?); - assert(arg_code != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.verifyPasswordResetCode was null, expected non-null String.'); + final List args = message! as List; + final AuthPigeonFirebaseApp arg_app = + args[0]! as AuthPigeonFirebaseApp; + final String arg_code = args[1]! as String; try { final String output = - await api.verifyPasswordResetCode(arg_app!, arg_code!); + await api.verifyPasswordResetCode(arg_app, arg_code); return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); @@ -925,32 +794,25 @@ abstract class TestFirebaseAuthHostApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.verifyPhoneNumber$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.verifyPhoneNumber was null.'); - final List args = (message as List?)!; - final AuthPigeonFirebaseApp? arg_app = - (args[0] as AuthPigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.verifyPhoneNumber was null, expected non-null AuthPigeonFirebaseApp.'); - final PigeonVerifyPhoneNumberRequest? arg_request = - (args[1] as PigeonVerifyPhoneNumberRequest?); - assert(arg_request != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.verifyPhoneNumber was null, expected non-null PigeonVerifyPhoneNumberRequest.'); + final List args = message! as List; + final AuthPigeonFirebaseApp arg_app = + args[0]! as AuthPigeonFirebaseApp; + final InternalVerifyPhoneNumberRequest arg_request = + args[1]! as InternalVerifyPhoneNumberRequest; try { final String output = - await api.verifyPhoneNumber(arg_app!, arg_request!); + await api.verifyPhoneNumber(arg_app, arg_request); return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); @@ -962,31 +824,24 @@ abstract class TestFirebaseAuthHostApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.revokeTokenWithAuthorizationCode$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.revokeTokenWithAuthorizationCode was null.'); - final List args = (message as List?)!; - final AuthPigeonFirebaseApp? arg_app = - (args[0] as AuthPigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.revokeTokenWithAuthorizationCode was null, expected non-null AuthPigeonFirebaseApp.'); - final String? arg_authorizationCode = (args[1] as String?); - assert(arg_authorizationCode != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.revokeTokenWithAuthorizationCode was null, expected non-null String.'); + final List args = message! as List; + final AuthPigeonFirebaseApp arg_app = + args[0]! as AuthPigeonFirebaseApp; + final String arg_authorizationCode = args[1]! as String; try { await api.revokeTokenWithAuthorizationCode( - arg_app!, arg_authorizationCode!); + arg_app, arg_authorizationCode); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -998,30 +853,23 @@ abstract class TestFirebaseAuthHostApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.revokeAccessToken$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.revokeAccessToken was null.'); - final List args = (message as List?)!; - final AuthPigeonFirebaseApp? arg_app = - (args[0] as AuthPigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.revokeAccessToken was null, expected non-null AuthPigeonFirebaseApp.'); - final String? arg_accessToken = (args[1] as String?); - assert(arg_accessToken != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.revokeAccessToken was null, expected non-null String.'); + final List args = message! as List; + final AuthPigeonFirebaseApp arg_app = + args[0]! as AuthPigeonFirebaseApp; + final String arg_accessToken = args[1]! as String; try { - await api.revokeAccessToken(arg_app!, arg_accessToken!); + await api.revokeAccessToken(arg_app, arg_accessToken); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -1033,27 +881,22 @@ abstract class TestFirebaseAuthHostApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.initializeRecaptchaConfig$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.initializeRecaptchaConfig was null.'); - final List args = (message as List?)!; - final AuthPigeonFirebaseApp? arg_app = - (args[0] as AuthPigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.initializeRecaptchaConfig was null, expected non-null AuthPigeonFirebaseApp.'); + final List args = message! as List; + final AuthPigeonFirebaseApp arg_app = + args[0]! as AuthPigeonFirebaseApp; try { - await api.initializeRecaptchaConfig(arg_app!); + await api.initializeRecaptchaConfig(arg_app); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -1067,159 +910,50 @@ abstract class TestFirebaseAuthHostApi { } } -class _TestFirebaseAuthUserHostApiCodec extends StandardMessageCodec { - const _TestFirebaseAuthUserHostApiCodec(); - @override - void writeValue(WriteBuffer buffer, Object? value) { - if (value is AuthPigeonFirebaseApp) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else if (value is PigeonActionCodeInfo) { - buffer.putUint8(129); - writeValue(buffer, value.encode()); - } else if (value is PigeonActionCodeInfoData) { - buffer.putUint8(130); - writeValue(buffer, value.encode()); - } else if (value is PigeonActionCodeSettings) { - buffer.putUint8(131); - writeValue(buffer, value.encode()); - } else if (value is PigeonAdditionalUserInfo) { - buffer.putUint8(132); - writeValue(buffer, value.encode()); - } else if (value is PigeonAuthCredential) { - buffer.putUint8(133); - writeValue(buffer, value.encode()); - } else if (value is PigeonFirebaseAuthSettings) { - buffer.putUint8(134); - writeValue(buffer, value.encode()); - } else if (value is PigeonIdTokenResult) { - buffer.putUint8(135); - writeValue(buffer, value.encode()); - } else if (value is PigeonMultiFactorInfo) { - buffer.putUint8(136); - writeValue(buffer, value.encode()); - } else if (value is PigeonMultiFactorSession) { - buffer.putUint8(137); - writeValue(buffer, value.encode()); - } else if (value is PigeonPhoneMultiFactorAssertion) { - buffer.putUint8(138); - writeValue(buffer, value.encode()); - } else if (value is PigeonSignInProvider) { - buffer.putUint8(139); - writeValue(buffer, value.encode()); - } else if (value is PigeonTotpSecret) { - buffer.putUint8(140); - writeValue(buffer, value.encode()); - } else if (value is PigeonUserCredential) { - buffer.putUint8(141); - writeValue(buffer, value.encode()); - } else if (value is PigeonUserDetails) { - buffer.putUint8(142); - writeValue(buffer, value.encode()); - } else if (value is PigeonUserInfo) { - buffer.putUint8(143); - writeValue(buffer, value.encode()); - } else if (value is PigeonUserProfile) { - buffer.putUint8(144); - writeValue(buffer, value.encode()); - } else if (value is PigeonVerifyPhoneNumberRequest) { - buffer.putUint8(145); - writeValue(buffer, value.encode()); - } else { - super.writeValue(buffer, value); - } - } - - @override - Object? readValueOfType(int type, ReadBuffer buffer) { - switch (type) { - case 128: - return AuthPigeonFirebaseApp.decode(readValue(buffer)!); - case 129: - return PigeonActionCodeInfo.decode(readValue(buffer)!); - case 130: - return PigeonActionCodeInfoData.decode(readValue(buffer)!); - case 131: - return PigeonActionCodeSettings.decode(readValue(buffer)!); - case 132: - return PigeonAdditionalUserInfo.decode(readValue(buffer)!); - case 133: - return PigeonAuthCredential.decode(readValue(buffer)!); - case 134: - return PigeonFirebaseAuthSettings.decode(readValue(buffer)!); - case 135: - return PigeonIdTokenResult.decode(readValue(buffer)!); - case 136: - return PigeonMultiFactorInfo.decode(readValue(buffer)!); - case 137: - return PigeonMultiFactorSession.decode(readValue(buffer)!); - case 138: - return PigeonPhoneMultiFactorAssertion.decode(readValue(buffer)!); - case 139: - return PigeonSignInProvider.decode(readValue(buffer)!); - case 140: - return PigeonTotpSecret.decode(readValue(buffer)!); - case 141: - return PigeonUserCredential.decode(readValue(buffer)!); - case 142: - return PigeonUserDetails.decode(readValue(buffer)!); - case 143: - return PigeonUserInfo.decode(readValue(buffer)!); - case 144: - return PigeonUserProfile.decode(readValue(buffer)!); - case 145: - return PigeonVerifyPhoneNumberRequest.decode(readValue(buffer)!); - default: - return super.readValueOfType(type, buffer); - } - } -} - abstract class TestFirebaseAuthUserHostApi { static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec pigeonChannelCodec = - _TestFirebaseAuthUserHostApiCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); Future delete(AuthPigeonFirebaseApp app); - Future getIdToken( + Future getIdToken( AuthPigeonFirebaseApp app, bool forceRefresh); - Future linkWithCredential( + Future linkWithCredential( AuthPigeonFirebaseApp app, Map input); - Future linkWithProvider( - AuthPigeonFirebaseApp app, PigeonSignInProvider signInProvider); + Future linkWithProvider( + AuthPigeonFirebaseApp app, InternalSignInProvider signInProvider); - Future reauthenticateWithCredential( + Future reauthenticateWithCredential( AuthPigeonFirebaseApp app, Map input); - Future reauthenticateWithProvider( - AuthPigeonFirebaseApp app, PigeonSignInProvider signInProvider); + Future reauthenticateWithProvider( + AuthPigeonFirebaseApp app, InternalSignInProvider signInProvider); - Future reload(AuthPigeonFirebaseApp app); + Future reload(AuthPigeonFirebaseApp app); - Future sendEmailVerification( - AuthPigeonFirebaseApp app, PigeonActionCodeSettings? actionCodeSettings); + Future sendEmailVerification(AuthPigeonFirebaseApp app, + InternalActionCodeSettings? actionCodeSettings); - Future unlink( + Future unlink( AuthPigeonFirebaseApp app, String providerId); - Future updateEmail( + Future updateEmail( AuthPigeonFirebaseApp app, String newEmail); - Future updatePassword( + Future updatePassword( AuthPigeonFirebaseApp app, String newPassword); - Future updatePhoneNumber( + Future updatePhoneNumber( AuthPigeonFirebaseApp app, Map input); - Future updateProfile( - AuthPigeonFirebaseApp app, PigeonUserProfile profile); + Future updateProfile( + AuthPigeonFirebaseApp app, InternalUserProfile profile); Future verifyBeforeUpdateEmail(AuthPigeonFirebaseApp app, - String newEmail, PigeonActionCodeSettings? actionCodeSettings); + String newEmail, InternalActionCodeSettings? actionCodeSettings); static void setUp( TestFirebaseAuthUserHostApi? api, { @@ -1229,27 +963,22 @@ abstract class TestFirebaseAuthUserHostApi { messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.delete$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.delete was null.'); - final List args = (message as List?)!; - final AuthPigeonFirebaseApp? arg_app = - (args[0] as AuthPigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.delete was null, expected non-null AuthPigeonFirebaseApp.'); + final List args = message! as List; + final AuthPigeonFirebaseApp arg_app = + args[0]! as AuthPigeonFirebaseApp; try { - await api.delete(arg_app!); + await api.delete(arg_app); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -1261,31 +990,24 @@ abstract class TestFirebaseAuthUserHostApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.getIdToken$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.getIdToken was null.'); - final List args = (message as List?)!; - final AuthPigeonFirebaseApp? arg_app = - (args[0] as AuthPigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.getIdToken was null, expected non-null AuthPigeonFirebaseApp.'); - final bool? arg_forceRefresh = (args[1] as bool?); - assert(arg_forceRefresh != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.getIdToken was null, expected non-null bool.'); + final List args = message! as List; + final AuthPigeonFirebaseApp arg_app = + args[0]! as AuthPigeonFirebaseApp; + final bool arg_forceRefresh = args[1]! as bool; try { - final PigeonIdTokenResult output = - await api.getIdToken(arg_app!, arg_forceRefresh!); + final InternalIdTokenResult output = + await api.getIdToken(arg_app, arg_forceRefresh); return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); @@ -1297,32 +1019,25 @@ abstract class TestFirebaseAuthUserHostApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.linkWithCredential$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.linkWithCredential was null.'); - final List args = (message as List?)!; - final AuthPigeonFirebaseApp? arg_app = - (args[0] as AuthPigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.linkWithCredential was null, expected non-null AuthPigeonFirebaseApp.'); - final Map? arg_input = - (args[1] as Map?)?.cast(); - assert(arg_input != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.linkWithCredential was null, expected non-null Map.'); + final List args = message! as List; + final AuthPigeonFirebaseApp arg_app = + args[0]! as AuthPigeonFirebaseApp; + final Map arg_input = + (args[1]! as Map).cast(); try { - final PigeonUserCredential output = - await api.linkWithCredential(arg_app!, arg_input!); + final InternalUserCredential output = + await api.linkWithCredential(arg_app, arg_input); return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); @@ -1334,32 +1049,25 @@ abstract class TestFirebaseAuthUserHostApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.linkWithProvider$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.linkWithProvider was null.'); - final List args = (message as List?)!; - final AuthPigeonFirebaseApp? arg_app = - (args[0] as AuthPigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.linkWithProvider was null, expected non-null AuthPigeonFirebaseApp.'); - final PigeonSignInProvider? arg_signInProvider = - (args[1] as PigeonSignInProvider?); - assert(arg_signInProvider != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.linkWithProvider was null, expected non-null PigeonSignInProvider.'); + final List args = message! as List; + final AuthPigeonFirebaseApp arg_app = + args[0]! as AuthPigeonFirebaseApp; + final InternalSignInProvider arg_signInProvider = + args[1]! as InternalSignInProvider; try { - final PigeonUserCredential output = - await api.linkWithProvider(arg_app!, arg_signInProvider!); + final InternalUserCredential output = + await api.linkWithProvider(arg_app, arg_signInProvider); return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); @@ -1371,32 +1079,25 @@ abstract class TestFirebaseAuthUserHostApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.reauthenticateWithCredential$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.reauthenticateWithCredential was null.'); - final List args = (message as List?)!; - final AuthPigeonFirebaseApp? arg_app = - (args[0] as AuthPigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.reauthenticateWithCredential was null, expected non-null AuthPigeonFirebaseApp.'); - final Map? arg_input = - (args[1] as Map?)?.cast(); - assert(arg_input != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.reauthenticateWithCredential was null, expected non-null Map.'); + final List args = message! as List; + final AuthPigeonFirebaseApp arg_app = + args[0]! as AuthPigeonFirebaseApp; + final Map arg_input = + (args[1]! as Map).cast(); try { - final PigeonUserCredential output = - await api.reauthenticateWithCredential(arg_app!, arg_input!); + final InternalUserCredential output = + await api.reauthenticateWithCredential(arg_app, arg_input); return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); @@ -1408,32 +1109,25 @@ abstract class TestFirebaseAuthUserHostApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.reauthenticateWithProvider$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.reauthenticateWithProvider was null.'); - final List args = (message as List?)!; - final AuthPigeonFirebaseApp? arg_app = - (args[0] as AuthPigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.reauthenticateWithProvider was null, expected non-null AuthPigeonFirebaseApp.'); - final PigeonSignInProvider? arg_signInProvider = - (args[1] as PigeonSignInProvider?); - assert(arg_signInProvider != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.reauthenticateWithProvider was null, expected non-null PigeonSignInProvider.'); + final List args = message! as List; + final AuthPigeonFirebaseApp arg_app = + args[0]! as AuthPigeonFirebaseApp; + final InternalSignInProvider arg_signInProvider = + args[1]! as InternalSignInProvider; try { - final PigeonUserCredential output = await api - .reauthenticateWithProvider(arg_app!, arg_signInProvider!); + final InternalUserCredential output = await api + .reauthenticateWithProvider(arg_app, arg_signInProvider); return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); @@ -1445,27 +1139,22 @@ abstract class TestFirebaseAuthUserHostApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.reload$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.reload was null.'); - final List args = (message as List?)!; - final AuthPigeonFirebaseApp? arg_app = - (args[0] as AuthPigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.reload was null, expected non-null AuthPigeonFirebaseApp.'); + final List args = message! as List; + final AuthPigeonFirebaseApp arg_app = + args[0]! as AuthPigeonFirebaseApp; try { - final PigeonUserDetails output = await api.reload(arg_app!); + final InternalUserDetails output = await api.reload(arg_app); return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); @@ -1477,29 +1166,24 @@ abstract class TestFirebaseAuthUserHostApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.sendEmailVerification$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.sendEmailVerification was null.'); - final List args = (message as List?)!; - final AuthPigeonFirebaseApp? arg_app = - (args[0] as AuthPigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.sendEmailVerification was null, expected non-null AuthPigeonFirebaseApp.'); - final PigeonActionCodeSettings? arg_actionCodeSettings = - (args[1] as PigeonActionCodeSettings?); + final List args = message! as List; + final AuthPigeonFirebaseApp arg_app = + args[0]! as AuthPigeonFirebaseApp; + final InternalActionCodeSettings? arg_actionCodeSettings = + args[1] as InternalActionCodeSettings?; try { - await api.sendEmailVerification(arg_app!, arg_actionCodeSettings); + await api.sendEmailVerification(arg_app, arg_actionCodeSettings); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -1511,31 +1195,24 @@ abstract class TestFirebaseAuthUserHostApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.unlink$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.unlink was null.'); - final List args = (message as List?)!; - final AuthPigeonFirebaseApp? arg_app = - (args[0] as AuthPigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.unlink was null, expected non-null AuthPigeonFirebaseApp.'); - final String? arg_providerId = (args[1] as String?); - assert(arg_providerId != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.unlink was null, expected non-null String.'); + final List args = message! as List; + final AuthPigeonFirebaseApp arg_app = + args[0]! as AuthPigeonFirebaseApp; + final String arg_providerId = args[1]! as String; try { - final PigeonUserCredential output = - await api.unlink(arg_app!, arg_providerId!); + final InternalUserCredential output = + await api.unlink(arg_app, arg_providerId); return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); @@ -1547,31 +1224,24 @@ abstract class TestFirebaseAuthUserHostApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.updateEmail$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.updateEmail was null.'); - final List args = (message as List?)!; - final AuthPigeonFirebaseApp? arg_app = - (args[0] as AuthPigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.updateEmail was null, expected non-null AuthPigeonFirebaseApp.'); - final String? arg_newEmail = (args[1] as String?); - assert(arg_newEmail != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.updateEmail was null, expected non-null String.'); + final List args = message! as List; + final AuthPigeonFirebaseApp arg_app = + args[0]! as AuthPigeonFirebaseApp; + final String arg_newEmail = args[1]! as String; try { - final PigeonUserDetails output = - await api.updateEmail(arg_app!, arg_newEmail!); + final InternalUserDetails output = + await api.updateEmail(arg_app, arg_newEmail); return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); @@ -1583,31 +1253,24 @@ abstract class TestFirebaseAuthUserHostApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.updatePassword$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.updatePassword was null.'); - final List args = (message as List?)!; - final AuthPigeonFirebaseApp? arg_app = - (args[0] as AuthPigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.updatePassword was null, expected non-null AuthPigeonFirebaseApp.'); - final String? arg_newPassword = (args[1] as String?); - assert(arg_newPassword != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.updatePassword was null, expected non-null String.'); + final List args = message! as List; + final AuthPigeonFirebaseApp arg_app = + args[0]! as AuthPigeonFirebaseApp; + final String arg_newPassword = args[1]! as String; try { - final PigeonUserDetails output = - await api.updatePassword(arg_app!, arg_newPassword!); + final InternalUserDetails output = + await api.updatePassword(arg_app, arg_newPassword); return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); @@ -1619,32 +1282,25 @@ abstract class TestFirebaseAuthUserHostApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.updatePhoneNumber$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.updatePhoneNumber was null.'); - final List args = (message as List?)!; - final AuthPigeonFirebaseApp? arg_app = - (args[0] as AuthPigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.updatePhoneNumber was null, expected non-null AuthPigeonFirebaseApp.'); - final Map? arg_input = - (args[1] as Map?)?.cast(); - assert(arg_input != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.updatePhoneNumber was null, expected non-null Map.'); + final List args = message! as List; + final AuthPigeonFirebaseApp arg_app = + args[0]! as AuthPigeonFirebaseApp; + final Map arg_input = + (args[1]! as Map).cast(); try { - final PigeonUserDetails output = - await api.updatePhoneNumber(arg_app!, arg_input!); + final InternalUserDetails output = + await api.updatePhoneNumber(arg_app, arg_input); return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); @@ -1656,32 +1312,25 @@ abstract class TestFirebaseAuthUserHostApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.updateProfile$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.updateProfile was null.'); - final List args = (message as List?)!; - final AuthPigeonFirebaseApp? arg_app = - (args[0] as AuthPigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.updateProfile was null, expected non-null AuthPigeonFirebaseApp.'); - final PigeonUserProfile? arg_profile = - (args[1] as PigeonUserProfile?); - assert(arg_profile != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.updateProfile was null, expected non-null PigeonUserProfile.'); + final List args = message! as List; + final AuthPigeonFirebaseApp arg_app = + args[0]! as AuthPigeonFirebaseApp; + final InternalUserProfile arg_profile = + args[1]! as InternalUserProfile; try { - final PigeonUserDetails output = - await api.updateProfile(arg_app!, arg_profile!); + final InternalUserDetails output = + await api.updateProfile(arg_app, arg_profile); return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); @@ -1693,33 +1342,26 @@ abstract class TestFirebaseAuthUserHostApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.verifyBeforeUpdateEmail$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.verifyBeforeUpdateEmail was null.'); - final List args = (message as List?)!; - final AuthPigeonFirebaseApp? arg_app = - (args[0] as AuthPigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.verifyBeforeUpdateEmail was null, expected non-null AuthPigeonFirebaseApp.'); - final String? arg_newEmail = (args[1] as String?); - assert(arg_newEmail != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthUserHostApi.verifyBeforeUpdateEmail was null, expected non-null String.'); - final PigeonActionCodeSettings? arg_actionCodeSettings = - (args[2] as PigeonActionCodeSettings?); + final List args = message! as List; + final AuthPigeonFirebaseApp arg_app = + args[0]! as AuthPigeonFirebaseApp; + final String arg_newEmail = args[1]! as String; + final InternalActionCodeSettings? arg_actionCodeSettings = + args[2] as InternalActionCodeSettings?; try { await api.verifyBeforeUpdateEmail( - arg_app!, arg_newEmail!, arg_actionCodeSettings); + arg_app, arg_newEmail, arg_actionCodeSettings); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -1733,61 +1375,22 @@ abstract class TestFirebaseAuthUserHostApi { } } -class _TestMultiFactorUserHostApiCodec extends StandardMessageCodec { - const _TestMultiFactorUserHostApiCodec(); - @override - void writeValue(WriteBuffer buffer, Object? value) { - if (value is AuthPigeonFirebaseApp) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else if (value is PigeonMultiFactorInfo) { - buffer.putUint8(129); - writeValue(buffer, value.encode()); - } else if (value is PigeonMultiFactorSession) { - buffer.putUint8(130); - writeValue(buffer, value.encode()); - } else if (value is PigeonPhoneMultiFactorAssertion) { - buffer.putUint8(131); - writeValue(buffer, value.encode()); - } else { - super.writeValue(buffer, value); - } - } - - @override - Object? readValueOfType(int type, ReadBuffer buffer) { - switch (type) { - case 128: - return AuthPigeonFirebaseApp.decode(readValue(buffer)!); - case 129: - return PigeonMultiFactorInfo.decode(readValue(buffer)!); - case 130: - return PigeonMultiFactorSession.decode(readValue(buffer)!); - case 131: - return PigeonPhoneMultiFactorAssertion.decode(readValue(buffer)!); - default: - return super.readValueOfType(type, buffer); - } - } -} - abstract class TestMultiFactorUserHostApi { static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec pigeonChannelCodec = - _TestMultiFactorUserHostApiCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); Future enrollPhone(AuthPigeonFirebaseApp app, - PigeonPhoneMultiFactorAssertion assertion, String? displayName); + InternalPhoneMultiFactorAssertion assertion, String? displayName); Future enrollTotp( AuthPigeonFirebaseApp app, String assertionId, String? displayName); - Future getSession(AuthPigeonFirebaseApp app); + Future getSession(AuthPigeonFirebaseApp app); Future unenroll(AuthPigeonFirebaseApp app, String factorUid); - Future> getEnrolledFactors( + Future> getEnrolledFactors( AuthPigeonFirebaseApp app); static void setUp( @@ -1798,32 +1401,25 @@ abstract class TestMultiFactorUserHostApi { messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorUserHostApi.enrollPhone$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorUserHostApi.enrollPhone was null.'); - final List args = (message as List?)!; - final AuthPigeonFirebaseApp? arg_app = - (args[0] as AuthPigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorUserHostApi.enrollPhone was null, expected non-null AuthPigeonFirebaseApp.'); - final PigeonPhoneMultiFactorAssertion? arg_assertion = - (args[1] as PigeonPhoneMultiFactorAssertion?); - assert(arg_assertion != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorUserHostApi.enrollPhone was null, expected non-null PigeonPhoneMultiFactorAssertion.'); - final String? arg_displayName = (args[2] as String?); + final List args = message! as List; + final AuthPigeonFirebaseApp arg_app = + args[0]! as AuthPigeonFirebaseApp; + final InternalPhoneMultiFactorAssertion arg_assertion = + args[1]! as InternalPhoneMultiFactorAssertion; + final String? arg_displayName = args[2] as String?; try { - await api.enrollPhone(arg_app!, arg_assertion!, arg_displayName); + await api.enrollPhone(arg_app, arg_assertion, arg_displayName); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -1835,31 +1431,24 @@ abstract class TestMultiFactorUserHostApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorUserHostApi.enrollTotp$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorUserHostApi.enrollTotp was null.'); - final List args = (message as List?)!; - final AuthPigeonFirebaseApp? arg_app = - (args[0] as AuthPigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorUserHostApi.enrollTotp was null, expected non-null AuthPigeonFirebaseApp.'); - final String? arg_assertionId = (args[1] as String?); - assert(arg_assertionId != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorUserHostApi.enrollTotp was null, expected non-null String.'); - final String? arg_displayName = (args[2] as String?); + final List args = message! as List; + final AuthPigeonFirebaseApp arg_app = + args[0]! as AuthPigeonFirebaseApp; + final String arg_assertionId = args[1]! as String; + final String? arg_displayName = args[2] as String?; try { - await api.enrollTotp(arg_app!, arg_assertionId!, arg_displayName); + await api.enrollTotp(arg_app, arg_assertionId, arg_displayName); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -1871,28 +1460,23 @@ abstract class TestMultiFactorUserHostApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorUserHostApi.getSession$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorUserHostApi.getSession was null.'); - final List args = (message as List?)!; - final AuthPigeonFirebaseApp? arg_app = - (args[0] as AuthPigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorUserHostApi.getSession was null, expected non-null AuthPigeonFirebaseApp.'); + final List args = message! as List; + final AuthPigeonFirebaseApp arg_app = + args[0]! as AuthPigeonFirebaseApp; try { - final PigeonMultiFactorSession output = - await api.getSession(arg_app!); + final InternalMultiFactorSession output = + await api.getSession(arg_app); return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); @@ -1904,30 +1488,23 @@ abstract class TestMultiFactorUserHostApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorUserHostApi.unenroll$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorUserHostApi.unenroll was null.'); - final List args = (message as List?)!; - final AuthPigeonFirebaseApp? arg_app = - (args[0] as AuthPigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorUserHostApi.unenroll was null, expected non-null AuthPigeonFirebaseApp.'); - final String? arg_factorUid = (args[1] as String?); - assert(arg_factorUid != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorUserHostApi.unenroll was null, expected non-null String.'); + final List args = message! as List; + final AuthPigeonFirebaseApp arg_app = + args[0]! as AuthPigeonFirebaseApp; + final String arg_factorUid = args[1]! as String; try { - await api.unenroll(arg_app!, arg_factorUid!); + await api.unenroll(arg_app, arg_factorUid); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -1939,28 +1516,23 @@ abstract class TestMultiFactorUserHostApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorUserHostApi.getEnrolledFactors$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorUserHostApi.getEnrolledFactors was null.'); - final List args = (message as List?)!; - final AuthPigeonFirebaseApp? arg_app = - (args[0] as AuthPigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorUserHostApi.getEnrolledFactors was null, expected non-null AuthPigeonFirebaseApp.'); + final List args = message! as List; + final AuthPigeonFirebaseApp arg_app = + args[0]! as AuthPigeonFirebaseApp; try { - final List output = - await api.getEnrolledFactors(arg_app!); + final List output = + await api.getEnrolledFactors(arg_app); return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); @@ -1974,62 +1546,13 @@ abstract class TestMultiFactorUserHostApi { } } -class _TestMultiFactoResolverHostApiCodec extends StandardMessageCodec { - const _TestMultiFactoResolverHostApiCodec(); - @override - void writeValue(WriteBuffer buffer, Object? value) { - if (value is PigeonAdditionalUserInfo) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else if (value is PigeonAuthCredential) { - buffer.putUint8(129); - writeValue(buffer, value.encode()); - } else if (value is PigeonPhoneMultiFactorAssertion) { - buffer.putUint8(130); - writeValue(buffer, value.encode()); - } else if (value is PigeonUserCredential) { - buffer.putUint8(131); - writeValue(buffer, value.encode()); - } else if (value is PigeonUserDetails) { - buffer.putUint8(132); - writeValue(buffer, value.encode()); - } else if (value is PigeonUserInfo) { - buffer.putUint8(133); - writeValue(buffer, value.encode()); - } else { - super.writeValue(buffer, value); - } - } - - @override - Object? readValueOfType(int type, ReadBuffer buffer) { - switch (type) { - case 128: - return PigeonAdditionalUserInfo.decode(readValue(buffer)!); - case 129: - return PigeonAuthCredential.decode(readValue(buffer)!); - case 130: - return PigeonPhoneMultiFactorAssertion.decode(readValue(buffer)!); - case 131: - return PigeonUserCredential.decode(readValue(buffer)!); - case 132: - return PigeonUserDetails.decode(readValue(buffer)!); - case 133: - return PigeonUserInfo.decode(readValue(buffer)!); - default: - return super.readValueOfType(type, buffer); - } - } -} - abstract class TestMultiFactoResolverHostApi { static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec pigeonChannelCodec = - _TestMultiFactoResolverHostApiCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); - Future resolveSignIn(String resolverId, - PigeonPhoneMultiFactorAssertion? assertion, String? totpAssertionId); + Future resolveSignIn(String resolverId, + InternalPhoneMultiFactorAssertion? assertion, String? totpAssertionId); static void setUp( TestMultiFactoResolverHostApi? api, { @@ -2039,30 +1562,25 @@ abstract class TestMultiFactoResolverHostApi { messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactoResolverHostApi.resolveSignIn$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactoResolverHostApi.resolveSignIn was null.'); - final List args = (message as List?)!; - final String? arg_resolverId = (args[0] as String?); - assert(arg_resolverId != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactoResolverHostApi.resolveSignIn was null, expected non-null String.'); - final PigeonPhoneMultiFactorAssertion? arg_assertion = - (args[1] as PigeonPhoneMultiFactorAssertion?); - final String? arg_totpAssertionId = (args[2] as String?); + final List args = message! as List; + final String arg_resolverId = args[0]! as String; + final InternalPhoneMultiFactorAssertion? arg_assertion = + args[1] as InternalPhoneMultiFactorAssertion?; + final String? arg_totpAssertionId = args[2] as String?; try { - final PigeonUserCredential output = await api.resolveSignIn( - arg_resolverId!, arg_assertion, arg_totpAssertionId); + final InternalUserCredential output = await api.resolveSignIn( + arg_resolverId, arg_assertion, arg_totpAssertionId); return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); @@ -2076,36 +1594,12 @@ abstract class TestMultiFactoResolverHostApi { } } -class _TestMultiFactoResolverHostApiCodec extends StandardMessageCodec { - const _TestMultiFactoResolverHostApiCodec(); - @override - void writeValue(WriteBuffer buffer, Object? value) { - if (value is PigeonTotpSecret) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else { - super.writeValue(buffer, value); - } - } - - @override - Object? readValueOfType(int type, ReadBuffer buffer) { - switch (type) { - case 128: - return PigeonTotpSecret.decode(readValue(buffer)!); - default: - return super.readValueOfType(type, buffer); - } - } -} - abstract class TestMultiFactoResolverHostApi { static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec pigeonChannelCodec = - _TestMultiFactoResolverHostApiCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); - Future generateSecret(String sessionId); + Future generateSecret(String sessionId); Future getAssertionForEnrollment( String secretKey, String oneTimePassword); @@ -2121,27 +1615,22 @@ abstract class TestMultiFactoResolverHostApi { messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorTotpHostApi.generateSecret$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorTotpHostApi.generateSecret was null.'); - final List args = (message as List?)!; - final String? arg_sessionId = (args[0] as String?); - assert(arg_sessionId != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorTotpHostApi.generateSecret was null, expected non-null String.'); + final List args = message! as List; + final String arg_sessionId = args[0]! as String; try { - final PigeonTotpSecret output = - await api.generateSecret(arg_sessionId!); + final InternalTotpSecret output = + await api.generateSecret(arg_sessionId); return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); @@ -2153,30 +1642,23 @@ abstract class TestMultiFactoResolverHostApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorTotpHostApi.getAssertionForEnrollment$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorTotpHostApi.getAssertionForEnrollment was null.'); - final List args = (message as List?)!; - final String? arg_secretKey = (args[0] as String?); - assert(arg_secretKey != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorTotpHostApi.getAssertionForEnrollment was null, expected non-null String.'); - final String? arg_oneTimePassword = (args[1] as String?); - assert(arg_oneTimePassword != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorTotpHostApi.getAssertionForEnrollment was null, expected non-null String.'); + final List args = message! as List; + final String arg_secretKey = args[0]! as String; + final String arg_oneTimePassword = args[1]! as String; try { final String output = await api.getAssertionForEnrollment( - arg_secretKey!, arg_oneTimePassword!); + arg_secretKey, arg_oneTimePassword); return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); @@ -2188,30 +1670,23 @@ abstract class TestMultiFactoResolverHostApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorTotpHostApi.getAssertionForSignIn$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorTotpHostApi.getAssertionForSignIn was null.'); - final List args = (message as List?)!; - final String? arg_enrollmentId = (args[0] as String?); - assert(arg_enrollmentId != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorTotpHostApi.getAssertionForSignIn was null, expected non-null String.'); - final String? arg_oneTimePassword = (args[1] as String?); - assert(arg_oneTimePassword != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorTotpHostApi.getAssertionForSignIn was null, expected non-null String.'); + final List args = message! as List; + final String arg_enrollmentId = args[0]! as String; + final String arg_oneTimePassword = args[1]! as String; try { final String output = await api.getAssertionForSignIn( - arg_enrollmentId!, arg_oneTimePassword!); + arg_enrollmentId, arg_oneTimePassword); return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); @@ -2228,8 +1703,7 @@ abstract class TestMultiFactoResolverHostApi { abstract class TestMultiFactoResolverHostApi { static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec pigeonChannelCodec = - StandardMessageCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); Future generateQrCodeUrl( String secretKey, String? accountName, String? issuer); @@ -2244,29 +1718,24 @@ abstract class TestMultiFactoResolverHostApi { messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorTotpSecretHostApi.generateQrCodeUrl$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorTotpSecretHostApi.generateQrCodeUrl was null.'); - final List args = (message as List?)!; - final String? arg_secretKey = (args[0] as String?); - assert(arg_secretKey != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorTotpSecretHostApi.generateQrCodeUrl was null, expected non-null String.'); - final String? arg_accountName = (args[1] as String?); - final String? arg_issuer = (args[2] as String?); + final List args = message! as List; + final String arg_secretKey = args[0]! as String; + final String? arg_accountName = args[1] as String?; + final String? arg_issuer = args[2] as String?; try { final String output = await api.generateQrCodeUrl( - arg_secretKey!, arg_accountName, arg_issuer); + arg_secretKey, arg_accountName, arg_issuer); return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); @@ -2278,29 +1747,22 @@ abstract class TestMultiFactoResolverHostApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorTotpSecretHostApi.openInOtpApp$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorTotpSecretHostApi.openInOtpApp was null.'); - final List args = (message as List?)!; - final String? arg_secretKey = (args[0] as String?); - assert(arg_secretKey != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorTotpSecretHostApi.openInOtpApp was null, expected non-null String.'); - final String? arg_qrCodeUrl = (args[1] as String?); - assert(arg_qrCodeUrl != null, - 'Argument for dev.flutter.pigeon.firebase_auth_platform_interface.MultiFactorTotpSecretHostApi.openInOtpApp was null, expected non-null String.'); + final List args = message! as List; + final String arg_secretKey = args[0]! as String; + final String arg_qrCodeUrl = args[1]! as String; try { - await api.openInOtpApp(arg_secretKey!, arg_qrCodeUrl!); + await api.openInOtpApp(arg_secretKey, arg_qrCodeUrl); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); diff --git a/packages/firebase_auth/firebase_auth_platform_interface/test/platform_interface_tests/platform_interface_user_credential_test.dart b/packages/firebase_auth/firebase_auth_platform_interface/test/platform_interface_tests/platform_interface_user_credential_test.dart index 5adffbf2faf3..ea8540a8842d 100644 --- a/packages/firebase_auth/firebase_auth_platform_interface/test/platform_interface_tests/platform_interface_user_credential_test.dart +++ b/packages/firebase_auth/firebase_auth_platform_interface/test/platform_interface_tests/platform_interface_user_credential_test.dart @@ -19,8 +19,8 @@ void main() { const String kMockEmail = 'test@example.com'; const String kMockPassword = 'test-password'; - final kMockUserData = PigeonUserDetails( - userInfo: PigeonUserInfo( + final kMockUserData = InternalUserDetails( + userInfo: InternalUserInfo( uid: kMockUid, email: kMockEmail, isAnonymous: false, @@ -103,7 +103,7 @@ void main() { class TestUserPlatform extends UserPlatform { TestUserPlatform(FirebaseAuthPlatform auth, - MultiFactorPlatform multiFactorPlatform, PigeonUserDetails data) + MultiFactorPlatform multiFactorPlatform, InternalUserDetails data) : super(auth, multiFactorPlatform, data); } diff --git a/packages/firebase_auth/firebase_auth_platform_interface/test/platform_interface_tests/platform_interface_user_test.dart b/packages/firebase_auth/firebase_auth_platform_interface/test/platform_interface_tests/platform_interface_user_test.dart index abc49090f128..9247c1796229 100644 --- a/packages/firebase_auth/firebase_auth_platform_interface/test/platform_interface_tests/platform_interface_user_test.dart +++ b/packages/firebase_auth/firebase_auth_platform_interface/test/platform_interface_tests/platform_interface_user_test.dart @@ -40,13 +40,13 @@ void main() { }, ]; group('$UserPlatform()', () { - PigeonUserDetails kMockUser; + InternalUserDetails kMockUser; setUpAll(() async { await Firebase.initializeApp(); auth = FirebaseAuthPlatform.instance; - kMockUser = PigeonUserDetails( - userInfo: PigeonUserInfo( + kMockUser = InternalUserDetails( + userInfo: InternalUserInfo( uid: kMockUid, isAnonymous: true, email: kMockEmail, @@ -289,6 +289,6 @@ void main() { class TestUserPlatform extends UserPlatform { TestUserPlatform(FirebaseAuthPlatform auth, MultiFactorPlatform multiFactor, - PigeonUserDetails data) + InternalUserDetails data) : super(auth, multiFactor, data); } diff --git a/packages/firebase_auth/firebase_auth_web/lib/firebase_auth_web.dart b/packages/firebase_auth/firebase_auth_web/lib/firebase_auth_web.dart index 62dd3bc843b2..5ee8031d52ac 100644 --- a/packages/firebase_auth/firebase_auth_web/lib/firebase_auth_web.dart +++ b/packages/firebase_auth/firebase_auth_web/lib/firebase_auth_web.dart @@ -219,7 +219,7 @@ class FirebaseAuthWeb extends FirebaseAuthPlatform { @override FirebaseAuthWeb setInitialValues({ - PigeonUserDetails? currentUser, + InternalUserDetails? currentUser, String? languageCode, }) { // Values are already set on web diff --git a/packages/firebase_auth/firebase_auth_web/lib/src/firebase_auth_web_user.dart b/packages/firebase_auth/firebase_auth_web/lib/src/firebase_auth_web_user.dart index 28f6efeb6fe4..20c345d90a32 100644 --- a/packages/firebase_auth/firebase_auth_web/lib/src/firebase_auth_web_user.dart +++ b/packages/firebase_auth/firebase_auth_web/lib/src/firebase_auth_web_user.dart @@ -25,8 +25,8 @@ class UserWeb extends UserPlatform { ) : super( auth, multiFactor, - PigeonUserDetails( - userInfo: PigeonUserInfo( + InternalUserDetails( + userInfo: InternalUserInfo( displayName: _webUser.displayName, email: _webUser.email, isEmailVerified: _webUser.emailVerified, diff --git a/packages/firebase_auth/firebase_auth_web/lib/src/utils/web_utils.dart b/packages/firebase_auth/firebase_auth_web/lib/src/utils/web_utils.dart index 7e215a3299b4..1dd2681fc52e 100644 --- a/packages/firebase_auth/firebase_auth_web/lib/src/utils/web_utils.dart +++ b/packages/firebase_auth/firebase_auth_web/lib/src/utils/web_utils.dart @@ -221,7 +221,7 @@ IdTokenResult convertWebIdTokenResult( auth_interop.IdTokenResult webIdTokenResult, ) { return IdTokenResult( - PigeonIdTokenResult( + InternalIdTokenResult( claims: webIdTokenResult.claims, token: webIdTokenResult.token, authTimestamp: webIdTokenResult.authTime.millisecondsSinceEpoch, diff --git a/packages/firebase_core/analysis_options.yaml b/packages/firebase_core/analysis_options.yaml index 9afc3598d90a..9d4eb42ab944 100644 --- a/packages/firebase_core/analysis_options.yaml +++ b/packages/firebase_core/analysis_options.yaml @@ -9,6 +9,7 @@ analyzer: exclude: - firebase_core_platform_interface/lib/src/pigeon/messages.pigeon.dart - firebase_core_platform_interface/lib/src/pigeon/test_api.dart + - firebase_core_platform_interface/pigeons/messages.dart linter: rules: diff --git a/packages/firebase_core/firebase_core/android/src/main/java/io/flutter/plugins/firebase/core/GeneratedAndroidFirebaseCore.java b/packages/firebase_core/firebase_core/android/src/main/java/io/flutter/plugins/firebase/core/GeneratedAndroidFirebaseCore.java index af1dec848522..8a5db2e48066 100644 --- a/packages/firebase_core/firebase_core/android/src/main/java/io/flutter/plugins/firebase/core/GeneratedAndroidFirebaseCore.java +++ b/packages/firebase_core/firebase_core/android/src/main/java/io/flutter/plugins/firebase/core/GeneratedAndroidFirebaseCore.java @@ -1,7 +1,7 @@ // Copyright 2023, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v25.3.2), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), do not edit directly. // See also: https://pub.dev/packages/pigeon package io.flutter.plugins.firebase.core; @@ -21,13 +21,170 @@ import java.lang.annotation.Target; import java.nio.ByteBuffer; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.Map; -import java.util.Objects; /** Generated class from Pigeon. */ @SuppressWarnings({"unused", "unchecked", "CodeBlock2Expr", "RedundantSuppression", "serial"}) public class GeneratedAndroidFirebaseCore { + static boolean pigeonDoubleEquals(double a, double b) { + // Normalize -0.0 to 0.0 and handle NaN equality. + return (a == 0.0 ? 0.0 : a) == (b == 0.0 ? 0.0 : b) || (Double.isNaN(a) && Double.isNaN(b)); + } + + static boolean pigeonFloatEquals(float a, float b) { + // Normalize -0.0 to 0.0 and handle NaN equality. + return (a == 0.0f ? 0.0f : a) == (b == 0.0f ? 0.0f : b) || (Float.isNaN(a) && Float.isNaN(b)); + } + + static int pigeonDoubleHashCode(double d) { + // Normalize -0.0 to 0.0 and handle NaN to ensure consistent hash codes. + if (d == 0.0) { + d = 0.0; + } + long bits = Double.doubleToLongBits(d); + return (int) (bits ^ (bits >>> 32)); + } + + static int pigeonFloatHashCode(float f) { + // Normalize -0.0 to 0.0 and handle NaN to ensure consistent hash codes. + if (f == 0.0f) { + f = 0.0f; + } + return Float.floatToIntBits(f); + } + + static boolean pigeonDeepEquals(Object a, Object b) { + if (a == b) { + return true; + } + if (a == null || b == null) { + return false; + } + if (a instanceof byte[] && b instanceof byte[]) { + return Arrays.equals((byte[]) a, (byte[]) b); + } + if (a instanceof int[] && b instanceof int[]) { + return Arrays.equals((int[]) a, (int[]) b); + } + if (a instanceof long[] && b instanceof long[]) { + return Arrays.equals((long[]) a, (long[]) b); + } + if (a instanceof double[] && b instanceof double[]) { + double[] da = (double[]) a; + double[] db = (double[]) b; + if (da.length != db.length) { + return false; + } + for (int i = 0; i < da.length; i++) { + if (!pigeonDoubleEquals(da[i], db[i])) { + return false; + } + } + return true; + } + if (a instanceof List && b instanceof List) { + List listA = (List) a; + List listB = (List) b; + if (listA.size() != listB.size()) { + return false; + } + for (int i = 0; i < listA.size(); i++) { + if (!pigeonDeepEquals(listA.get(i), listB.get(i))) { + return false; + } + } + return true; + } + if (a instanceof Map && b instanceof Map) { + Map mapA = (Map) a; + Map mapB = (Map) b; + if (mapA.size() != mapB.size()) { + return false; + } + for (Map.Entry entryA : mapA.entrySet()) { + Object keyA = entryA.getKey(); + Object valueA = entryA.getValue(); + boolean found = false; + for (Map.Entry entryB : mapB.entrySet()) { + Object keyB = entryB.getKey(); + if (pigeonDeepEquals(keyA, keyB)) { + Object valueB = entryB.getValue(); + if (pigeonDeepEquals(valueA, valueB)) { + found = true; + break; + } else { + return false; + } + } + } + if (!found) { + return false; + } + } + return true; + } + if (a instanceof Double && b instanceof Double) { + return pigeonDoubleEquals((double) a, (double) b); + } + if (a instanceof Float && b instanceof Float) { + return pigeonFloatEquals((float) a, (float) b); + } + return a.equals(b); + } + + static int pigeonDeepHashCode(Object value) { + if (value == null) { + return 0; + } + if (value instanceof byte[]) { + return Arrays.hashCode((byte[]) value); + } + if (value instanceof int[]) { + return Arrays.hashCode((int[]) value); + } + if (value instanceof long[]) { + return Arrays.hashCode((long[]) value); + } + if (value instanceof double[]) { + double[] da = (double[]) value; + int result = 1; + for (double d : da) { + result = 31 * result + pigeonDoubleHashCode(d); + } + return result; + } + if (value instanceof List) { + int result = 1; + for (Object item : (List) value) { + result = 31 * result + pigeonDeepHashCode(item); + } + return result; + } + if (value instanceof Map) { + int result = 0; + for (Map.Entry entry : ((Map) value).entrySet()) { + result += + ((pigeonDeepHashCode(entry.getKey()) * 31) ^ pigeonDeepHashCode(entry.getValue())); + } + return result; + } + if (value instanceof Object[]) { + int result = 1; + for (Object item : (Object[]) value) { + result = 31 * result + pigeonDeepHashCode(item); + } + return result; + } + if (value instanceof Double) { + return pigeonDoubleHashCode((double) value); + } + if (value instanceof Float) { + return pigeonFloatHashCode((float) value); + } + return value.hashCode(); + } /** Error class for passing custom error details to Flutter via a thrown PlatformException. */ public static class FlutterError extends RuntimeException { @@ -232,39 +389,43 @@ public boolean equals(Object o) { return false; } CoreFirebaseOptions that = (CoreFirebaseOptions) o; - return apiKey.equals(that.apiKey) - && appId.equals(that.appId) - && messagingSenderId.equals(that.messagingSenderId) - && projectId.equals(that.projectId) - && Objects.equals(authDomain, that.authDomain) - && Objects.equals(databaseURL, that.databaseURL) - && Objects.equals(storageBucket, that.storageBucket) - && Objects.equals(measurementId, that.measurementId) - && Objects.equals(trackingId, that.trackingId) - && Objects.equals(deepLinkURLScheme, that.deepLinkURLScheme) - && Objects.equals(androidClientId, that.androidClientId) - && Objects.equals(iosClientId, that.iosClientId) - && Objects.equals(iosBundleId, that.iosBundleId) - && Objects.equals(appGroupId, that.appGroupId); + return pigeonDeepEquals(apiKey, that.apiKey) + && pigeonDeepEquals(appId, that.appId) + && pigeonDeepEquals(messagingSenderId, that.messagingSenderId) + && pigeonDeepEquals(projectId, that.projectId) + && pigeonDeepEquals(authDomain, that.authDomain) + && pigeonDeepEquals(databaseURL, that.databaseURL) + && pigeonDeepEquals(storageBucket, that.storageBucket) + && pigeonDeepEquals(measurementId, that.measurementId) + && pigeonDeepEquals(trackingId, that.trackingId) + && pigeonDeepEquals(deepLinkURLScheme, that.deepLinkURLScheme) + && pigeonDeepEquals(androidClientId, that.androidClientId) + && pigeonDeepEquals(iosClientId, that.iosClientId) + && pigeonDeepEquals(iosBundleId, that.iosBundleId) + && pigeonDeepEquals(appGroupId, that.appGroupId); } @Override public int hashCode() { - return Objects.hash( - apiKey, - appId, - messagingSenderId, - projectId, - authDomain, - databaseURL, - storageBucket, - measurementId, - trackingId, - deepLinkURLScheme, - androidClientId, - iosClientId, - iosBundleId, - appGroupId); + Object[] fields = + new Object[] { + getClass(), + apiKey, + appId, + messagingSenderId, + projectId, + authDomain, + databaseURL, + storageBucket, + measurementId, + trackingId, + deepLinkURLScheme, + androidClientId, + iosClientId, + iosBundleId, + appGroupId + }; + return pigeonDeepHashCode(fields); } public static final class Builder { @@ -518,15 +679,20 @@ public boolean equals(Object o) { return false; } CoreInitializeResponse that = (CoreInitializeResponse) o; - return name.equals(that.name) - && options.equals(that.options) - && Objects.equals(isAutomaticDataCollectionEnabled, that.isAutomaticDataCollectionEnabled) - && pluginConstants.equals(that.pluginConstants); + return pigeonDeepEquals(name, that.name) + && pigeonDeepEquals(options, that.options) + && pigeonDeepEquals( + isAutomaticDataCollectionEnabled, that.isAutomaticDataCollectionEnabled) + && pigeonDeepEquals(pluginConstants, that.pluginConstants); } @Override public int hashCode() { - return Objects.hash(name, options, isAutomaticDataCollectionEnabled, pluginConstants); + Object[] fields = + new Object[] { + getClass(), name, options, isAutomaticDataCollectionEnabled, pluginConstants + }; + return pigeonDeepHashCode(fields); } public static final class Builder { diff --git a/packages/firebase_core/firebase_core/ios/firebase_core/Sources/firebase_core/include/firebase_core/messages.g.h b/packages/firebase_core/firebase_core/ios/firebase_core/Sources/firebase_core/include/firebase_core/messages.g.h index cc06241e7cb1..913fdbbd3e43 100644 --- a/packages/firebase_core/firebase_core/ios/firebase_core/Sources/firebase_core/include/firebase_core/messages.g.h +++ b/packages/firebase_core/firebase_core/ios/firebase_core/Sources/firebase_core/include/firebase_core/messages.g.h @@ -1,10 +1,10 @@ // Copyright 2023, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v25.3.2), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), do not edit directly. // See also: https://pub.dev/packages/pigeon -#import +@import Foundation; @protocol FlutterBinaryMessenger; @protocol FlutterMessageCodec; diff --git a/packages/firebase_core/firebase_core/ios/firebase_core/Sources/firebase_core/messages.g.m b/packages/firebase_core/firebase_core/ios/firebase_core/Sources/firebase_core/messages.g.m index cf3e439b92ac..c0d58e28a6f3 100644 --- a/packages/firebase_core/firebase_core/ios/firebase_core/Sources/firebase_core/messages.g.m +++ b/packages/firebase_core/firebase_core/ios/firebase_core/Sources/firebase_core/messages.g.m @@ -1,24 +1,107 @@ // Copyright 2023, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v25.3.2), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), do not edit directly. // See also: https://pub.dev/packages/pigeon -#if __has_include("include/firebase_core/messages.g.h") -#import "include/firebase_core/messages.g.h" -#else -#import "include/messages.g.h" -#endif +#import "messages.g.h" #if TARGET_OS_OSX -#import +@import FlutterMacOS; #else -#import +@import Flutter; #endif -#if !__has_feature(objc_arc) -#error File requires ARC to be enabled. -#endif +static BOOL __attribute__((unused)) FLTPigeonDeepEquals(id _Nullable a, id _Nullable b) { + if (a == b) { + return YES; + } + if (a == nil) { + return b == [NSNull null]; + } + if (b == nil) { + return a == [NSNull null]; + } + if ([a isKindOfClass:[NSNumber class]] && [b isKindOfClass:[NSNumber class]]) { + return + [a isEqual:b] || (isnan([(NSNumber *)a doubleValue]) && isnan([(NSNumber *)b doubleValue])); + } + if ([a isKindOfClass:[NSArray class]] && [b isKindOfClass:[NSArray class]]) { + NSArray *arrayA = (NSArray *)a; + NSArray *arrayB = (NSArray *)b; + if (arrayA.count != arrayB.count) { + return NO; + } + for (NSUInteger i = 0; i < arrayA.count; i++) { + if (!FLTPigeonDeepEquals(arrayA[i], arrayB[i])) { + return NO; + } + } + return YES; + } + if ([a isKindOfClass:[NSDictionary class]] && [b isKindOfClass:[NSDictionary class]]) { + NSDictionary *dictA = (NSDictionary *)a; + NSDictionary *dictB = (NSDictionary *)b; + if (dictA.count != dictB.count) { + return NO; + } + for (id keyA in dictA) { + id valueA = dictA[keyA]; + BOOL found = NO; + for (id keyB in dictB) { + if (FLTPigeonDeepEquals(keyA, keyB)) { + id valueB = dictB[keyB]; + if (FLTPigeonDeepEquals(valueA, valueB)) { + found = YES; + break; + } else { + return NO; + } + } + } + if (!found) { + return NO; + } + } + return YES; + } + return [a isEqual:b]; +} + +static NSUInteger __attribute__((unused)) FLTPigeonDeepHash(id _Nullable value) { + if (value == nil || value == (id)[NSNull null]) { + return 0; + } + if ([value isKindOfClass:[NSNumber class]]) { + NSNumber *n = (NSNumber *)value; + double d = n.doubleValue; + if (isnan(d)) { + // Normalize NaN to a consistent hash. + return (NSUInteger)0x7FF8000000000000; + } + if (d == 0.0) { + // Normalize -0.0 to 0.0 so they have the same hash code. + d = 0.0; + } + return @(d).hash; + } + if ([value isKindOfClass:[NSArray class]]) { + NSUInteger result = 1; + for (id item in (NSArray *)value) { + result = result * 31 + FLTPigeonDeepHash(item); + } + return result; + } + if ([value isKindOfClass:[NSDictionary class]]) { + NSUInteger result = 0; + NSDictionary *dict = (NSDictionary *)value; + for (id key in dict) { + result += ((FLTPigeonDeepHash(key) * 31) ^ FLTPigeonDeepHash(dict[key])); + } + return result; + } + return [value hash]; +} static NSArray *wrapResult(id result, FlutterError *error) { if (error) { @@ -117,6 +200,48 @@ + (nullable CoreFirebaseOptions *)nullableFromList:(NSArray *)list { self.appGroupId ?: [NSNull null], ]; } +- (BOOL)isEqual:(id)object { + if (self == object) { + return YES; + } + if (![object isKindOfClass:[self class]]) { + return NO; + } + CoreFirebaseOptions *other = (CoreFirebaseOptions *)object; + return FLTPigeonDeepEquals(self.apiKey, other.apiKey) && + FLTPigeonDeepEquals(self.appId, other.appId) && + FLTPigeonDeepEquals(self.messagingSenderId, other.messagingSenderId) && + FLTPigeonDeepEquals(self.projectId, other.projectId) && + FLTPigeonDeepEquals(self.authDomain, other.authDomain) && + FLTPigeonDeepEquals(self.databaseURL, other.databaseURL) && + FLTPigeonDeepEquals(self.storageBucket, other.storageBucket) && + FLTPigeonDeepEquals(self.measurementId, other.measurementId) && + FLTPigeonDeepEquals(self.trackingId, other.trackingId) && + FLTPigeonDeepEquals(self.deepLinkURLScheme, other.deepLinkURLScheme) && + FLTPigeonDeepEquals(self.androidClientId, other.androidClientId) && + FLTPigeonDeepEquals(self.iosClientId, other.iosClientId) && + FLTPigeonDeepEquals(self.iosBundleId, other.iosBundleId) && + FLTPigeonDeepEquals(self.appGroupId, other.appGroupId); +} + +- (NSUInteger)hash { + NSUInteger result = [self class].hash; + result = result * 31 + FLTPigeonDeepHash(self.apiKey); + result = result * 31 + FLTPigeonDeepHash(self.appId); + result = result * 31 + FLTPigeonDeepHash(self.messagingSenderId); + result = result * 31 + FLTPigeonDeepHash(self.projectId); + result = result * 31 + FLTPigeonDeepHash(self.authDomain); + result = result * 31 + FLTPigeonDeepHash(self.databaseURL); + result = result * 31 + FLTPigeonDeepHash(self.storageBucket); + result = result * 31 + FLTPigeonDeepHash(self.measurementId); + result = result * 31 + FLTPigeonDeepHash(self.trackingId); + result = result * 31 + FLTPigeonDeepHash(self.deepLinkURLScheme); + result = result * 31 + FLTPigeonDeepHash(self.androidClientId); + result = result * 31 + FLTPigeonDeepHash(self.iosClientId); + result = result * 31 + FLTPigeonDeepHash(self.iosBundleId); + result = result * 31 + FLTPigeonDeepHash(self.appGroupId); + return result; +} @end @implementation CoreInitializeResponse @@ -150,6 +275,29 @@ + (nullable CoreInitializeResponse *)nullableFromList:(NSArray *)list { self.pluginConstants ?: [NSNull null], ]; } +- (BOOL)isEqual:(id)object { + if (self == object) { + return YES; + } + if (![object isKindOfClass:[self class]]) { + return NO; + } + CoreInitializeResponse *other = (CoreInitializeResponse *)object; + return FLTPigeonDeepEquals(self.name, other.name) && + FLTPigeonDeepEquals(self.options, other.options) && + FLTPigeonDeepEquals(self.isAutomaticDataCollectionEnabled, + other.isAutomaticDataCollectionEnabled) && + FLTPigeonDeepEquals(self.pluginConstants, other.pluginConstants); +} + +- (NSUInteger)hash { + NSUInteger result = [self class].hash; + result = result * 31 + FLTPigeonDeepHash(self.name); + result = result * 31 + FLTPigeonDeepHash(self.options); + result = result * 31 + FLTPigeonDeepHash(self.isAutomaticDataCollectionEnabled); + result = result * 31 + FLTPigeonDeepHash(self.pluginConstants); + return result; +} @end @interface nullMessagesPigeonCodecReader : FlutterStandardReader diff --git a/packages/firebase_core/firebase_core/windows/messages.g.cpp b/packages/firebase_core/firebase_core/windows/messages.g.cpp index dfa5388d5c6c..42e8046a21e1 100644 --- a/packages/firebase_core/firebase_core/windows/messages.g.cpp +++ b/packages/firebase_core/firebase_core/windows/messages.g.cpp @@ -1,7 +1,7 @@ // Copyright 2023, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v25.3.2), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), do not edit directly. // See also: https://pub.dev/packages/pigeon #undef _HAS_EXCEPTIONS @@ -13,16 +13,18 @@ #include #include +#include +#include #include #include #include namespace firebase_core_windows { -using flutter::BasicMessageChannel; -using flutter::CustomEncodableValue; -using flutter::EncodableList; -using flutter::EncodableMap; -using flutter::EncodableValue; +using ::flutter::BasicMessageChannel; +using ::flutter::CustomEncodableValue; +using ::flutter::EncodableList; +using ::flutter::EncodableMap; +using ::flutter::EncodableValue; FlutterError CreateConnectionError(const std::string channel_name) { return FlutterError( @@ -31,6 +33,212 @@ FlutterError CreateConnectionError(const std::string channel_name) { EncodableValue("")); } +namespace { +template +bool PigeonInternalDeepEquals(const T& a, const T& b); + +bool PigeonInternalDeepEquals(const double& a, const double& b); + +template +bool PigeonInternalDeepEquals(const std::vector& a, const std::vector& b); + +template +bool PigeonInternalDeepEquals(const std::map& a, const std::map& b); + +template +bool PigeonInternalDeepEquals(const std::optional& a, + const std::optional& b); + +template +bool PigeonInternalDeepEquals(const std::unique_ptr& a, + const std::unique_ptr& b); + +bool PigeonInternalDeepEquals(const ::flutter::EncodableValue& a, + const ::flutter::EncodableValue& b); + +template +bool PigeonInternalDeepEquals(const T& a, const T& b) { + return a == b; +} + +template +bool PigeonInternalDeepEquals(const std::vector& a, + const std::vector& b) { + if (a.size() != b.size()) { + return false; + } + for (size_t i = 0; i < a.size(); ++i) { + if (!PigeonInternalDeepEquals(a[i], b[i])) { + return false; + } + } + return true; +} + +template +bool PigeonInternalDeepEquals(const std::map& a, + const std::map& b) { + if (a.size() != b.size()) { + return false; + } + for (const auto& kv : a) { + bool found = false; + for (const auto& b_kv : b) { + if (PigeonInternalDeepEquals(kv.first, b_kv.first)) { + if (PigeonInternalDeepEquals(kv.second, b_kv.second)) { + found = true; + break; + } else { + return false; + } + } + } + if (!found) { + return false; + } + } + return true; +} + +bool PigeonInternalDeepEquals(const double& a, const double& b) { + // Normalize -0.0 to 0.0 and handle NaN equality. + return (a == b) || (std::isnan(a) && std::isnan(b)); +} + +template +bool PigeonInternalDeepEquals(const std::optional& a, + const std::optional& b) { + if (!a && !b) { + return true; + } + if (!a || !b) { + return false; + } + return PigeonInternalDeepEquals(*a, *b); +} + +template +bool PigeonInternalDeepEquals(const std::unique_ptr& a, + const std::unique_ptr& b) { + if (a.get() == b.get()) { + return true; + } + if (!a || !b) { + return false; + } + return PigeonInternalDeepEquals(*a, *b); +} + +bool PigeonInternalDeepEquals(const ::flutter::EncodableValue& a, + const ::flutter::EncodableValue& b) { + if (a.index() != b.index()) { + return false; + } + if (const double* da = std::get_if(&a)) { + return PigeonInternalDeepEquals(*da, std::get(b)); + } else if (const ::flutter::EncodableList* la = + std::get_if<::flutter::EncodableList>(&a)) { + return PigeonInternalDeepEquals(*la, std::get<::flutter::EncodableList>(b)); + } else if (const ::flutter::EncodableMap* ma = + std::get_if<::flutter::EncodableMap>(&a)) { + return PigeonInternalDeepEquals(*ma, std::get<::flutter::EncodableMap>(b)); + } + return a == b; +} + +template +size_t PigeonInternalDeepHash(const T& v); + +size_t PigeonInternalDeepHash(const double& v); + +template +size_t PigeonInternalDeepHash(const std::vector& v); + +template +size_t PigeonInternalDeepHash(const std::map& v); + +template +size_t PigeonInternalDeepHash(const std::optional& v); + +template +size_t PigeonInternalDeepHash(const std::unique_ptr& v); + +size_t PigeonInternalDeepHash(const ::flutter::EncodableValue& v); + +template +size_t PigeonInternalDeepHash(const T& v) { + return std::hash()(v); +} + +template +size_t PigeonInternalDeepHash(const std::vector& v) { + size_t result = 1; + for (const auto& item : v) { + result = result * 31 + PigeonInternalDeepHash(item); + } + return result; +} + +template +size_t PigeonInternalDeepHash(const std::map& v) { + size_t result = 0; + for (const auto& kv : v) { + result += ((PigeonInternalDeepHash(kv.first) * 31) ^ + PigeonInternalDeepHash(kv.second)); + } + return result; +} + +size_t PigeonInternalDeepHash(const double& v) { + if (std::isnan(v)) { + // Normalize NaN to a consistent hash. + return std::hash()(std::numeric_limits::quiet_NaN()); + } + if (v == 0.0) { + // Normalize -0.0 to 0.0 so they have the same hash code. + return std::hash()(0.0); + } + return std::hash()(v); +} + +template +size_t PigeonInternalDeepHash(const std::optional& v) { + return v ? PigeonInternalDeepHash(*v) : 0; +} + +template +size_t PigeonInternalDeepHash(const std::unique_ptr& v) { + return v ? PigeonInternalDeepHash(*v) : 0; +} + +size_t PigeonInternalDeepHash(const ::flutter::EncodableValue& v) { + size_t result = v.index(); + if (const double* dv = std::get_if(&v)) { + result = result * 31 + PigeonInternalDeepHash(*dv); + } else if (const ::flutter::EncodableList* lv = + std::get_if<::flutter::EncodableList>(&v)) { + result = result * 31 + PigeonInternalDeepHash(*lv); + } else if (const ::flutter::EncodableMap* mv = + std::get_if<::flutter::EncodableMap>(&v)) { + result = result * 31 + PigeonInternalDeepHash(*mv); + } else { + std::visit( + [&result](const auto& val) { + using T = std::decay_t; + if constexpr (!std::is_same_v && + !std::is_same_v && + !std::is_same_v && + !std::is_same_v && + !std::is_same_v) { + result = result * 31 + PigeonInternalDeepHash(val); + } + }, + v); + } + return result; +} + +} // namespace // CoreFirebaseOptions CoreFirebaseOptions::CoreFirebaseOptions(const std::string& api_key, @@ -326,6 +534,51 @@ CoreFirebaseOptions CoreFirebaseOptions::FromEncodableList( return decoded; } +bool CoreFirebaseOptions::operator==(const CoreFirebaseOptions& other) const { + return PigeonInternalDeepEquals(api_key_, other.api_key_) && + PigeonInternalDeepEquals(app_id_, other.app_id_) && + PigeonInternalDeepEquals(messaging_sender_id_, + other.messaging_sender_id_) && + PigeonInternalDeepEquals(project_id_, other.project_id_) && + PigeonInternalDeepEquals(auth_domain_, other.auth_domain_) && + PigeonInternalDeepEquals(database_u_r_l_, other.database_u_r_l_) && + PigeonInternalDeepEquals(storage_bucket_, other.storage_bucket_) && + PigeonInternalDeepEquals(measurement_id_, other.measurement_id_) && + PigeonInternalDeepEquals(tracking_id_, other.tracking_id_) && + PigeonInternalDeepEquals(deep_link_u_r_l_scheme_, + other.deep_link_u_r_l_scheme_) && + PigeonInternalDeepEquals(android_client_id_, + other.android_client_id_) && + PigeonInternalDeepEquals(ios_client_id_, other.ios_client_id_) && + PigeonInternalDeepEquals(ios_bundle_id_, other.ios_bundle_id_) && + PigeonInternalDeepEquals(app_group_id_, other.app_group_id_); +} + +bool CoreFirebaseOptions::operator!=(const CoreFirebaseOptions& other) const { + return !(*this == other); +} + +size_t CoreFirebaseOptions::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(api_key_); + result = result * 31 + PigeonInternalDeepHash(app_id_); + result = result * 31 + PigeonInternalDeepHash(messaging_sender_id_); + result = result * 31 + PigeonInternalDeepHash(project_id_); + result = result * 31 + PigeonInternalDeepHash(auth_domain_); + result = result * 31 + PigeonInternalDeepHash(database_u_r_l_); + result = result * 31 + PigeonInternalDeepHash(storage_bucket_); + result = result * 31 + PigeonInternalDeepHash(measurement_id_); + result = result * 31 + PigeonInternalDeepHash(tracking_id_); + result = result * 31 + PigeonInternalDeepHash(deep_link_u_r_l_scheme_); + result = result * 31 + PigeonInternalDeepHash(android_client_id_); + result = result * 31 + PigeonInternalDeepHash(ios_client_id_); + result = result * 31 + PigeonInternalDeepHash(ios_bundle_id_); + result = result * 31 + PigeonInternalDeepHash(app_group_id_); + return result; +} + +size_t PigeonInternalDeepHash(const CoreFirebaseOptions& v) { return v.Hash(); } + // CoreInitializeResponse CoreInitializeResponse::CoreInitializeResponse( @@ -435,10 +688,39 @@ CoreInitializeResponse CoreInitializeResponse::FromEncodableList( return decoded; } +bool CoreInitializeResponse::operator==( + const CoreInitializeResponse& other) const { + return PigeonInternalDeepEquals(name_, other.name_) && + PigeonInternalDeepEquals(options_, other.options_) && + PigeonInternalDeepEquals( + is_automatic_data_collection_enabled_, + other.is_automatic_data_collection_enabled_) && + PigeonInternalDeepEquals(plugin_constants_, other.plugin_constants_); +} + +bool CoreInitializeResponse::operator!=( + const CoreInitializeResponse& other) const { + return !(*this == other); +} + +size_t CoreInitializeResponse::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(name_); + result = result * 31 + PigeonInternalDeepHash(options_); + result = result * 31 + + PigeonInternalDeepHash(is_automatic_data_collection_enabled_); + result = result * 31 + PigeonInternalDeepHash(plugin_constants_); + return result; +} + +size_t PigeonInternalDeepHash(const CoreInitializeResponse& v) { + return v.Hash(); +} + PigeonInternalCodecSerializer::PigeonInternalCodecSerializer() {} EncodableValue PigeonInternalCodecSerializer::ReadValueOfType( - uint8_t type, flutter::ByteStreamReader* stream) const { + uint8_t type, ::flutter::ByteStreamReader* stream) const { switch (type) { case 129: { return CustomEncodableValue(CoreFirebaseOptions::FromEncodableList( @@ -449,12 +731,12 @@ EncodableValue PigeonInternalCodecSerializer::ReadValueOfType( std::get(ReadValue(stream)))); } default: - return flutter::StandardCodecSerializer::ReadValueOfType(type, stream); + return ::flutter::StandardCodecSerializer::ReadValueOfType(type, stream); } } void PigeonInternalCodecSerializer::WriteValue( - const EncodableValue& value, flutter::ByteStreamWriter* stream) const { + const EncodableValue& value, ::flutter::ByteStreamWriter* stream) const { if (const CustomEncodableValue* custom_value = std::get_if(&value)) { if (custom_value->type() == typeid(CoreFirebaseOptions)) { @@ -474,23 +756,23 @@ void PigeonInternalCodecSerializer::WriteValue( return; } } - flutter::StandardCodecSerializer::WriteValue(value, stream); + ::flutter::StandardCodecSerializer::WriteValue(value, stream); } /// The codec used by FirebaseCoreHostApi. -const flutter::StandardMessageCodec& FirebaseCoreHostApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance( +const ::flutter::StandardMessageCodec& FirebaseCoreHostApi::GetCodec() { + return ::flutter::StandardMessageCodec::GetInstance( &PigeonInternalCodecSerializer::GetInstance()); } // Sets up an instance of `FirebaseCoreHostApi` to handle messages through the // `binary_messenger`. -void FirebaseCoreHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, +void FirebaseCoreHostApi::SetUp(::flutter::BinaryMessenger* binary_messenger, FirebaseCoreHostApi* api) { FirebaseCoreHostApi::SetUp(binary_messenger, api, ""); } -void FirebaseCoreHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, +void FirebaseCoreHostApi::SetUp(::flutter::BinaryMessenger* binary_messenger, FirebaseCoreHostApi* api, const std::string& message_channel_suffix) { const std::string prepended_suffix = @@ -507,7 +789,7 @@ void FirebaseCoreHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_name_arg = args.at(0); @@ -557,7 +839,7 @@ void FirebaseCoreHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { api->InitializeCore([reply](ErrorOr&& output) { if (output.has_error()) { @@ -587,7 +869,7 @@ void FirebaseCoreHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { api->OptionsFromResource( [reply](ErrorOr&& output) { @@ -623,19 +905,19 @@ EncodableValue FirebaseCoreHostApi::WrapError(const FlutterError& error) { } /// The codec used by FirebaseAppHostApi. -const flutter::StandardMessageCodec& FirebaseAppHostApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance( +const ::flutter::StandardMessageCodec& FirebaseAppHostApi::GetCodec() { + return ::flutter::StandardMessageCodec::GetInstance( &PigeonInternalCodecSerializer::GetInstance()); } // Sets up an instance of `FirebaseAppHostApi` to handle messages through the // `binary_messenger`. -void FirebaseAppHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, +void FirebaseAppHostApi::SetUp(::flutter::BinaryMessenger* binary_messenger, FirebaseAppHostApi* api) { FirebaseAppHostApi::SetUp(binary_messenger, api, ""); } -void FirebaseAppHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, +void FirebaseAppHostApi::SetUp(::flutter::BinaryMessenger* binary_messenger, FirebaseAppHostApi* api, const std::string& message_channel_suffix) { const std::string prepended_suffix = @@ -652,7 +934,7 @@ void FirebaseAppHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_name_arg = args.at(0); @@ -697,7 +979,7 @@ void FirebaseAppHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_name_arg = args.at(0); @@ -741,7 +1023,7 @@ void FirebaseAppHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_name_arg = args.at(0); diff --git a/packages/firebase_core/firebase_core/windows/messages.g.h b/packages/firebase_core/firebase_core/windows/messages.g.h index 68a41114984b..bce0a6a81f24 100644 --- a/packages/firebase_core/firebase_core/windows/messages.g.h +++ b/packages/firebase_core/firebase_core/windows/messages.g.h @@ -1,7 +1,7 @@ // Copyright 2023, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v25.3.2), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), do not edit directly. // See also: https://pub.dev/packages/pigeon #ifndef PIGEON_MESSAGES_G_H_ @@ -25,17 +25,17 @@ class FlutterError { explicit FlutterError(const std::string& code, const std::string& message) : code_(code), message_(message) {} explicit FlutterError(const std::string& code, const std::string& message, - const flutter::EncodableValue& details) + const ::flutter::EncodableValue& details) : code_(code), message_(message), details_(details) {} const std::string& code() const { return code_; } const std::string& message() const { return message_; } - const flutter::EncodableValue& details() const { return details_; } + const ::flutter::EncodableValue& details() const { return details_; } private: std::string code_; std::string message_; - flutter::EncodableValue details_; + ::flutter::EncodableValue details_; }; template @@ -130,10 +130,22 @@ class CoreFirebaseOptions { void set_app_group_id(const std::string_view* value_arg); void set_app_group_id(std::string_view value_arg); + bool operator==(const CoreFirebaseOptions& other) const; + bool operator!=(const CoreFirebaseOptions& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + private: static CoreFirebaseOptions FromEncodableList( - const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; + const ::flutter::EncodableList& list); + + public: + public: + ::flutter::EncodableList ToEncodableList() const; + + private: + private: friend class CoreInitializeResponse; friend class FirebaseCoreHostApi; friend class FirebaseAppHostApi; @@ -160,13 +172,13 @@ class CoreInitializeResponse { // Constructs an object setting all non-nullable fields. explicit CoreInitializeResponse( const std::string& name, const CoreFirebaseOptions& options, - const flutter::EncodableMap& plugin_constants); + const ::flutter::EncodableMap& plugin_constants); // Constructs an object setting all fields. explicit CoreInitializeResponse( const std::string& name, const CoreFirebaseOptions& options, const bool* is_automatic_data_collection_enabled, - const flutter::EncodableMap& plugin_constants); + const ::flutter::EncodableMap& plugin_constants); ~CoreInitializeResponse() = default; CoreInitializeResponse(const CoreInitializeResponse& other); @@ -184,23 +196,36 @@ class CoreInitializeResponse { void set_is_automatic_data_collection_enabled(const bool* value_arg); void set_is_automatic_data_collection_enabled(bool value_arg); - const flutter::EncodableMap& plugin_constants() const; - void set_plugin_constants(const flutter::EncodableMap& value_arg); + const ::flutter::EncodableMap& plugin_constants() const; + void set_plugin_constants(const ::flutter::EncodableMap& value_arg); + + bool operator==(const CoreInitializeResponse& other) const; + bool operator!=(const CoreInitializeResponse& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; private: static CoreInitializeResponse FromEncodableList( - const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; + const ::flutter::EncodableList& list); + + public: + public: + ::flutter::EncodableList ToEncodableList() const; + + private: + private: friend class FirebaseCoreHostApi; friend class FirebaseAppHostApi; friend class PigeonInternalCodecSerializer; std::string name_; std::unique_ptr options_; std::optional is_automatic_data_collection_enabled_; - flutter::EncodableMap plugin_constants_; + ::flutter::EncodableMap plugin_constants_; }; -class PigeonInternalCodecSerializer : public flutter::StandardCodecSerializer { +class PigeonInternalCodecSerializer + : public ::flutter::StandardCodecSerializer { public: PigeonInternalCodecSerializer(); inline static PigeonInternalCodecSerializer& GetInstance() { @@ -208,12 +233,12 @@ class PigeonInternalCodecSerializer : public flutter::StandardCodecSerializer { return sInstance; } - void WriteValue(const flutter::EncodableValue& value, - flutter::ByteStreamWriter* stream) const override; + void WriteValue(const ::flutter::EncodableValue& value, + ::flutter::ByteStreamWriter* stream) const override; protected: - flutter::EncodableValue ReadValueOfType( - uint8_t type, flutter::ByteStreamReader* stream) const override; + ::flutter::EncodableValue ReadValueOfType( + uint8_t type, ::flutter::ByteStreamReader* stream) const override; }; // Generated interface from Pigeon that represents a handler of messages from @@ -228,21 +253,21 @@ class FirebaseCoreHostApi { const CoreFirebaseOptions& initialize_app_request, std::function reply)> result) = 0; virtual void InitializeCore( - std::function reply)> result) = 0; + std::function reply)> result) = 0; virtual void OptionsFromResource( std::function reply)> result) = 0; // The codec used by FirebaseCoreHostApi. - static const flutter::StandardMessageCodec& GetCodec(); + static const ::flutter::StandardMessageCodec& GetCodec(); // Sets up an instance of `FirebaseCoreHostApi` to handle messages through the // `binary_messenger`. - static void SetUp(flutter::BinaryMessenger* binary_messenger, + static void SetUp(::flutter::BinaryMessenger* binary_messenger, FirebaseCoreHostApi* api); - static void SetUp(flutter::BinaryMessenger* binary_messenger, + static void SetUp(::flutter::BinaryMessenger* binary_messenger, FirebaseCoreHostApi* api, const std::string& message_channel_suffix); - static flutter::EncodableValue WrapError(std::string_view error_message); - static flutter::EncodableValue WrapError(const FlutterError& error); + static ::flutter::EncodableValue WrapError(std::string_view error_message); + static ::flutter::EncodableValue WrapError(const FlutterError& error); protected: FirebaseCoreHostApi() = default; @@ -265,16 +290,16 @@ class FirebaseAppHostApi { std::function reply)> result) = 0; // The codec used by FirebaseAppHostApi. - static const flutter::StandardMessageCodec& GetCodec(); + static const ::flutter::StandardMessageCodec& GetCodec(); // Sets up an instance of `FirebaseAppHostApi` to handle messages through the // `binary_messenger`. - static void SetUp(flutter::BinaryMessenger* binary_messenger, + static void SetUp(::flutter::BinaryMessenger* binary_messenger, FirebaseAppHostApi* api); - static void SetUp(flutter::BinaryMessenger* binary_messenger, + static void SetUp(::flutter::BinaryMessenger* binary_messenger, FirebaseAppHostApi* api, const std::string& message_channel_suffix); - static flutter::EncodableValue WrapError(std::string_view error_message); - static flutter::EncodableValue WrapError(const FlutterError& error); + static ::flutter::EncodableValue WrapError(std::string_view error_message); + static ::flutter::EncodableValue WrapError(const FlutterError& error); protected: FirebaseAppHostApi() = default; diff --git a/packages/firebase_core/firebase_core_platform_interface/lib/src/pigeon/messages.pigeon.dart b/packages/firebase_core/firebase_core_platform_interface/lib/src/pigeon/messages.pigeon.dart index d07a1ca4b84a..6d4123a1f1cb 100644 --- a/packages/firebase_core/firebase_core_platform_interface/lib/src/pigeon/messages.pigeon.dart +++ b/packages/firebase_core/firebase_core_platform_interface/lib/src/pigeon/messages.pigeon.dart @@ -1,21 +1,40 @@ // Copyright 2023, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v25.3.2), do not edit directly. +// Autogenerated from Pigeon (v26.3.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, no_leading_underscores_for_local_identifiers +// ignore_for_file: unused_import, unused_shown_name +// ignore_for_file: type=lint import 'dart:async'; -import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; +import 'dart:typed_data' show Float64List, Int32List, Int64List; -import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer; import 'package:flutter/services.dart'; - -PlatformException _createConnectionError(String channelName) { - return PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel: "$channelName".', - ); +import 'package:meta/meta.dart' show immutable, protected, visibleForTesting; + +Object? _extractReplyValueOrThrow( + List? replyList, + String channelName, { + required bool isNullValid, +}) { + if (replyList == null) { + throw PlatformException( + code: 'channel-error', + message: 'Unable to establish connection on channel: "$channelName".', + ); + } else if (replyList.length > 1) { + throw PlatformException( + code: replyList[0]! as String, + message: replyList[1] as String?, + details: replyList[2], + ); + } else if (!isNullValid && (replyList.isNotEmpty && replyList[0] == null)) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } + return replyList.firstOrNull; } List wrapResponse( @@ -30,20 +49,67 @@ List wrapResponse( } bool _deepEquals(Object? a, Object? b) { + if (identical(a, b)) { + return true; + } + if (a is double && b is double) { + if (a.isNaN && b.isNaN) { + return true; + } + return a == b; + } if (a is List && b is List) { return a.length == b.length && a.indexed .every(((int, dynamic) item) => _deepEquals(item.$2, b[item.$1])); } if (a is Map && b is Map) { - return a.length == b.length && - a.entries.every((MapEntry entry) => - (b as Map).containsKey(entry.key) && - _deepEquals(entry.value, b[entry.key])); + if (a.length != b.length) { + return false; + } + for (final MapEntry entryA in a.entries) { + bool found = false; + for (final MapEntry entryB in b.entries) { + if (_deepEquals(entryA.key, entryB.key)) { + if (_deepEquals(entryA.value, entryB.value)) { + found = true; + break; + } else { + return false; + } + } + } + if (!found) { + return false; + } + } + return true; } return a == b; } +int _deepHash(Object? value) { + if (value is List) { + return Object.hashAll(value.map(_deepHash)); + } + if (value is Map) { + int result = 0; + for (final MapEntry entry in value.entries) { + result += (_deepHash(entry.key) * 31) ^ _deepHash(entry.value); + } + return result; + } + if (value is double && value.isNaN) { + // Normalize NaN to a consistent hash. + return 0x7FF8000000000000.hashCode; + } + if (value is double && value == 0.0) { + // Normalize -0.0 to 0.0 so they have the same hash code. + return 0.0.hashCode; + } + return value.hashCode; +} + class CoreFirebaseOptions { CoreFirebaseOptions({ required this.apiKey, @@ -142,12 +208,25 @@ class CoreFirebaseOptions { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(apiKey, other.apiKey) && + _deepEquals(appId, other.appId) && + _deepEquals(messagingSenderId, other.messagingSenderId) && + _deepEquals(projectId, other.projectId) && + _deepEquals(authDomain, other.authDomain) && + _deepEquals(databaseURL, other.databaseURL) && + _deepEquals(storageBucket, other.storageBucket) && + _deepEquals(measurementId, other.measurementId) && + _deepEquals(trackingId, other.trackingId) && + _deepEquals(deepLinkURLScheme, other.deepLinkURLScheme) && + _deepEquals(androidClientId, other.androidClientId) && + _deepEquals(iosClientId, other.iosClientId) && + _deepEquals(iosBundleId, other.iosBundleId) && + _deepEquals(appGroupId, other.appGroupId); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()); + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class CoreInitializeResponse { @@ -186,7 +265,7 @@ class CoreInitializeResponse { options: result[1]! as CoreFirebaseOptions, isAutomaticDataCollectionEnabled: result[2] as bool?, pluginConstants: - (result[3] as Map?)!.cast(), + (result[3]! as Map).cast(), ); } @@ -199,12 +278,16 @@ class CoreInitializeResponse { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(name, other.name) && + _deepEquals(options, other.options) && + _deepEquals(isAutomaticDataCollectionEnabled, + other.isAutomaticDataCollectionEnabled) && + _deepEquals(pluginConstants, other.pluginConstants); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()); + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class _PigeonCodec extends StandardMessageCodec { @@ -255,95 +338,62 @@ class FirebaseCoreHostApi { Future initializeApp( String appName, CoreFirebaseOptions initializeAppRequest) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_core_platform_interface.FirebaseCoreHostApi.initializeApp$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([appName, initializeAppRequest]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as CoreInitializeResponse?)!; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as CoreInitializeResponse; } Future> initializeCore() async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_core_platform_interface.FirebaseCoreHostApi.initializeCore$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as List?)! - .cast(); - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return (pigeonVar_replyValue! as List) + .cast(); } Future optionsFromResource() async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_core_platform_interface.FirebaseCoreHostApi.optionsFromResource$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as CoreFirebaseOptions?)!; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as CoreFirebaseOptions; } } @@ -364,81 +414,60 @@ class FirebaseAppHostApi { Future setAutomaticDataCollectionEnabled( String appName, bool enabled) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_core_platform_interface.FirebaseAppHostApi.setAutomaticDataCollectionEnabled$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([appName, enabled]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future setAutomaticResourceManagementEnabled( String appName, bool enabled) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_core_platform_interface.FirebaseAppHostApi.setAutomaticResourceManagementEnabled$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([appName, enabled]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future delete(String appName) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_core_platform_interface.FirebaseAppHostApi.delete$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([appName]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } } diff --git a/packages/firebase_core/firebase_core_platform_interface/lib/src/pigeon/test_api.dart b/packages/firebase_core/firebase_core_platform_interface/lib/src/pigeon/test_api.dart index fbf2394b4022..9dd32fe50dba 100644 --- a/packages/firebase_core/firebase_core_platform_interface/lib/src/pigeon/test_api.dart +++ b/packages/firebase_core/firebase_core_platform_interface/lib/src/pigeon/test_api.dart @@ -1,9 +1,9 @@ // Copyright 2023, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v25.3.2), do not edit directly. +// Autogenerated from Pigeon (v26.3.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, unnecessary_import, no_leading_underscores_for_local_identifiers +// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, unnecessary_import, no_leading_underscores_for_local_identifiers, omit_obvious_local_variable_types // ignore_for_file: avoid_relative_lib_imports import 'dart:async'; import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; @@ -64,9 +64,7 @@ abstract class TestFirebaseCoreHostApi { messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_core_platform_interface.FirebaseCoreHostApi.initializeApp$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -77,19 +75,13 @@ abstract class TestFirebaseCoreHostApi { _testBinaryMessengerBinding!.defaultBinaryMessenger .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_core_platform_interface.FirebaseCoreHostApi.initializeApp was null.'); - final List args = (message as List?)!; - final String? arg_appName = (args[0] as String?); - assert(arg_appName != null, - 'Argument for dev.flutter.pigeon.firebase_core_platform_interface.FirebaseCoreHostApi.initializeApp was null, expected non-null String.'); - final CoreFirebaseOptions? arg_initializeAppRequest = - (args[1] as CoreFirebaseOptions?); - assert(arg_initializeAppRequest != null, - 'Argument for dev.flutter.pigeon.firebase_core_platform_interface.FirebaseCoreHostApi.initializeApp was null, expected non-null CoreFirebaseOptions.'); + final List args = message! as List; + final String arg_appName = args[0]! as String; + final CoreFirebaseOptions arg_initializeAppRequest = + args[1]! as CoreFirebaseOptions; try { - final CoreInitializeResponse output = await api.initializeApp( - arg_appName!, arg_initializeAppRequest!); + final CoreInitializeResponse output = + await api.initializeApp(arg_appName, arg_initializeAppRequest); return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); @@ -101,9 +93,7 @@ abstract class TestFirebaseCoreHostApi { } } { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_core_platform_interface.FirebaseCoreHostApi.initializeCore$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -128,9 +118,7 @@ abstract class TestFirebaseCoreHostApi { } } { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_core_platform_interface.FirebaseCoreHostApi.optionsFromResource$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -176,9 +164,7 @@ abstract class TestFirebaseAppHostApi { messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_core_platform_interface.FirebaseAppHostApi.setAutomaticDataCollectionEnabled$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -189,18 +175,12 @@ abstract class TestFirebaseAppHostApi { _testBinaryMessengerBinding!.defaultBinaryMessenger .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_core_platform_interface.FirebaseAppHostApi.setAutomaticDataCollectionEnabled was null.'); - final List args = (message as List?)!; - final String? arg_appName = (args[0] as String?); - assert(arg_appName != null, - 'Argument for dev.flutter.pigeon.firebase_core_platform_interface.FirebaseAppHostApi.setAutomaticDataCollectionEnabled was null, expected non-null String.'); - final bool? arg_enabled = (args[1] as bool?); - assert(arg_enabled != null, - 'Argument for dev.flutter.pigeon.firebase_core_platform_interface.FirebaseAppHostApi.setAutomaticDataCollectionEnabled was null, expected non-null bool.'); + final List args = message! as List; + final String arg_appName = args[0]! as String; + final bool arg_enabled = args[1]! as bool; try { await api.setAutomaticDataCollectionEnabled( - arg_appName!, arg_enabled!); + arg_appName, arg_enabled); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -212,9 +192,7 @@ abstract class TestFirebaseAppHostApi { } } { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_core_platform_interface.FirebaseAppHostApi.setAutomaticResourceManagementEnabled$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -225,18 +203,12 @@ abstract class TestFirebaseAppHostApi { _testBinaryMessengerBinding!.defaultBinaryMessenger .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_core_platform_interface.FirebaseAppHostApi.setAutomaticResourceManagementEnabled was null.'); - final List args = (message as List?)!; - final String? arg_appName = (args[0] as String?); - assert(arg_appName != null, - 'Argument for dev.flutter.pigeon.firebase_core_platform_interface.FirebaseAppHostApi.setAutomaticResourceManagementEnabled was null, expected non-null String.'); - final bool? arg_enabled = (args[1] as bool?); - assert(arg_enabled != null, - 'Argument for dev.flutter.pigeon.firebase_core_platform_interface.FirebaseAppHostApi.setAutomaticResourceManagementEnabled was null, expected non-null bool.'); + final List args = message! as List; + final String arg_appName = args[0]! as String; + final bool arg_enabled = args[1]! as bool; try { await api.setAutomaticResourceManagementEnabled( - arg_appName!, arg_enabled!); + arg_appName, arg_enabled); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -248,9 +220,7 @@ abstract class TestFirebaseAppHostApi { } } { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_core_platform_interface.FirebaseAppHostApi.delete$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -261,14 +231,10 @@ abstract class TestFirebaseAppHostApi { _testBinaryMessengerBinding!.defaultBinaryMessenger .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_core_platform_interface.FirebaseAppHostApi.delete was null.'); - final List args = (message as List?)!; - final String? arg_appName = (args[0] as String?); - assert(arg_appName != null, - 'Argument for dev.flutter.pigeon.firebase_core_platform_interface.FirebaseAppHostApi.delete was null, expected non-null String.'); + final List args = message! as List; + final String arg_appName = args[0]! as String; try { - await api.delete(arg_appName!); + await api.delete(arg_appName); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); diff --git a/packages/firebase_core/firebase_core_platform_interface/pubspec.yaml b/packages/firebase_core/firebase_core_platform_interface/pubspec.yaml index 907abb8617f6..e299ccf9d279 100644 --- a/packages/firebase_core/firebase_core_platform_interface/pubspec.yaml +++ b/packages/firebase_core/firebase_core_platform_interface/pubspec.yaml @@ -22,4 +22,4 @@ dependencies: dev_dependencies: mockito: ^5.4.0 - pigeon: 25.3.2 + pigeon: 26.3.4 diff --git a/packages/firebase_database/firebase_database/android/src/main/kotlin/io/flutter/plugins/firebase/database/GeneratedAndroidFirebaseDatabase.g.kt b/packages/firebase_database/firebase_database/android/src/main/kotlin/io/flutter/plugins/firebase/database/GeneratedAndroidFirebaseDatabase.g.kt index ddef8fb19c37..1d8dd75cfbb5 100644 --- a/packages/firebase_database/firebase_database/android/src/main/kotlin/io/flutter/plugins/firebase/database/GeneratedAndroidFirebaseDatabase.g.kt +++ b/packages/firebase_database/firebase_database/android/src/main/kotlin/io/flutter/plugins/firebase/database/GeneratedAndroidFirebaseDatabase.g.kt @@ -1,7 +1,7 @@ // Copyright 2025, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v25.3.2), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), do not edit directly. // See also: https://pub.dev/packages/pigeon @file:Suppress("UNCHECKED_CAST", "ArrayInDataClass") @@ -40,36 +40,150 @@ private object GeneratedAndroidFirebaseDatabasePigeonUtils { ) } } + fun doubleEquals(a: Double, b: Double): Boolean { + // Normalize -0.0 to 0.0 and handle NaN equality. + return (if (a == 0.0) 0.0 else a) == (if (b == 0.0) 0.0 else b) || (a.isNaN() && b.isNaN()) + } + + fun floatEquals(a: Float, b: Float): Boolean { + // Normalize -0.0 to 0.0 and handle NaN equality. + return (if (a == 0.0f) 0.0f else a) == (if (b == 0.0f) 0.0f else b) || (a.isNaN() && b.isNaN()) + } + + fun doubleHash(d: Double): Int { + // Normalize -0.0 to 0.0 and handle NaN to ensure consistent hash codes. + val normalized = if (d == 0.0) 0.0 else d + val bits = java.lang.Double.doubleToLongBits(normalized) + return (bits xor (bits ushr 32)).toInt() + } + + fun floatHash(f: Float): Int { + // Normalize -0.0 to 0.0 and handle NaN to ensure consistent hash codes. + val normalized = if (f == 0.0f) 0.0f else f + return java.lang.Float.floatToIntBits(normalized) + } + fun deepEquals(a: Any?, b: Any?): Boolean { + if (a === b) { + return true + } + if (a == null || b == null) { + return false + } if (a is ByteArray && b is ByteArray) { - return a.contentEquals(b) + return a.contentEquals(b) } if (a is IntArray && b is IntArray) { - return a.contentEquals(b) + return a.contentEquals(b) } if (a is LongArray && b is LongArray) { - return a.contentEquals(b) + return a.contentEquals(b) } if (a is DoubleArray && b is DoubleArray) { - return a.contentEquals(b) + if (a.size != b.size) return false + for (i in a.indices) { + if (!doubleEquals(a[i], b[i])) return false + } + return true + } + if (a is FloatArray && b is FloatArray) { + if (a.size != b.size) return false + for (i in a.indices) { + if (!floatEquals(a[i], b[i])) return false + } + return true } if (a is Array<*> && b is Array<*>) { - return a.size == b.size && - a.indices.all{ deepEquals(a[it], b[it]) } + if (a.size != b.size) return false + for (i in a.indices) { + if (!deepEquals(a[i], b[i])) return false + } + return true } if (a is List<*> && b is List<*>) { - return a.size == b.size && - a.indices.all{ deepEquals(a[it], b[it]) } + if (a.size != b.size) return false + val iterA = a.iterator() + val iterB = b.iterator() + while (iterA.hasNext() && iterB.hasNext()) { + if (!deepEquals(iterA.next(), iterB.next())) return false + } + return true } if (a is Map<*, *> && b is Map<*, *>) { - return a.size == b.size && a.all { - (b as Map).containsKey(it.key) && - deepEquals(it.value, b[it.key]) + if (a.size != b.size) return false + for (entry in a) { + val key = entry.key + var found = false + for (bEntry in b) { + if (deepEquals(key, bEntry.key)) { + if (deepEquals(entry.value, bEntry.value)) { + found = true + break + } else { + return false + } + } + } + if (!found) return false } + return true + } + if (a is Double && b is Double) { + return doubleEquals(a, b) + } + if (a is Float && b is Float) { + return floatEquals(a, b) } return a == b } - + + fun deepHash(value: Any?): Int { + return when (value) { + null -> 0 + is ByteArray -> value.contentHashCode() + is IntArray -> value.contentHashCode() + is LongArray -> value.contentHashCode() + is DoubleArray -> { + var result = 1 + for (item in value) { + result = 31 * result + doubleHash(item) + } + result + } + is FloatArray -> { + var result = 1 + for (item in value) { + result = 31 * result + floatHash(item) + } + result + } + is Array<*> -> { + var result = 1 + for (item in value) { + result = 31 * result + deepHash(item) + } + result + } + is List<*> -> { + var result = 1 + for (item in value) { + result = 31 * result + deepHash(item) + } + result + } + is Map<*, *> -> { + var result = 0 + for (entry in value) { + result += ((deepHash(entry.key) * 31) xor deepHash(entry.value)) + } + result + } + is Double -> doubleHash(value) + is Float -> floatHash(value) + else -> value.hashCode() + } + } + } /** @@ -82,7 +196,7 @@ class FlutterError ( val code: String, override val message: String? = null, val details: Any? = null -) : Throwable() +) : RuntimeException() /** Generated class from Pigeon that represents data sent in messages. */ data class DatabasePigeonSettings ( @@ -113,15 +227,25 @@ data class DatabasePigeonSettings ( ) } override fun equals(other: Any?): Boolean { - if (other !is DatabasePigeonSettings) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeneratedAndroidFirebaseDatabasePigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as DatabasePigeonSettings + return GeneratedAndroidFirebaseDatabasePigeonUtils.deepEquals(this.persistenceEnabled, other.persistenceEnabled) && GeneratedAndroidFirebaseDatabasePigeonUtils.deepEquals(this.cacheSizeBytes, other.cacheSizeBytes) && GeneratedAndroidFirebaseDatabasePigeonUtils.deepEquals(this.loggingEnabled, other.loggingEnabled) && GeneratedAndroidFirebaseDatabasePigeonUtils.deepEquals(this.emulatorHost, other.emulatorHost) && GeneratedAndroidFirebaseDatabasePigeonUtils.deepEquals(this.emulatorPort, other.emulatorPort) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeneratedAndroidFirebaseDatabasePigeonUtils.deepHash(this.persistenceEnabled) + result = 31 * result + GeneratedAndroidFirebaseDatabasePigeonUtils.deepHash(this.cacheSizeBytes) + result = 31 * result + GeneratedAndroidFirebaseDatabasePigeonUtils.deepHash(this.loggingEnabled) + result = 31 * result + GeneratedAndroidFirebaseDatabasePigeonUtils.deepHash(this.emulatorHost) + result = 31 * result + GeneratedAndroidFirebaseDatabasePigeonUtils.deepHash(this.emulatorPort) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -147,15 +271,23 @@ data class DatabasePigeonFirebaseApp ( ) } override fun equals(other: Any?): Boolean { - if (other !is DatabasePigeonFirebaseApp) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeneratedAndroidFirebaseDatabasePigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as DatabasePigeonFirebaseApp + return GeneratedAndroidFirebaseDatabasePigeonUtils.deepEquals(this.appName, other.appName) && GeneratedAndroidFirebaseDatabasePigeonUtils.deepEquals(this.databaseURL, other.databaseURL) && GeneratedAndroidFirebaseDatabasePigeonUtils.deepEquals(this.settings, other.settings) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeneratedAndroidFirebaseDatabasePigeonUtils.deepHash(this.appName) + result = 31 * result + GeneratedAndroidFirebaseDatabasePigeonUtils.deepHash(this.databaseURL) + result = 31 * result + GeneratedAndroidFirebaseDatabasePigeonUtils.deepHash(this.settings) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -175,15 +307,21 @@ data class DatabaseReferencePlatform ( ) } override fun equals(other: Any?): Boolean { - if (other !is DatabaseReferencePlatform) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeneratedAndroidFirebaseDatabasePigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as DatabaseReferencePlatform + return GeneratedAndroidFirebaseDatabasePigeonUtils.deepEquals(this.path, other.path) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeneratedAndroidFirebaseDatabasePigeonUtils.deepHash(this.path) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -209,15 +347,23 @@ data class DatabaseReferenceRequest ( ) } override fun equals(other: Any?): Boolean { - if (other !is DatabaseReferenceRequest) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeneratedAndroidFirebaseDatabasePigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as DatabaseReferenceRequest + return GeneratedAndroidFirebaseDatabasePigeonUtils.deepEquals(this.path, other.path) && GeneratedAndroidFirebaseDatabasePigeonUtils.deepEquals(this.value, other.value) && GeneratedAndroidFirebaseDatabasePigeonUtils.deepEquals(this.priority, other.priority) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeneratedAndroidFirebaseDatabasePigeonUtils.deepHash(this.path) + result = 31 * result + GeneratedAndroidFirebaseDatabasePigeonUtils.deepHash(this.value) + result = 31 * result + GeneratedAndroidFirebaseDatabasePigeonUtils.deepHash(this.priority) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -240,15 +386,22 @@ data class UpdateRequest ( ) } override fun equals(other: Any?): Boolean { - if (other !is UpdateRequest) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeneratedAndroidFirebaseDatabasePigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as UpdateRequest + return GeneratedAndroidFirebaseDatabasePigeonUtils.deepEquals(this.path, other.path) && GeneratedAndroidFirebaseDatabasePigeonUtils.deepEquals(this.value, other.value) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeneratedAndroidFirebaseDatabasePigeonUtils.deepHash(this.path) + result = 31 * result + GeneratedAndroidFirebaseDatabasePigeonUtils.deepHash(this.value) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -274,15 +427,23 @@ data class TransactionRequest ( ) } override fun equals(other: Any?): Boolean { - if (other !is TransactionRequest) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeneratedAndroidFirebaseDatabasePigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as TransactionRequest + return GeneratedAndroidFirebaseDatabasePigeonUtils.deepEquals(this.path, other.path) && GeneratedAndroidFirebaseDatabasePigeonUtils.deepEquals(this.transactionKey, other.transactionKey) && GeneratedAndroidFirebaseDatabasePigeonUtils.deepEquals(this.applyLocally, other.applyLocally) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeneratedAndroidFirebaseDatabasePigeonUtils.deepHash(this.path) + result = 31 * result + GeneratedAndroidFirebaseDatabasePigeonUtils.deepHash(this.transactionKey) + result = 31 * result + GeneratedAndroidFirebaseDatabasePigeonUtils.deepHash(this.applyLocally) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -308,15 +469,23 @@ data class QueryRequest ( ) } override fun equals(other: Any?): Boolean { - if (other !is QueryRequest) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeneratedAndroidFirebaseDatabasePigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as QueryRequest + return GeneratedAndroidFirebaseDatabasePigeonUtils.deepEquals(this.path, other.path) && GeneratedAndroidFirebaseDatabasePigeonUtils.deepEquals(this.modifiers, other.modifiers) && GeneratedAndroidFirebaseDatabasePigeonUtils.deepEquals(this.value, other.value) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeneratedAndroidFirebaseDatabasePigeonUtils.deepHash(this.path) + result = 31 * result + GeneratedAndroidFirebaseDatabasePigeonUtils.deepHash(this.modifiers) + result = 31 * result + GeneratedAndroidFirebaseDatabasePigeonUtils.deepHash(this.value) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -342,15 +511,23 @@ data class TransactionHandlerResult ( ) } override fun equals(other: Any?): Boolean { - if (other !is TransactionHandlerResult) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeneratedAndroidFirebaseDatabasePigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as TransactionHandlerResult + return GeneratedAndroidFirebaseDatabasePigeonUtils.deepEquals(this.value, other.value) && GeneratedAndroidFirebaseDatabasePigeonUtils.deepEquals(this.aborted, other.aborted) && GeneratedAndroidFirebaseDatabasePigeonUtils.deepEquals(this.exception, other.exception) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeneratedAndroidFirebaseDatabasePigeonUtils.deepHash(this.value) + result = 31 * result + GeneratedAndroidFirebaseDatabasePigeonUtils.deepHash(this.aborted) + result = 31 * result + GeneratedAndroidFirebaseDatabasePigeonUtils.deepHash(this.exception) + return result + } } private open class GeneratedAndroidFirebaseDatabasePigeonCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { diff --git a/packages/firebase_database/firebase_database/ios/firebase_database/Sources/firebase_database/FirebaseDatabaseMessages.g.swift b/packages/firebase_database/firebase_database/ios/firebase_database/Sources/firebase_database/FirebaseDatabaseMessages.g.swift index e91097627f7e..5e0d5707382d 100644 --- a/packages/firebase_database/firebase_database/ios/firebase_database/Sources/firebase_database/FirebaseDatabaseMessages.g.swift +++ b/packages/firebase_database/firebase_database/ios/firebase_database/Sources/firebase_database/FirebaseDatabaseMessages.g.swift @@ -1,7 +1,7 @@ // Copyright 2025, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v25.3.2), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), do not edit directly. // See also: https://pub.dev/packages/pigeon import Foundation @@ -52,7 +52,7 @@ private func wrapError(_ error: Any) -> [Any?] { } return [ "\(error)", - "\(type(of: error))", + "\(Swift.type(of: error))", "Stacktrace: \(Thread.callStackSymbols)", ] } @@ -74,6 +74,19 @@ private func nilOrValue(_ value: Any?) -> T? { return value as! T? } +private func doubleEqualsFirebaseDatabaseMessages(_ lhs: Double, _ rhs: Double) -> Bool { + (lhs.isNaN && rhs.isNaN) || lhs == rhs +} + +private func doubleHashFirebaseDatabaseMessages(_ value: Double, _ hasher: inout Hasher) { + if value.isNaN { + hasher.combine(0x7FF8_0000_0000_0000) + } else { + // Normalize -0.0 to 0.0 + hasher.combine(value == 0 ? 0 : value) + } +} + func deepEqualsFirebaseDatabaseMessages(_ lhs: Any?, _ rhs: Any?) -> Bool { let cleanLhs = nilOrValue(lhs) as Any? let cleanRhs = nilOrValue(rhs) as Any? @@ -84,59 +97,90 @@ func deepEqualsFirebaseDatabaseMessages(_ lhs: Any?, _ rhs: Any?) -> Bool { case (nil, _), (_, nil): return false - case is (Void, Void): + case let (lhs as AnyObject, rhs as AnyObject) where lhs === rhs: return true - case let (cleanLhsHashable, cleanRhsHashable) as (AnyHashable, AnyHashable): - return cleanLhsHashable == cleanRhsHashable + case is (Void, Void): + return true - case let (cleanLhsArray, cleanRhsArray) as ([Any?], [Any?]): - guard cleanLhsArray.count == cleanRhsArray.count else { return false } - for (index, element) in cleanLhsArray.enumerated() { - if !deepEqualsFirebaseDatabaseMessages(element, cleanRhsArray[index]) { + case let (lhsArray, rhsArray) as ([Any?], [Any?]): + guard lhsArray.count == rhsArray.count else { return false } + for (index, element) in lhsArray.enumerated() { + if !deepEqualsFirebaseDatabaseMessages(element, rhsArray[index]) { return false } } return true - case let (cleanLhsDictionary, cleanRhsDictionary) as ([AnyHashable: Any?], [AnyHashable: Any?]): - guard cleanLhsDictionary.count == cleanRhsDictionary.count else { return false } - for (key, cleanLhsValue) in cleanLhsDictionary { - guard cleanRhsDictionary.index(forKey: key) != nil else { return false } - if !deepEqualsFirebaseDatabaseMessages(cleanLhsValue, cleanRhsDictionary[key]!) { + case let (lhsArray, rhsArray) as ([Double], [Double]): + guard lhsArray.count == rhsArray.count else { return false } + for (index, element) in lhsArray.enumerated() { + if !doubleEqualsFirebaseDatabaseMessages(element, rhsArray[index]) { return false } } return true + case let (lhsDictionary, rhsDictionary) as ([AnyHashable: Any?], [AnyHashable: Any?]): + guard lhsDictionary.count == rhsDictionary.count else { return false } + for (lhsKey, lhsValue) in lhsDictionary { + var found = false + for (rhsKey, rhsValue) in rhsDictionary { + if deepEqualsFirebaseDatabaseMessages(lhsKey, rhsKey) { + if deepEqualsFirebaseDatabaseMessages(lhsValue, rhsValue) { + found = true + break + } else { + return false + } + } + } + if !found { return false } + } + return true + + case let (lhs as Double, rhs as Double): + return doubleEqualsFirebaseDatabaseMessages(lhs, rhs) + + case let (lhsHashable, rhsHashable) as (AnyHashable, AnyHashable): + return lhsHashable == rhsHashable + default: - // Any other type shouldn't be able to be used with pigeon. File an issue if you find this to be - // untrue. return false } } func deepHashFirebaseDatabaseMessages(value: Any?, hasher: inout Hasher) { - if let valueList = value as? [AnyHashable] { - for item in valueList { - deepHashFirebaseDatabaseMessages(value: item, hasher: &hasher) - } - return - } - - if let valueDict = value as? [AnyHashable: AnyHashable] { - for key in valueDict.keys { - hasher.combine(key) - deepHashFirebaseDatabaseMessages(value: valueDict[key]!, hasher: &hasher) + let cleanValue = nilOrValue(value) as Any? + if let cleanValue { + if let doubleValue = cleanValue as? Double { + doubleHashFirebaseDatabaseMessages(doubleValue, &hasher) + } else if let valueList = cleanValue as? [Any?] { + for item in valueList { + deepHashFirebaseDatabaseMessages(value: item, hasher: &hasher) + } + } else if let valueList = cleanValue as? [Double] { + for item in valueList { + doubleHashFirebaseDatabaseMessages(item, &hasher) + } + } else if let valueDict = cleanValue as? [AnyHashable: Any?] { + var result = 0 + for (key, value) in valueDict { + var entryKeyHasher = Hasher() + deepHashFirebaseDatabaseMessages(value: key, hasher: &entryKeyHasher) + var entryValueHasher = Hasher() + deepHashFirebaseDatabaseMessages(value: value, hasher: &entryValueHasher) + result = result &+ ((entryKeyHasher.finalize() &* 31) ^ entryValueHasher.finalize()) + } + hasher.combine(result) + } else if let hashableValue = cleanValue as? AnyHashable { + hasher.combine(hashableValue) + } else { + hasher.combine(String(describing: cleanValue)) } - return - } - - if let hashableValue = value as? AnyHashable { - hasher.combine(hashableValue.hashValue) + } else { + hasher.combine(0) } - - return hasher.combine(String(describing: value)) } /// Generated class from Pigeon that represents data sent in messages. @@ -175,11 +219,27 @@ struct DatabasePigeonSettings: Hashable { } static func == (lhs: DatabasePigeonSettings, rhs: DatabasePigeonSettings) -> Bool { - deepEqualsFirebaseDatabaseMessages(lhs.toList(), rhs.toList()) + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return deepEqualsFirebaseDatabaseMessages(lhs.persistenceEnabled, rhs.persistenceEnabled) && + deepEqualsFirebaseDatabaseMessages( + lhs.cacheSizeBytes, + rhs.cacheSizeBytes + ) && deepEqualsFirebaseDatabaseMessages(lhs.loggingEnabled, rhs.loggingEnabled) && + deepEqualsFirebaseDatabaseMessages( + lhs.emulatorHost, + rhs.emulatorHost + ) && deepEqualsFirebaseDatabaseMessages(lhs.emulatorPort, rhs.emulatorPort) } func hash(into hasher: inout Hasher) { - deepHashFirebaseDatabaseMessages(value: toList(), hasher: &hasher) + hasher.combine("DatabasePigeonSettings") + deepHashFirebaseDatabaseMessages(value: persistenceEnabled, hasher: &hasher) + deepHashFirebaseDatabaseMessages(value: cacheSizeBytes, hasher: &hasher) + deepHashFirebaseDatabaseMessages(value: loggingEnabled, hasher: &hasher) + deepHashFirebaseDatabaseMessages(value: emulatorHost, hasher: &hasher) + deepHashFirebaseDatabaseMessages(value: emulatorPort, hasher: &hasher) } } @@ -211,11 +271,21 @@ struct DatabasePigeonFirebaseApp: Hashable { } static func == (lhs: DatabasePigeonFirebaseApp, rhs: DatabasePigeonFirebaseApp) -> Bool { - deepEqualsFirebaseDatabaseMessages(lhs.toList(), rhs.toList()) + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return deepEqualsFirebaseDatabaseMessages(lhs.appName, rhs.appName) && + deepEqualsFirebaseDatabaseMessages( + lhs.databaseURL, + rhs.databaseURL + ) && deepEqualsFirebaseDatabaseMessages(lhs.settings, rhs.settings) } func hash(into hasher: inout Hasher) { - deepHashFirebaseDatabaseMessages(value: toList(), hasher: &hasher) + hasher.combine("DatabasePigeonFirebaseApp") + deepHashFirebaseDatabaseMessages(value: appName, hasher: &hasher) + deepHashFirebaseDatabaseMessages(value: databaseURL, hasher: &hasher) + deepHashFirebaseDatabaseMessages(value: settings, hasher: &hasher) } } @@ -239,11 +309,15 @@ struct DatabaseReferencePlatform: Hashable { } static func == (lhs: DatabaseReferencePlatform, rhs: DatabaseReferencePlatform) -> Bool { - deepEqualsFirebaseDatabaseMessages(lhs.toList(), rhs.toList()) + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return deepEqualsFirebaseDatabaseMessages(lhs.path, rhs.path) } func hash(into hasher: inout Hasher) { - deepHashFirebaseDatabaseMessages(value: toList(), hasher: &hasher) + hasher.combine("DatabaseReferencePlatform") + deepHashFirebaseDatabaseMessages(value: path, hasher: &hasher) } } @@ -275,11 +349,21 @@ struct DatabaseReferenceRequest: Hashable { } static func == (lhs: DatabaseReferenceRequest, rhs: DatabaseReferenceRequest) -> Bool { - deepEqualsFirebaseDatabaseMessages(lhs.toList(), rhs.toList()) + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return deepEqualsFirebaseDatabaseMessages(lhs.path, rhs.path) && + deepEqualsFirebaseDatabaseMessages( + lhs.value, + rhs.value + ) && deepEqualsFirebaseDatabaseMessages(lhs.priority, rhs.priority) } func hash(into hasher: inout Hasher) { - deepHashFirebaseDatabaseMessages(value: toList(), hasher: &hasher) + hasher.combine("DatabaseReferenceRequest") + deepHashFirebaseDatabaseMessages(value: path, hasher: &hasher) + deepHashFirebaseDatabaseMessages(value: value, hasher: &hasher) + deepHashFirebaseDatabaseMessages(value: priority, hasher: &hasher) } } @@ -307,11 +391,20 @@ struct UpdateRequest: Hashable { } static func == (lhs: UpdateRequest, rhs: UpdateRequest) -> Bool { - deepEqualsFirebaseDatabaseMessages(lhs.toList(), rhs.toList()) + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return deepEqualsFirebaseDatabaseMessages(lhs.path, rhs.path) && + deepEqualsFirebaseDatabaseMessages( + lhs.value, + rhs.value + ) } func hash(into hasher: inout Hasher) { - deepHashFirebaseDatabaseMessages(value: toList(), hasher: &hasher) + hasher.combine("UpdateRequest") + deepHashFirebaseDatabaseMessages(value: path, hasher: &hasher) + deepHashFirebaseDatabaseMessages(value: value, hasher: &hasher) } } @@ -343,11 +436,21 @@ struct TransactionRequest: Hashable { } static func == (lhs: TransactionRequest, rhs: TransactionRequest) -> Bool { - deepEqualsFirebaseDatabaseMessages(lhs.toList(), rhs.toList()) + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return deepEqualsFirebaseDatabaseMessages(lhs.path, rhs.path) && + deepEqualsFirebaseDatabaseMessages( + lhs.transactionKey, + rhs.transactionKey + ) && deepEqualsFirebaseDatabaseMessages(lhs.applyLocally, rhs.applyLocally) } func hash(into hasher: inout Hasher) { - deepHashFirebaseDatabaseMessages(value: toList(), hasher: &hasher) + hasher.combine("TransactionRequest") + deepHashFirebaseDatabaseMessages(value: path, hasher: &hasher) + deepHashFirebaseDatabaseMessages(value: transactionKey, hasher: &hasher) + deepHashFirebaseDatabaseMessages(value: applyLocally, hasher: &hasher) } } @@ -379,11 +482,21 @@ struct QueryRequest: Hashable { } static func == (lhs: QueryRequest, rhs: QueryRequest) -> Bool { - deepEqualsFirebaseDatabaseMessages(lhs.toList(), rhs.toList()) + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return deepEqualsFirebaseDatabaseMessages(lhs.path, rhs.path) && + deepEqualsFirebaseDatabaseMessages( + lhs.modifiers, + rhs.modifiers + ) && deepEqualsFirebaseDatabaseMessages(lhs.value, rhs.value) } func hash(into hasher: inout Hasher) { - deepHashFirebaseDatabaseMessages(value: toList(), hasher: &hasher) + hasher.combine("QueryRequest") + deepHashFirebaseDatabaseMessages(value: path, hasher: &hasher) + deepHashFirebaseDatabaseMessages(value: modifiers, hasher: &hasher) + deepHashFirebaseDatabaseMessages(value: value, hasher: &hasher) } } @@ -415,11 +528,21 @@ struct TransactionHandlerResult: Hashable { } static func == (lhs: TransactionHandlerResult, rhs: TransactionHandlerResult) -> Bool { - deepEqualsFirebaseDatabaseMessages(lhs.toList(), rhs.toList()) + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return deepEqualsFirebaseDatabaseMessages(lhs.value, rhs.value) && + deepEqualsFirebaseDatabaseMessages( + lhs.aborted, + rhs.aborted + ) && deepEqualsFirebaseDatabaseMessages(lhs.exception, rhs.exception) } func hash(into hasher: inout Hasher) { - deepHashFirebaseDatabaseMessages(value: toList(), hasher: &hasher) + hasher.combine("TransactionHandlerResult") + deepHashFirebaseDatabaseMessages(value: value, hasher: &hasher) + deepHashFirebaseDatabaseMessages(value: aborted, hasher: &hasher) + deepHashFirebaseDatabaseMessages(value: exception, hasher: &hasher) } } diff --git a/packages/firebase_database/firebase_database/windows/messages.g.cpp b/packages/firebase_database/firebase_database/windows/messages.g.cpp index 8c0aeeb54adc..f503c24680bf 100644 --- a/packages/firebase_database/firebase_database/windows/messages.g.cpp +++ b/packages/firebase_database/firebase_database/windows/messages.g.cpp @@ -1,7 +1,7 @@ // Copyright 2025, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v25.3.2), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), do not edit directly. // See also: https://pub.dev/packages/pigeon #undef _HAS_EXCEPTIONS @@ -13,16 +13,18 @@ #include #include +#include +#include #include #include #include namespace firebase_database_windows { -using flutter::BasicMessageChannel; -using flutter::CustomEncodableValue; -using flutter::EncodableList; -using flutter::EncodableMap; -using flutter::EncodableValue; +using ::flutter::BasicMessageChannel; +using ::flutter::CustomEncodableValue; +using ::flutter::EncodableList; +using ::flutter::EncodableMap; +using ::flutter::EncodableValue; FlutterError CreateConnectionError(const std::string channel_name) { return FlutterError( @@ -31,6 +33,212 @@ FlutterError CreateConnectionError(const std::string channel_name) { EncodableValue("")); } +namespace { +template +bool PigeonInternalDeepEquals(const T& a, const T& b); + +bool PigeonInternalDeepEquals(const double& a, const double& b); + +template +bool PigeonInternalDeepEquals(const std::vector& a, const std::vector& b); + +template +bool PigeonInternalDeepEquals(const std::map& a, const std::map& b); + +template +bool PigeonInternalDeepEquals(const std::optional& a, + const std::optional& b); + +template +bool PigeonInternalDeepEquals(const std::unique_ptr& a, + const std::unique_ptr& b); + +bool PigeonInternalDeepEquals(const ::flutter::EncodableValue& a, + const ::flutter::EncodableValue& b); + +template +bool PigeonInternalDeepEquals(const T& a, const T& b) { + return a == b; +} + +template +bool PigeonInternalDeepEquals(const std::vector& a, + const std::vector& b) { + if (a.size() != b.size()) { + return false; + } + for (size_t i = 0; i < a.size(); ++i) { + if (!PigeonInternalDeepEquals(a[i], b[i])) { + return false; + } + } + return true; +} + +template +bool PigeonInternalDeepEquals(const std::map& a, + const std::map& b) { + if (a.size() != b.size()) { + return false; + } + for (const auto& kv : a) { + bool found = false; + for (const auto& b_kv : b) { + if (PigeonInternalDeepEquals(kv.first, b_kv.first)) { + if (PigeonInternalDeepEquals(kv.second, b_kv.second)) { + found = true; + break; + } else { + return false; + } + } + } + if (!found) { + return false; + } + } + return true; +} + +bool PigeonInternalDeepEquals(const double& a, const double& b) { + // Normalize -0.0 to 0.0 and handle NaN equality. + return (a == b) || (std::isnan(a) && std::isnan(b)); +} + +template +bool PigeonInternalDeepEquals(const std::optional& a, + const std::optional& b) { + if (!a && !b) { + return true; + } + if (!a || !b) { + return false; + } + return PigeonInternalDeepEquals(*a, *b); +} + +template +bool PigeonInternalDeepEquals(const std::unique_ptr& a, + const std::unique_ptr& b) { + if (a.get() == b.get()) { + return true; + } + if (!a || !b) { + return false; + } + return PigeonInternalDeepEquals(*a, *b); +} + +bool PigeonInternalDeepEquals(const ::flutter::EncodableValue& a, + const ::flutter::EncodableValue& b) { + if (a.index() != b.index()) { + return false; + } + if (const double* da = std::get_if(&a)) { + return PigeonInternalDeepEquals(*da, std::get(b)); + } else if (const ::flutter::EncodableList* la = + std::get_if<::flutter::EncodableList>(&a)) { + return PigeonInternalDeepEquals(*la, std::get<::flutter::EncodableList>(b)); + } else if (const ::flutter::EncodableMap* ma = + std::get_if<::flutter::EncodableMap>(&a)) { + return PigeonInternalDeepEquals(*ma, std::get<::flutter::EncodableMap>(b)); + } + return a == b; +} + +template +size_t PigeonInternalDeepHash(const T& v); + +size_t PigeonInternalDeepHash(const double& v); + +template +size_t PigeonInternalDeepHash(const std::vector& v); + +template +size_t PigeonInternalDeepHash(const std::map& v); + +template +size_t PigeonInternalDeepHash(const std::optional& v); + +template +size_t PigeonInternalDeepHash(const std::unique_ptr& v); + +size_t PigeonInternalDeepHash(const ::flutter::EncodableValue& v); + +template +size_t PigeonInternalDeepHash(const T& v) { + return std::hash()(v); +} + +template +size_t PigeonInternalDeepHash(const std::vector& v) { + size_t result = 1; + for (const auto& item : v) { + result = result * 31 + PigeonInternalDeepHash(item); + } + return result; +} + +template +size_t PigeonInternalDeepHash(const std::map& v) { + size_t result = 0; + for (const auto& kv : v) { + result += ((PigeonInternalDeepHash(kv.first) * 31) ^ + PigeonInternalDeepHash(kv.second)); + } + return result; +} + +size_t PigeonInternalDeepHash(const double& v) { + if (std::isnan(v)) { + // Normalize NaN to a consistent hash. + return std::hash()(std::numeric_limits::quiet_NaN()); + } + if (v == 0.0) { + // Normalize -0.0 to 0.0 so they have the same hash code. + return std::hash()(0.0); + } + return std::hash()(v); +} + +template +size_t PigeonInternalDeepHash(const std::optional& v) { + return v ? PigeonInternalDeepHash(*v) : 0; +} + +template +size_t PigeonInternalDeepHash(const std::unique_ptr& v) { + return v ? PigeonInternalDeepHash(*v) : 0; +} + +size_t PigeonInternalDeepHash(const ::flutter::EncodableValue& v) { + size_t result = v.index(); + if (const double* dv = std::get_if(&v)) { + result = result * 31 + PigeonInternalDeepHash(*dv); + } else if (const ::flutter::EncodableList* lv = + std::get_if<::flutter::EncodableList>(&v)) { + result = result * 31 + PigeonInternalDeepHash(*lv); + } else if (const ::flutter::EncodableMap* mv = + std::get_if<::flutter::EncodableMap>(&v)) { + result = result * 31 + PigeonInternalDeepHash(*mv); + } else { + std::visit( + [&result](const auto& val) { + using T = std::decay_t; + if constexpr (!std::is_same_v && + !std::is_same_v && + !std::is_same_v && + !std::is_same_v && + !std::is_same_v) { + result = result * 31 + PigeonInternalDeepHash(val); + } + }, + v); + } + return result; +} + +} // namespace // DatabasePigeonSettings DatabasePigeonSettings::DatabasePigeonSettings() {} @@ -161,6 +369,35 @@ DatabasePigeonSettings DatabasePigeonSettings::FromEncodableList( return decoded; } +bool DatabasePigeonSettings::operator==( + const DatabasePigeonSettings& other) const { + return PigeonInternalDeepEquals(persistence_enabled_, + other.persistence_enabled_) && + PigeonInternalDeepEquals(cache_size_bytes_, other.cache_size_bytes_) && + PigeonInternalDeepEquals(logging_enabled_, other.logging_enabled_) && + PigeonInternalDeepEquals(emulator_host_, other.emulator_host_) && + PigeonInternalDeepEquals(emulator_port_, other.emulator_port_); +} + +bool DatabasePigeonSettings::operator!=( + const DatabasePigeonSettings& other) const { + return !(*this == other); +} + +size_t DatabasePigeonSettings::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(persistence_enabled_); + result = result * 31 + PigeonInternalDeepHash(cache_size_bytes_); + result = result * 31 + PigeonInternalDeepHash(logging_enabled_); + result = result * 31 + PigeonInternalDeepHash(emulator_host_); + result = result * 31 + PigeonInternalDeepHash(emulator_port_); + return result; +} + +size_t PigeonInternalDeepHash(const DatabasePigeonSettings& v) { + return v.Hash(); +} + // DatabasePigeonFirebaseApp DatabasePigeonFirebaseApp::DatabasePigeonFirebaseApp( @@ -247,6 +484,30 @@ DatabasePigeonFirebaseApp DatabasePigeonFirebaseApp::FromEncodableList( return decoded; } +bool DatabasePigeonFirebaseApp::operator==( + const DatabasePigeonFirebaseApp& other) const { + return PigeonInternalDeepEquals(app_name_, other.app_name_) && + PigeonInternalDeepEquals(database_u_r_l_, other.database_u_r_l_) && + PigeonInternalDeepEquals(settings_, other.settings_); +} + +bool DatabasePigeonFirebaseApp::operator!=( + const DatabasePigeonFirebaseApp& other) const { + return !(*this == other); +} + +size_t DatabasePigeonFirebaseApp::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(app_name_); + result = result * 31 + PigeonInternalDeepHash(database_u_r_l_); + result = result * 31 + PigeonInternalDeepHash(settings_); + return result; +} + +size_t PigeonInternalDeepHash(const DatabasePigeonFirebaseApp& v) { + return v.Hash(); +} + // DatabaseReferencePlatform DatabaseReferencePlatform::DatabaseReferencePlatform(const std::string& path) @@ -271,6 +532,26 @@ DatabaseReferencePlatform DatabaseReferencePlatform::FromEncodableList( return decoded; } +bool DatabaseReferencePlatform::operator==( + const DatabaseReferencePlatform& other) const { + return PigeonInternalDeepEquals(path_, other.path_); +} + +bool DatabaseReferencePlatform::operator!=( + const DatabaseReferencePlatform& other) const { + return !(*this == other); +} + +size_t DatabaseReferencePlatform::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(path_); + return result; +} + +size_t PigeonInternalDeepHash(const DatabaseReferencePlatform& v) { + return v.Hash(); +} + // DatabaseReferenceRequest DatabaseReferenceRequest::DatabaseReferenceRequest(const std::string& path) @@ -338,6 +619,30 @@ DatabaseReferenceRequest DatabaseReferenceRequest::FromEncodableList( return decoded; } +bool DatabaseReferenceRequest::operator==( + const DatabaseReferenceRequest& other) const { + return PigeonInternalDeepEquals(path_, other.path_) && + PigeonInternalDeepEquals(value_, other.value_) && + PigeonInternalDeepEquals(priority_, other.priority_); +} + +bool DatabaseReferenceRequest::operator!=( + const DatabaseReferenceRequest& other) const { + return !(*this == other); +} + +size_t DatabaseReferenceRequest::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(path_); + result = result * 31 + PigeonInternalDeepHash(value_); + result = result * 31 + PigeonInternalDeepHash(priority_); + return result; +} + +size_t PigeonInternalDeepHash(const DatabaseReferenceRequest& v) { + return v.Hash(); +} + // UpdateRequest UpdateRequest::UpdateRequest(const std::string& path, const EncodableMap& value) @@ -367,6 +672,24 @@ UpdateRequest UpdateRequest::FromEncodableList(const EncodableList& list) { return decoded; } +bool UpdateRequest::operator==(const UpdateRequest& other) const { + return PigeonInternalDeepEquals(path_, other.path_) && + PigeonInternalDeepEquals(value_, other.value_); +} + +bool UpdateRequest::operator!=(const UpdateRequest& other) const { + return !(*this == other); +} + +size_t UpdateRequest::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(path_); + result = result * 31 + PigeonInternalDeepHash(value_); + return result; +} + +size_t PigeonInternalDeepHash(const UpdateRequest& v) { return v.Hash(); } + // TransactionRequest TransactionRequest::TransactionRequest(const std::string& path, @@ -411,6 +734,26 @@ TransactionRequest TransactionRequest::FromEncodableList( return decoded; } +bool TransactionRequest::operator==(const TransactionRequest& other) const { + return PigeonInternalDeepEquals(path_, other.path_) && + PigeonInternalDeepEquals(transaction_key_, other.transaction_key_) && + PigeonInternalDeepEquals(apply_locally_, other.apply_locally_); +} + +bool TransactionRequest::operator!=(const TransactionRequest& other) const { + return !(*this == other); +} + +size_t TransactionRequest::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(path_); + result = result * 31 + PigeonInternalDeepHash(transaction_key_); + result = result * 31 + PigeonInternalDeepHash(apply_locally_); + return result; +} + +size_t PigeonInternalDeepHash(const TransactionRequest& v) { return v.Hash(); } + // QueryRequest QueryRequest::QueryRequest(const std::string& path, @@ -462,6 +805,26 @@ QueryRequest QueryRequest::FromEncodableList(const EncodableList& list) { return decoded; } +bool QueryRequest::operator==(const QueryRequest& other) const { + return PigeonInternalDeepEquals(path_, other.path_) && + PigeonInternalDeepEquals(modifiers_, other.modifiers_) && + PigeonInternalDeepEquals(value_, other.value_); +} + +bool QueryRequest::operator!=(const QueryRequest& other) const { + return !(*this == other); +} + +size_t QueryRequest::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(path_); + result = result * 31 + PigeonInternalDeepHash(modifiers_); + result = result * 31 + PigeonInternalDeepHash(value_); + return result; +} + +size_t PigeonInternalDeepHash(const QueryRequest& v) { return v.Hash(); } + // TransactionHandlerResult TransactionHandlerResult::TransactionHandlerResult(bool aborted, bool exception) @@ -517,10 +880,34 @@ TransactionHandlerResult TransactionHandlerResult::FromEncodableList( return decoded; } +bool TransactionHandlerResult::operator==( + const TransactionHandlerResult& other) const { + return PigeonInternalDeepEquals(value_, other.value_) && + PigeonInternalDeepEquals(aborted_, other.aborted_) && + PigeonInternalDeepEquals(exception_, other.exception_); +} + +bool TransactionHandlerResult::operator!=( + const TransactionHandlerResult& other) const { + return !(*this == other); +} + +size_t TransactionHandlerResult::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(value_); + result = result * 31 + PigeonInternalDeepHash(aborted_); + result = result * 31 + PigeonInternalDeepHash(exception_); + return result; +} + +size_t PigeonInternalDeepHash(const TransactionHandlerResult& v) { + return v.Hash(); +} + PigeonInternalCodecSerializer::PigeonInternalCodecSerializer() {} EncodableValue PigeonInternalCodecSerializer::ReadValueOfType( - uint8_t type, flutter::ByteStreamReader* stream) const { + uint8_t type, ::flutter::ByteStreamReader* stream) const { switch (type) { case 129: { return CustomEncodableValue(DatabasePigeonSettings::FromEncodableList( @@ -555,12 +942,12 @@ EncodableValue PigeonInternalCodecSerializer::ReadValueOfType( std::get(ReadValue(stream)))); } default: - return flutter::StandardCodecSerializer::ReadValueOfType(type, stream); + return ::flutter::StandardCodecSerializer::ReadValueOfType(type, stream); } } void PigeonInternalCodecSerializer::WriteValue( - const EncodableValue& value, flutter::ByteStreamWriter* stream) const { + const EncodableValue& value, ::flutter::ByteStreamWriter* stream) const { if (const CustomEncodableValue* custom_value = std::get_if(&value)) { if (custom_value->type() == typeid(DatabasePigeonSettings)) { @@ -627,25 +1014,26 @@ void PigeonInternalCodecSerializer::WriteValue( return; } } - flutter::StandardCodecSerializer::WriteValue(value, stream); + ::flutter::StandardCodecSerializer::WriteValue(value, stream); } /// The codec used by FirebaseDatabaseHostApi. -const flutter::StandardMessageCodec& FirebaseDatabaseHostApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance( +const ::flutter::StandardMessageCodec& FirebaseDatabaseHostApi::GetCodec() { + return ::flutter::StandardMessageCodec::GetInstance( &PigeonInternalCodecSerializer::GetInstance()); } // Sets up an instance of `FirebaseDatabaseHostApi` to handle messages through // the `binary_messenger`. -void FirebaseDatabaseHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, - FirebaseDatabaseHostApi* api) { +void FirebaseDatabaseHostApi::SetUp( + ::flutter::BinaryMessenger* binary_messenger, + FirebaseDatabaseHostApi* api) { FirebaseDatabaseHostApi::SetUp(binary_messenger, api, ""); } -void FirebaseDatabaseHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, - FirebaseDatabaseHostApi* api, - const std::string& message_channel_suffix) { +void FirebaseDatabaseHostApi::SetUp( + ::flutter::BinaryMessenger* binary_messenger, FirebaseDatabaseHostApi* api, + const std::string& message_channel_suffix) { const std::string prepended_suffix = message_channel_suffix.length() > 0 ? std::string(".") + message_channel_suffix @@ -660,7 +1048,7 @@ void FirebaseDatabaseHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -699,7 +1087,7 @@ void FirebaseDatabaseHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -738,7 +1126,7 @@ void FirebaseDatabaseHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -784,7 +1172,7 @@ void FirebaseDatabaseHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -831,7 +1219,7 @@ void FirebaseDatabaseHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -877,7 +1265,7 @@ void FirebaseDatabaseHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -929,7 +1317,7 @@ void FirebaseDatabaseHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -972,7 +1360,7 @@ void FirebaseDatabaseHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -1019,7 +1407,7 @@ void FirebaseDatabaseHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -1058,7 +1446,7 @@ void FirebaseDatabaseHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -1106,7 +1494,7 @@ void FirebaseDatabaseHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -1154,7 +1542,7 @@ void FirebaseDatabaseHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -1201,7 +1589,7 @@ void FirebaseDatabaseHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -1249,7 +1637,7 @@ void FirebaseDatabaseHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -1297,7 +1685,7 @@ void FirebaseDatabaseHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -1345,7 +1733,7 @@ void FirebaseDatabaseHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -1393,7 +1781,7 @@ void FirebaseDatabaseHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -1441,7 +1829,7 @@ void FirebaseDatabaseHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -1488,7 +1876,7 @@ void FirebaseDatabaseHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -1534,7 +1922,7 @@ void FirebaseDatabaseHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -1581,7 +1969,7 @@ void FirebaseDatabaseHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -1628,7 +2016,7 @@ void FirebaseDatabaseHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -1683,19 +2071,19 @@ EncodableValue FirebaseDatabaseHostApi::WrapError(const FlutterError& error) { // Generated class from Pigeon that represents Flutter messages that can be // called from C++. FirebaseDatabaseFlutterApi::FirebaseDatabaseFlutterApi( - flutter::BinaryMessenger* binary_messenger) + ::flutter::BinaryMessenger* binary_messenger) : binary_messenger_(binary_messenger), message_channel_suffix_("") {} FirebaseDatabaseFlutterApi::FirebaseDatabaseFlutterApi( - flutter::BinaryMessenger* binary_messenger, + ::flutter::BinaryMessenger* binary_messenger, const std::string& message_channel_suffix) : binary_messenger_(binary_messenger), message_channel_suffix_(message_channel_suffix.length() > 0 ? std::string(".") + message_channel_suffix : "") {} -const flutter::StandardMessageCodec& FirebaseDatabaseFlutterApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance( +const ::flutter::StandardMessageCodec& FirebaseDatabaseFlutterApi::GetCodec() { + return ::flutter::StandardMessageCodec::GetInstance( &PigeonInternalCodecSerializer::GetInstance()); } diff --git a/packages/firebase_database/firebase_database/windows/messages.g.h b/packages/firebase_database/firebase_database/windows/messages.g.h index 0a44f40b593f..a25163618fcc 100644 --- a/packages/firebase_database/firebase_database/windows/messages.g.h +++ b/packages/firebase_database/firebase_database/windows/messages.g.h @@ -1,7 +1,7 @@ // Copyright 2025, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v25.3.2), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), do not edit directly. // See also: https://pub.dev/packages/pigeon #ifndef PIGEON_MESSAGES_G_H_ @@ -25,17 +25,17 @@ class FlutterError { explicit FlutterError(const std::string& code, const std::string& message) : code_(code), message_(message) {} explicit FlutterError(const std::string& code, const std::string& message, - const flutter::EncodableValue& details) + const ::flutter::EncodableValue& details) : code_(code), message_(message), details_(details) {} const std::string& code() const { return code_; } const std::string& message() const { return message_; } - const flutter::EncodableValue& details() const { return details_; } + const ::flutter::EncodableValue& details() const { return details_; } private: std::string code_; std::string message_; - flutter::EncodableValue details_; + ::flutter::EncodableValue details_; }; template @@ -92,10 +92,22 @@ class DatabasePigeonSettings { void set_emulator_port(const int64_t* value_arg); void set_emulator_port(int64_t value_arg); + bool operator==(const DatabasePigeonSettings& other) const; + bool operator!=(const DatabasePigeonSettings& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + private: static DatabasePigeonSettings FromEncodableList( - const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; + const ::flutter::EncodableList& list); + + public: + public: + ::flutter::EncodableList ToEncodableList() const; + + private: + private: friend class DatabasePigeonFirebaseApp; friend class FirebaseDatabaseHostApi; friend class FirebaseDatabaseFlutterApi; @@ -135,10 +147,22 @@ class DatabasePigeonFirebaseApp { const DatabasePigeonSettings& settings() const; void set_settings(const DatabasePigeonSettings& value_arg); + bool operator==(const DatabasePigeonFirebaseApp& other) const; + bool operator!=(const DatabasePigeonFirebaseApp& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + private: static DatabasePigeonFirebaseApp FromEncodableList( - const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; + const ::flutter::EncodableList& list); + + public: + public: + ::flutter::EncodableList ToEncodableList() const; + + private: + private: friend class FirebaseDatabaseHostApi; friend class FirebaseDatabaseFlutterApi; friend class PigeonInternalCodecSerializer; @@ -156,10 +180,22 @@ class DatabaseReferencePlatform { const std::string& path() const; void set_path(std::string_view value_arg); + bool operator==(const DatabaseReferencePlatform& other) const; + bool operator!=(const DatabaseReferencePlatform& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + private: static DatabaseReferencePlatform FromEncodableList( - const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; + const ::flutter::EncodableList& list); + + public: + public: + ::flutter::EncodableList ToEncodableList() const; + + private: + private: friend class FirebaseDatabaseHostApi; friend class FirebaseDatabaseFlutterApi; friend class PigeonInternalCodecSerializer; @@ -174,30 +210,42 @@ class DatabaseReferenceRequest { // Constructs an object setting all fields. explicit DatabaseReferenceRequest(const std::string& path, - const flutter::EncodableValue* value, - const flutter::EncodableValue* priority); + const ::flutter::EncodableValue* value, + const ::flutter::EncodableValue* priority); const std::string& path() const; void set_path(std::string_view value_arg); - const flutter::EncodableValue* value() const; - void set_value(const flutter::EncodableValue* value_arg); - void set_value(const flutter::EncodableValue& value_arg); + const ::flutter::EncodableValue* value() const; + void set_value(const ::flutter::EncodableValue* value_arg); + void set_value(const ::flutter::EncodableValue& value_arg); - const flutter::EncodableValue* priority() const; - void set_priority(const flutter::EncodableValue* value_arg); - void set_priority(const flutter::EncodableValue& value_arg); + const ::flutter::EncodableValue* priority() const; + void set_priority(const ::flutter::EncodableValue* value_arg); + void set_priority(const ::flutter::EncodableValue& value_arg); + + bool operator==(const DatabaseReferenceRequest& other) const; + bool operator!=(const DatabaseReferenceRequest& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; private: static DatabaseReferenceRequest FromEncodableList( - const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; + const ::flutter::EncodableList& list); + + public: + public: + ::flutter::EncodableList ToEncodableList() const; + + private: + private: friend class FirebaseDatabaseHostApi; friend class FirebaseDatabaseFlutterApi; friend class PigeonInternalCodecSerializer; std::string path_; - std::optional value_; - std::optional priority_; + std::optional<::flutter::EncodableValue> value_; + std::optional<::flutter::EncodableValue> priority_; }; // Generated class from Pigeon that represents data sent in messages. @@ -205,22 +253,34 @@ class UpdateRequest { public: // Constructs an object setting all fields. explicit UpdateRequest(const std::string& path, - const flutter::EncodableMap& value); + const ::flutter::EncodableMap& value); const std::string& path() const; void set_path(std::string_view value_arg); - const flutter::EncodableMap& value() const; - void set_value(const flutter::EncodableMap& value_arg); + const ::flutter::EncodableMap& value() const; + void set_value(const ::flutter::EncodableMap& value_arg); + bool operator==(const UpdateRequest& other) const; + bool operator!=(const UpdateRequest& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + + private: + static UpdateRequest FromEncodableList(const ::flutter::EncodableList& list); + + public: + public: + ::flutter::EncodableList ToEncodableList() const; + + private: private: - static UpdateRequest FromEncodableList(const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; friend class FirebaseDatabaseHostApi; friend class FirebaseDatabaseFlutterApi; friend class PigeonInternalCodecSerializer; std::string path_; - flutter::EncodableMap value_; + ::flutter::EncodableMap value_; }; // Generated class from Pigeon that represents data sent in messages. @@ -239,10 +299,22 @@ class TransactionRequest { bool apply_locally() const; void set_apply_locally(bool value_arg); + bool operator==(const TransactionRequest& other) const; + bool operator!=(const TransactionRequest& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + private: static TransactionRequest FromEncodableList( - const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; + const ::flutter::EncodableList& list); + + public: + public: + ::flutter::EncodableList ToEncodableList() const; + + private: + private: friend class FirebaseDatabaseHostApi; friend class FirebaseDatabaseFlutterApi; friend class PigeonInternalCodecSerializer; @@ -256,31 +328,43 @@ class QueryRequest { public: // Constructs an object setting all non-nullable fields. explicit QueryRequest(const std::string& path, - const flutter::EncodableList& modifiers); + const ::flutter::EncodableList& modifiers); // Constructs an object setting all fields. explicit QueryRequest(const std::string& path, - const flutter::EncodableList& modifiers, + const ::flutter::EncodableList& modifiers, const bool* value); const std::string& path() const; void set_path(std::string_view value_arg); - const flutter::EncodableList& modifiers() const; - void set_modifiers(const flutter::EncodableList& value_arg); + const ::flutter::EncodableList& modifiers() const; + void set_modifiers(const ::flutter::EncodableList& value_arg); const bool* value() const; void set_value(const bool* value_arg); void set_value(bool value_arg); + bool operator==(const QueryRequest& other) const; + bool operator!=(const QueryRequest& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + + private: + static QueryRequest FromEncodableList(const ::flutter::EncodableList& list); + + public: + public: + ::flutter::EncodableList ToEncodableList() const; + + private: private: - static QueryRequest FromEncodableList(const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; friend class FirebaseDatabaseHostApi; friend class FirebaseDatabaseFlutterApi; friend class PigeonInternalCodecSerializer; std::string path_; - flutter::EncodableList modifiers_; + ::flutter::EncodableList modifiers_; std::optional value_; }; @@ -291,12 +375,12 @@ class TransactionHandlerResult { explicit TransactionHandlerResult(bool aborted, bool exception); // Constructs an object setting all fields. - explicit TransactionHandlerResult(const flutter::EncodableValue* value, + explicit TransactionHandlerResult(const ::flutter::EncodableValue* value, bool aborted, bool exception); - const flutter::EncodableValue* value() const; - void set_value(const flutter::EncodableValue* value_arg); - void set_value(const flutter::EncodableValue& value_arg); + const ::flutter::EncodableValue* value() const; + void set_value(const ::flutter::EncodableValue* value_arg); + void set_value(const ::flutter::EncodableValue& value_arg); bool aborted() const; void set_aborted(bool value_arg); @@ -304,19 +388,32 @@ class TransactionHandlerResult { bool exception() const; void set_exception(bool value_arg); + bool operator==(const TransactionHandlerResult& other) const; + bool operator!=(const TransactionHandlerResult& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + private: static TransactionHandlerResult FromEncodableList( - const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; + const ::flutter::EncodableList& list); + + public: + public: + ::flutter::EncodableList ToEncodableList() const; + + private: + private: friend class FirebaseDatabaseHostApi; friend class FirebaseDatabaseFlutterApi; friend class PigeonInternalCodecSerializer; - std::optional value_; + std::optional<::flutter::EncodableValue> value_; bool aborted_; bool exception_; }; -class PigeonInternalCodecSerializer : public flutter::StandardCodecSerializer { +class PigeonInternalCodecSerializer + : public ::flutter::StandardCodecSerializer { public: PigeonInternalCodecSerializer(); inline static PigeonInternalCodecSerializer& GetInstance() { @@ -324,12 +421,12 @@ class PigeonInternalCodecSerializer : public flutter::StandardCodecSerializer { return sInstance; } - void WriteValue(const flutter::EncodableValue& value, - flutter::ByteStreamWriter* stream) const override; + void WriteValue(const ::flutter::EncodableValue& value, + ::flutter::ByteStreamWriter* stream) const override; protected: - flutter::EncodableValue ReadValueOfType( - uint8_t type, flutter::ByteStreamReader* stream) const override; + ::flutter::EncodableValue ReadValueOfType( + uint8_t type, ::flutter::ByteStreamReader* stream) const override; }; // Generated interface from Pigeon that represents a handler of messages from @@ -387,7 +484,7 @@ class FirebaseDatabaseHostApi { std::function reply)> result) = 0; virtual void DatabaseReferenceGetTransactionResult( const DatabasePigeonFirebaseApp& app, int64_t transaction_key, - std::function reply)> result) = 0; + std::function reply)> result) = 0; virtual void OnDisconnectSet( const DatabasePigeonFirebaseApp& app, const DatabaseReferenceRequest& request, @@ -410,19 +507,19 @@ class FirebaseDatabaseHostApi { std::function reply)> result) = 0; virtual void QueryGet( const DatabasePigeonFirebaseApp& app, const QueryRequest& request, - std::function reply)> result) = 0; + std::function reply)> result) = 0; // The codec used by FirebaseDatabaseHostApi. - static const flutter::StandardMessageCodec& GetCodec(); + static const ::flutter::StandardMessageCodec& GetCodec(); // Sets up an instance of `FirebaseDatabaseHostApi` to handle messages through // the `binary_messenger`. - static void SetUp(flutter::BinaryMessenger* binary_messenger, + static void SetUp(::flutter::BinaryMessenger* binary_messenger, FirebaseDatabaseHostApi* api); - static void SetUp(flutter::BinaryMessenger* binary_messenger, + static void SetUp(::flutter::BinaryMessenger* binary_messenger, FirebaseDatabaseHostApi* api, const std::string& message_channel_suffix); - static flutter::EncodableValue WrapError(std::string_view error_message); - static flutter::EncodableValue WrapError(const FlutterError& error); + static ::flutter::EncodableValue WrapError(std::string_view error_message); + static ::flutter::EncodableValue WrapError(const FlutterError& error); protected: FirebaseDatabaseHostApi() = default; @@ -431,17 +528,17 @@ class FirebaseDatabaseHostApi { // called from C++. class FirebaseDatabaseFlutterApi { public: - FirebaseDatabaseFlutterApi(flutter::BinaryMessenger* binary_messenger); - FirebaseDatabaseFlutterApi(flutter::BinaryMessenger* binary_messenger, + FirebaseDatabaseFlutterApi(::flutter::BinaryMessenger* binary_messenger); + FirebaseDatabaseFlutterApi(::flutter::BinaryMessenger* binary_messenger, const std::string& message_channel_suffix); - static const flutter::StandardMessageCodec& GetCodec(); + static const ::flutter::StandardMessageCodec& GetCodec(); void CallTransactionHandler( - int64_t transaction_key, const flutter::EncodableValue* snapshot_value, + int64_t transaction_key, const ::flutter::EncodableValue* snapshot_value, std::function&& on_success, std::function&& on_error); private: - flutter::BinaryMessenger* binary_messenger_; + ::flutter::BinaryMessenger* binary_messenger_; std::string message_channel_suffix_; }; diff --git a/packages/firebase_database/firebase_database_platform_interface/lib/src/pigeon/messages.pigeon.dart b/packages/firebase_database/firebase_database_platform_interface/lib/src/pigeon/messages.pigeon.dart index 592d072fca61..f8b622a7016a 100644 --- a/packages/firebase_database/firebase_database_platform_interface/lib/src/pigeon/messages.pigeon.dart +++ b/packages/firebase_database/firebase_database_platform_interface/lib/src/pigeon/messages.pigeon.dart @@ -1,21 +1,40 @@ // Copyright 2025, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v25.3.2), do not edit directly. +// Autogenerated from Pigeon (v26.3.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, no_leading_underscores_for_local_identifiers +// ignore_for_file: unused_import, unused_shown_name +// ignore_for_file: type=lint import 'dart:async'; -import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; +import 'dart:typed_data' show Float64List, Int32List, Int64List; -import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer; import 'package:flutter/services.dart'; - -PlatformException _createConnectionError(String channelName) { - return PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel: "$channelName".', - ); +import 'package:meta/meta.dart' show immutable, protected, visibleForTesting; + +Object? _extractReplyValueOrThrow( + List? replyList, + String channelName, { + required bool isNullValid, +}) { + if (replyList == null) { + throw PlatformException( + code: 'channel-error', + message: 'Unable to establish connection on channel: "$channelName".', + ); + } else if (replyList.length > 1) { + throw PlatformException( + code: replyList[0]! as String, + message: replyList[1] as String?, + details: replyList[2], + ); + } else if (!isNullValid && (replyList.isNotEmpty && replyList[0] == null)) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } + return replyList.firstOrNull; } List wrapResponse( @@ -30,20 +49,67 @@ List wrapResponse( } bool _deepEquals(Object? a, Object? b) { + if (identical(a, b)) { + return true; + } + if (a is double && b is double) { + if (a.isNaN && b.isNaN) { + return true; + } + return a == b; + } if (a is List && b is List) { return a.length == b.length && a.indexed .every(((int, dynamic) item) => _deepEquals(item.$2, b[item.$1])); } if (a is Map && b is Map) { - return a.length == b.length && - a.entries.every((MapEntry entry) => - (b as Map).containsKey(entry.key) && - _deepEquals(entry.value, b[entry.key])); + if (a.length != b.length) { + return false; + } + for (final MapEntry entryA in a.entries) { + bool found = false; + for (final MapEntry entryB in b.entries) { + if (_deepEquals(entryA.key, entryB.key)) { + if (_deepEquals(entryA.value, entryB.value)) { + found = true; + break; + } else { + return false; + } + } + } + if (!found) { + return false; + } + } + return true; } return a == b; } +int _deepHash(Object? value) { + if (value is List) { + return Object.hashAll(value.map(_deepHash)); + } + if (value is Map) { + int result = 0; + for (final MapEntry entry in value.entries) { + result += (_deepHash(entry.key) * 31) ^ _deepHash(entry.value); + } + return result; + } + if (value is double && value.isNaN) { + // Normalize NaN to a consistent hash. + return 0x7FF8000000000000.hashCode; + } + if (value is double && value == 0.0) { + // Normalize -0.0 to 0.0 so they have the same hash code. + return 0.0.hashCode; + } + return value.hashCode; +} + class DatabasePigeonSettings { DatabasePigeonSettings({ this.persistenceEnabled, @@ -97,12 +163,16 @@ class DatabasePigeonSettings { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(persistenceEnabled, other.persistenceEnabled) && + _deepEquals(cacheSizeBytes, other.cacheSizeBytes) && + _deepEquals(loggingEnabled, other.loggingEnabled) && + _deepEquals(emulatorHost, other.emulatorHost) && + _deepEquals(emulatorPort, other.emulatorPort); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()); + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class DatabasePigeonFirebaseApp { @@ -149,12 +219,14 @@ class DatabasePigeonFirebaseApp { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(appName, other.appName) && + _deepEquals(databaseURL, other.databaseURL) && + _deepEquals(settings, other.settings); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()); + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class DatabaseReferencePlatform { @@ -191,12 +263,12 @@ class DatabaseReferencePlatform { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(path, other.path); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()); + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class DatabaseReferenceRequest { @@ -243,12 +315,14 @@ class DatabaseReferenceRequest { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(path, other.path) && + _deepEquals(value, other.value) && + _deepEquals(priority, other.priority); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()); + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class UpdateRequest { @@ -276,7 +350,7 @@ class UpdateRequest { result as List; return UpdateRequest( path: result[0]! as String, - value: (result[1] as Map?)!.cast(), + value: (result[1]! as Map).cast(), ); } @@ -289,12 +363,12 @@ class UpdateRequest { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(path, other.path) && _deepEquals(value, other.value); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()); + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class TransactionRequest { @@ -340,12 +414,14 @@ class TransactionRequest { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(path, other.path) && + _deepEquals(transactionKey, other.transactionKey) && + _deepEquals(applyLocally, other.applyLocally); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()); + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class QueryRequest { @@ -377,7 +453,7 @@ class QueryRequest { result as List; return QueryRequest( path: result[0]! as String, - modifiers: (result[1] as List?)!.cast>(), + modifiers: (result[1]! as List).cast>(), value: result[2] as bool?, ); } @@ -391,12 +467,14 @@ class QueryRequest { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(path, other.path) && + _deepEquals(modifiers, other.modifiers) && + _deepEquals(value, other.value); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()); + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class TransactionHandlerResult { @@ -443,12 +521,14 @@ class TransactionHandlerResult { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(value, other.value) && + _deepEquals(aborted, other.aborted) && + _deepEquals(exception, other.exception); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()); + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class _PigeonCodec extends StandardMessageCodec { @@ -528,621 +608,447 @@ class FirebaseDatabaseHostApi { final String pigeonVar_messageChannelSuffix; Future goOnline(DatabasePigeonFirebaseApp app) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.goOnline$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([app]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future goOffline(DatabasePigeonFirebaseApp app) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.goOffline$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([app]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future setPersistenceEnabled( DatabasePigeonFirebaseApp app, bool enabled) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.setPersistenceEnabled$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([app, enabled]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future setPersistenceCacheSizeBytes( DatabasePigeonFirebaseApp app, int cacheSize) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.setPersistenceCacheSizeBytes$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([app, cacheSize]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future setLoggingEnabled( DatabasePigeonFirebaseApp app, bool enabled) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.setLoggingEnabled$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([app, enabled]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future useDatabaseEmulator( DatabasePigeonFirebaseApp app, String host, int port) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.useDatabaseEmulator$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([app, host, port]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future ref(DatabasePigeonFirebaseApp app, [String? path]) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.ref$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([app, path]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as DatabaseReferencePlatform?)!; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as DatabaseReferencePlatform; } Future refFromURL( DatabasePigeonFirebaseApp app, String url) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.refFromURL$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([app, url]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as DatabaseReferencePlatform?)!; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as DatabaseReferencePlatform; } Future purgeOutstandingWrites(DatabasePigeonFirebaseApp app) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.purgeOutstandingWrites$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([app]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future databaseReferenceSet( DatabasePigeonFirebaseApp app, DatabaseReferenceRequest request) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.databaseReferenceSet$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([app, request]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future databaseReferenceSetWithPriority( DatabasePigeonFirebaseApp app, DatabaseReferenceRequest request) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.databaseReferenceSetWithPriority$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([app, request]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future databaseReferenceUpdate( DatabasePigeonFirebaseApp app, UpdateRequest request) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.databaseReferenceUpdate$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([app, request]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future databaseReferenceSetPriority( DatabasePigeonFirebaseApp app, DatabaseReferenceRequest request) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.databaseReferenceSetPriority$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([app, request]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future databaseReferenceRunTransaction( DatabasePigeonFirebaseApp app, TransactionRequest request) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.databaseReferenceRunTransaction$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([app, request]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future> databaseReferenceGetTransactionResult( DatabasePigeonFirebaseApp app, int transactionKey) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.databaseReferenceGetTransactionResult$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([app, transactionKey]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as Map?)! - .cast(); - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return (pigeonVar_replyValue! as Map) + .cast(); } Future onDisconnectSet( DatabasePigeonFirebaseApp app, DatabaseReferenceRequest request) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.onDisconnectSet$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([app, request]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future onDisconnectSetWithPriority( DatabasePigeonFirebaseApp app, DatabaseReferenceRequest request) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.onDisconnectSetWithPriority$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([app, request]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future onDisconnectUpdate( DatabasePigeonFirebaseApp app, UpdateRequest request) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.onDisconnectUpdate$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([app, request]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future onDisconnectCancel( DatabasePigeonFirebaseApp app, String path) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.onDisconnectCancel$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([app, path]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future queryObserve( DatabasePigeonFirebaseApp app, QueryRequest request) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.queryObserve$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([app, request]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as String?)!; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as String; } Future queryKeepSynced( DatabasePigeonFirebaseApp app, QueryRequest request) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.queryKeepSynced$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([app, request]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future> queryGet( DatabasePigeonFirebaseApp app, QueryRequest request) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.queryGet$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([app, request]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as Map?)! - .cast(); - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return (pigeonVar_replyValue! as Map) + .cast(); } } @@ -1160,9 +1066,7 @@ abstract class FirebaseDatabaseFlutterApi { messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseFlutterApi.callTransactionHandler$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -1170,16 +1074,12 @@ abstract class FirebaseDatabaseFlutterApi { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseFlutterApi.callTransactionHandler was null.'); - final List args = (message as List?)!; - final int? arg_transactionKey = (args[0] as int?); - assert(arg_transactionKey != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseFlutterApi.callTransactionHandler was null, expected non-null int.'); - final Object? arg_snapshotValue = (args[1] as Object?); + final List args = message! as List; + final int arg_transactionKey = args[0]! as int; + final Object? arg_snapshotValue = args[1]; try { final TransactionHandlerResult output = await api - .callTransactionHandler(arg_transactionKey!, arg_snapshotValue); + .callTransactionHandler(arg_transactionKey, arg_snapshotValue); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); diff --git a/packages/firebase_database/firebase_database_platform_interface/pubspec.yaml b/packages/firebase_database/firebase_database_platform_interface/pubspec.yaml index 6333f8bc6b3c..fc60b133c334 100755 --- a/packages/firebase_database/firebase_database_platform_interface/pubspec.yaml +++ b/packages/firebase_database/firebase_database_platform_interface/pubspec.yaml @@ -21,4 +21,4 @@ dev_dependencies: flutter_test: sdk: flutter mockito: ^5.0.2 - pigeon: 25.3.2 + pigeon: 26.3.4 diff --git a/packages/firebase_database/firebase_database_platform_interface/test/pigeon/test_api.dart b/packages/firebase_database/firebase_database_platform_interface/test/pigeon/test_api.dart index 9c08cae382af..da5370c5adb2 100644 --- a/packages/firebase_database/firebase_database_platform_interface/test/pigeon/test_api.dart +++ b/packages/firebase_database/firebase_database_platform_interface/test/pigeon/test_api.dart @@ -1,9 +1,9 @@ // Copyright 2025, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v25.3.2), do not edit directly. +// Autogenerated from Pigeon (v26.3.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, unnecessary_import, no_leading_underscores_for_local_identifiers +// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, unnecessary_import, no_leading_underscores_for_local_identifiers, omit_obvious_local_variable_types // ignore_for_file: avoid_relative_lib_imports import 'dart:async'; import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; @@ -148,9 +148,7 @@ abstract class TestFirebaseDatabaseHostApi { messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.goOnline$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -161,15 +159,11 @@ abstract class TestFirebaseDatabaseHostApi { _testBinaryMessengerBinding!.defaultBinaryMessenger .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.goOnline was null.'); - final List args = (message as List?)!; - final DatabasePigeonFirebaseApp? arg_app = - (args[0] as DatabasePigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.goOnline was null, expected non-null DatabasePigeonFirebaseApp.'); + final List args = message! as List; + final DatabasePigeonFirebaseApp arg_app = + args[0]! as DatabasePigeonFirebaseApp; try { - await api.goOnline(arg_app!); + await api.goOnline(arg_app); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -181,9 +175,7 @@ abstract class TestFirebaseDatabaseHostApi { } } { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.goOffline$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -194,15 +186,11 @@ abstract class TestFirebaseDatabaseHostApi { _testBinaryMessengerBinding!.defaultBinaryMessenger .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.goOffline was null.'); - final List args = (message as List?)!; - final DatabasePigeonFirebaseApp? arg_app = - (args[0] as DatabasePigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.goOffline was null, expected non-null DatabasePigeonFirebaseApp.'); + final List args = message! as List; + final DatabasePigeonFirebaseApp arg_app = + args[0]! as DatabasePigeonFirebaseApp; try { - await api.goOffline(arg_app!); + await api.goOffline(arg_app); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -214,9 +202,7 @@ abstract class TestFirebaseDatabaseHostApi { } } { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.setPersistenceEnabled$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -227,18 +213,12 @@ abstract class TestFirebaseDatabaseHostApi { _testBinaryMessengerBinding!.defaultBinaryMessenger .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.setPersistenceEnabled was null.'); - final List args = (message as List?)!; - final DatabasePigeonFirebaseApp? arg_app = - (args[0] as DatabasePigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.setPersistenceEnabled was null, expected non-null DatabasePigeonFirebaseApp.'); - final bool? arg_enabled = (args[1] as bool?); - assert(arg_enabled != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.setPersistenceEnabled was null, expected non-null bool.'); + final List args = message! as List; + final DatabasePigeonFirebaseApp arg_app = + args[0]! as DatabasePigeonFirebaseApp; + final bool arg_enabled = args[1]! as bool; try { - await api.setPersistenceEnabled(arg_app!, arg_enabled!); + await api.setPersistenceEnabled(arg_app, arg_enabled); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -250,9 +230,7 @@ abstract class TestFirebaseDatabaseHostApi { } } { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.setPersistenceCacheSizeBytes$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -263,18 +241,12 @@ abstract class TestFirebaseDatabaseHostApi { _testBinaryMessengerBinding!.defaultBinaryMessenger .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.setPersistenceCacheSizeBytes was null.'); - final List args = (message as List?)!; - final DatabasePigeonFirebaseApp? arg_app = - (args[0] as DatabasePigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.setPersistenceCacheSizeBytes was null, expected non-null DatabasePigeonFirebaseApp.'); - final int? arg_cacheSize = (args[1] as int?); - assert(arg_cacheSize != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.setPersistenceCacheSizeBytes was null, expected non-null int.'); + final List args = message! as List; + final DatabasePigeonFirebaseApp arg_app = + args[0]! as DatabasePigeonFirebaseApp; + final int arg_cacheSize = args[1]! as int; try { - await api.setPersistenceCacheSizeBytes(arg_app!, arg_cacheSize!); + await api.setPersistenceCacheSizeBytes(arg_app, arg_cacheSize); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -286,9 +258,7 @@ abstract class TestFirebaseDatabaseHostApi { } } { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.setLoggingEnabled$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -299,18 +269,12 @@ abstract class TestFirebaseDatabaseHostApi { _testBinaryMessengerBinding!.defaultBinaryMessenger .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.setLoggingEnabled was null.'); - final List args = (message as List?)!; - final DatabasePigeonFirebaseApp? arg_app = - (args[0] as DatabasePigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.setLoggingEnabled was null, expected non-null DatabasePigeonFirebaseApp.'); - final bool? arg_enabled = (args[1] as bool?); - assert(arg_enabled != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.setLoggingEnabled was null, expected non-null bool.'); + final List args = message! as List; + final DatabasePigeonFirebaseApp arg_app = + args[0]! as DatabasePigeonFirebaseApp; + final bool arg_enabled = args[1]! as bool; try { - await api.setLoggingEnabled(arg_app!, arg_enabled!); + await api.setLoggingEnabled(arg_app, arg_enabled); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -322,9 +286,7 @@ abstract class TestFirebaseDatabaseHostApi { } } { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.useDatabaseEmulator$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -335,21 +297,13 @@ abstract class TestFirebaseDatabaseHostApi { _testBinaryMessengerBinding!.defaultBinaryMessenger .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.useDatabaseEmulator was null.'); - final List args = (message as List?)!; - final DatabasePigeonFirebaseApp? arg_app = - (args[0] as DatabasePigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.useDatabaseEmulator was null, expected non-null DatabasePigeonFirebaseApp.'); - final String? arg_host = (args[1] as String?); - assert(arg_host != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.useDatabaseEmulator was null, expected non-null String.'); - final int? arg_port = (args[2] as int?); - assert(arg_port != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.useDatabaseEmulator was null, expected non-null int.'); + final List args = message! as List; + final DatabasePigeonFirebaseApp arg_app = + args[0]! as DatabasePigeonFirebaseApp; + final String arg_host = args[1]! as String; + final int arg_port = args[2]! as int; try { - await api.useDatabaseEmulator(arg_app!, arg_host!, arg_port!); + await api.useDatabaseEmulator(arg_app, arg_host, arg_port); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -361,9 +315,7 @@ abstract class TestFirebaseDatabaseHostApi { } } { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.ref$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -374,17 +326,13 @@ abstract class TestFirebaseDatabaseHostApi { _testBinaryMessengerBinding!.defaultBinaryMessenger .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.ref was null.'); - final List args = (message as List?)!; - final DatabasePigeonFirebaseApp? arg_app = - (args[0] as DatabasePigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.ref was null, expected non-null DatabasePigeonFirebaseApp.'); - final String? arg_path = (args[1] as String?); + final List args = message! as List; + final DatabasePigeonFirebaseApp arg_app = + args[0]! as DatabasePigeonFirebaseApp; + final String? arg_path = args[1] as String?; try { final DatabaseReferencePlatform output = - await api.ref(arg_app!, arg_path); + await api.ref(arg_app, arg_path); return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); @@ -396,9 +344,7 @@ abstract class TestFirebaseDatabaseHostApi { } } { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.refFromURL$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -409,19 +355,13 @@ abstract class TestFirebaseDatabaseHostApi { _testBinaryMessengerBinding!.defaultBinaryMessenger .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.refFromURL was null.'); - final List args = (message as List?)!; - final DatabasePigeonFirebaseApp? arg_app = - (args[0] as DatabasePigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.refFromURL was null, expected non-null DatabasePigeonFirebaseApp.'); - final String? arg_url = (args[1] as String?); - assert(arg_url != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.refFromURL was null, expected non-null String.'); + final List args = message! as List; + final DatabasePigeonFirebaseApp arg_app = + args[0]! as DatabasePigeonFirebaseApp; + final String arg_url = args[1]! as String; try { final DatabaseReferencePlatform output = - await api.refFromURL(arg_app!, arg_url!); + await api.refFromURL(arg_app, arg_url); return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); @@ -433,9 +373,7 @@ abstract class TestFirebaseDatabaseHostApi { } } { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.purgeOutstandingWrites$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -446,15 +384,11 @@ abstract class TestFirebaseDatabaseHostApi { _testBinaryMessengerBinding!.defaultBinaryMessenger .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.purgeOutstandingWrites was null.'); - final List args = (message as List?)!; - final DatabasePigeonFirebaseApp? arg_app = - (args[0] as DatabasePigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.purgeOutstandingWrites was null, expected non-null DatabasePigeonFirebaseApp.'); + final List args = message! as List; + final DatabasePigeonFirebaseApp arg_app = + args[0]! as DatabasePigeonFirebaseApp; try { - await api.purgeOutstandingWrites(arg_app!); + await api.purgeOutstandingWrites(arg_app); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -466,9 +400,7 @@ abstract class TestFirebaseDatabaseHostApi { } } { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.databaseReferenceSet$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -479,19 +411,13 @@ abstract class TestFirebaseDatabaseHostApi { _testBinaryMessengerBinding!.defaultBinaryMessenger .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.databaseReferenceSet was null.'); - final List args = (message as List?)!; - final DatabasePigeonFirebaseApp? arg_app = - (args[0] as DatabasePigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.databaseReferenceSet was null, expected non-null DatabasePigeonFirebaseApp.'); - final DatabaseReferenceRequest? arg_request = - (args[1] as DatabaseReferenceRequest?); - assert(arg_request != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.databaseReferenceSet was null, expected non-null DatabaseReferenceRequest.'); + final List args = message! as List; + final DatabasePigeonFirebaseApp arg_app = + args[0]! as DatabasePigeonFirebaseApp; + final DatabaseReferenceRequest arg_request = + args[1]! as DatabaseReferenceRequest; try { - await api.databaseReferenceSet(arg_app!, arg_request!); + await api.databaseReferenceSet(arg_app, arg_request); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -503,9 +429,7 @@ abstract class TestFirebaseDatabaseHostApi { } } { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.databaseReferenceSetWithPriority$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -516,19 +440,13 @@ abstract class TestFirebaseDatabaseHostApi { _testBinaryMessengerBinding!.defaultBinaryMessenger .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.databaseReferenceSetWithPriority was null.'); - final List args = (message as List?)!; - final DatabasePigeonFirebaseApp? arg_app = - (args[0] as DatabasePigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.databaseReferenceSetWithPriority was null, expected non-null DatabasePigeonFirebaseApp.'); - final DatabaseReferenceRequest? arg_request = - (args[1] as DatabaseReferenceRequest?); - assert(arg_request != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.databaseReferenceSetWithPriority was null, expected non-null DatabaseReferenceRequest.'); + final List args = message! as List; + final DatabasePigeonFirebaseApp arg_app = + args[0]! as DatabasePigeonFirebaseApp; + final DatabaseReferenceRequest arg_request = + args[1]! as DatabaseReferenceRequest; try { - await api.databaseReferenceSetWithPriority(arg_app!, arg_request!); + await api.databaseReferenceSetWithPriority(arg_app, arg_request); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -540,9 +458,7 @@ abstract class TestFirebaseDatabaseHostApi { } } { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.databaseReferenceUpdate$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -553,18 +469,12 @@ abstract class TestFirebaseDatabaseHostApi { _testBinaryMessengerBinding!.defaultBinaryMessenger .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.databaseReferenceUpdate was null.'); - final List args = (message as List?)!; - final DatabasePigeonFirebaseApp? arg_app = - (args[0] as DatabasePigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.databaseReferenceUpdate was null, expected non-null DatabasePigeonFirebaseApp.'); - final UpdateRequest? arg_request = (args[1] as UpdateRequest?); - assert(arg_request != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.databaseReferenceUpdate was null, expected non-null UpdateRequest.'); + final List args = message! as List; + final DatabasePigeonFirebaseApp arg_app = + args[0]! as DatabasePigeonFirebaseApp; + final UpdateRequest arg_request = args[1]! as UpdateRequest; try { - await api.databaseReferenceUpdate(arg_app!, arg_request!); + await api.databaseReferenceUpdate(arg_app, arg_request); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -576,9 +486,7 @@ abstract class TestFirebaseDatabaseHostApi { } } { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.databaseReferenceSetPriority$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -589,19 +497,13 @@ abstract class TestFirebaseDatabaseHostApi { _testBinaryMessengerBinding!.defaultBinaryMessenger .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.databaseReferenceSetPriority was null.'); - final List args = (message as List?)!; - final DatabasePigeonFirebaseApp? arg_app = - (args[0] as DatabasePigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.databaseReferenceSetPriority was null, expected non-null DatabasePigeonFirebaseApp.'); - final DatabaseReferenceRequest? arg_request = - (args[1] as DatabaseReferenceRequest?); - assert(arg_request != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.databaseReferenceSetPriority was null, expected non-null DatabaseReferenceRequest.'); + final List args = message! as List; + final DatabasePigeonFirebaseApp arg_app = + args[0]! as DatabasePigeonFirebaseApp; + final DatabaseReferenceRequest arg_request = + args[1]! as DatabaseReferenceRequest; try { - await api.databaseReferenceSetPriority(arg_app!, arg_request!); + await api.databaseReferenceSetPriority(arg_app, arg_request); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -613,9 +515,7 @@ abstract class TestFirebaseDatabaseHostApi { } } { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.databaseReferenceRunTransaction$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -626,19 +526,12 @@ abstract class TestFirebaseDatabaseHostApi { _testBinaryMessengerBinding!.defaultBinaryMessenger .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.databaseReferenceRunTransaction was null.'); - final List args = (message as List?)!; - final DatabasePigeonFirebaseApp? arg_app = - (args[0] as DatabasePigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.databaseReferenceRunTransaction was null, expected non-null DatabasePigeonFirebaseApp.'); - final TransactionRequest? arg_request = - (args[1] as TransactionRequest?); - assert(arg_request != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.databaseReferenceRunTransaction was null, expected non-null TransactionRequest.'); + final List args = message! as List; + final DatabasePigeonFirebaseApp arg_app = + args[0]! as DatabasePigeonFirebaseApp; + final TransactionRequest arg_request = args[1]! as TransactionRequest; try { - await api.databaseReferenceRunTransaction(arg_app!, arg_request!); + await api.databaseReferenceRunTransaction(arg_app, arg_request); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -650,9 +543,7 @@ abstract class TestFirebaseDatabaseHostApi { } } { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.databaseReferenceGetTransactionResult$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -663,20 +554,14 @@ abstract class TestFirebaseDatabaseHostApi { _testBinaryMessengerBinding!.defaultBinaryMessenger .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.databaseReferenceGetTransactionResult was null.'); - final List args = (message as List?)!; - final DatabasePigeonFirebaseApp? arg_app = - (args[0] as DatabasePigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.databaseReferenceGetTransactionResult was null, expected non-null DatabasePigeonFirebaseApp.'); - final int? arg_transactionKey = (args[1] as int?); - assert(arg_transactionKey != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.databaseReferenceGetTransactionResult was null, expected non-null int.'); + final List args = message! as List; + final DatabasePigeonFirebaseApp arg_app = + args[0]! as DatabasePigeonFirebaseApp; + final int arg_transactionKey = args[1]! as int; try { final Map output = await api.databaseReferenceGetTransactionResult( - arg_app!, arg_transactionKey!); + arg_app, arg_transactionKey); return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); @@ -688,9 +573,7 @@ abstract class TestFirebaseDatabaseHostApi { } } { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.onDisconnectSet$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -701,19 +584,13 @@ abstract class TestFirebaseDatabaseHostApi { _testBinaryMessengerBinding!.defaultBinaryMessenger .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.onDisconnectSet was null.'); - final List args = (message as List?)!; - final DatabasePigeonFirebaseApp? arg_app = - (args[0] as DatabasePigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.onDisconnectSet was null, expected non-null DatabasePigeonFirebaseApp.'); - final DatabaseReferenceRequest? arg_request = - (args[1] as DatabaseReferenceRequest?); - assert(arg_request != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.onDisconnectSet was null, expected non-null DatabaseReferenceRequest.'); + final List args = message! as List; + final DatabasePigeonFirebaseApp arg_app = + args[0]! as DatabasePigeonFirebaseApp; + final DatabaseReferenceRequest arg_request = + args[1]! as DatabaseReferenceRequest; try { - await api.onDisconnectSet(arg_app!, arg_request!); + await api.onDisconnectSet(arg_app, arg_request); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -725,9 +602,7 @@ abstract class TestFirebaseDatabaseHostApi { } } { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.onDisconnectSetWithPriority$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -738,19 +613,13 @@ abstract class TestFirebaseDatabaseHostApi { _testBinaryMessengerBinding!.defaultBinaryMessenger .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.onDisconnectSetWithPriority was null.'); - final List args = (message as List?)!; - final DatabasePigeonFirebaseApp? arg_app = - (args[0] as DatabasePigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.onDisconnectSetWithPriority was null, expected non-null DatabasePigeonFirebaseApp.'); - final DatabaseReferenceRequest? arg_request = - (args[1] as DatabaseReferenceRequest?); - assert(arg_request != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.onDisconnectSetWithPriority was null, expected non-null DatabaseReferenceRequest.'); + final List args = message! as List; + final DatabasePigeonFirebaseApp arg_app = + args[0]! as DatabasePigeonFirebaseApp; + final DatabaseReferenceRequest arg_request = + args[1]! as DatabaseReferenceRequest; try { - await api.onDisconnectSetWithPriority(arg_app!, arg_request!); + await api.onDisconnectSetWithPriority(arg_app, arg_request); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -762,9 +631,7 @@ abstract class TestFirebaseDatabaseHostApi { } } { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.onDisconnectUpdate$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -775,18 +642,12 @@ abstract class TestFirebaseDatabaseHostApi { _testBinaryMessengerBinding!.defaultBinaryMessenger .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.onDisconnectUpdate was null.'); - final List args = (message as List?)!; - final DatabasePigeonFirebaseApp? arg_app = - (args[0] as DatabasePigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.onDisconnectUpdate was null, expected non-null DatabasePigeonFirebaseApp.'); - final UpdateRequest? arg_request = (args[1] as UpdateRequest?); - assert(arg_request != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.onDisconnectUpdate was null, expected non-null UpdateRequest.'); + final List args = message! as List; + final DatabasePigeonFirebaseApp arg_app = + args[0]! as DatabasePigeonFirebaseApp; + final UpdateRequest arg_request = args[1]! as UpdateRequest; try { - await api.onDisconnectUpdate(arg_app!, arg_request!); + await api.onDisconnectUpdate(arg_app, arg_request); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -798,9 +659,7 @@ abstract class TestFirebaseDatabaseHostApi { } } { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.onDisconnectCancel$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -811,18 +670,12 @@ abstract class TestFirebaseDatabaseHostApi { _testBinaryMessengerBinding!.defaultBinaryMessenger .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.onDisconnectCancel was null.'); - final List args = (message as List?)!; - final DatabasePigeonFirebaseApp? arg_app = - (args[0] as DatabasePigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.onDisconnectCancel was null, expected non-null DatabasePigeonFirebaseApp.'); - final String? arg_path = (args[1] as String?); - assert(arg_path != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.onDisconnectCancel was null, expected non-null String.'); + final List args = message! as List; + final DatabasePigeonFirebaseApp arg_app = + args[0]! as DatabasePigeonFirebaseApp; + final String arg_path = args[1]! as String; try { - await api.onDisconnectCancel(arg_app!, arg_path!); + await api.onDisconnectCancel(arg_app, arg_path); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -834,9 +687,7 @@ abstract class TestFirebaseDatabaseHostApi { } } { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.queryObserve$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -847,19 +698,12 @@ abstract class TestFirebaseDatabaseHostApi { _testBinaryMessengerBinding!.defaultBinaryMessenger .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.queryObserve was null.'); - final List args = (message as List?)!; - final DatabasePigeonFirebaseApp? arg_app = - (args[0] as DatabasePigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.queryObserve was null, expected non-null DatabasePigeonFirebaseApp.'); - final QueryRequest? arg_request = (args[1] as QueryRequest?); - assert(arg_request != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.queryObserve was null, expected non-null QueryRequest.'); + final List args = message! as List; + final DatabasePigeonFirebaseApp arg_app = + args[0]! as DatabasePigeonFirebaseApp; + final QueryRequest arg_request = args[1]! as QueryRequest; try { - final String output = - await api.queryObserve(arg_app!, arg_request!); + final String output = await api.queryObserve(arg_app, arg_request); return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); @@ -871,9 +715,7 @@ abstract class TestFirebaseDatabaseHostApi { } } { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.queryKeepSynced$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -884,18 +726,12 @@ abstract class TestFirebaseDatabaseHostApi { _testBinaryMessengerBinding!.defaultBinaryMessenger .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.queryKeepSynced was null.'); - final List args = (message as List?)!; - final DatabasePigeonFirebaseApp? arg_app = - (args[0] as DatabasePigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.queryKeepSynced was null, expected non-null DatabasePigeonFirebaseApp.'); - final QueryRequest? arg_request = (args[1] as QueryRequest?); - assert(arg_request != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.queryKeepSynced was null, expected non-null QueryRequest.'); + final List args = message! as List; + final DatabasePigeonFirebaseApp arg_app = + args[0]! as DatabasePigeonFirebaseApp; + final QueryRequest arg_request = args[1]! as QueryRequest; try { - await api.queryKeepSynced(arg_app!, arg_request!); + await api.queryKeepSynced(arg_app, arg_request); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -907,9 +743,7 @@ abstract class TestFirebaseDatabaseHostApi { } } { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.queryGet$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -920,19 +754,13 @@ abstract class TestFirebaseDatabaseHostApi { _testBinaryMessengerBinding!.defaultBinaryMessenger .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.queryGet was null.'); - final List args = (message as List?)!; - final DatabasePigeonFirebaseApp? arg_app = - (args[0] as DatabasePigeonFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.queryGet was null, expected non-null DatabasePigeonFirebaseApp.'); - final QueryRequest? arg_request = (args[1] as QueryRequest?); - assert(arg_request != null, - 'Argument for dev.flutter.pigeon.firebase_database_platform_interface.FirebaseDatabaseHostApi.queryGet was null, expected non-null QueryRequest.'); + final List args = message! as List; + final DatabasePigeonFirebaseApp arg_app = + args[0]! as DatabasePigeonFirebaseApp; + final QueryRequest arg_request = args[1]! as QueryRequest; try { final Map output = - await api.queryGet(arg_app!, arg_request!); + await api.queryGet(arg_app, arg_request); return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); diff --git a/packages/firebase_performance/analysis_options.yaml b/packages/firebase_performance/analysis_options.yaml index a9341971bf6a..e8ee91e2edaa 100644 --- a/packages/firebase_performance/analysis_options.yaml +++ b/packages/firebase_performance/analysis_options.yaml @@ -7,4 +7,5 @@ include: ../../analysis_options.yaml analyzer: exclude: - firebase_performance_platform_interface/lib/src/pigeon/messages.pigeon.dart - - firebase_performance_platform_interface/test/pigeon/test_api.dart \ No newline at end of file + - firebase_performance_platform_interface/test/pigeon/test_api.dart + - firebase_performance_platform_interface/pigeons/messages.dart \ No newline at end of file diff --git a/packages/firebase_performance/firebase_performance/android/src/main/kotlin/io/flutter/plugins/firebase/performance/GeneratedAndroidFirebasePerformance.g.kt b/packages/firebase_performance/firebase_performance/android/src/main/kotlin/io/flutter/plugins/firebase/performance/GeneratedAndroidFirebasePerformance.g.kt index 39423870b952..666c2379ab10 100644 --- a/packages/firebase_performance/firebase_performance/android/src/main/kotlin/io/flutter/plugins/firebase/performance/GeneratedAndroidFirebasePerformance.g.kt +++ b/packages/firebase_performance/firebase_performance/android/src/main/kotlin/io/flutter/plugins/firebase/performance/GeneratedAndroidFirebasePerformance.g.kt @@ -1,7 +1,7 @@ // Copyright 2025, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v25.3.2), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), do not edit directly. // See also: https://pub.dev/packages/pigeon @file:Suppress("UNCHECKED_CAST", "ArrayInDataClass") @@ -37,36 +37,150 @@ private object GeneratedAndroidFirebasePerformancePigeonUtils { ) } } + fun doubleEquals(a: Double, b: Double): Boolean { + // Normalize -0.0 to 0.0 and handle NaN equality. + return (if (a == 0.0) 0.0 else a) == (if (b == 0.0) 0.0 else b) || (a.isNaN() && b.isNaN()) + } + + fun floatEquals(a: Float, b: Float): Boolean { + // Normalize -0.0 to 0.0 and handle NaN equality. + return (if (a == 0.0f) 0.0f else a) == (if (b == 0.0f) 0.0f else b) || (a.isNaN() && b.isNaN()) + } + + fun doubleHash(d: Double): Int { + // Normalize -0.0 to 0.0 and handle NaN to ensure consistent hash codes. + val normalized = if (d == 0.0) 0.0 else d + val bits = java.lang.Double.doubleToLongBits(normalized) + return (bits xor (bits ushr 32)).toInt() + } + + fun floatHash(f: Float): Int { + // Normalize -0.0 to 0.0 and handle NaN to ensure consistent hash codes. + val normalized = if (f == 0.0f) 0.0f else f + return java.lang.Float.floatToIntBits(normalized) + } + fun deepEquals(a: Any?, b: Any?): Boolean { + if (a === b) { + return true + } + if (a == null || b == null) { + return false + } if (a is ByteArray && b is ByteArray) { - return a.contentEquals(b) + return a.contentEquals(b) } if (a is IntArray && b is IntArray) { - return a.contentEquals(b) + return a.contentEquals(b) } if (a is LongArray && b is LongArray) { - return a.contentEquals(b) + return a.contentEquals(b) } if (a is DoubleArray && b is DoubleArray) { - return a.contentEquals(b) + if (a.size != b.size) return false + for (i in a.indices) { + if (!doubleEquals(a[i], b[i])) return false + } + return true + } + if (a is FloatArray && b is FloatArray) { + if (a.size != b.size) return false + for (i in a.indices) { + if (!floatEquals(a[i], b[i])) return false + } + return true } if (a is Array<*> && b is Array<*>) { - return a.size == b.size && - a.indices.all{ deepEquals(a[it], b[it]) } + if (a.size != b.size) return false + for (i in a.indices) { + if (!deepEquals(a[i], b[i])) return false + } + return true } if (a is List<*> && b is List<*>) { - return a.size == b.size && - a.indices.all{ deepEquals(a[it], b[it]) } + if (a.size != b.size) return false + val iterA = a.iterator() + val iterB = b.iterator() + while (iterA.hasNext() && iterB.hasNext()) { + if (!deepEquals(iterA.next(), iterB.next())) return false + } + return true } if (a is Map<*, *> && b is Map<*, *>) { - return a.size == b.size && a.all { - (b as Map).containsKey(it.key) && - deepEquals(it.value, b[it.key]) + if (a.size != b.size) return false + for (entry in a) { + val key = entry.key + var found = false + for (bEntry in b) { + if (deepEquals(key, bEntry.key)) { + if (deepEquals(entry.value, bEntry.value)) { + found = true + break + } else { + return false + } + } + } + if (!found) return false } + return true + } + if (a is Double && b is Double) { + return doubleEquals(a, b) + } + if (a is Float && b is Float) { + return floatEquals(a, b) } return a == b } - + + fun deepHash(value: Any?): Int { + return when (value) { + null -> 0 + is ByteArray -> value.contentHashCode() + is IntArray -> value.contentHashCode() + is LongArray -> value.contentHashCode() + is DoubleArray -> { + var result = 1 + for (item in value) { + result = 31 * result + doubleHash(item) + } + result + } + is FloatArray -> { + var result = 1 + for (item in value) { + result = 31 * result + floatHash(item) + } + result + } + is Array<*> -> { + var result = 1 + for (item in value) { + result = 31 * result + deepHash(item) + } + result + } + is List<*> -> { + var result = 1 + for (item in value) { + result = 31 * result + deepHash(item) + } + result + } + is Map<*, *> -> { + var result = 0 + for (entry in value) { + result += ((deepHash(entry.key) * 31) xor deepHash(entry.value)) + } + result + } + is Double -> doubleHash(value) + is Float -> floatHash(value) + else -> value.hashCode() + } + } + } /** @@ -79,7 +193,7 @@ class FlutterError ( val code: String, override val message: String? = null, val details: Any? = null -) : Throwable() +) : RuntimeException() enum class HttpMethod(val raw: Int) { CONNECT(0), @@ -119,15 +233,22 @@ data class HttpMetricOptions ( ) } override fun equals(other: Any?): Boolean { - if (other !is HttpMetricOptions) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeneratedAndroidFirebasePerformancePigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as HttpMetricOptions + return GeneratedAndroidFirebasePerformancePigeonUtils.deepEquals(this.url, other.url) && GeneratedAndroidFirebasePerformancePigeonUtils.deepEquals(this.httpMethod, other.httpMethod) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeneratedAndroidFirebasePerformancePigeonUtils.deepHash(this.url) + result = 31 * result + GeneratedAndroidFirebasePerformancePigeonUtils.deepHash(this.httpMethod) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -159,15 +280,25 @@ data class HttpMetricAttributes ( ) } override fun equals(other: Any?): Boolean { - if (other !is HttpMetricAttributes) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeneratedAndroidFirebasePerformancePigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as HttpMetricAttributes + return GeneratedAndroidFirebasePerformancePigeonUtils.deepEquals(this.httpResponseCode, other.httpResponseCode) && GeneratedAndroidFirebasePerformancePigeonUtils.deepEquals(this.requestPayloadSize, other.requestPayloadSize) && GeneratedAndroidFirebasePerformancePigeonUtils.deepEquals(this.responsePayloadSize, other.responsePayloadSize) && GeneratedAndroidFirebasePerformancePigeonUtils.deepEquals(this.responseContentType, other.responseContentType) && GeneratedAndroidFirebasePerformancePigeonUtils.deepEquals(this.attributes, other.attributes) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeneratedAndroidFirebasePerformancePigeonUtils.deepHash(this.httpResponseCode) + result = 31 * result + GeneratedAndroidFirebasePerformancePigeonUtils.deepHash(this.requestPayloadSize) + result = 31 * result + GeneratedAndroidFirebasePerformancePigeonUtils.deepHash(this.responsePayloadSize) + result = 31 * result + GeneratedAndroidFirebasePerformancePigeonUtils.deepHash(this.responseContentType) + result = 31 * result + GeneratedAndroidFirebasePerformancePigeonUtils.deepHash(this.attributes) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -190,15 +321,22 @@ data class TraceAttributes ( ) } override fun equals(other: Any?): Boolean { - if (other !is TraceAttributes) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeneratedAndroidFirebasePerformancePigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as TraceAttributes + return GeneratedAndroidFirebasePerformancePigeonUtils.deepEquals(this.metrics, other.metrics) && GeneratedAndroidFirebasePerformancePigeonUtils.deepEquals(this.attributes, other.attributes) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeneratedAndroidFirebasePerformancePigeonUtils.deepHash(this.metrics) + result = 31 * result + GeneratedAndroidFirebasePerformancePigeonUtils.deepHash(this.attributes) + return result + } } private open class GeneratedAndroidFirebasePerformancePigeonCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { @@ -230,7 +368,7 @@ private open class GeneratedAndroidFirebasePerformancePigeonCodec : StandardMess when (value) { is HttpMethod -> { stream.write(129) - writeValue(stream, value.raw) + writeValue(stream, value.raw.toLong()) } is HttpMetricOptions -> { stream.write(130) diff --git a/packages/firebase_performance/firebase_performance/ios/firebase_performance/Sources/firebase_performance/FirebasePerformanceMessages.g.swift b/packages/firebase_performance/firebase_performance/ios/firebase_performance/Sources/firebase_performance/FirebasePerformanceMessages.g.swift index 2ff69619ed50..47f32896fcb5 100644 --- a/packages/firebase_performance/firebase_performance/ios/firebase_performance/Sources/firebase_performance/FirebasePerformanceMessages.g.swift +++ b/packages/firebase_performance/firebase_performance/ios/firebase_performance/Sources/firebase_performance/FirebasePerformanceMessages.g.swift @@ -1,7 +1,7 @@ // Copyright 2025, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v25.3.2), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), do not edit directly. // See also: https://pub.dev/packages/pigeon import Foundation @@ -52,7 +52,7 @@ private func wrapError(_ error: Any) -> [Any?] { } return [ "\(error)", - "\(type(of: error))", + "\(Swift.type(of: error))", "Stacktrace: \(Thread.callStackSymbols)", ] } @@ -66,6 +66,19 @@ private func nilOrValue(_ value: Any?) -> T? { return value as! T? } +private func doubleEqualsFirebasePerformanceMessages(_ lhs: Double, _ rhs: Double) -> Bool { + (lhs.isNaN && rhs.isNaN) || lhs == rhs +} + +private func doubleHashFirebasePerformanceMessages(_ value: Double, _ hasher: inout Hasher) { + if value.isNaN { + hasher.combine(0x7FF8_0000_0000_0000) + } else { + // Normalize -0.0 to 0.0 + hasher.combine(value == 0 ? 0 : value) + } +} + func deepEqualsFirebasePerformanceMessages(_ lhs: Any?, _ rhs: Any?) -> Bool { let cleanLhs = nilOrValue(lhs) as Any? let cleanRhs = nilOrValue(rhs) as Any? @@ -76,59 +89,90 @@ func deepEqualsFirebasePerformanceMessages(_ lhs: Any?, _ rhs: Any?) -> Bool { case (nil, _), (_, nil): return false - case is (Void, Void): + case let (lhs as AnyObject, rhs as AnyObject) where lhs === rhs: return true - case let (cleanLhsHashable, cleanRhsHashable) as (AnyHashable, AnyHashable): - return cleanLhsHashable == cleanRhsHashable + case is (Void, Void): + return true - case let (cleanLhsArray, cleanRhsArray) as ([Any?], [Any?]): - guard cleanLhsArray.count == cleanRhsArray.count else { return false } - for (index, element) in cleanLhsArray.enumerated() { - if !deepEqualsFirebasePerformanceMessages(element, cleanRhsArray[index]) { + case let (lhsArray, rhsArray) as ([Any?], [Any?]): + guard lhsArray.count == rhsArray.count else { return false } + for (index, element) in lhsArray.enumerated() { + if !deepEqualsFirebasePerformanceMessages(element, rhsArray[index]) { return false } } return true - case let (cleanLhsDictionary, cleanRhsDictionary) as ([AnyHashable: Any?], [AnyHashable: Any?]): - guard cleanLhsDictionary.count == cleanRhsDictionary.count else { return false } - for (key, cleanLhsValue) in cleanLhsDictionary { - guard cleanRhsDictionary.index(forKey: key) != nil else { return false } - if !deepEqualsFirebasePerformanceMessages(cleanLhsValue, cleanRhsDictionary[key]!) { + case let (lhsArray, rhsArray) as ([Double], [Double]): + guard lhsArray.count == rhsArray.count else { return false } + for (index, element) in lhsArray.enumerated() { + if !doubleEqualsFirebasePerformanceMessages(element, rhsArray[index]) { return false } } return true + case let (lhsDictionary, rhsDictionary) as ([AnyHashable: Any?], [AnyHashable: Any?]): + guard lhsDictionary.count == rhsDictionary.count else { return false } + for (lhsKey, lhsValue) in lhsDictionary { + var found = false + for (rhsKey, rhsValue) in rhsDictionary { + if deepEqualsFirebasePerformanceMessages(lhsKey, rhsKey) { + if deepEqualsFirebasePerformanceMessages(lhsValue, rhsValue) { + found = true + break + } else { + return false + } + } + } + if !found { return false } + } + return true + + case let (lhs as Double, rhs as Double): + return doubleEqualsFirebasePerformanceMessages(lhs, rhs) + + case let (lhsHashable, rhsHashable) as (AnyHashable, AnyHashable): + return lhsHashable == rhsHashable + default: - // Any other type shouldn't be able to be used with pigeon. File an issue if you find this to be - // untrue. return false } } func deepHashFirebasePerformanceMessages(value: Any?, hasher: inout Hasher) { - if let valueList = value as? [AnyHashable] { - for item in valueList { - deepHashFirebasePerformanceMessages(value: item, hasher: &hasher) - } - return - } - - if let valueDict = value as? [AnyHashable: AnyHashable] { - for key in valueDict.keys { - hasher.combine(key) - deepHashFirebasePerformanceMessages(value: valueDict[key]!, hasher: &hasher) + let cleanValue = nilOrValue(value) as Any? + if let cleanValue { + if let doubleValue = cleanValue as? Double { + doubleHashFirebasePerformanceMessages(doubleValue, &hasher) + } else if let valueList = cleanValue as? [Any?] { + for item in valueList { + deepHashFirebasePerformanceMessages(value: item, hasher: &hasher) + } + } else if let valueList = cleanValue as? [Double] { + for item in valueList { + doubleHashFirebasePerformanceMessages(item, &hasher) + } + } else if let valueDict = cleanValue as? [AnyHashable: Any?] { + var result = 0 + for (key, value) in valueDict { + var entryKeyHasher = Hasher() + deepHashFirebasePerformanceMessages(value: key, hasher: &entryKeyHasher) + var entryValueHasher = Hasher() + deepHashFirebasePerformanceMessages(value: value, hasher: &entryValueHasher) + result = result &+ ((entryKeyHasher.finalize() &* 31) ^ entryValueHasher.finalize()) + } + hasher.combine(result) + } else if let hashableValue = cleanValue as? AnyHashable { + hasher.combine(hashableValue) + } else { + hasher.combine(String(describing: cleanValue)) } - return - } - - if let hashableValue = value as? AnyHashable { - hasher.combine(hashableValue.hashValue) + } else { + hasher.combine(0) } - - return hasher.combine(String(describing: value)) } enum HttpMethod: Int { @@ -167,11 +211,20 @@ struct HttpMetricOptions: Hashable { } static func == (lhs: HttpMetricOptions, rhs: HttpMetricOptions) -> Bool { - deepEqualsFirebasePerformanceMessages(lhs.toList(), rhs.toList()) + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return deepEqualsFirebasePerformanceMessages(lhs.url, rhs.url) && + deepEqualsFirebasePerformanceMessages( + lhs.httpMethod, + rhs.httpMethod + ) } func hash(into hasher: inout Hasher) { - deepHashFirebasePerformanceMessages(value: toList(), hasher: &hasher) + hasher.combine("HttpMetricOptions") + deepHashFirebasePerformanceMessages(value: url, hasher: &hasher) + deepHashFirebasePerformanceMessages(value: httpMethod, hasher: &hasher) } } @@ -211,11 +264,30 @@ struct HttpMetricAttributes: Hashable { } static func == (lhs: HttpMetricAttributes, rhs: HttpMetricAttributes) -> Bool { - deepEqualsFirebasePerformanceMessages(lhs.toList(), rhs.toList()) + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return deepEqualsFirebasePerformanceMessages(lhs.httpResponseCode, rhs.httpResponseCode) && + deepEqualsFirebasePerformanceMessages( + lhs.requestPayloadSize, + rhs.requestPayloadSize + ) && deepEqualsFirebasePerformanceMessages( + lhs.responsePayloadSize, + rhs.responsePayloadSize + ) && + deepEqualsFirebasePerformanceMessages( + lhs.responseContentType, + rhs.responseContentType + ) && deepEqualsFirebasePerformanceMessages(lhs.attributes, rhs.attributes) } func hash(into hasher: inout Hasher) { - deepHashFirebasePerformanceMessages(value: toList(), hasher: &hasher) + hasher.combine("HttpMetricAttributes") + deepHashFirebasePerformanceMessages(value: httpResponseCode, hasher: &hasher) + deepHashFirebasePerformanceMessages(value: requestPayloadSize, hasher: &hasher) + deepHashFirebasePerformanceMessages(value: responsePayloadSize, hasher: &hasher) + deepHashFirebasePerformanceMessages(value: responseContentType, hasher: &hasher) + deepHashFirebasePerformanceMessages(value: attributes, hasher: &hasher) } } @@ -243,11 +315,20 @@ struct TraceAttributes: Hashable { } static func == (lhs: TraceAttributes, rhs: TraceAttributes) -> Bool { - deepEqualsFirebasePerformanceMessages(lhs.toList(), rhs.toList()) + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return deepEqualsFirebasePerformanceMessages(lhs.metrics, rhs.metrics) && + deepEqualsFirebasePerformanceMessages( + lhs.attributes, + rhs.attributes + ) } func hash(into hasher: inout Hasher) { - deepHashFirebasePerformanceMessages(value: toList(), hasher: &hasher) + hasher.combine("TraceAttributes") + deepHashFirebasePerformanceMessages(value: metrics, hasher: &hasher) + deepHashFirebasePerformanceMessages(value: attributes, hasher: &hasher) } } diff --git a/packages/firebase_performance/firebase_performance/windows/messages.g.cpp b/packages/firebase_performance/firebase_performance/windows/messages.g.cpp index f5934afda061..4efec43167f6 100644 --- a/packages/firebase_performance/firebase_performance/windows/messages.g.cpp +++ b/packages/firebase_performance/firebase_performance/windows/messages.g.cpp @@ -1,7 +1,7 @@ // Copyright 2025, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v25.3.2), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), do not edit directly. // See also: https://pub.dev/packages/pigeon #undef _HAS_EXCEPTIONS @@ -13,16 +13,18 @@ #include #include +#include +#include #include #include #include namespace firebase_performance_windows { -using flutter::BasicMessageChannel; -using flutter::CustomEncodableValue; -using flutter::EncodableList; -using flutter::EncodableMap; -using flutter::EncodableValue; +using ::flutter::BasicMessageChannel; +using ::flutter::CustomEncodableValue; +using ::flutter::EncodableList; +using ::flutter::EncodableMap; +using ::flutter::EncodableValue; FlutterError CreateConnectionError(const std::string channel_name) { return FlutterError( @@ -31,6 +33,212 @@ FlutterError CreateConnectionError(const std::string channel_name) { EncodableValue("")); } +namespace { +template +bool PigeonInternalDeepEquals(const T& a, const T& b); + +bool PigeonInternalDeepEquals(const double& a, const double& b); + +template +bool PigeonInternalDeepEquals(const std::vector& a, const std::vector& b); + +template +bool PigeonInternalDeepEquals(const std::map& a, const std::map& b); + +template +bool PigeonInternalDeepEquals(const std::optional& a, + const std::optional& b); + +template +bool PigeonInternalDeepEquals(const std::unique_ptr& a, + const std::unique_ptr& b); + +bool PigeonInternalDeepEquals(const ::flutter::EncodableValue& a, + const ::flutter::EncodableValue& b); + +template +bool PigeonInternalDeepEquals(const T& a, const T& b) { + return a == b; +} + +template +bool PigeonInternalDeepEquals(const std::vector& a, + const std::vector& b) { + if (a.size() != b.size()) { + return false; + } + for (size_t i = 0; i < a.size(); ++i) { + if (!PigeonInternalDeepEquals(a[i], b[i])) { + return false; + } + } + return true; +} + +template +bool PigeonInternalDeepEquals(const std::map& a, + const std::map& b) { + if (a.size() != b.size()) { + return false; + } + for (const auto& kv : a) { + bool found = false; + for (const auto& b_kv : b) { + if (PigeonInternalDeepEquals(kv.first, b_kv.first)) { + if (PigeonInternalDeepEquals(kv.second, b_kv.second)) { + found = true; + break; + } else { + return false; + } + } + } + if (!found) { + return false; + } + } + return true; +} + +bool PigeonInternalDeepEquals(const double& a, const double& b) { + // Normalize -0.0 to 0.0 and handle NaN equality. + return (a == b) || (std::isnan(a) && std::isnan(b)); +} + +template +bool PigeonInternalDeepEquals(const std::optional& a, + const std::optional& b) { + if (!a && !b) { + return true; + } + if (!a || !b) { + return false; + } + return PigeonInternalDeepEquals(*a, *b); +} + +template +bool PigeonInternalDeepEquals(const std::unique_ptr& a, + const std::unique_ptr& b) { + if (a.get() == b.get()) { + return true; + } + if (!a || !b) { + return false; + } + return PigeonInternalDeepEquals(*a, *b); +} + +bool PigeonInternalDeepEquals(const ::flutter::EncodableValue& a, + const ::flutter::EncodableValue& b) { + if (a.index() != b.index()) { + return false; + } + if (const double* da = std::get_if(&a)) { + return PigeonInternalDeepEquals(*da, std::get(b)); + } else if (const ::flutter::EncodableList* la = + std::get_if<::flutter::EncodableList>(&a)) { + return PigeonInternalDeepEquals(*la, std::get<::flutter::EncodableList>(b)); + } else if (const ::flutter::EncodableMap* ma = + std::get_if<::flutter::EncodableMap>(&a)) { + return PigeonInternalDeepEquals(*ma, std::get<::flutter::EncodableMap>(b)); + } + return a == b; +} + +template +size_t PigeonInternalDeepHash(const T& v); + +size_t PigeonInternalDeepHash(const double& v); + +template +size_t PigeonInternalDeepHash(const std::vector& v); + +template +size_t PigeonInternalDeepHash(const std::map& v); + +template +size_t PigeonInternalDeepHash(const std::optional& v); + +template +size_t PigeonInternalDeepHash(const std::unique_ptr& v); + +size_t PigeonInternalDeepHash(const ::flutter::EncodableValue& v); + +template +size_t PigeonInternalDeepHash(const T& v) { + return std::hash()(v); +} + +template +size_t PigeonInternalDeepHash(const std::vector& v) { + size_t result = 1; + for (const auto& item : v) { + result = result * 31 + PigeonInternalDeepHash(item); + } + return result; +} + +template +size_t PigeonInternalDeepHash(const std::map& v) { + size_t result = 0; + for (const auto& kv : v) { + result += ((PigeonInternalDeepHash(kv.first) * 31) ^ + PigeonInternalDeepHash(kv.second)); + } + return result; +} + +size_t PigeonInternalDeepHash(const double& v) { + if (std::isnan(v)) { + // Normalize NaN to a consistent hash. + return std::hash()(std::numeric_limits::quiet_NaN()); + } + if (v == 0.0) { + // Normalize -0.0 to 0.0 so they have the same hash code. + return std::hash()(0.0); + } + return std::hash()(v); +} + +template +size_t PigeonInternalDeepHash(const std::optional& v) { + return v ? PigeonInternalDeepHash(*v) : 0; +} + +template +size_t PigeonInternalDeepHash(const std::unique_ptr& v) { + return v ? PigeonInternalDeepHash(*v) : 0; +} + +size_t PigeonInternalDeepHash(const ::flutter::EncodableValue& v) { + size_t result = v.index(); + if (const double* dv = std::get_if(&v)) { + result = result * 31 + PigeonInternalDeepHash(*dv); + } else if (const ::flutter::EncodableList* lv = + std::get_if<::flutter::EncodableList>(&v)) { + result = result * 31 + PigeonInternalDeepHash(*lv); + } else if (const ::flutter::EncodableMap* mv = + std::get_if<::flutter::EncodableMap>(&v)) { + result = result * 31 + PigeonInternalDeepHash(*mv); + } else { + std::visit( + [&result](const auto& val) { + using T = std::decay_t; + if constexpr (!std::is_same_v && + !std::is_same_v && + !std::is_same_v && + !std::is_same_v && + !std::is_same_v) { + result = result * 31 + PigeonInternalDeepHash(val); + } + }, + v); + } + return result; +} + +} // namespace // HttpMetricOptions HttpMetricOptions::HttpMetricOptions(const std::string& url, @@ -67,6 +275,24 @@ HttpMetricOptions HttpMetricOptions::FromEncodableList( return decoded; } +bool HttpMetricOptions::operator==(const HttpMetricOptions& other) const { + return PigeonInternalDeepEquals(url_, other.url_) && + PigeonInternalDeepEquals(http_method_, other.http_method_); +} + +bool HttpMetricOptions::operator!=(const HttpMetricOptions& other) const { + return !(*this == other); +} + +size_t HttpMetricOptions::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(url_); + result = result * 31 + PigeonInternalDeepHash(http_method_); + return result; +} + +size_t PigeonInternalDeepHash(const HttpMetricOptions& v) { return v.Hash(); } + // HttpMetricAttributes HttpMetricAttributes::HttpMetricAttributes() {} @@ -204,6 +430,36 @@ HttpMetricAttributes HttpMetricAttributes::FromEncodableList( return decoded; } +bool HttpMetricAttributes::operator==(const HttpMetricAttributes& other) const { + return PigeonInternalDeepEquals(http_response_code_, + other.http_response_code_) && + PigeonInternalDeepEquals(request_payload_size_, + other.request_payload_size_) && + PigeonInternalDeepEquals(response_payload_size_, + other.response_payload_size_) && + PigeonInternalDeepEquals(response_content_type_, + other.response_content_type_) && + PigeonInternalDeepEquals(attributes_, other.attributes_); +} + +bool HttpMetricAttributes::operator!=(const HttpMetricAttributes& other) const { + return !(*this == other); +} + +size_t HttpMetricAttributes::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(http_response_code_); + result = result * 31 + PigeonInternalDeepHash(request_payload_size_); + result = result * 31 + PigeonInternalDeepHash(response_payload_size_); + result = result * 31 + PigeonInternalDeepHash(response_content_type_); + result = result * 31 + PigeonInternalDeepHash(attributes_); + return result; +} + +size_t PigeonInternalDeepHash(const HttpMetricAttributes& v) { + return v.Hash(); +} + // TraceAttributes TraceAttributes::TraceAttributes() {} @@ -260,10 +516,28 @@ TraceAttributes TraceAttributes::FromEncodableList(const EncodableList& list) { return decoded; } +bool TraceAttributes::operator==(const TraceAttributes& other) const { + return PigeonInternalDeepEquals(metrics_, other.metrics_) && + PigeonInternalDeepEquals(attributes_, other.attributes_); +} + +bool TraceAttributes::operator!=(const TraceAttributes& other) const { + return !(*this == other); +} + +size_t TraceAttributes::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(metrics_); + result = result * 31 + PigeonInternalDeepHash(attributes_); + return result; +} + +size_t PigeonInternalDeepHash(const TraceAttributes& v) { return v.Hash(); } + PigeonInternalCodecSerializer::PigeonInternalCodecSerializer() {} EncodableValue PigeonInternalCodecSerializer::ReadValueOfType( - uint8_t type, flutter::ByteStreamReader* stream) const { + uint8_t type, ::flutter::ByteStreamReader* stream) const { switch (type) { case 129: { const auto& encodable_enum_arg = ReadValue(stream); @@ -287,12 +561,12 @@ EncodableValue PigeonInternalCodecSerializer::ReadValueOfType( std::get(ReadValue(stream)))); } default: - return flutter::StandardCodecSerializer::ReadValueOfType(type, stream); + return ::flutter::StandardCodecSerializer::ReadValueOfType(type, stream); } } void PigeonInternalCodecSerializer::WriteValue( - const EncodableValue& value, flutter::ByteStreamWriter* stream) const { + const EncodableValue& value, ::flutter::ByteStreamWriter* stream) const { if (const CustomEncodableValue* custom_value = std::get_if(&value)) { if (custom_value->type() == typeid(HttpMethod)) { @@ -326,25 +600,26 @@ void PigeonInternalCodecSerializer::WriteValue( return; } } - flutter::StandardCodecSerializer::WriteValue(value, stream); + ::flutter::StandardCodecSerializer::WriteValue(value, stream); } /// The codec used by FirebasePerformanceHostApi. -const flutter::StandardMessageCodec& FirebasePerformanceHostApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance( +const ::flutter::StandardMessageCodec& FirebasePerformanceHostApi::GetCodec() { + return ::flutter::StandardMessageCodec::GetInstance( &PigeonInternalCodecSerializer::GetInstance()); } // Sets up an instance of `FirebasePerformanceHostApi` to handle messages // through the `binary_messenger`. void FirebasePerformanceHostApi::SetUp( - flutter::BinaryMessenger* binary_messenger, + ::flutter::BinaryMessenger* binary_messenger, FirebasePerformanceHostApi* api) { FirebasePerformanceHostApi::SetUp(binary_messenger, api, ""); } void FirebasePerformanceHostApi::SetUp( - flutter::BinaryMessenger* binary_messenger, FirebasePerformanceHostApi* api, + ::flutter::BinaryMessenger* binary_messenger, + FirebasePerformanceHostApi* api, const std::string& message_channel_suffix) { const std::string prepended_suffix = message_channel_suffix.length() > 0 @@ -360,7 +635,7 @@ void FirebasePerformanceHostApi::SetUp( if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_enabled_arg = args.at(0); @@ -397,7 +672,7 @@ void FirebasePerformanceHostApi::SetUp( if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { api->IsPerformanceCollectionEnabled( [reply](ErrorOr&& output) { @@ -428,7 +703,7 @@ void FirebasePerformanceHostApi::SetUp( if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_name_arg = args.at(0); @@ -465,7 +740,7 @@ void FirebasePerformanceHostApi::SetUp( if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_handle_arg = args.at(0); @@ -510,7 +785,7 @@ void FirebasePerformanceHostApi::SetUp( if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_options_arg = args.at(0); @@ -549,7 +824,7 @@ void FirebasePerformanceHostApi::SetUp( if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_handle_arg = args.at(0); diff --git a/packages/firebase_performance/firebase_performance/windows/messages.g.h b/packages/firebase_performance/firebase_performance/windows/messages.g.h index a9802f4c703a..cf8d9bfd9ebb 100644 --- a/packages/firebase_performance/firebase_performance/windows/messages.g.h +++ b/packages/firebase_performance/firebase_performance/windows/messages.g.h @@ -1,7 +1,7 @@ // Copyright 2025, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v25.3.2), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), do not edit directly. // See also: https://pub.dev/packages/pigeon #ifndef PIGEON_MESSAGES_G_H_ @@ -25,17 +25,17 @@ class FlutterError { explicit FlutterError(const std::string& code, const std::string& message) : code_(code), message_(message) {} explicit FlutterError(const std::string& code, const std::string& message, - const flutter::EncodableValue& details) + const ::flutter::EncodableValue& details) : code_(code), message_(message), details_(details) {} const std::string& code() const { return code_; } const std::string& message() const { return message_; } - const flutter::EncodableValue& details() const { return details_; } + const ::flutter::EncodableValue& details() const { return details_; } private: std::string code_; std::string message_; - flutter::EncodableValue details_; + ::flutter::EncodableValue details_; }; template @@ -83,10 +83,22 @@ class HttpMetricOptions { const HttpMethod& http_method() const; void set_http_method(const HttpMethod& value_arg); + bool operator==(const HttpMetricOptions& other) const; + bool operator!=(const HttpMetricOptions& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + private: static HttpMetricOptions FromEncodableList( - const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; + const ::flutter::EncodableList& list); + + public: + public: + ::flutter::EncodableList ToEncodableList() const; + + private: + private: friend class FirebasePerformanceHostApi; friend class PigeonInternalCodecSerializer; std::string url_; @@ -104,7 +116,7 @@ class HttpMetricAttributes { const int64_t* request_payload_size, const int64_t* response_payload_size, const std::string* response_content_type, - const flutter::EncodableMap* attributes); + const ::flutter::EncodableMap* attributes); const int64_t* http_response_code() const; void set_http_response_code(const int64_t* value_arg); @@ -122,21 +134,33 @@ class HttpMetricAttributes { void set_response_content_type(const std::string_view* value_arg); void set_response_content_type(std::string_view value_arg); - const flutter::EncodableMap* attributes() const; - void set_attributes(const flutter::EncodableMap* value_arg); - void set_attributes(const flutter::EncodableMap& value_arg); + const ::flutter::EncodableMap* attributes() const; + void set_attributes(const ::flutter::EncodableMap* value_arg); + void set_attributes(const ::flutter::EncodableMap& value_arg); + + bool operator==(const HttpMetricAttributes& other) const; + bool operator!=(const HttpMetricAttributes& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; private: static HttpMetricAttributes FromEncodableList( - const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; + const ::flutter::EncodableList& list); + + public: + public: + ::flutter::EncodableList ToEncodableList() const; + + private: + private: friend class FirebasePerformanceHostApi; friend class PigeonInternalCodecSerializer; std::optional http_response_code_; std::optional request_payload_size_; std::optional response_payload_size_; std::optional response_content_type_; - std::optional attributes_; + std::optional<::flutter::EncodableMap> attributes_; }; // Generated class from Pigeon that represents data sent in messages. @@ -146,27 +170,41 @@ class TraceAttributes { TraceAttributes(); // Constructs an object setting all fields. - explicit TraceAttributes(const flutter::EncodableMap* metrics, - const flutter::EncodableMap* attributes); + explicit TraceAttributes(const ::flutter::EncodableMap* metrics, + const ::flutter::EncodableMap* attributes); + + const ::flutter::EncodableMap* metrics() const; + void set_metrics(const ::flutter::EncodableMap* value_arg); + void set_metrics(const ::flutter::EncodableMap& value_arg); + + const ::flutter::EncodableMap* attributes() const; + void set_attributes(const ::flutter::EncodableMap* value_arg); + void set_attributes(const ::flutter::EncodableMap& value_arg); - const flutter::EncodableMap* metrics() const; - void set_metrics(const flutter::EncodableMap* value_arg); - void set_metrics(const flutter::EncodableMap& value_arg); + bool operator==(const TraceAttributes& other) const; + bool operator!=(const TraceAttributes& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; - const flutter::EncodableMap* attributes() const; - void set_attributes(const flutter::EncodableMap* value_arg); - void set_attributes(const flutter::EncodableMap& value_arg); + private: + static TraceAttributes FromEncodableList( + const ::flutter::EncodableList& list); + public: + public: + ::flutter::EncodableList ToEncodableList() const; + + private: private: - static TraceAttributes FromEncodableList(const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; friend class FirebasePerformanceHostApi; friend class PigeonInternalCodecSerializer; - std::optional metrics_; - std::optional attributes_; + std::optional<::flutter::EncodableMap> metrics_; + std::optional<::flutter::EncodableMap> attributes_; }; -class PigeonInternalCodecSerializer : public flutter::StandardCodecSerializer { +class PigeonInternalCodecSerializer + : public ::flutter::StandardCodecSerializer { public: PigeonInternalCodecSerializer(); inline static PigeonInternalCodecSerializer& GetInstance() { @@ -174,12 +212,12 @@ class PigeonInternalCodecSerializer : public flutter::StandardCodecSerializer { return sInstance; } - void WriteValue(const flutter::EncodableValue& value, - flutter::ByteStreamWriter* stream) const override; + void WriteValue(const ::flutter::EncodableValue& value, + ::flutter::ByteStreamWriter* stream) const override; protected: - flutter::EncodableValue ReadValueOfType( - uint8_t type, flutter::ByteStreamReader* stream) const override; + ::flutter::EncodableValue ReadValueOfType( + uint8_t type, ::flutter::ByteStreamReader* stream) const override; }; // Generated interface from Pigeon that represents a handler of messages from @@ -209,16 +247,16 @@ class FirebasePerformanceHostApi { std::function reply)> result) = 0; // The codec used by FirebasePerformanceHostApi. - static const flutter::StandardMessageCodec& GetCodec(); + static const ::flutter::StandardMessageCodec& GetCodec(); // Sets up an instance of `FirebasePerformanceHostApi` to handle messages // through the `binary_messenger`. - static void SetUp(flutter::BinaryMessenger* binary_messenger, + static void SetUp(::flutter::BinaryMessenger* binary_messenger, FirebasePerformanceHostApi* api); - static void SetUp(flutter::BinaryMessenger* binary_messenger, + static void SetUp(::flutter::BinaryMessenger* binary_messenger, FirebasePerformanceHostApi* api, const std::string& message_channel_suffix); - static flutter::EncodableValue WrapError(std::string_view error_message); - static flutter::EncodableValue WrapError(const FlutterError& error); + static ::flutter::EncodableValue WrapError(std::string_view error_message); + static ::flutter::EncodableValue WrapError(const FlutterError& error); protected: FirebasePerformanceHostApi() = default; diff --git a/packages/firebase_performance/firebase_performance_platform_interface/lib/src/pigeon/messages.pigeon.dart b/packages/firebase_performance/firebase_performance_platform_interface/lib/src/pigeon/messages.pigeon.dart index b01f643749c4..df055af51a47 100644 --- a/packages/firebase_performance/firebase_performance_platform_interface/lib/src/pigeon/messages.pigeon.dart +++ b/packages/firebase_performance/firebase_performance_platform_interface/lib/src/pigeon/messages.pigeon.dart @@ -1,21 +1,40 @@ // Copyright 2025, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v25.3.2), do not edit directly. +// Autogenerated from Pigeon (v26.3.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, no_leading_underscores_for_local_identifiers +// ignore_for_file: unused_import, unused_shown_name +// ignore_for_file: type=lint import 'dart:async'; -import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; +import 'dart:typed_data' show Float64List, Int32List, Int64List; -import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer; import 'package:flutter/services.dart'; - -PlatformException _createConnectionError(String channelName) { - return PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel: "$channelName".', - ); +import 'package:meta/meta.dart' show immutable, protected, visibleForTesting; + +Object? _extractReplyValueOrThrow( + List? replyList, + String channelName, { + required bool isNullValid, +}) { + if (replyList == null) { + throw PlatformException( + code: 'channel-error', + message: 'Unable to establish connection on channel: "$channelName".', + ); + } else if (replyList.length > 1) { + throw PlatformException( + code: replyList[0]! as String, + message: replyList[1] as String?, + details: replyList[2], + ); + } else if (!isNullValid && (replyList.isNotEmpty && replyList[0] == null)) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } + return replyList.firstOrNull; } List wrapResponse( @@ -30,20 +49,67 @@ List wrapResponse( } bool _deepEquals(Object? a, Object? b) { + if (identical(a, b)) { + return true; + } + if (a is double && b is double) { + if (a.isNaN && b.isNaN) { + return true; + } + return a == b; + } if (a is List && b is List) { return a.length == b.length && a.indexed .every(((int, dynamic) item) => _deepEquals(item.$2, b[item.$1])); } if (a is Map && b is Map) { - return a.length == b.length && - a.entries.every((MapEntry entry) => - (b as Map).containsKey(entry.key) && - _deepEquals(entry.value, b[entry.key])); + if (a.length != b.length) { + return false; + } + for (final MapEntry entryA in a.entries) { + bool found = false; + for (final MapEntry entryB in b.entries) { + if (_deepEquals(entryA.key, entryB.key)) { + if (_deepEquals(entryA.value, entryB.value)) { + found = true; + break; + } else { + return false; + } + } + } + if (!found) { + return false; + } + } + return true; } return a == b; } +int _deepHash(Object? value) { + if (value is List) { + return Object.hashAll(value.map(_deepHash)); + } + if (value is Map) { + int result = 0; + for (final MapEntry entry in value.entries) { + result += (_deepHash(entry.key) * 31) ^ _deepHash(entry.value); + } + return result; + } + if (value is double && value.isNaN) { + // Normalize NaN to a consistent hash. + return 0x7FF8000000000000.hashCode; + } + if (value is double && value == 0.0) { + // Normalize -0.0 to 0.0 so they have the same hash code. + return 0.0.hashCode; + } + return value.hashCode; +} + enum HttpMethod { connect, delete, @@ -94,12 +160,13 @@ class HttpMetricOptions { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(url, other.url) && + _deepEquals(httpMethod, other.httpMethod); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()); + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class HttpMetricAttributes { @@ -155,12 +222,16 @@ class HttpMetricAttributes { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(httpResponseCode, other.httpResponseCode) && + _deepEquals(requestPayloadSize, other.requestPayloadSize) && + _deepEquals(responsePayloadSize, other.responsePayloadSize) && + _deepEquals(responseContentType, other.responseContentType) && + _deepEquals(attributes, other.attributes); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()); + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class TraceAttributes { @@ -201,12 +272,13 @@ class TraceAttributes { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(metrics, other.metrics) && + _deepEquals(attributes, other.attributes); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()); + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class _PigeonCodec extends StandardMessageCodec { @@ -237,7 +309,7 @@ class _PigeonCodec extends StandardMessageCodec { Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { case 129: - final int? value = readValue(buffer) as int?; + final value = readValue(buffer) as int?; return value == null ? null : HttpMethod.values[value]; case 130: return HttpMetricOptions.decode(readValue(buffer)!); @@ -267,173 +339,119 @@ class FirebasePerformanceHostApi { final String pigeonVar_messageChannelSuffix; Future setPerformanceCollectionEnabled(bool enabled) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_performance_platform_interface.FirebasePerformanceHostApi.setPerformanceCollectionEnabled$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([enabled]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future isPerformanceCollectionEnabled() async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_performance_platform_interface.FirebasePerformanceHostApi.isPerformanceCollectionEnabled$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as bool?)!; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as bool; } Future startTrace(String name) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_performance_platform_interface.FirebasePerformanceHostApi.startTrace$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([name]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as int?)!; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as int; } Future stopTrace(int handle, TraceAttributes attributes) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_performance_platform_interface.FirebasePerformanceHostApi.stopTrace$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([handle, attributes]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future startHttpMetric(HttpMetricOptions options) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_performance_platform_interface.FirebasePerformanceHostApi.startHttpMetric$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([options]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as int?)!; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as int; } Future stopHttpMetric( int handle, HttpMetricAttributes attributes) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_performance_platform_interface.FirebasePerformanceHostApi.stopHttpMetric$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([handle, attributes]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } } diff --git a/packages/firebase_performance/firebase_performance_platform_interface/pubspec.yaml b/packages/firebase_performance/firebase_performance_platform_interface/pubspec.yaml index 9f8b80674720..5470c22a2612 100644 --- a/packages/firebase_performance/firebase_performance_platform_interface/pubspec.yaml +++ b/packages/firebase_performance/firebase_performance_platform_interface/pubspec.yaml @@ -12,10 +12,11 @@ dependencies: firebase_core: ^4.7.0 flutter: sdk: flutter + meta: ^1.8.0 plugin_platform_interface: ^2.1.3 dev_dependencies: firebase_core_platform_interface: ^6.0.3 flutter_test: sdk: flutter - pigeon: 25.3.2 + pigeon: 26.3.4 diff --git a/packages/firebase_performance/firebase_performance_platform_interface/test/pigeon/test_api.dart b/packages/firebase_performance/firebase_performance_platform_interface/test/pigeon/test_api.dart index 4426bc6d19af..e1bf4fe97659 100644 --- a/packages/firebase_performance/firebase_performance_platform_interface/test/pigeon/test_api.dart +++ b/packages/firebase_performance/firebase_performance_platform_interface/test/pigeon/test_api.dart @@ -1,9 +1,9 @@ // Copyright 2025, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v25.3.2), do not edit directly. +// Autogenerated from Pigeon (v26.3.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, unnecessary_import, no_leading_underscores_for_local_identifiers +// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, unnecessary_import, no_leading_underscores_for_local_identifiers, omit_obvious_local_variable_types // ignore_for_file: avoid_relative_lib_imports import 'dart:async'; import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; @@ -41,7 +41,7 @@ class _PigeonCodec extends StandardMessageCodec { Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { case 129: - final int? value = readValue(buffer) as int?; + final value = readValue(buffer) as int?; return value == null ? null : HttpMethod.values[value]; case 130: return HttpMetricOptions.decode(readValue(buffer)!); @@ -80,9 +80,7 @@ abstract class TestFirebasePerformanceHostApi { messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_performance_platform_interface.FirebasePerformanceHostApi.setPerformanceCollectionEnabled$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -93,14 +91,10 @@ abstract class TestFirebasePerformanceHostApi { _testBinaryMessengerBinding!.defaultBinaryMessenger .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_performance_platform_interface.FirebasePerformanceHostApi.setPerformanceCollectionEnabled was null.'); - final List args = (message as List?)!; - final bool? arg_enabled = (args[0] as bool?); - assert(arg_enabled != null, - 'Argument for dev.flutter.pigeon.firebase_performance_platform_interface.FirebasePerformanceHostApi.setPerformanceCollectionEnabled was null, expected non-null bool.'); + final List args = message! as List; + final bool arg_enabled = args[0]! as bool; try { - await api.setPerformanceCollectionEnabled(arg_enabled!); + await api.setPerformanceCollectionEnabled(arg_enabled); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -112,9 +106,7 @@ abstract class TestFirebasePerformanceHostApi { } } { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_performance_platform_interface.FirebasePerformanceHostApi.isPerformanceCollectionEnabled$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -138,9 +130,7 @@ abstract class TestFirebasePerformanceHostApi { } } { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_performance_platform_interface.FirebasePerformanceHostApi.startTrace$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -151,14 +141,10 @@ abstract class TestFirebasePerformanceHostApi { _testBinaryMessengerBinding!.defaultBinaryMessenger .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_performance_platform_interface.FirebasePerformanceHostApi.startTrace was null.'); - final List args = (message as List?)!; - final String? arg_name = (args[0] as String?); - assert(arg_name != null, - 'Argument for dev.flutter.pigeon.firebase_performance_platform_interface.FirebasePerformanceHostApi.startTrace was null, expected non-null String.'); + final List args = message! as List; + final String arg_name = args[0]! as String; try { - final int output = await api.startTrace(arg_name!); + final int output = await api.startTrace(arg_name); return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); @@ -170,9 +156,7 @@ abstract class TestFirebasePerformanceHostApi { } } { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_performance_platform_interface.FirebasePerformanceHostApi.stopTrace$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -183,17 +167,11 @@ abstract class TestFirebasePerformanceHostApi { _testBinaryMessengerBinding!.defaultBinaryMessenger .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_performance_platform_interface.FirebasePerformanceHostApi.stopTrace was null.'); - final List args = (message as List?)!; - final int? arg_handle = (args[0] as int?); - assert(arg_handle != null, - 'Argument for dev.flutter.pigeon.firebase_performance_platform_interface.FirebasePerformanceHostApi.stopTrace was null, expected non-null int.'); - final TraceAttributes? arg_attributes = (args[1] as TraceAttributes?); - assert(arg_attributes != null, - 'Argument for dev.flutter.pigeon.firebase_performance_platform_interface.FirebasePerformanceHostApi.stopTrace was null, expected non-null TraceAttributes.'); + final List args = message! as List; + final int arg_handle = args[0]! as int; + final TraceAttributes arg_attributes = args[1]! as TraceAttributes; try { - await api.stopTrace(arg_handle!, arg_attributes!); + await api.stopTrace(arg_handle, arg_attributes); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -205,9 +183,7 @@ abstract class TestFirebasePerformanceHostApi { } } { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_performance_platform_interface.FirebasePerformanceHostApi.startHttpMetric$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -218,15 +194,10 @@ abstract class TestFirebasePerformanceHostApi { _testBinaryMessengerBinding!.defaultBinaryMessenger .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_performance_platform_interface.FirebasePerformanceHostApi.startHttpMetric was null.'); - final List args = (message as List?)!; - final HttpMetricOptions? arg_options = - (args[0] as HttpMetricOptions?); - assert(arg_options != null, - 'Argument for dev.flutter.pigeon.firebase_performance_platform_interface.FirebasePerformanceHostApi.startHttpMetric was null, expected non-null HttpMetricOptions.'); + final List args = message! as List; + final HttpMetricOptions arg_options = args[0]! as HttpMetricOptions; try { - final int output = await api.startHttpMetric(arg_options!); + final int output = await api.startHttpMetric(arg_options); return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); @@ -238,9 +209,7 @@ abstract class TestFirebasePerformanceHostApi { } } { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( + final pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.firebase_performance_platform_interface.FirebasePerformanceHostApi.stopHttpMetric$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); @@ -251,18 +220,12 @@ abstract class TestFirebasePerformanceHostApi { _testBinaryMessengerBinding!.defaultBinaryMessenger .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_performance_platform_interface.FirebasePerformanceHostApi.stopHttpMetric was null.'); - final List args = (message as List?)!; - final int? arg_handle = (args[0] as int?); - assert(arg_handle != null, - 'Argument for dev.flutter.pigeon.firebase_performance_platform_interface.FirebasePerformanceHostApi.stopHttpMetric was null, expected non-null int.'); - final HttpMetricAttributes? arg_attributes = - (args[1] as HttpMetricAttributes?); - assert(arg_attributes != null, - 'Argument for dev.flutter.pigeon.firebase_performance_platform_interface.FirebasePerformanceHostApi.stopHttpMetric was null, expected non-null HttpMetricAttributes.'); + final List args = message! as List; + final int arg_handle = args[0]! as int; + final HttpMetricAttributes arg_attributes = + args[1]! as HttpMetricAttributes; try { - await api.stopHttpMetric(arg_handle!, arg_attributes!); + await api.stopHttpMetric(arg_handle, arg_attributes); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); diff --git a/packages/firebase_remote_config/analysis_options.yaml b/packages/firebase_remote_config/analysis_options.yaml index 75a21d21f70b..02c4d6a7e39a 100644 --- a/packages/firebase_remote_config/analysis_options.yaml +++ b/packages/firebase_remote_config/analysis_options.yaml @@ -8,3 +8,4 @@ analyzer: exclude: - firebase_remote_config_platform_interface/lib/src/pigeon/messages.pigeon.dart - firebase_remote_config_platform_interface/test/pigeon/test_api.dart + - firebase_remote_config_platform_interface/pigeons/messages.dart diff --git a/packages/firebase_remote_config/firebase_remote_config/android/src/main/kotlin/io/flutter/plugins/firebase/firebaseremoteconfig/GeneratedAndroidFirebaseRemoteConfig.g.kt b/packages/firebase_remote_config/firebase_remote_config/android/src/main/kotlin/io/flutter/plugins/firebase/firebaseremoteconfig/GeneratedAndroidFirebaseRemoteConfig.g.kt index 40c1056cf62c..4a3d096eafdc 100644 --- a/packages/firebase_remote_config/firebase_remote_config/android/src/main/kotlin/io/flutter/plugins/firebase/firebaseremoteconfig/GeneratedAndroidFirebaseRemoteConfig.g.kt +++ b/packages/firebase_remote_config/firebase_remote_config/android/src/main/kotlin/io/flutter/plugins/firebase/firebaseremoteconfig/GeneratedAndroidFirebaseRemoteConfig.g.kt @@ -1,7 +1,7 @@ // Copyright 2025, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v25.3.2), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), do not edit directly. // See also: https://pub.dev/packages/pigeon @file:Suppress("UNCHECKED_CAST", "ArrayInDataClass") @@ -37,36 +37,150 @@ private object GeneratedAndroidFirebaseRemoteConfigPigeonUtils { ) } } + fun doubleEquals(a: Double, b: Double): Boolean { + // Normalize -0.0 to 0.0 and handle NaN equality. + return (if (a == 0.0) 0.0 else a) == (if (b == 0.0) 0.0 else b) || (a.isNaN() && b.isNaN()) + } + + fun floatEquals(a: Float, b: Float): Boolean { + // Normalize -0.0 to 0.0 and handle NaN equality. + return (if (a == 0.0f) 0.0f else a) == (if (b == 0.0f) 0.0f else b) || (a.isNaN() && b.isNaN()) + } + + fun doubleHash(d: Double): Int { + // Normalize -0.0 to 0.0 and handle NaN to ensure consistent hash codes. + val normalized = if (d == 0.0) 0.0 else d + val bits = java.lang.Double.doubleToLongBits(normalized) + return (bits xor (bits ushr 32)).toInt() + } + + fun floatHash(f: Float): Int { + // Normalize -0.0 to 0.0 and handle NaN to ensure consistent hash codes. + val normalized = if (f == 0.0f) 0.0f else f + return java.lang.Float.floatToIntBits(normalized) + } + fun deepEquals(a: Any?, b: Any?): Boolean { + if (a === b) { + return true + } + if (a == null || b == null) { + return false + } if (a is ByteArray && b is ByteArray) { - return a.contentEquals(b) + return a.contentEquals(b) } if (a is IntArray && b is IntArray) { - return a.contentEquals(b) + return a.contentEquals(b) } if (a is LongArray && b is LongArray) { - return a.contentEquals(b) + return a.contentEquals(b) } if (a is DoubleArray && b is DoubleArray) { - return a.contentEquals(b) + if (a.size != b.size) return false + for (i in a.indices) { + if (!doubleEquals(a[i], b[i])) return false + } + return true + } + if (a is FloatArray && b is FloatArray) { + if (a.size != b.size) return false + for (i in a.indices) { + if (!floatEquals(a[i], b[i])) return false + } + return true } if (a is Array<*> && b is Array<*>) { - return a.size == b.size && - a.indices.all{ deepEquals(a[it], b[it]) } + if (a.size != b.size) return false + for (i in a.indices) { + if (!deepEquals(a[i], b[i])) return false + } + return true } if (a is List<*> && b is List<*>) { - return a.size == b.size && - a.indices.all{ deepEquals(a[it], b[it]) } + if (a.size != b.size) return false + val iterA = a.iterator() + val iterB = b.iterator() + while (iterA.hasNext() && iterB.hasNext()) { + if (!deepEquals(iterA.next(), iterB.next())) return false + } + return true } if (a is Map<*, *> && b is Map<*, *>) { - return a.size == b.size && a.all { - (b as Map).containsKey(it.key) && - deepEquals(it.value, b[it.key]) + if (a.size != b.size) return false + for (entry in a) { + val key = entry.key + var found = false + for (bEntry in b) { + if (deepEquals(key, bEntry.key)) { + if (deepEquals(entry.value, bEntry.value)) { + found = true + break + } else { + return false + } + } + } + if (!found) return false } + return true + } + if (a is Double && b is Double) { + return doubleEquals(a, b) + } + if (a is Float && b is Float) { + return floatEquals(a, b) } return a == b } - + + fun deepHash(value: Any?): Int { + return when (value) { + null -> 0 + is ByteArray -> value.contentHashCode() + is IntArray -> value.contentHashCode() + is LongArray -> value.contentHashCode() + is DoubleArray -> { + var result = 1 + for (item in value) { + result = 31 * result + doubleHash(item) + } + result + } + is FloatArray -> { + var result = 1 + for (item in value) { + result = 31 * result + floatHash(item) + } + result + } + is Array<*> -> { + var result = 1 + for (item in value) { + result = 31 * result + deepHash(item) + } + result + } + is List<*> -> { + var result = 1 + for (item in value) { + result = 31 * result + deepHash(item) + } + result + } + is Map<*, *> -> { + var result = 0 + for (entry in value) { + result += ((deepHash(entry.key) * 31) xor deepHash(entry.value)) + } + result + } + is Double -> doubleHash(value) + is Float -> floatHash(value) + else -> value.hashCode() + } + } + } /** @@ -79,7 +193,7 @@ class FlutterError ( val code: String, override val message: String? = null, val details: Any? = null -) : Throwable() +) : RuntimeException() /** Generated class from Pigeon that represents data sent in messages. */ data class RemoteConfigPigeonSettings ( @@ -101,15 +215,22 @@ data class RemoteConfigPigeonSettings ( ) } override fun equals(other: Any?): Boolean { - if (other !is RemoteConfigPigeonSettings) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeneratedAndroidFirebaseRemoteConfigPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as RemoteConfigPigeonSettings + return GeneratedAndroidFirebaseRemoteConfigPigeonUtils.deepEquals(this.fetchTimeoutSeconds, other.fetchTimeoutSeconds) && GeneratedAndroidFirebaseRemoteConfigPigeonUtils.deepEquals(this.minimumFetchIntervalSeconds, other.minimumFetchIntervalSeconds) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeneratedAndroidFirebaseRemoteConfigPigeonUtils.deepHash(this.fetchTimeoutSeconds) + result = 31 * result + GeneratedAndroidFirebaseRemoteConfigPigeonUtils.deepHash(this.minimumFetchIntervalSeconds) + return result + } } private open class GeneratedAndroidFirebaseRemoteConfigPigeonCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { diff --git a/packages/firebase_remote_config/firebase_remote_config/ios/firebase_remote_config/Sources/firebase_remote_config/FirebaseRemoteConfigMessages.g.swift b/packages/firebase_remote_config/firebase_remote_config/ios/firebase_remote_config/Sources/firebase_remote_config/FirebaseRemoteConfigMessages.g.swift index ac749f8cdb7f..15be7c5b33a7 100644 --- a/packages/firebase_remote_config/firebase_remote_config/ios/firebase_remote_config/Sources/firebase_remote_config/FirebaseRemoteConfigMessages.g.swift +++ b/packages/firebase_remote_config/firebase_remote_config/ios/firebase_remote_config/Sources/firebase_remote_config/FirebaseRemoteConfigMessages.g.swift @@ -1,7 +1,7 @@ // Copyright 2025, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v25.3.2), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), do not edit directly. // See also: https://pub.dev/packages/pigeon import Foundation @@ -52,7 +52,7 @@ private func wrapError(_ error: Any) -> [Any?] { } return [ "\(error)", - "\(type(of: error))", + "\(Swift.type(of: error))", "Stacktrace: \(Thread.callStackSymbols)", ] } @@ -66,6 +66,19 @@ private func nilOrValue(_ value: Any?) -> T? { return value as! T? } +private func doubleEqualsFirebaseRemoteConfigMessages(_ lhs: Double, _ rhs: Double) -> Bool { + (lhs.isNaN && rhs.isNaN) || lhs == rhs +} + +private func doubleHashFirebaseRemoteConfigMessages(_ value: Double, _ hasher: inout Hasher) { + if value.isNaN { + hasher.combine(0x7FF8_0000_0000_0000) + } else { + // Normalize -0.0 to 0.0 + hasher.combine(value == 0 ? 0 : value) + } +} + func deepEqualsFirebaseRemoteConfigMessages(_ lhs: Any?, _ rhs: Any?) -> Bool { let cleanLhs = nilOrValue(lhs) as Any? let cleanRhs = nilOrValue(rhs) as Any? @@ -76,59 +89,90 @@ func deepEqualsFirebaseRemoteConfigMessages(_ lhs: Any?, _ rhs: Any?) -> Bool { case (nil, _), (_, nil): return false - case is (Void, Void): + case let (lhs as AnyObject, rhs as AnyObject) where lhs === rhs: return true - case let (cleanLhsHashable, cleanRhsHashable) as (AnyHashable, AnyHashable): - return cleanLhsHashable == cleanRhsHashable + case is (Void, Void): + return true - case let (cleanLhsArray, cleanRhsArray) as ([Any?], [Any?]): - guard cleanLhsArray.count == cleanRhsArray.count else { return false } - for (index, element) in cleanLhsArray.enumerated() { - if !deepEqualsFirebaseRemoteConfigMessages(element, cleanRhsArray[index]) { + case let (lhsArray, rhsArray) as ([Any?], [Any?]): + guard lhsArray.count == rhsArray.count else { return false } + for (index, element) in lhsArray.enumerated() { + if !deepEqualsFirebaseRemoteConfigMessages(element, rhsArray[index]) { return false } } return true - case let (cleanLhsDictionary, cleanRhsDictionary) as ([AnyHashable: Any?], [AnyHashable: Any?]): - guard cleanLhsDictionary.count == cleanRhsDictionary.count else { return false } - for (key, cleanLhsValue) in cleanLhsDictionary { - guard cleanRhsDictionary.index(forKey: key) != nil else { return false } - if !deepEqualsFirebaseRemoteConfigMessages(cleanLhsValue, cleanRhsDictionary[key]!) { + case let (lhsArray, rhsArray) as ([Double], [Double]): + guard lhsArray.count == rhsArray.count else { return false } + for (index, element) in lhsArray.enumerated() { + if !doubleEqualsFirebaseRemoteConfigMessages(element, rhsArray[index]) { return false } } return true + case let (lhsDictionary, rhsDictionary) as ([AnyHashable: Any?], [AnyHashable: Any?]): + guard lhsDictionary.count == rhsDictionary.count else { return false } + for (lhsKey, lhsValue) in lhsDictionary { + var found = false + for (rhsKey, rhsValue) in rhsDictionary { + if deepEqualsFirebaseRemoteConfigMessages(lhsKey, rhsKey) { + if deepEqualsFirebaseRemoteConfigMessages(lhsValue, rhsValue) { + found = true + break + } else { + return false + } + } + } + if !found { return false } + } + return true + + case let (lhs as Double, rhs as Double): + return doubleEqualsFirebaseRemoteConfigMessages(lhs, rhs) + + case let (lhsHashable, rhsHashable) as (AnyHashable, AnyHashable): + return lhsHashable == rhsHashable + default: - // Any other type shouldn't be able to be used with pigeon. File an issue if you find this to be - // untrue. return false } } func deepHashFirebaseRemoteConfigMessages(value: Any?, hasher: inout Hasher) { - if let valueList = value as? [AnyHashable] { - for item in valueList { - deepHashFirebaseRemoteConfigMessages(value: item, hasher: &hasher) - } - return - } - - if let valueDict = value as? [AnyHashable: AnyHashable] { - for key in valueDict.keys { - hasher.combine(key) - deepHashFirebaseRemoteConfigMessages(value: valueDict[key]!, hasher: &hasher) + let cleanValue = nilOrValue(value) as Any? + if let cleanValue { + if let doubleValue = cleanValue as? Double { + doubleHashFirebaseRemoteConfigMessages(doubleValue, &hasher) + } else if let valueList = cleanValue as? [Any?] { + for item in valueList { + deepHashFirebaseRemoteConfigMessages(value: item, hasher: &hasher) + } + } else if let valueList = cleanValue as? [Double] { + for item in valueList { + doubleHashFirebaseRemoteConfigMessages(item, &hasher) + } + } else if let valueDict = cleanValue as? [AnyHashable: Any?] { + var result = 0 + for (key, value) in valueDict { + var entryKeyHasher = Hasher() + deepHashFirebaseRemoteConfigMessages(value: key, hasher: &entryKeyHasher) + var entryValueHasher = Hasher() + deepHashFirebaseRemoteConfigMessages(value: value, hasher: &entryValueHasher) + result = result &+ ((entryKeyHasher.finalize() &* 31) ^ entryValueHasher.finalize()) + } + hasher.combine(result) + } else if let hashableValue = cleanValue as? AnyHashable { + hasher.combine(hashableValue) + } else { + hasher.combine(String(describing: cleanValue)) } - return - } - - if let hashableValue = value as? AnyHashable { - hasher.combine(hashableValue.hashValue) + } else { + hasher.combine(0) } - - return hasher.combine(String(describing: value)) } /// Generated class from Pigeon that represents data sent in messages. @@ -155,11 +199,23 @@ struct RemoteConfigPigeonSettings: Hashable { } static func == (lhs: RemoteConfigPigeonSettings, rhs: RemoteConfigPigeonSettings) -> Bool { - deepEqualsFirebaseRemoteConfigMessages(lhs.toList(), rhs.toList()) + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return deepEqualsFirebaseRemoteConfigMessages( + lhs.fetchTimeoutSeconds, + rhs.fetchTimeoutSeconds + ) && + deepEqualsFirebaseRemoteConfigMessages( + lhs.minimumFetchIntervalSeconds, + rhs.minimumFetchIntervalSeconds + ) } func hash(into hasher: inout Hasher) { - deepHashFirebaseRemoteConfigMessages(value: toList(), hasher: &hasher) + hasher.combine("RemoteConfigPigeonSettings") + deepHashFirebaseRemoteConfigMessages(value: fetchTimeoutSeconds, hasher: &hasher) + deepHashFirebaseRemoteConfigMessages(value: minimumFetchIntervalSeconds, hasher: &hasher) } } diff --git a/packages/firebase_remote_config/firebase_remote_config/windows/messages.g.cpp b/packages/firebase_remote_config/firebase_remote_config/windows/messages.g.cpp index f8f200289fff..bf13f7b7ad47 100644 --- a/packages/firebase_remote_config/firebase_remote_config/windows/messages.g.cpp +++ b/packages/firebase_remote_config/firebase_remote_config/windows/messages.g.cpp @@ -1,7 +1,7 @@ // Copyright 2025, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v25.3.2), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), do not edit directly. // See also: https://pub.dev/packages/pigeon #undef _HAS_EXCEPTIONS @@ -13,16 +13,18 @@ #include #include +#include +#include #include #include #include namespace firebase_remote_config_windows { -using flutter::BasicMessageChannel; -using flutter::CustomEncodableValue; -using flutter::EncodableList; -using flutter::EncodableMap; -using flutter::EncodableValue; +using ::flutter::BasicMessageChannel; +using ::flutter::CustomEncodableValue; +using ::flutter::EncodableList; +using ::flutter::EncodableMap; +using ::flutter::EncodableValue; FlutterError CreateConnectionError(const std::string channel_name) { return FlutterError( @@ -31,6 +33,212 @@ FlutterError CreateConnectionError(const std::string channel_name) { EncodableValue("")); } +namespace { +template +bool PigeonInternalDeepEquals(const T& a, const T& b); + +bool PigeonInternalDeepEquals(const double& a, const double& b); + +template +bool PigeonInternalDeepEquals(const std::vector& a, const std::vector& b); + +template +bool PigeonInternalDeepEquals(const std::map& a, const std::map& b); + +template +bool PigeonInternalDeepEquals(const std::optional& a, + const std::optional& b); + +template +bool PigeonInternalDeepEquals(const std::unique_ptr& a, + const std::unique_ptr& b); + +bool PigeonInternalDeepEquals(const ::flutter::EncodableValue& a, + const ::flutter::EncodableValue& b); + +template +bool PigeonInternalDeepEquals(const T& a, const T& b) { + return a == b; +} + +template +bool PigeonInternalDeepEquals(const std::vector& a, + const std::vector& b) { + if (a.size() != b.size()) { + return false; + } + for (size_t i = 0; i < a.size(); ++i) { + if (!PigeonInternalDeepEquals(a[i], b[i])) { + return false; + } + } + return true; +} + +template +bool PigeonInternalDeepEquals(const std::map& a, + const std::map& b) { + if (a.size() != b.size()) { + return false; + } + for (const auto& kv : a) { + bool found = false; + for (const auto& b_kv : b) { + if (PigeonInternalDeepEquals(kv.first, b_kv.first)) { + if (PigeonInternalDeepEquals(kv.second, b_kv.second)) { + found = true; + break; + } else { + return false; + } + } + } + if (!found) { + return false; + } + } + return true; +} + +bool PigeonInternalDeepEquals(const double& a, const double& b) { + // Normalize -0.0 to 0.0 and handle NaN equality. + return (a == b) || (std::isnan(a) && std::isnan(b)); +} + +template +bool PigeonInternalDeepEquals(const std::optional& a, + const std::optional& b) { + if (!a && !b) { + return true; + } + if (!a || !b) { + return false; + } + return PigeonInternalDeepEquals(*a, *b); +} + +template +bool PigeonInternalDeepEquals(const std::unique_ptr& a, + const std::unique_ptr& b) { + if (a.get() == b.get()) { + return true; + } + if (!a || !b) { + return false; + } + return PigeonInternalDeepEquals(*a, *b); +} + +bool PigeonInternalDeepEquals(const ::flutter::EncodableValue& a, + const ::flutter::EncodableValue& b) { + if (a.index() != b.index()) { + return false; + } + if (const double* da = std::get_if(&a)) { + return PigeonInternalDeepEquals(*da, std::get(b)); + } else if (const ::flutter::EncodableList* la = + std::get_if<::flutter::EncodableList>(&a)) { + return PigeonInternalDeepEquals(*la, std::get<::flutter::EncodableList>(b)); + } else if (const ::flutter::EncodableMap* ma = + std::get_if<::flutter::EncodableMap>(&a)) { + return PigeonInternalDeepEquals(*ma, std::get<::flutter::EncodableMap>(b)); + } + return a == b; +} + +template +size_t PigeonInternalDeepHash(const T& v); + +size_t PigeonInternalDeepHash(const double& v); + +template +size_t PigeonInternalDeepHash(const std::vector& v); + +template +size_t PigeonInternalDeepHash(const std::map& v); + +template +size_t PigeonInternalDeepHash(const std::optional& v); + +template +size_t PigeonInternalDeepHash(const std::unique_ptr& v); + +size_t PigeonInternalDeepHash(const ::flutter::EncodableValue& v); + +template +size_t PigeonInternalDeepHash(const T& v) { + return std::hash()(v); +} + +template +size_t PigeonInternalDeepHash(const std::vector& v) { + size_t result = 1; + for (const auto& item : v) { + result = result * 31 + PigeonInternalDeepHash(item); + } + return result; +} + +template +size_t PigeonInternalDeepHash(const std::map& v) { + size_t result = 0; + for (const auto& kv : v) { + result += ((PigeonInternalDeepHash(kv.first) * 31) ^ + PigeonInternalDeepHash(kv.second)); + } + return result; +} + +size_t PigeonInternalDeepHash(const double& v) { + if (std::isnan(v)) { + // Normalize NaN to a consistent hash. + return std::hash()(std::numeric_limits::quiet_NaN()); + } + if (v == 0.0) { + // Normalize -0.0 to 0.0 so they have the same hash code. + return std::hash()(0.0); + } + return std::hash()(v); +} + +template +size_t PigeonInternalDeepHash(const std::optional& v) { + return v ? PigeonInternalDeepHash(*v) : 0; +} + +template +size_t PigeonInternalDeepHash(const std::unique_ptr& v) { + return v ? PigeonInternalDeepHash(*v) : 0; +} + +size_t PigeonInternalDeepHash(const ::flutter::EncodableValue& v) { + size_t result = v.index(); + if (const double* dv = std::get_if(&v)) { + result = result * 31 + PigeonInternalDeepHash(*dv); + } else if (const ::flutter::EncodableList* lv = + std::get_if<::flutter::EncodableList>(&v)) { + result = result * 31 + PigeonInternalDeepHash(*lv); + } else if (const ::flutter::EncodableMap* mv = + std::get_if<::flutter::EncodableMap>(&v)) { + result = result * 31 + PigeonInternalDeepHash(*mv); + } else { + std::visit( + [&result](const auto& val) { + using T = std::decay_t; + if constexpr (!std::is_same_v && + !std::is_same_v && + !std::is_same_v && + !std::is_same_v && + !std::is_same_v) { + result = result * 31 + PigeonInternalDeepHash(val); + } + }, + v); + } + return result; +} + +} // namespace // RemoteConfigPigeonSettings RemoteConfigPigeonSettings::RemoteConfigPigeonSettings( @@ -70,22 +278,47 @@ RemoteConfigPigeonSettings RemoteConfigPigeonSettings::FromEncodableList( return decoded; } +bool RemoteConfigPigeonSettings::operator==( + const RemoteConfigPigeonSettings& other) const { + return PigeonInternalDeepEquals(fetch_timeout_seconds_, + other.fetch_timeout_seconds_) && + PigeonInternalDeepEquals(minimum_fetch_interval_seconds_, + other.minimum_fetch_interval_seconds_); +} + +bool RemoteConfigPigeonSettings::operator!=( + const RemoteConfigPigeonSettings& other) const { + return !(*this == other); +} + +size_t RemoteConfigPigeonSettings::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(fetch_timeout_seconds_); + result = + result * 31 + PigeonInternalDeepHash(minimum_fetch_interval_seconds_); + return result; +} + +size_t PigeonInternalDeepHash(const RemoteConfigPigeonSettings& v) { + return v.Hash(); +} + PigeonInternalCodecSerializer::PigeonInternalCodecSerializer() {} EncodableValue PigeonInternalCodecSerializer::ReadValueOfType( - uint8_t type, flutter::ByteStreamReader* stream) const { + uint8_t type, ::flutter::ByteStreamReader* stream) const { switch (type) { case 129: { return CustomEncodableValue(RemoteConfigPigeonSettings::FromEncodableList( std::get(ReadValue(stream)))); } default: - return flutter::StandardCodecSerializer::ReadValueOfType(type, stream); + return ::flutter::StandardCodecSerializer::ReadValueOfType(type, stream); } } void PigeonInternalCodecSerializer::WriteValue( - const EncodableValue& value, flutter::ByteStreamWriter* stream) const { + const EncodableValue& value, ::flutter::ByteStreamWriter* stream) const { if (const CustomEncodableValue* custom_value = std::get_if(&value)) { if (custom_value->type() == typeid(RemoteConfigPigeonSettings)) { @@ -97,25 +330,25 @@ void PigeonInternalCodecSerializer::WriteValue( return; } } - flutter::StandardCodecSerializer::WriteValue(value, stream); + ::flutter::StandardCodecSerializer::WriteValue(value, stream); } /// The codec used by FirebaseRemoteConfigHostApi. -const flutter::StandardMessageCodec& FirebaseRemoteConfigHostApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance( +const ::flutter::StandardMessageCodec& FirebaseRemoteConfigHostApi::GetCodec() { + return ::flutter::StandardMessageCodec::GetInstance( &PigeonInternalCodecSerializer::GetInstance()); } // Sets up an instance of `FirebaseRemoteConfigHostApi` to handle messages // through the `binary_messenger`. void FirebaseRemoteConfigHostApi::SetUp( - flutter::BinaryMessenger* binary_messenger, + ::flutter::BinaryMessenger* binary_messenger, FirebaseRemoteConfigHostApi* api) { FirebaseRemoteConfigHostApi::SetUp(binary_messenger, api, ""); } void FirebaseRemoteConfigHostApi::SetUp( - flutter::BinaryMessenger* binary_messenger, + ::flutter::BinaryMessenger* binary_messenger, FirebaseRemoteConfigHostApi* api, const std::string& message_channel_suffix) { const std::string prepended_suffix = @@ -132,7 +365,7 @@ void FirebaseRemoteConfigHostApi::SetUp( if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_name_arg = args.at(0); @@ -170,7 +403,7 @@ void FirebaseRemoteConfigHostApi::SetUp( if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_name_arg = args.at(0); @@ -209,7 +442,7 @@ void FirebaseRemoteConfigHostApi::SetUp( if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_name_arg = args.at(0); @@ -247,7 +480,7 @@ void FirebaseRemoteConfigHostApi::SetUp( if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_name_arg = args.at(0); @@ -294,7 +527,7 @@ void FirebaseRemoteConfigHostApi::SetUp( if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_name_arg = args.at(0); @@ -339,7 +572,7 @@ void FirebaseRemoteConfigHostApi::SetUp( if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_name_arg = args.at(0); @@ -377,7 +610,7 @@ void FirebaseRemoteConfigHostApi::SetUp( if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_name_arg = args.at(0); @@ -423,7 +656,7 @@ void FirebaseRemoteConfigHostApi::SetUp( if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_name_arg = args.at(0); @@ -462,7 +695,7 @@ void FirebaseRemoteConfigHostApi::SetUp( if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_name_arg = args.at(0); diff --git a/packages/firebase_remote_config/firebase_remote_config/windows/messages.g.h b/packages/firebase_remote_config/firebase_remote_config/windows/messages.g.h index c325943b6d22..43ddff65edaa 100644 --- a/packages/firebase_remote_config/firebase_remote_config/windows/messages.g.h +++ b/packages/firebase_remote_config/firebase_remote_config/windows/messages.g.h @@ -1,7 +1,7 @@ // Copyright 2025, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v25.3.2), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), do not edit directly. // See also: https://pub.dev/packages/pigeon #ifndef PIGEON_MESSAGES_G_H_ @@ -25,17 +25,17 @@ class FlutterError { explicit FlutterError(const std::string& code, const std::string& message) : code_(code), message_(message) {} explicit FlutterError(const std::string& code, const std::string& message, - const flutter::EncodableValue& details) + const ::flutter::EncodableValue& details) : code_(code), message_(message), details_(details) {} const std::string& code() const { return code_; } const std::string& message() const { return message_; } - const flutter::EncodableValue& details() const { return details_; } + const ::flutter::EncodableValue& details() const { return details_; } private: std::string code_; std::string message_; - flutter::EncodableValue details_; + ::flutter::EncodableValue details_; }; template @@ -71,17 +71,30 @@ class RemoteConfigPigeonSettings { int64_t minimum_fetch_interval_seconds() const; void set_minimum_fetch_interval_seconds(int64_t value_arg); + bool operator==(const RemoteConfigPigeonSettings& other) const; + bool operator!=(const RemoteConfigPigeonSettings& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + private: static RemoteConfigPigeonSettings FromEncodableList( - const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; + const ::flutter::EncodableList& list); + + public: + public: + ::flutter::EncodableList ToEncodableList() const; + + private: + private: friend class FirebaseRemoteConfigHostApi; friend class PigeonInternalCodecSerializer; int64_t fetch_timeout_seconds_; int64_t minimum_fetch_interval_seconds_; }; -class PigeonInternalCodecSerializer : public flutter::StandardCodecSerializer { +class PigeonInternalCodecSerializer + : public ::flutter::StandardCodecSerializer { public: PigeonInternalCodecSerializer(); inline static PigeonInternalCodecSerializer& GetInstance() { @@ -89,12 +102,12 @@ class PigeonInternalCodecSerializer : public flutter::StandardCodecSerializer { return sInstance; } - void WriteValue(const flutter::EncodableValue& value, - flutter::ByteStreamWriter* stream) const override; + void WriteValue(const ::flutter::EncodableValue& value, + ::flutter::ByteStreamWriter* stream) const override; protected: - flutter::EncodableValue ReadValueOfType( - uint8_t type, flutter::ByteStreamReader* stream) const override; + ::flutter::EncodableValue ReadValueOfType( + uint8_t type, ::flutter::ByteStreamReader* stream) const override; }; // Generated interface from Pigeon that represents a handler of messages from @@ -118,32 +131,33 @@ class FirebaseRemoteConfigHostApi { std::function reply)> result) = 0; virtual void SetDefaults( const std::string& app_name, - const flutter::EncodableMap& default_parameters, + const ::flutter::EncodableMap& default_parameters, std::function reply)> result) = 0; virtual void EnsureInitialized( const std::string& app_name, std::function reply)> result) = 0; virtual void SetCustomSignals( - const std::string& app_name, const flutter::EncodableMap& custom_signals, + const std::string& app_name, + const ::flutter::EncodableMap& custom_signals, std::function reply)> result) = 0; virtual void GetAll( const std::string& app_name, - std::function reply)> result) = 0; + std::function reply)> result) = 0; virtual void GetProperties( const std::string& app_name, - std::function reply)> result) = 0; + std::function reply)> result) = 0; // The codec used by FirebaseRemoteConfigHostApi. - static const flutter::StandardMessageCodec& GetCodec(); + static const ::flutter::StandardMessageCodec& GetCodec(); // Sets up an instance of `FirebaseRemoteConfigHostApi` to handle messages // through the `binary_messenger`. - static void SetUp(flutter::BinaryMessenger* binary_messenger, + static void SetUp(::flutter::BinaryMessenger* binary_messenger, FirebaseRemoteConfigHostApi* api); - static void SetUp(flutter::BinaryMessenger* binary_messenger, + static void SetUp(::flutter::BinaryMessenger* binary_messenger, FirebaseRemoteConfigHostApi* api, const std::string& message_channel_suffix); - static flutter::EncodableValue WrapError(std::string_view error_message); - static flutter::EncodableValue WrapError(const FlutterError& error); + static ::flutter::EncodableValue WrapError(std::string_view error_message); + static ::flutter::EncodableValue WrapError(const FlutterError& error); protected: FirebaseRemoteConfigHostApi() = default; diff --git a/packages/firebase_remote_config/firebase_remote_config_platform_interface/lib/src/pigeon/messages.pigeon.dart b/packages/firebase_remote_config/firebase_remote_config_platform_interface/lib/src/pigeon/messages.pigeon.dart index c9ed1ec45a6a..f1d5c1686e7d 100644 --- a/packages/firebase_remote_config/firebase_remote_config_platform_interface/lib/src/pigeon/messages.pigeon.dart +++ b/packages/firebase_remote_config/firebase_remote_config_platform_interface/lib/src/pigeon/messages.pigeon.dart @@ -1,49 +1,104 @@ // Copyright 2025, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v25.3.2), do not edit directly. +// Autogenerated from Pigeon (v26.3.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, no_leading_underscores_for_local_identifiers +// ignore_for_file: unused_import, unused_shown_name +// ignore_for_file: type=lint import 'dart:async'; -import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; +import 'dart:typed_data' show Float64List, Int32List, Int64List; -import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer; import 'package:flutter/services.dart'; +import 'package:meta/meta.dart' show immutable, protected, visibleForTesting; -PlatformException _createConnectionError(String channelName) { - return PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel: "$channelName".', - ); -} - -List wrapResponse( - {Object? result, PlatformException? error, bool empty = false}) { - if (empty) { - return []; - } - if (error == null) { - return [result]; +Object? _extractReplyValueOrThrow( + List? replyList, + String channelName, { + required bool isNullValid, +}) { + if (replyList == null) { + throw PlatformException( + code: 'channel-error', + message: 'Unable to establish connection on channel: "$channelName".', + ); + } else if (replyList.length > 1) { + throw PlatformException( + code: replyList[0]! as String, + message: replyList[1] as String?, + details: replyList[2], + ); + } else if (!isNullValid && (replyList.isNotEmpty && replyList[0] == null)) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); } - return [error.code, error.message, error.details]; + return replyList.firstOrNull; } bool _deepEquals(Object? a, Object? b) { + if (identical(a, b)) { + return true; + } + if (a is double && b is double) { + if (a.isNaN && b.isNaN) { + return true; + } + return a == b; + } if (a is List && b is List) { return a.length == b.length && a.indexed .every(((int, dynamic) item) => _deepEquals(item.$2, b[item.$1])); } if (a is Map && b is Map) { - return a.length == b.length && - a.entries.every((MapEntry entry) => - (b as Map).containsKey(entry.key) && - _deepEquals(entry.value, b[entry.key])); + if (a.length != b.length) { + return false; + } + for (final MapEntry entryA in a.entries) { + bool found = false; + for (final MapEntry entryB in b.entries) { + if (_deepEquals(entryA.key, entryB.key)) { + if (_deepEquals(entryA.value, entryB.value)) { + found = true; + break; + } else { + return false; + } + } + } + if (!found) { + return false; + } + } + return true; } return a == b; } +int _deepHash(Object? value) { + if (value is List) { + return Object.hashAll(value.map(_deepHash)); + } + if (value is Map) { + int result = 0; + for (final MapEntry entry in value.entries) { + result += (_deepHash(entry.key) * 31) ^ _deepHash(entry.value); + } + return result; + } + if (value is double && value.isNaN) { + // Normalize NaN to a consistent hash. + return 0x7FF8000000000000.hashCode; + } + if (value is double && value == 0.0) { + // Normalize -0.0 to 0.0 so they have the same hash code. + return 0.0.hashCode; + } + return value.hashCode; +} + class RemoteConfigPigeonSettings { RemoteConfigPigeonSettings({ required this.fetchTimeoutSeconds, @@ -83,12 +138,14 @@ class RemoteConfigPigeonSettings { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(fetchTimeoutSeconds, other.fetchTimeoutSeconds) && + _deepEquals( + minimumFetchIntervalSeconds, other.minimumFetchIntervalSeconds); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()); + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class _PigeonCodec extends StandardMessageCodec { @@ -133,261 +190,182 @@ class FirebaseRemoteConfigHostApi { final String pigeonVar_messageChannelSuffix; Future fetch(String appName) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_remote_config_platform_interface.FirebaseRemoteConfigHostApi.fetch$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([appName]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future fetchAndActivate(String appName) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_remote_config_platform_interface.FirebaseRemoteConfigHostApi.fetchAndActivate$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([appName]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as bool?)!; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as bool; } Future activate(String appName) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_remote_config_platform_interface.FirebaseRemoteConfigHostApi.activate$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([appName]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as bool?)!; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as bool; } Future setConfigSettings( String appName, RemoteConfigPigeonSettings settings) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_remote_config_platform_interface.FirebaseRemoteConfigHostApi.setConfigSettings$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([appName, settings]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future setDefaults( String appName, Map defaultParameters) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_remote_config_platform_interface.FirebaseRemoteConfigHostApi.setDefaults$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([appName, defaultParameters]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future ensureInitialized(String appName) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_remote_config_platform_interface.FirebaseRemoteConfigHostApi.ensureInitialized$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([appName]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future setCustomSignals( String appName, Map customSignals) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_remote_config_platform_interface.FirebaseRemoteConfigHostApi.setCustomSignals$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([appName, customSignals]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future> getAll(String appName) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_remote_config_platform_interface.FirebaseRemoteConfigHostApi.getAll$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([appName]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as Map?)! - .cast(); - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return (pigeonVar_replyValue! as Map) + .cast(); } Future> getProperties(String appName) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.firebase_remote_config_platform_interface.FirebaseRemoteConfigHostApi.getProperties$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([appName]); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as Map?)! - .cast(); - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return (pigeonVar_replyValue! as Map) + .cast(); } } diff --git a/packages/firebase_remote_config/firebase_remote_config_platform_interface/pubspec.yaml b/packages/firebase_remote_config/firebase_remote_config_platform_interface/pubspec.yaml index 26430f70ed34..57ffffc5c647 100644 --- a/packages/firebase_remote_config/firebase_remote_config_platform_interface/pubspec.yaml +++ b/packages/firebase_remote_config/firebase_remote_config_platform_interface/pubspec.yaml @@ -23,4 +23,4 @@ dev_dependencies: flutter_test: sdk: flutter mockito: ^5.0.0 - pigeon: 25.3.2 + pigeon: 26.3.4 diff --git a/packages/firebase_storage/analysis_options.yaml b/packages/firebase_storage/analysis_options.yaml index 5004d8c56d8c..ad032c876e0e 100644 --- a/packages/firebase_storage/analysis_options.yaml +++ b/packages/firebase_storage/analysis_options.yaml @@ -10,6 +10,10 @@ analyzer: # We explicitly enabled even conflicting rules and are fixing the conflict # in this file included_file_warning: ignore + exclude: + - firebase_storage_platform_interface/lib/src/pigeon/messages.pigeon.dart + - firebase_storage_platform_interface/test/pigeon/test_api.dart + - firebase_storage_platform_interface/pigeons/messages.dart linter: rules: diff --git a/packages/firebase_storage/firebase_storage/android/src/main/kotlin/io/flutter/plugins/firebase/storage/FlutterFirebaseStoragePlugin.kt b/packages/firebase_storage/firebase_storage/android/src/main/kotlin/io/flutter/plugins/firebase/storage/FlutterFirebaseStoragePlugin.kt index 7453d5040713..466c44c98220 100644 --- a/packages/firebase_storage/firebase_storage/android/src/main/kotlin/io/flutter/plugins/firebase/storage/FlutterFirebaseStoragePlugin.kt +++ b/packages/firebase_storage/firebase_storage/android/src/main/kotlin/io/flutter/plugins/firebase/storage/FlutterFirebaseStoragePlugin.kt @@ -81,38 +81,38 @@ class FlutterFirebaseStoragePlugin : FlutterFirebasePlugin, FlutterPlugin, Fireb } } - private fun getStorageFromPigeon(app: PigeonStorageFirebaseApp): FirebaseStorage { + private fun getStorageFromPigeon(app: InternalStorageFirebaseApp): FirebaseStorage { val androidApp = FirebaseApp.getInstance(app.appName) return FirebaseStorage.getInstance(androidApp, "gs://${app.bucket}") } private fun getReferenceFromPigeon( - app: PigeonStorageFirebaseApp, - reference: PigeonStorageReference + app: InternalStorageFirebaseApp, + reference: InternalStorageReference ): StorageReference { val androidStorage = getStorageFromPigeon(app) return androidStorage.getReference(reference.fullPath) } - private fun convertToPigeonReference(reference: StorageReference): PigeonStorageReference { - return PigeonStorageReference( + private fun convertToPigeonReference(reference: StorageReference): InternalStorageReference { + return InternalStorageReference( bucket = reference.bucket, fullPath = reference.path, name = reference.name ) } - private fun convertToPigeonMetaData(storageMetadata: StorageMetadata?): PigeonFullMetaData { - return PigeonFullMetaData(metadata = parseMetadataToMap(storageMetadata)) + private fun convertToPigeonMetaData(storageMetadata: StorageMetadata?): InternalFullMetaData { + return InternalFullMetaData(metadata = parseMetadataToMap(storageMetadata)) } - private fun convertToPigeonListResult(listResult: ListResult): PigeonListResult { + private fun convertToPigeonListResult(listResult: ListResult): InternalListResult { val items = listResult.items.map { convertToPigeonReference(it) } val prefixes = listResult.prefixes.map { convertToPigeonReference(it) } - return PigeonListResult(items = items, pageToken = listResult.pageToken, prefixs = prefixes) + return InternalListResult(items = items, pageToken = listResult.pageToken, prefixs = prefixes) } - private fun getMetaDataFromPigeon(pigeonSettableMetatdata: PigeonSettableMetadata): StorageMetadata { + private fun getMetaDataFromPigeon(pigeonSettableMetatdata: InternalSettableMetadata): StorageMetadata { val builder = StorageMetadata.Builder() pigeonSettableMetatdata.contentType?.let { builder.setContentType(it) } pigeonSettableMetatdata.cacheControl?.let { builder.setCacheControl(it) } @@ -132,17 +132,17 @@ class FlutterFirebaseStoragePlugin : FlutterFirebasePlugin, FlutterPlugin, Fireb } override fun getReferencebyPath( - app: PigeonStorageFirebaseApp, + app: InternalStorageFirebaseApp, path: String, bucket: String?, - callback: (Result) -> Unit + callback: (Result) -> Unit ) { val androidReference = getStorageFromPigeon(app).getReference(path) callback(Result.success(convertToPigeonReference(androidReference))) } override fun useStorageEmulator( - app: PigeonStorageFirebaseApp, + app: InternalStorageFirebaseApp, host: String, port: Long, callback: (Result) -> Unit @@ -157,8 +157,8 @@ class FlutterFirebaseStoragePlugin : FlutterFirebasePlugin, FlutterPlugin, Fireb } override fun referenceDelete( - app: PigeonStorageFirebaseApp, - reference: PigeonStorageReference, + app: InternalStorageFirebaseApp, + reference: InternalStorageReference, callback: (Result) -> Unit ) { val androidReference = getStorageFromPigeon(app).getReference(reference.fullPath) @@ -169,8 +169,8 @@ class FlutterFirebaseStoragePlugin : FlutterFirebasePlugin, FlutterPlugin, Fireb } override fun referenceGetDownloadURL( - app: PigeonStorageFirebaseApp, - reference: PigeonStorageReference, + app: InternalStorageFirebaseApp, + reference: InternalStorageReference, callback: (Result) -> Unit ) { val androidReference = getStorageFromPigeon(app).getReference(reference.fullPath) @@ -181,8 +181,8 @@ class FlutterFirebaseStoragePlugin : FlutterFirebasePlugin, FlutterPlugin, Fireb } override fun referenceGetData( - app: PigeonStorageFirebaseApp, - reference: PigeonStorageReference, + app: InternalStorageFirebaseApp, + reference: InternalStorageReference, maxSize: Long, callback: (Result) -> Unit ) { @@ -194,9 +194,9 @@ class FlutterFirebaseStoragePlugin : FlutterFirebasePlugin, FlutterPlugin, Fireb } override fun referenceGetMetaData( - app: PigeonStorageFirebaseApp, - reference: PigeonStorageReference, - callback: (Result) -> Unit + app: InternalStorageFirebaseApp, + reference: InternalStorageReference, + callback: (Result) -> Unit ) { val androidReference = getStorageFromPigeon(app).getReference(reference.fullPath) androidReference.metadata.addOnCompleteListener { task -> @@ -206,10 +206,10 @@ class FlutterFirebaseStoragePlugin : FlutterFirebasePlugin, FlutterPlugin, Fireb } override fun referenceList( - app: PigeonStorageFirebaseApp, - reference: PigeonStorageReference, - options: PigeonListOptions, - callback: (Result) -> Unit + app: InternalStorageFirebaseApp, + reference: InternalStorageReference, + options: InternalListOptions, + callback: (Result) -> Unit ) { val androidReference = getStorageFromPigeon(app).getReference(reference.fullPath) val task = if (options.pageToken != null) { @@ -224,9 +224,9 @@ class FlutterFirebaseStoragePlugin : FlutterFirebasePlugin, FlutterPlugin, Fireb } override fun referenceListAll( - app: PigeonStorageFirebaseApp, - reference: PigeonStorageReference, - callback: (Result) -> Unit + app: InternalStorageFirebaseApp, + reference: InternalStorageReference, + callback: (Result) -> Unit ) { val androidReference = getStorageFromPigeon(app).getReference(reference.fullPath) androidReference.listAll().addOnCompleteListener { task -> @@ -236,10 +236,10 @@ class FlutterFirebaseStoragePlugin : FlutterFirebasePlugin, FlutterPlugin, Fireb } override fun referenceUpdateMetadata( - app: PigeonStorageFirebaseApp, - reference: PigeonStorageReference, - metadata: PigeonSettableMetadata, - callback: (Result) -> Unit + app: InternalStorageFirebaseApp, + reference: InternalStorageReference, + metadata: InternalSettableMetadata, + callback: (Result) -> Unit ) { val androidReference = getStorageFromPigeon(app).getReference(reference.fullPath) androidReference.updateMetadata(getMetaDataFromPigeon(metadata)).addOnCompleteListener { task -> @@ -249,10 +249,10 @@ class FlutterFirebaseStoragePlugin : FlutterFirebasePlugin, FlutterPlugin, Fireb } override fun referencePutData( - app: PigeonStorageFirebaseApp, - reference: PigeonStorageReference, + app: InternalStorageFirebaseApp, + reference: InternalStorageReference, data: ByteArray, - settableMetaData: PigeonSettableMetadata, + settableMetaData: InternalSettableMetadata, handle: Long, callback: (Result) -> Unit ) { @@ -269,11 +269,11 @@ class FlutterFirebaseStoragePlugin : FlutterFirebasePlugin, FlutterPlugin, Fireb } override fun referencePutString( - app: PigeonStorageFirebaseApp, - reference: PigeonStorageReference, + app: InternalStorageFirebaseApp, + reference: InternalStorageReference, data: String, format: Long, - settableMetaData: PigeonSettableMetadata, + settableMetaData: InternalSettableMetadata, handle: Long, callback: (Result) -> Unit ) { @@ -291,10 +291,10 @@ class FlutterFirebaseStoragePlugin : FlutterFirebasePlugin, FlutterPlugin, Fireb } override fun referencePutFile( - app: PigeonStorageFirebaseApp, - reference: PigeonStorageReference, + app: InternalStorageFirebaseApp, + reference: InternalStorageReference, filePath: String, - settableMetaData: PigeonSettableMetadata?, + settableMetaData: InternalSettableMetadata?, handle: Long, callback: (Result) -> Unit ) { @@ -315,8 +315,8 @@ class FlutterFirebaseStoragePlugin : FlutterFirebasePlugin, FlutterPlugin, Fireb } override fun referenceDownloadFile( - app: PigeonStorageFirebaseApp, - reference: PigeonStorageReference, + app: InternalStorageFirebaseApp, + reference: InternalStorageReference, filePath: String, handle: Long, callback: (Result) -> Unit @@ -333,7 +333,7 @@ class FlutterFirebaseStoragePlugin : FlutterFirebasePlugin, FlutterPlugin, Fireb } override fun taskPause( - app: PigeonStorageFirebaseApp, + app: InternalStorageFirebaseApp, handle: Long, callback: (Result>) -> Unit ) { @@ -361,7 +361,7 @@ class FlutterFirebaseStoragePlugin : FlutterFirebasePlugin, FlutterPlugin, Fireb } override fun taskResume( - app: PigeonStorageFirebaseApp, + app: InternalStorageFirebaseApp, handle: Long, callback: (Result>) -> Unit ) { @@ -389,7 +389,7 @@ class FlutterFirebaseStoragePlugin : FlutterFirebasePlugin, FlutterPlugin, Fireb } override fun taskCancel( - app: PigeonStorageFirebaseApp, + app: InternalStorageFirebaseApp, handle: Long, callback: (Result>) -> Unit ) { @@ -414,7 +414,7 @@ class FlutterFirebaseStoragePlugin : FlutterFirebasePlugin, FlutterPlugin, Fireb } override fun setMaxOperationRetryTime( - app: PigeonStorageFirebaseApp, + app: InternalStorageFirebaseApp, time: Long, callback: (Result) -> Unit ) { @@ -424,7 +424,7 @@ class FlutterFirebaseStoragePlugin : FlutterFirebasePlugin, FlutterPlugin, Fireb } override fun setMaxUploadRetryTime( - app: PigeonStorageFirebaseApp, + app: InternalStorageFirebaseApp, time: Long, callback: (Result) -> Unit ) { @@ -434,7 +434,7 @@ class FlutterFirebaseStoragePlugin : FlutterFirebasePlugin, FlutterPlugin, Fireb } override fun setMaxDownloadRetryTime( - app: PigeonStorageFirebaseApp, + app: InternalStorageFirebaseApp, time: Long, callback: (Result) -> Unit ) { diff --git a/packages/firebase_storage/firebase_storage/android/src/main/kotlin/io/flutter/plugins/firebase/storage/GeneratedAndroidFirebaseStorage.g.kt b/packages/firebase_storage/firebase_storage/android/src/main/kotlin/io/flutter/plugins/firebase/storage/GeneratedAndroidFirebaseStorage.g.kt index 66149daa3d82..ffd0cf5a58d8 100644 --- a/packages/firebase_storage/firebase_storage/android/src/main/kotlin/io/flutter/plugins/firebase/storage/GeneratedAndroidFirebaseStorage.g.kt +++ b/packages/firebase_storage/firebase_storage/android/src/main/kotlin/io/flutter/plugins/firebase/storage/GeneratedAndroidFirebaseStorage.g.kt @@ -1,37 +1,186 @@ // Copyright 2023, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v11.0.1), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), do not edit directly. // See also: https://pub.dev/packages/pigeon +@file:Suppress("UNCHECKED_CAST", "ArrayInDataClass") package io.flutter.plugins.firebase.storage import android.util.Log import io.flutter.plugin.common.BasicMessageChannel import io.flutter.plugin.common.BinaryMessenger +import io.flutter.plugin.common.EventChannel import io.flutter.plugin.common.MessageCodec +import io.flutter.plugin.common.StandardMethodCodec import io.flutter.plugin.common.StandardMessageCodec import java.io.ByteArrayOutputStream import java.nio.ByteBuffer +private object GeneratedAndroidFirebaseStoragePigeonUtils { -private fun wrapResult(result: Any?): List { - return listOf(result) -} + 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) - ) + fun wrapError(exception: Throwable): List { + return if (exception is FlutterError) { + listOf( + exception.code, + exception.message, + exception.details + ) + } else { + listOf( + exception.javaClass.simpleName, + exception.toString(), + "Cause: " + exception.cause + ", Stacktrace: " + Log.getStackTraceString(exception) + ) + } + } + fun doubleEquals(a: Double, b: Double): Boolean { + // Normalize -0.0 to 0.0 and handle NaN equality. + return (if (a == 0.0) 0.0 else a) == (if (b == 0.0) 0.0 else b) || (a.isNaN() && b.isNaN()) + } + + fun floatEquals(a: Float, b: Float): Boolean { + // Normalize -0.0 to 0.0 and handle NaN equality. + return (if (a == 0.0f) 0.0f else a) == (if (b == 0.0f) 0.0f else b) || (a.isNaN() && b.isNaN()) + } + + fun doubleHash(d: Double): Int { + // Normalize -0.0 to 0.0 and handle NaN to ensure consistent hash codes. + val normalized = if (d == 0.0) 0.0 else d + val bits = java.lang.Double.doubleToLongBits(normalized) + return (bits xor (bits ushr 32)).toInt() + } + + fun floatHash(f: Float): Int { + // Normalize -0.0 to 0.0 and handle NaN to ensure consistent hash codes. + val normalized = if (f == 0.0f) 0.0f else f + return java.lang.Float.floatToIntBits(normalized) + } + + fun deepEquals(a: Any?, b: Any?): Boolean { + if (a === b) { + return true + } + if (a == null || b == null) { + return false + } + if (a is ByteArray && b is ByteArray) { + return a.contentEquals(b) + } + if (a is IntArray && b is IntArray) { + return a.contentEquals(b) + } + if (a is LongArray && b is LongArray) { + return a.contentEquals(b) + } + if (a is DoubleArray && b is DoubleArray) { + if (a.size != b.size) return false + for (i in a.indices) { + if (!doubleEquals(a[i], b[i])) return false + } + return true + } + if (a is FloatArray && b is FloatArray) { + if (a.size != b.size) return false + for (i in a.indices) { + if (!floatEquals(a[i], b[i])) return false + } + return true + } + if (a is Array<*> && b is Array<*>) { + if (a.size != b.size) return false + for (i in a.indices) { + if (!deepEquals(a[i], b[i])) return false + } + return true + } + if (a is List<*> && b is List<*>) { + if (a.size != b.size) return false + val iterA = a.iterator() + val iterB = b.iterator() + while (iterA.hasNext() && iterB.hasNext()) { + if (!deepEquals(iterA.next(), iterB.next())) return false + } + return true + } + if (a is Map<*, *> && b is Map<*, *>) { + if (a.size != b.size) return false + for (entry in a) { + val key = entry.key + var found = false + for (bEntry in b) { + if (deepEquals(key, bEntry.key)) { + if (deepEquals(entry.value, bEntry.value)) { + found = true + break + } else { + return false + } + } + } + if (!found) return false + } + return true + } + if (a is Double && b is Double) { + return doubleEquals(a, b) + } + if (a is Float && b is Float) { + return floatEquals(a, b) + } + return a == b } + + fun deepHash(value: Any?): Int { + return when (value) { + null -> 0 + is ByteArray -> value.contentHashCode() + is IntArray -> value.contentHashCode() + is LongArray -> value.contentHashCode() + is DoubleArray -> { + var result = 1 + for (item in value) { + result = 31 * result + doubleHash(item) + } + result + } + is FloatArray -> { + var result = 1 + for (item in value) { + result = 31 * result + floatHash(item) + } + result + } + is Array<*> -> { + var result = 1 + for (item in value) { + result = 31 * result + deepHash(item) + } + result + } + is List<*> -> { + var result = 1 + for (item in value) { + result = 31 * result + deepHash(item) + } + result + } + is Map<*, *> -> { + var result = 0 + for (entry in value) { + result += ((deepHash(entry.key) * 31) xor deepHash(entry.value)) + } + result + } + is Double -> doubleHash(value) + is Float -> floatHash(value) + else -> value.hashCode() + } + } + } /** @@ -44,13 +193,13 @@ class FlutterError ( val code: String, override val message: String? = null, val details: Any? = null -) : Throwable() +) : RuntimeException() /** * The type of operation that generated the action code from calling * [TaskState]. */ -enum class PigeonStorageTaskState(val raw: Int) { +enum class InternalStorageTaskState(val raw: Int) { /** Indicates the task has been paused by the user. */ PAUSED(0), /** Indicates the task is currently in-progress. */ @@ -63,83 +212,132 @@ enum class PigeonStorageTaskState(val raw: Int) { ERROR(4); companion object { - fun ofRaw(raw: Int): PigeonStorageTaskState? { + fun ofRaw(raw: Int): InternalStorageTaskState? { return values().firstOrNull { it.raw == raw } } } } /** Generated class from Pigeon that represents data sent in messages. */ -data class PigeonStorageFirebaseApp ( +data class InternalStorageFirebaseApp ( val appName: String, val tenantId: String? = null, val bucket: String - -) { +) + { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): PigeonStorageFirebaseApp { - val appName = list[0] as String - val tenantId = list[1] as String? - val bucket = list[2] as String - return PigeonStorageFirebaseApp(appName, tenantId, bucket) + fun fromList(pigeonVar_list: List): InternalStorageFirebaseApp { + val appName = pigeonVar_list[0] as String + val tenantId = pigeonVar_list[1] as String? + val bucket = pigeonVar_list[2] as String + return InternalStorageFirebaseApp(appName, tenantId, bucket) } } fun toList(): List { - return listOf( + return listOf( appName, tenantId, bucket, ) } + override fun equals(other: Any?): Boolean { + if (other == null || other.javaClass != javaClass) { + return false + } + if (this === other) { + return true + } + val other = other as InternalStorageFirebaseApp + return GeneratedAndroidFirebaseStoragePigeonUtils.deepEquals(this.appName, other.appName) && GeneratedAndroidFirebaseStoragePigeonUtils.deepEquals(this.tenantId, other.tenantId) && GeneratedAndroidFirebaseStoragePigeonUtils.deepEquals(this.bucket, other.bucket) + } + + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeneratedAndroidFirebaseStoragePigeonUtils.deepHash(this.appName) + result = 31 * result + GeneratedAndroidFirebaseStoragePigeonUtils.deepHash(this.tenantId) + result = 31 * result + GeneratedAndroidFirebaseStoragePigeonUtils.deepHash(this.bucket) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ -data class PigeonStorageReference ( +data class InternalStorageReference ( val bucket: String, val fullPath: String, val name: String - -) { +) + { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): PigeonStorageReference { - val bucket = list[0] as String - val fullPath = list[1] as String - val name = list[2] as String - return PigeonStorageReference(bucket, fullPath, name) + fun fromList(pigeonVar_list: List): InternalStorageReference { + val bucket = pigeonVar_list[0] as String + val fullPath = pigeonVar_list[1] as String + val name = pigeonVar_list[2] as String + return InternalStorageReference(bucket, fullPath, name) } } fun toList(): List { - return listOf( + return listOf( bucket, fullPath, name, ) } + override fun equals(other: Any?): Boolean { + if (other == null || other.javaClass != javaClass) { + return false + } + if (this === other) { + return true + } + val other = other as InternalStorageReference + return GeneratedAndroidFirebaseStoragePigeonUtils.deepEquals(this.bucket, other.bucket) && GeneratedAndroidFirebaseStoragePigeonUtils.deepEquals(this.fullPath, other.fullPath) && GeneratedAndroidFirebaseStoragePigeonUtils.deepEquals(this.name, other.name) + } + + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeneratedAndroidFirebaseStoragePigeonUtils.deepHash(this.bucket) + result = 31 * result + GeneratedAndroidFirebaseStoragePigeonUtils.deepHash(this.fullPath) + result = 31 * result + GeneratedAndroidFirebaseStoragePigeonUtils.deepHash(this.name) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ -data class PigeonFullMetaData ( +data class InternalFullMetaData ( val metadata: Map? = null - -) { +) + { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): PigeonFullMetaData { - val metadata = list[0] as Map? - return PigeonFullMetaData(metadata) + fun fromList(pigeonVar_list: List): InternalFullMetaData { + val metadata = pigeonVar_list[0] as Map? + return InternalFullMetaData(metadata) } } fun toList(): List { - return listOf( + return listOf( metadata, ) } + override fun equals(other: Any?): Boolean { + if (other == null || other.javaClass != javaClass) { + return false + } + if (this === other) { + return true + } + val other = other as InternalFullMetaData + return GeneratedAndroidFirebaseStoragePigeonUtils.deepEquals(this.metadata, other.metadata) + } + + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeneratedAndroidFirebaseStoragePigeonUtils.deepHash(this.metadata) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ -data class PigeonListOptions ( +data class InternalListOptions ( /** * If set, limits the total number of `prefixes` and `items` to return. * @@ -152,26 +350,42 @@ data class PigeonListOptions ( * If provided, listing is resumed from the previous position. */ val pageToken: String? = null - -) { +) + { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): PigeonListOptions { - val maxResults = list[0].let { if (it is Int) it.toLong() else it as Long } - val pageToken = list[1] as String? - return PigeonListOptions(maxResults, pageToken) + fun fromList(pigeonVar_list: List): InternalListOptions { + val maxResults = pigeonVar_list[0] as Long + val pageToken = pigeonVar_list[1] as String? + return InternalListOptions(maxResults, pageToken) } } fun toList(): List { - return listOf( + return listOf( maxResults, pageToken, ) } + override fun equals(other: Any?): Boolean { + if (other == null || other.javaClass != javaClass) { + return false + } + if (this === other) { + return true + } + val other = other as InternalListOptions + return GeneratedAndroidFirebaseStoragePigeonUtils.deepEquals(this.maxResults, other.maxResults) && GeneratedAndroidFirebaseStoragePigeonUtils.deepEquals(this.pageToken, other.pageToken) + } + + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeneratedAndroidFirebaseStoragePigeonUtils.deepHash(this.maxResults) + result = 31 * result + GeneratedAndroidFirebaseStoragePigeonUtils.deepHash(this.pageToken) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ -data class PigeonSettableMetadata ( +data class InternalSettableMetadata ( /** * Served as the 'Cache-Control' header on object download. * @@ -204,22 +418,21 @@ data class PigeonSettableMetadata ( val contentType: String? = null, /** Additional user-defined custom metadata. */ val customMetadata: Map? = null - -) { +) + { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): PigeonSettableMetadata { - val cacheControl = list[0] as String? - val contentDisposition = list[1] as String? - val contentEncoding = list[2] as String? - val contentLanguage = list[3] as String? - val contentType = list[4] as String? - val customMetadata = list[5] as Map? - return PigeonSettableMetadata(cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType, customMetadata) + fun fromList(pigeonVar_list: List): InternalSettableMetadata { + val cacheControl = pigeonVar_list[0] as String? + val contentDisposition = pigeonVar_list[1] as String? + val contentEncoding = pigeonVar_list[2] as String? + val contentLanguage = pigeonVar_list[3] as String? + val contentType = pigeonVar_list[4] as String? + val customMetadata = pigeonVar_list[5] as Map? + return InternalSettableMetadata(cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType, customMetadata) } } fun toList(): List { - return listOf( + return listOf( cacheControl, contentDisposition, contentEncoding, @@ -228,65 +441,157 @@ data class PigeonSettableMetadata ( customMetadata, ) } + override fun equals(other: Any?): Boolean { + if (other == null || other.javaClass != javaClass) { + return false + } + if (this === other) { + return true + } + val other = other as InternalSettableMetadata + return GeneratedAndroidFirebaseStoragePigeonUtils.deepEquals(this.cacheControl, other.cacheControl) && GeneratedAndroidFirebaseStoragePigeonUtils.deepEquals(this.contentDisposition, other.contentDisposition) && GeneratedAndroidFirebaseStoragePigeonUtils.deepEquals(this.contentEncoding, other.contentEncoding) && GeneratedAndroidFirebaseStoragePigeonUtils.deepEquals(this.contentLanguage, other.contentLanguage) && GeneratedAndroidFirebaseStoragePigeonUtils.deepEquals(this.contentType, other.contentType) && GeneratedAndroidFirebaseStoragePigeonUtils.deepEquals(this.customMetadata, other.customMetadata) + } + + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeneratedAndroidFirebaseStoragePigeonUtils.deepHash(this.cacheControl) + result = 31 * result + GeneratedAndroidFirebaseStoragePigeonUtils.deepHash(this.contentDisposition) + result = 31 * result + GeneratedAndroidFirebaseStoragePigeonUtils.deepHash(this.contentEncoding) + result = 31 * result + GeneratedAndroidFirebaseStoragePigeonUtils.deepHash(this.contentLanguage) + result = 31 * result + GeneratedAndroidFirebaseStoragePigeonUtils.deepHash(this.contentType) + result = 31 * result + GeneratedAndroidFirebaseStoragePigeonUtils.deepHash(this.customMetadata) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ -data class PigeonListResult ( - val items: List, - val pageToken: String? = null, - val prefixs: List +data class InternalStorageTaskSnapShot ( + val bytesTransferred: Long, + val metadata: InternalFullMetaData? = null, + val state: InternalStorageTaskState, + val totalBytes: Long +) + { + companion object { + fun fromList(pigeonVar_list: List): InternalStorageTaskSnapShot { + val bytesTransferred = pigeonVar_list[0] as Long + val metadata = pigeonVar_list[1] as InternalFullMetaData? + val state = pigeonVar_list[2] as InternalStorageTaskState + val totalBytes = pigeonVar_list[3] as Long + return InternalStorageTaskSnapShot(bytesTransferred, metadata, state, totalBytes) + } + } + fun toList(): List { + return listOf( + bytesTransferred, + metadata, + state, + totalBytes, + ) + } + override fun equals(other: Any?): Boolean { + if (other == null || other.javaClass != javaClass) { + return false + } + if (this === other) { + return true + } + val other = other as InternalStorageTaskSnapShot + return GeneratedAndroidFirebaseStoragePigeonUtils.deepEquals(this.bytesTransferred, other.bytesTransferred) && GeneratedAndroidFirebaseStoragePigeonUtils.deepEquals(this.metadata, other.metadata) && GeneratedAndroidFirebaseStoragePigeonUtils.deepEquals(this.state, other.state) && GeneratedAndroidFirebaseStoragePigeonUtils.deepEquals(this.totalBytes, other.totalBytes) + } + + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeneratedAndroidFirebaseStoragePigeonUtils.deepHash(this.bytesTransferred) + result = 31 * result + GeneratedAndroidFirebaseStoragePigeonUtils.deepHash(this.metadata) + result = 31 * result + GeneratedAndroidFirebaseStoragePigeonUtils.deepHash(this.state) + result = 31 * result + GeneratedAndroidFirebaseStoragePigeonUtils.deepHash(this.totalBytes) + return result + } +} -) { +/** Generated class from Pigeon that represents data sent in messages. */ +data class InternalListResult ( + val items: List, + val pageToken: String? = null, + val prefixs: List +) + { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): PigeonListResult { - val items = list[0] as List - val pageToken = list[1] as String? - val prefixs = list[2] as List - return PigeonListResult(items, pageToken, prefixs) + fun fromList(pigeonVar_list: List): InternalListResult { + val items = pigeonVar_list[0] as List + val pageToken = pigeonVar_list[1] as String? + val prefixs = pigeonVar_list[2] as List + return InternalListResult(items, pageToken, prefixs) } } fun toList(): List { - return listOf( + return listOf( items, pageToken, prefixs, ) } -} + override fun equals(other: Any?): Boolean { + if (other == null || other.javaClass != javaClass) { + return false + } + if (this === other) { + return true + } + val other = other as InternalListResult + return GeneratedAndroidFirebaseStoragePigeonUtils.deepEquals(this.items, other.items) && GeneratedAndroidFirebaseStoragePigeonUtils.deepEquals(this.pageToken, other.pageToken) && GeneratedAndroidFirebaseStoragePigeonUtils.deepEquals(this.prefixs, other.prefixs) + } -@Suppress("UNCHECKED_CAST") -private object FirebaseStorageHostApiCodec : StandardMessageCodec() { + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeneratedAndroidFirebaseStoragePigeonUtils.deepHash(this.items) + result = 31 * result + GeneratedAndroidFirebaseStoragePigeonUtils.deepHash(this.pageToken) + result = 31 * result + GeneratedAndroidFirebaseStoragePigeonUtils.deepHash(this.prefixs) + return result + } +} +private open class GeneratedAndroidFirebaseStoragePigeonCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { - 128.toByte() -> { - return (readValue(buffer) as? List)?.let { - PigeonFullMetaData.fromList(it) - } - } 129.toByte() -> { - return (readValue(buffer) as? List)?.let { - PigeonListOptions.fromList(it) + return (readValue(buffer) as Long?)?.let { + InternalStorageTaskState.ofRaw(it.toInt()) } } 130.toByte() -> { return (readValue(buffer) as? List)?.let { - PigeonListResult.fromList(it) + InternalStorageFirebaseApp.fromList(it) } } 131.toByte() -> { return (readValue(buffer) as? List)?.let { - PigeonSettableMetadata.fromList(it) + InternalStorageReference.fromList(it) } } 132.toByte() -> { return (readValue(buffer) as? List)?.let { - PigeonStorageFirebaseApp.fromList(it) + InternalFullMetaData.fromList(it) } } 133.toByte() -> { return (readValue(buffer) as? List)?.let { - PigeonStorageReference.fromList(it) + InternalListOptions.fromList(it) + } + } + 134.toByte() -> { + return (readValue(buffer) as? List)?.let { + InternalSettableMetadata.fromList(it) + } + } + 135.toByte() -> { + return (readValue(buffer) as? List)?.let { + InternalStorageTaskSnapShot.fromList(it) + } + } + 136.toByte() -> { + return (readValue(buffer) as? List)?.let { + InternalListResult.fromList(it) } } else -> super.readValueOfType(type, buffer) @@ -294,80 +599,90 @@ private object FirebaseStorageHostApiCodec : StandardMessageCodec() { } override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { when (value) { - is PigeonFullMetaData -> { - stream.write(128) - writeValue(stream, value.toList()) - } - is PigeonListOptions -> { + is InternalStorageTaskState -> { stream.write(129) - writeValue(stream, value.toList()) + writeValue(stream, value.raw.toLong()) } - is PigeonListResult -> { + is InternalStorageFirebaseApp -> { stream.write(130) writeValue(stream, value.toList()) } - is PigeonSettableMetadata -> { + is InternalStorageReference -> { stream.write(131) writeValue(stream, value.toList()) } - is PigeonStorageFirebaseApp -> { + is InternalFullMetaData -> { stream.write(132) writeValue(stream, value.toList()) } - is PigeonStorageReference -> { + is InternalListOptions -> { stream.write(133) writeValue(stream, value.toList()) } + is InternalSettableMetadata -> { + stream.write(134) + writeValue(stream, value.toList()) + } + is InternalStorageTaskSnapShot -> { + stream.write(135) + writeValue(stream, value.toList()) + } + is InternalListResult -> { + stream.write(136) + writeValue(stream, value.toList()) + } else -> super.writeValue(stream, value) } } } + /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ interface FirebaseStorageHostApi { - fun getReferencebyPath(app: PigeonStorageFirebaseApp, path: String, bucket: String?, callback: (Result) -> Unit) - fun setMaxOperationRetryTime(app: PigeonStorageFirebaseApp, time: Long, callback: (Result) -> Unit) - fun setMaxUploadRetryTime(app: PigeonStorageFirebaseApp, time: Long, callback: (Result) -> Unit) - fun setMaxDownloadRetryTime(app: PigeonStorageFirebaseApp, time: Long, callback: (Result) -> Unit) - fun useStorageEmulator(app: PigeonStorageFirebaseApp, host: String, port: Long, callback: (Result) -> Unit) - fun referenceDelete(app: PigeonStorageFirebaseApp, reference: PigeonStorageReference, callback: (Result) -> Unit) - fun referenceGetDownloadURL(app: PigeonStorageFirebaseApp, reference: PigeonStorageReference, callback: (Result) -> Unit) - fun referenceGetMetaData(app: PigeonStorageFirebaseApp, reference: PigeonStorageReference, callback: (Result) -> Unit) - fun referenceList(app: PigeonStorageFirebaseApp, reference: PigeonStorageReference, options: PigeonListOptions, callback: (Result) -> Unit) - fun referenceListAll(app: PigeonStorageFirebaseApp, reference: PigeonStorageReference, callback: (Result) -> Unit) - fun referenceGetData(app: PigeonStorageFirebaseApp, reference: PigeonStorageReference, maxSize: Long, callback: (Result) -> Unit) - fun referencePutData(app: PigeonStorageFirebaseApp, reference: PigeonStorageReference, data: ByteArray, settableMetaData: PigeonSettableMetadata, handle: Long, callback: (Result) -> Unit) - fun referencePutString(app: PigeonStorageFirebaseApp, reference: PigeonStorageReference, data: String, format: Long, settableMetaData: PigeonSettableMetadata, handle: Long, callback: (Result) -> Unit) - fun referencePutFile(app: PigeonStorageFirebaseApp, reference: PigeonStorageReference, filePath: String, settableMetaData: PigeonSettableMetadata?, handle: Long, callback: (Result) -> Unit) - fun referenceDownloadFile(app: PigeonStorageFirebaseApp, reference: PigeonStorageReference, filePath: String, handle: Long, callback: (Result) -> Unit) - fun referenceUpdateMetadata(app: PigeonStorageFirebaseApp, reference: PigeonStorageReference, metadata: PigeonSettableMetadata, callback: (Result) -> Unit) - fun taskPause(app: PigeonStorageFirebaseApp, handle: Long, callback: (Result>) -> Unit) - fun taskResume(app: PigeonStorageFirebaseApp, handle: Long, callback: (Result>) -> Unit) - fun taskCancel(app: PigeonStorageFirebaseApp, handle: Long, callback: (Result>) -> Unit) + fun getReferencebyPath(app: InternalStorageFirebaseApp, path: String, bucket: String?, callback: (Result) -> Unit) + fun setMaxOperationRetryTime(app: InternalStorageFirebaseApp, time: Long, callback: (Result) -> Unit) + fun setMaxUploadRetryTime(app: InternalStorageFirebaseApp, time: Long, callback: (Result) -> Unit) + fun setMaxDownloadRetryTime(app: InternalStorageFirebaseApp, time: Long, callback: (Result) -> Unit) + fun useStorageEmulator(app: InternalStorageFirebaseApp, host: String, port: Long, callback: (Result) -> Unit) + fun referenceDelete(app: InternalStorageFirebaseApp, reference: InternalStorageReference, callback: (Result) -> Unit) + fun referenceGetDownloadURL(app: InternalStorageFirebaseApp, reference: InternalStorageReference, callback: (Result) -> Unit) + fun referenceGetMetaData(app: InternalStorageFirebaseApp, reference: InternalStorageReference, callback: (Result) -> Unit) + fun referenceList(app: InternalStorageFirebaseApp, reference: InternalStorageReference, options: InternalListOptions, callback: (Result) -> Unit) + fun referenceListAll(app: InternalStorageFirebaseApp, reference: InternalStorageReference, callback: (Result) -> Unit) + fun referenceGetData(app: InternalStorageFirebaseApp, reference: InternalStorageReference, maxSize: Long, callback: (Result) -> Unit) + fun referencePutData(app: InternalStorageFirebaseApp, reference: InternalStorageReference, data: ByteArray, settableMetaData: InternalSettableMetadata, handle: Long, callback: (Result) -> Unit) + fun referencePutString(app: InternalStorageFirebaseApp, reference: InternalStorageReference, data: String, format: Long, settableMetaData: InternalSettableMetadata, handle: Long, callback: (Result) -> Unit) + fun referencePutFile(app: InternalStorageFirebaseApp, reference: InternalStorageReference, filePath: String, settableMetaData: InternalSettableMetadata?, handle: Long, callback: (Result) -> Unit) + fun referenceDownloadFile(app: InternalStorageFirebaseApp, reference: InternalStorageReference, filePath: String, handle: Long, callback: (Result) -> Unit) + fun referenceUpdateMetadata(app: InternalStorageFirebaseApp, reference: InternalStorageReference, metadata: InternalSettableMetadata, callback: (Result) -> Unit) + fun taskPause(app: InternalStorageFirebaseApp, handle: Long, callback: (Result>) -> Unit) + fun taskResume(app: InternalStorageFirebaseApp, handle: Long, callback: (Result>) -> Unit) + fun taskCancel(app: InternalStorageFirebaseApp, handle: Long, callback: (Result>) -> Unit) companion object { /** The codec used by FirebaseStorageHostApi. */ val codec: MessageCodec by lazy { - FirebaseStorageHostApiCodec + GeneratedAndroidFirebaseStoragePigeonCodec() } /** Sets up an instance of `FirebaseStorageHostApi` to handle messages through the `binaryMessenger`. */ - @Suppress("UNCHECKED_CAST") - fun setUp(binaryMessenger: BinaryMessenger, api: FirebaseStorageHostApi?) { + @JvmOverloads + fun setUp(binaryMessenger: BinaryMessenger, api: FirebaseStorageHostApi?, messageChannelSuffix: String = "") { + val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.getReferencebyPath", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.getReferencebyPath$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val appArg = args[0] as PigeonStorageFirebaseApp + val appArg = args[0] as InternalStorageFirebaseApp val pathArg = args[1] as String val bucketArg = args[2] as String? - api.getReferencebyPath(appArg, pathArg, bucketArg) { result: Result -> + api.getReferencebyPath(appArg, pathArg, bucketArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { - reply.reply(wrapError(error)) + reply.reply(GeneratedAndroidFirebaseStoragePigeonUtils.wrapError(error)) } else { val data = result.getOrNull() - reply.reply(wrapResult(data)) + reply.reply(GeneratedAndroidFirebaseStoragePigeonUtils.wrapResult(data)) } } } @@ -376,18 +691,18 @@ interface FirebaseStorageHostApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.setMaxOperationRetryTime", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.setMaxOperationRetryTime$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val appArg = args[0] as PigeonStorageFirebaseApp - val timeArg = args[1].let { if (it is Int) it.toLong() else it as Long } + val appArg = args[0] as InternalStorageFirebaseApp + val timeArg = args[1] as Long api.setMaxOperationRetryTime(appArg, timeArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { - reply.reply(wrapError(error)) + reply.reply(GeneratedAndroidFirebaseStoragePigeonUtils.wrapError(error)) } else { - reply.reply(wrapResult(null)) + reply.reply(GeneratedAndroidFirebaseStoragePigeonUtils.wrapResult(null)) } } } @@ -396,18 +711,18 @@ interface FirebaseStorageHostApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.setMaxUploadRetryTime", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.setMaxUploadRetryTime$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val appArg = args[0] as PigeonStorageFirebaseApp - val timeArg = args[1].let { if (it is Int) it.toLong() else it as Long } + val appArg = args[0] as InternalStorageFirebaseApp + val timeArg = args[1] as Long api.setMaxUploadRetryTime(appArg, timeArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { - reply.reply(wrapError(error)) + reply.reply(GeneratedAndroidFirebaseStoragePigeonUtils.wrapError(error)) } else { - reply.reply(wrapResult(null)) + reply.reply(GeneratedAndroidFirebaseStoragePigeonUtils.wrapResult(null)) } } } @@ -416,18 +731,18 @@ interface FirebaseStorageHostApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.setMaxDownloadRetryTime", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.setMaxDownloadRetryTime$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val appArg = args[0] as PigeonStorageFirebaseApp - val timeArg = args[1].let { if (it is Int) it.toLong() else it as Long } + val appArg = args[0] as InternalStorageFirebaseApp + val timeArg = args[1] as Long api.setMaxDownloadRetryTime(appArg, timeArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { - reply.reply(wrapError(error)) + reply.reply(GeneratedAndroidFirebaseStoragePigeonUtils.wrapError(error)) } else { - reply.reply(wrapResult(null)) + reply.reply(GeneratedAndroidFirebaseStoragePigeonUtils.wrapResult(null)) } } } @@ -436,19 +751,19 @@ interface FirebaseStorageHostApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.useStorageEmulator", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.useStorageEmulator$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val appArg = args[0] as PigeonStorageFirebaseApp + val appArg = args[0] as InternalStorageFirebaseApp val hostArg = args[1] as String - val portArg = args[2].let { if (it is Int) it.toLong() else it as Long } + val portArg = args[2] as Long api.useStorageEmulator(appArg, hostArg, portArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { - reply.reply(wrapError(error)) + reply.reply(GeneratedAndroidFirebaseStoragePigeonUtils.wrapError(error)) } else { - reply.reply(wrapResult(null)) + reply.reply(GeneratedAndroidFirebaseStoragePigeonUtils.wrapResult(null)) } } } @@ -457,18 +772,18 @@ interface FirebaseStorageHostApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceDelete", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceDelete$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val appArg = args[0] as PigeonStorageFirebaseApp - val referenceArg = args[1] as PigeonStorageReference + val appArg = args[0] as InternalStorageFirebaseApp + val referenceArg = args[1] as InternalStorageReference api.referenceDelete(appArg, referenceArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { - reply.reply(wrapError(error)) + reply.reply(GeneratedAndroidFirebaseStoragePigeonUtils.wrapError(error)) } else { - reply.reply(wrapResult(null)) + reply.reply(GeneratedAndroidFirebaseStoragePigeonUtils.wrapResult(null)) } } } @@ -477,19 +792,19 @@ interface FirebaseStorageHostApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceGetDownloadURL", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceGetDownloadURL$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val appArg = args[0] as PigeonStorageFirebaseApp - val referenceArg = args[1] as PigeonStorageReference + val appArg = args[0] as InternalStorageFirebaseApp + val referenceArg = args[1] as InternalStorageReference api.referenceGetDownloadURL(appArg, referenceArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { - reply.reply(wrapError(error)) + reply.reply(GeneratedAndroidFirebaseStoragePigeonUtils.wrapError(error)) } else { val data = result.getOrNull() - reply.reply(wrapResult(data)) + reply.reply(GeneratedAndroidFirebaseStoragePigeonUtils.wrapResult(data)) } } } @@ -498,19 +813,19 @@ interface FirebaseStorageHostApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceGetMetaData", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceGetMetaData$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val appArg = args[0] as PigeonStorageFirebaseApp - val referenceArg = args[1] as PigeonStorageReference - api.referenceGetMetaData(appArg, referenceArg) { result: Result -> + val appArg = args[0] as InternalStorageFirebaseApp + val referenceArg = args[1] as InternalStorageReference + api.referenceGetMetaData(appArg, referenceArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { - reply.reply(wrapError(error)) + reply.reply(GeneratedAndroidFirebaseStoragePigeonUtils.wrapError(error)) } else { val data = result.getOrNull() - reply.reply(wrapResult(data)) + reply.reply(GeneratedAndroidFirebaseStoragePigeonUtils.wrapResult(data)) } } } @@ -519,20 +834,20 @@ interface FirebaseStorageHostApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceList", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceList$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val appArg = args[0] as PigeonStorageFirebaseApp - val referenceArg = args[1] as PigeonStorageReference - val optionsArg = args[2] as PigeonListOptions - api.referenceList(appArg, referenceArg, optionsArg) { result: Result -> + val appArg = args[0] as InternalStorageFirebaseApp + val referenceArg = args[1] as InternalStorageReference + val optionsArg = args[2] as InternalListOptions + api.referenceList(appArg, referenceArg, optionsArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { - reply.reply(wrapError(error)) + reply.reply(GeneratedAndroidFirebaseStoragePigeonUtils.wrapError(error)) } else { val data = result.getOrNull() - reply.reply(wrapResult(data)) + reply.reply(GeneratedAndroidFirebaseStoragePigeonUtils.wrapResult(data)) } } } @@ -541,19 +856,19 @@ interface FirebaseStorageHostApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceListAll", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceListAll$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val appArg = args[0] as PigeonStorageFirebaseApp - val referenceArg = args[1] as PigeonStorageReference - api.referenceListAll(appArg, referenceArg) { result: Result -> + val appArg = args[0] as InternalStorageFirebaseApp + val referenceArg = args[1] as InternalStorageReference + api.referenceListAll(appArg, referenceArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { - reply.reply(wrapError(error)) + reply.reply(GeneratedAndroidFirebaseStoragePigeonUtils.wrapError(error)) } else { val data = result.getOrNull() - reply.reply(wrapResult(data)) + reply.reply(GeneratedAndroidFirebaseStoragePigeonUtils.wrapResult(data)) } } } @@ -562,20 +877,20 @@ interface FirebaseStorageHostApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceGetData", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceGetData$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val appArg = args[0] as PigeonStorageFirebaseApp - val referenceArg = args[1] as PigeonStorageReference - val maxSizeArg = args[2].let { if (it is Int) it.toLong() else it as Long } + val appArg = args[0] as InternalStorageFirebaseApp + val referenceArg = args[1] as InternalStorageReference + val maxSizeArg = args[2] as Long api.referenceGetData(appArg, referenceArg, maxSizeArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { - reply.reply(wrapError(error)) + reply.reply(GeneratedAndroidFirebaseStoragePigeonUtils.wrapError(error)) } else { val data = result.getOrNull() - reply.reply(wrapResult(data)) + reply.reply(GeneratedAndroidFirebaseStoragePigeonUtils.wrapResult(data)) } } } @@ -584,22 +899,22 @@ interface FirebaseStorageHostApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referencePutData", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referencePutData$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val appArg = args[0] as PigeonStorageFirebaseApp - val referenceArg = args[1] as PigeonStorageReference + val appArg = args[0] as InternalStorageFirebaseApp + val referenceArg = args[1] as InternalStorageReference val dataArg = args[2] as ByteArray - val settableMetaDataArg = args[3] as PigeonSettableMetadata - val handleArg = args[4].let { if (it is Int) it.toLong() else it as Long } + val settableMetaDataArg = args[3] as InternalSettableMetadata + val handleArg = args[4] as Long api.referencePutData(appArg, referenceArg, dataArg, settableMetaDataArg, handleArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { - reply.reply(wrapError(error)) + reply.reply(GeneratedAndroidFirebaseStoragePigeonUtils.wrapError(error)) } else { val data = result.getOrNull() - reply.reply(wrapResult(data)) + reply.reply(GeneratedAndroidFirebaseStoragePigeonUtils.wrapResult(data)) } } } @@ -608,23 +923,23 @@ interface FirebaseStorageHostApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referencePutString", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referencePutString$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val appArg = args[0] as PigeonStorageFirebaseApp - val referenceArg = args[1] as PigeonStorageReference + val appArg = args[0] as InternalStorageFirebaseApp + val referenceArg = args[1] as InternalStorageReference val dataArg = args[2] as String - val formatArg = args[3].let { if (it is Int) it.toLong() else it as Long } - val settableMetaDataArg = args[4] as PigeonSettableMetadata - val handleArg = args[5].let { if (it is Int) it.toLong() else it as Long } + val formatArg = args[3] as Long + val settableMetaDataArg = args[4] as InternalSettableMetadata + val handleArg = args[5] as Long api.referencePutString(appArg, referenceArg, dataArg, formatArg, settableMetaDataArg, handleArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { - reply.reply(wrapError(error)) + reply.reply(GeneratedAndroidFirebaseStoragePigeonUtils.wrapError(error)) } else { val data = result.getOrNull() - reply.reply(wrapResult(data)) + reply.reply(GeneratedAndroidFirebaseStoragePigeonUtils.wrapResult(data)) } } } @@ -633,22 +948,22 @@ interface FirebaseStorageHostApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referencePutFile", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referencePutFile$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val appArg = args[0] as PigeonStorageFirebaseApp - val referenceArg = args[1] as PigeonStorageReference + val appArg = args[0] as InternalStorageFirebaseApp + val referenceArg = args[1] as InternalStorageReference val filePathArg = args[2] as String - val settableMetaDataArg = args[3] as PigeonSettableMetadata? - val handleArg = args[4].let { if (it is Int) it.toLong() else it as Long } + val settableMetaDataArg = args[3] as InternalSettableMetadata? + val handleArg = args[4] as Long api.referencePutFile(appArg, referenceArg, filePathArg, settableMetaDataArg, handleArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { - reply.reply(wrapError(error)) + reply.reply(GeneratedAndroidFirebaseStoragePigeonUtils.wrapError(error)) } else { val data = result.getOrNull() - reply.reply(wrapResult(data)) + reply.reply(GeneratedAndroidFirebaseStoragePigeonUtils.wrapResult(data)) } } } @@ -657,21 +972,21 @@ interface FirebaseStorageHostApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceDownloadFile", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceDownloadFile$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val appArg = args[0] as PigeonStorageFirebaseApp - val referenceArg = args[1] as PigeonStorageReference + val appArg = args[0] as InternalStorageFirebaseApp + val referenceArg = args[1] as InternalStorageReference val filePathArg = args[2] as String - val handleArg = args[3].let { if (it is Int) it.toLong() else it as Long } + val handleArg = args[3] as Long api.referenceDownloadFile(appArg, referenceArg, filePathArg, handleArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { - reply.reply(wrapError(error)) + reply.reply(GeneratedAndroidFirebaseStoragePigeonUtils.wrapError(error)) } else { val data = result.getOrNull() - reply.reply(wrapResult(data)) + reply.reply(GeneratedAndroidFirebaseStoragePigeonUtils.wrapResult(data)) } } } @@ -680,20 +995,20 @@ interface FirebaseStorageHostApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceUpdateMetadata", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceUpdateMetadata$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val appArg = args[0] as PigeonStorageFirebaseApp - val referenceArg = args[1] as PigeonStorageReference - val metadataArg = args[2] as PigeonSettableMetadata - api.referenceUpdateMetadata(appArg, referenceArg, metadataArg) { result: Result -> + val appArg = args[0] as InternalStorageFirebaseApp + val referenceArg = args[1] as InternalStorageReference + val metadataArg = args[2] as InternalSettableMetadata + api.referenceUpdateMetadata(appArg, referenceArg, metadataArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { - reply.reply(wrapError(error)) + reply.reply(GeneratedAndroidFirebaseStoragePigeonUtils.wrapError(error)) } else { val data = result.getOrNull() - reply.reply(wrapResult(data)) + reply.reply(GeneratedAndroidFirebaseStoragePigeonUtils.wrapResult(data)) } } } @@ -702,19 +1017,19 @@ interface FirebaseStorageHostApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.taskPause", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.taskPause$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val appArg = args[0] as PigeonStorageFirebaseApp - val handleArg = args[1].let { if (it is Int) it.toLong() else it as Long } + val appArg = args[0] as InternalStorageFirebaseApp + val handleArg = args[1] as Long api.taskPause(appArg, handleArg) { result: Result> -> val error = result.exceptionOrNull() if (error != null) { - reply.reply(wrapError(error)) + reply.reply(GeneratedAndroidFirebaseStoragePigeonUtils.wrapError(error)) } else { val data = result.getOrNull() - reply.reply(wrapResult(data)) + reply.reply(GeneratedAndroidFirebaseStoragePigeonUtils.wrapResult(data)) } } } @@ -723,19 +1038,19 @@ interface FirebaseStorageHostApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.taskResume", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.taskResume$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val appArg = args[0] as PigeonStorageFirebaseApp - val handleArg = args[1].let { if (it is Int) it.toLong() else it as Long } + val appArg = args[0] as InternalStorageFirebaseApp + val handleArg = args[1] as Long api.taskResume(appArg, handleArg) { result: Result> -> val error = result.exceptionOrNull() if (error != null) { - reply.reply(wrapError(error)) + reply.reply(GeneratedAndroidFirebaseStoragePigeonUtils.wrapError(error)) } else { val data = result.getOrNull() - reply.reply(wrapResult(data)) + reply.reply(GeneratedAndroidFirebaseStoragePigeonUtils.wrapResult(data)) } } } @@ -744,19 +1059,19 @@ interface FirebaseStorageHostApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.taskCancel", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.taskCancel$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val appArg = args[0] as PigeonStorageFirebaseApp - val handleArg = args[1].let { if (it is Int) it.toLong() else it as Long } + val appArg = args[0] as InternalStorageFirebaseApp + val handleArg = args[1] as Long api.taskCancel(appArg, handleArg) { result: Result> -> val error = result.exceptionOrNull() if (error != null) { - reply.reply(wrapError(error)) + reply.reply(GeneratedAndroidFirebaseStoragePigeonUtils.wrapError(error)) } else { val data = result.getOrNull() - reply.reply(wrapResult(data)) + reply.reply(GeneratedAndroidFirebaseStoragePigeonUtils.wrapResult(data)) } } } diff --git a/packages/firebase_storage/firebase_storage/android/src/main/kotlin/io/flutter/plugins/firebase/storage/TaskStateChannelStreamHandler.kt b/packages/firebase_storage/firebase_storage/android/src/main/kotlin/io/flutter/plugins/firebase/storage/TaskStateChannelStreamHandler.kt index 06cc7eddaadb..5efa6415dae7 100644 --- a/packages/firebase_storage/firebase_storage/android/src/main/kotlin/io/flutter/plugins/firebase/storage/TaskStateChannelStreamHandler.kt +++ b/packages/firebase_storage/firebase_storage/android/src/main/kotlin/io/flutter/plugins/firebase/storage/TaskStateChannelStreamHandler.kt @@ -31,7 +31,7 @@ internal class TaskStateChannelStreamHandler( androidTask.addOnProgressListener { taskSnapshot -> if (flutterTask.isDestroyed()) return@addOnProgressListener val event = getTaskEventMap(taskSnapshot, null) - event[TASK_STATE_NAME] = PigeonStorageTaskState.RUNNING.raw + event[TASK_STATE_NAME] = InternalStorageTaskState.RUNNING.raw events.success(event) flutterTask.notifyResumeObjects() } @@ -39,7 +39,7 @@ internal class TaskStateChannelStreamHandler( androidTask.addOnPausedListener { taskSnapshot -> if (flutterTask.isDestroyed()) return@addOnPausedListener val event = getTaskEventMap(taskSnapshot, null) - event[TASK_STATE_NAME] = PigeonStorageTaskState.PAUSED.raw + event[TASK_STATE_NAME] = InternalStorageTaskState.PAUSED.raw events.success(event) flutterTask.notifyPauseObjects() } @@ -47,7 +47,7 @@ internal class TaskStateChannelStreamHandler( androidTask.addOnSuccessListener { taskSnapshot -> if (flutterTask.isDestroyed()) return@addOnSuccessListener val event = getTaskEventMap(taskSnapshot, null) - event[TASK_STATE_NAME] = PigeonStorageTaskState.SUCCESS.raw + event[TASK_STATE_NAME] = InternalStorageTaskState.SUCCESS.raw events.success(event) flutterTask.destroy() } @@ -55,7 +55,7 @@ internal class TaskStateChannelStreamHandler( androidTask.addOnCanceledListener { if (flutterTask.isDestroyed()) return@addOnCanceledListener val event = getTaskEventMap(null, null) - event[TASK_STATE_NAME] = PigeonStorageTaskState.ERROR.raw + event[TASK_STATE_NAME] = InternalStorageTaskState.ERROR.raw val syntheticException: MutableMap = HashMap() syntheticException["code"] = FlutterFirebaseStorageException.getCode(StorageException.ERROR_CANCELED) syntheticException["message"] = FlutterFirebaseStorageException.getMessage(StorageException.ERROR_CANCELED) @@ -68,7 +68,7 @@ internal class TaskStateChannelStreamHandler( androidTask.addOnFailureListener { exception -> if (flutterTask.isDestroyed()) return@addOnFailureListener val event = getTaskEventMap(null, exception) - event[TASK_STATE_NAME] = PigeonStorageTaskState.ERROR.raw + event[TASK_STATE_NAME] = InternalStorageTaskState.ERROR.raw events.success(event) flutterTask.destroy() } diff --git a/packages/firebase_storage/firebase_storage/example/android/app/build.gradle b/packages/firebase_storage/firebase_storage/example/android/app/build.gradle index 45de20db120a..e85ee381169d 100644 --- a/packages/firebase_storage/firebase_storage/example/android/app/build.gradle +++ b/packages/firebase_storage/firebase_storage/example/android/app/build.gradle @@ -45,7 +45,7 @@ android { applicationId = "io.flutter.plugins.firebasestorageexample" // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. - minSdk = 23 + minSdkVersion = flutter.minSdkVersion targetSdk = flutter.targetSdkVersion versionCode = flutterVersionCode.toInteger() versionName = flutterVersionName diff --git a/packages/firebase_storage/firebase_storage/example/ios/Flutter/AppFrameworkInfo.plist b/packages/firebase_storage/firebase_storage/example/ios/Flutter/AppFrameworkInfo.plist index b3aaa733dfbb..6fe4034356ac 100755 --- a/packages/firebase_storage/firebase_storage/example/ios/Flutter/AppFrameworkInfo.plist +++ b/packages/firebase_storage/firebase_storage/example/ios/Flutter/AppFrameworkInfo.plist @@ -24,7 +24,5 @@ arm64 - MinimumOSVersion - 12.0 diff --git a/packages/firebase_storage/firebase_storage/example/ios/Runner.xcodeproj/project.pbxproj b/packages/firebase_storage/firebase_storage/example/ios/Runner.xcodeproj/project.pbxproj index 25c8e390af78..3fffed27f781 100644 --- a/packages/firebase_storage/firebase_storage/example/ios/Runner.xcodeproj/project.pbxproj +++ b/packages/firebase_storage/firebase_storage/example/ios/Runner.xcodeproj/project.pbxproj @@ -39,6 +39,7 @@ 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 5C6F5A6F1EC3CCCC008D64B5 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 5C6F5A701EC3CCCC008D64B5 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = ""; }; 7A1ECC901E8EDB6900309407 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; @@ -72,6 +73,7 @@ 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */, 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 9740EEB21CF90195004384FC /* Debug.xcconfig */, 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, @@ -248,26 +250,10 @@ ); inputPaths = ( "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/FirebaseAppCheckInterop/FirebaseAppCheckInterop.framework", - "${BUILT_PRODUCTS_DIR}/FirebaseAuthInterop/FirebaseAuthInterop.framework", - "${BUILT_PRODUCTS_DIR}/FirebaseCore/FirebaseCore.framework", - "${BUILT_PRODUCTS_DIR}/FirebaseCoreExtension/FirebaseCoreExtension.framework", - "${BUILT_PRODUCTS_DIR}/FirebaseCoreInternal/FirebaseCoreInternal.framework", - "${BUILT_PRODUCTS_DIR}/FirebaseStorage/FirebaseStorage.framework", - "${BUILT_PRODUCTS_DIR}/GTMSessionFetcher/GTMSessionFetcher.framework", - "${BUILT_PRODUCTS_DIR}/GoogleUtilities/GoogleUtilities.framework", "${BUILT_PRODUCTS_DIR}/image_picker_ios/image_picker_ios.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseAppCheckInterop.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseAuthInterop.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCore.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCoreExtension.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCoreInternal.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseStorage.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GTMSessionFetcher.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleUtilities.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/image_picker_ios.framework", ); runOnlyForDeploymentPostprocessing = 0; diff --git a/packages/firebase_storage/firebase_storage/example/macos/Podfile b/packages/firebase_storage/firebase_storage/example/macos/Podfile index b4134e5ac6ca..c60870efea08 100644 --- a/packages/firebase_storage/firebase_storage/example/macos/Podfile +++ b/packages/firebase_storage/firebase_storage/example/macos/Podfile @@ -1,4 +1,4 @@ -platform :osx, '10.14' +platform :osx, '10.15' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/packages/firebase_storage/firebase_storage/example/macos/Runner.xcodeproj/project.pbxproj b/packages/firebase_storage/firebase_storage/example/macos/Runner.xcodeproj/project.pbxproj index e688261c0c0b..75f513426b4b 100644 --- a/packages/firebase_storage/firebase_storage/example/macos/Runner.xcodeproj/project.pbxproj +++ b/packages/firebase_storage/firebase_storage/example/macos/Runner.xcodeproj/project.pbxproj @@ -70,6 +70,7 @@ 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; 623F4E175EF0069D1AA8A1AE /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; B567FAAE240D1F2E0031F210 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; @@ -135,6 +136,7 @@ 33CEB47122A05771004F2AC0 /* Flutter */ = { isa = PBXGroup; children = ( + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */, 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */, 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */, 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */, @@ -188,6 +190,7 @@ 33CC10EB2044A3C60003C045 /* Resources */, 33CC110E2044A8840003C045 /* Bundle Framework */, 3399D490228B24CF009A79C7 /* ShellScript */, + 0E2E82C8DA2AA4C782E46D76 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -264,6 +267,24 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + 0E2E82C8DA2AA4C782E46D76 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/file_selector_macos/file_selector_macos.framework", + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/file_selector_macos.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; 3399D490228B24CF009A79C7 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; diff --git a/packages/firebase_storage/firebase_storage/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/firebase_storage/firebase_storage/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 8de585b49f18..126b4eb8ea7d 100644 --- a/packages/firebase_storage/firebase_storage/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/packages/firebase_storage/firebase_storage/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -78,6 +78,7 @@ ignoresPersistentStateOnLaunch = "NO" debugDocumentVersioning = "YES" debugServiceExtension = "internal" + enableGPUValidationMode = "1" allowLocationSimulation = "YES"> diff --git a/packages/firebase_storage/firebase_storage/ios/firebase_storage/Sources/firebase_storage/FLTFirebaseStoragePlugin.swift b/packages/firebase_storage/firebase_storage/ios/firebase_storage/Sources/firebase_storage/FLTFirebaseStoragePlugin.swift index bd35fb32d196..9b7693378a7a 100644 --- a/packages/firebase_storage/firebase_storage/ios/firebase_storage/Sources/firebase_storage/FLTFirebaseStoragePlugin.swift +++ b/packages/firebase_storage/firebase_storage/ios/firebase_storage/Sources/firebase_storage/FLTFirebaseStoragePlugin.swift @@ -57,50 +57,50 @@ public final class FLTFirebaseStoragePlugin: NSObject, FlutterPlugin, FirebaseSt result(FlutterMethodNotImplemented) } - private func storage(app: PigeonStorageFirebaseApp) -> Storage { + private func storage(app: InternalStorageFirebaseApp) -> Storage { let base = "gs://" + app.bucket let firApp = FLTFirebasePlugin.firebaseAppNamed(app.appName)! return Storage.storage(app: firApp, url: base) } - private func ref(app: PigeonStorageFirebaseApp, - reference: PigeonStorageReference) -> StorageReference { + private func ref(app: InternalStorageFirebaseApp, + reference: InternalStorageReference) -> StorageReference { storage(app: app).reference(withPath: reference.fullPath) } - private func toPigeon(_ ref: StorageReference) -> PigeonStorageReference { - PigeonStorageReference(bucket: ref.bucket, fullPath: ref.fullPath, name: ref.name) + private func toPigeon(_ ref: StorageReference) -> InternalStorageReference { + InternalStorageReference(bucket: ref.bucket, fullPath: ref.fullPath, name: ref.name) } - func getReferencebyPath(app: PigeonStorageFirebaseApp, path: String, bucket: String?, - completion: @escaping (Result) -> Void) { + func getReferencebyPath(app: InternalStorageFirebaseApp, path: String, bucket: String?, + completion: @escaping (Result) -> Void) { let r = storage(app: app).reference(withPath: path) - completion(.success(PigeonStorageReference( + completion(.success(InternalStorageReference( bucket: r.bucket, fullPath: r.fullPath, name: r.name ))) } - func setMaxOperationRetryTime(app: PigeonStorageFirebaseApp, time: Int64, + func setMaxOperationRetryTime(app: InternalStorageFirebaseApp, time: Int64, completion: @escaping (Result) -> Void) { storage(app: app).maxOperationRetryTime = TimeInterval(Double(time) / 1000.0) completion(.success(())) } - func setMaxUploadRetryTime(app: PigeonStorageFirebaseApp, time: Int64, + func setMaxUploadRetryTime(app: InternalStorageFirebaseApp, time: Int64, completion: @escaping (Result) -> Void) { storage(app: app).maxUploadRetryTime = TimeInterval(Double(time) / 1000.0) completion(.success(())) } - func setMaxDownloadRetryTime(app: PigeonStorageFirebaseApp, time: Int64, + func setMaxDownloadRetryTime(app: InternalStorageFirebaseApp, time: Int64, completion: @escaping (Result) -> Void) { storage(app: app).maxDownloadRetryTime = TimeInterval(Double(time) / 1000.0) completion(.success(())) } - func useStorageEmulator(app: PigeonStorageFirebaseApp, host: String, port: Int64, + func useStorageEmulator(app: InternalStorageFirebaseApp, host: String, port: Int64, completion: @escaping (Result) -> Void) { guard emulatorBooted[app.bucket] == nil else { completion(.success(())) @@ -112,7 +112,7 @@ public final class FLTFirebaseStoragePlugin: NSObject, FlutterPlugin, FirebaseSt completion(.success(())) } - func referenceDelete(app: PigeonStorageFirebaseApp, reference: PigeonStorageReference, + func referenceDelete(app: InternalStorageFirebaseApp, reference: InternalStorageReference, completion: @escaping (Result) -> Void) { ref(app: app, reference: reference).delete { error in if let e = error { completion(.failure(self.toFlutterError(e))) } @@ -120,7 +120,7 @@ public final class FLTFirebaseStoragePlugin: NSObject, FlutterPlugin, FirebaseSt } } - func referenceGetDownloadURL(app: PigeonStorageFirebaseApp, reference: PigeonStorageReference, + func referenceGetDownloadURL(app: InternalStorageFirebaseApp, reference: InternalStorageReference, completion: @escaping (Result) -> Void) { ref(app: app, reference: reference).downloadURL { url, error in if let e = error { completion(.failure(self.toFlutterError(e))) } @@ -131,18 +131,18 @@ public final class FLTFirebaseStoragePlugin: NSObject, FlutterPlugin, FirebaseSt } } - func referenceGetMetaData(app: PigeonStorageFirebaseApp, reference: PigeonStorageReference, - completion: @escaping (Result) -> Void) { + func referenceGetMetaData(app: InternalStorageFirebaseApp, reference: InternalStorageReference, + completion: @escaping (Result) -> Void) { ref(app: app, reference: reference).getMetadata { md, error in if let e = error { completion(.failure(self.toFlutterError(e))) } else { - completion(.success(PigeonFullMetaData(metadata: self.metaToDict(md)))) + completion(.success(InternalFullMetaData(metadata: self.metaToDict(md)))) } } } - func referenceList(app: PigeonStorageFirebaseApp, reference: PigeonStorageReference, - options: PigeonListOptions, - completion: @escaping (Result) -> Void) { + func referenceList(app: InternalStorageFirebaseApp, reference: InternalStorageReference, + options: InternalListOptions, + completion: @escaping (Result) -> Void) { let r = ref(app: app, reference: reference) let block: (StorageListResult?, Error?) -> Void = { list, error in if let e = error { completion(.failure(self.toFlutterError(e))) } else { @@ -156,15 +156,15 @@ public final class FLTFirebaseStoragePlugin: NSObject, FlutterPlugin, FirebaseSt } } - func referenceListAll(app: PigeonStorageFirebaseApp, reference: PigeonStorageReference, - completion: @escaping (Result) -> Void) { + func referenceListAll(app: InternalStorageFirebaseApp, reference: InternalStorageReference, + completion: @escaping (Result) -> Void) { ref(app: app, reference: reference).listAll { list, error in if let e = error { completion(.failure(self.toFlutterError(e))) } else { completion(.success(self.listToPigeon(list!))) } } } - func referenceGetData(app: PigeonStorageFirebaseApp, reference: PigeonStorageReference, + func referenceGetData(app: InternalStorageFirebaseApp, reference: InternalStorageReference, maxSize: Int64, completion: @escaping (Result) -> Void) { ref(app: app, reference: reference).getData(maxSize: maxSize) { data, error in @@ -178,8 +178,8 @@ public final class FLTFirebaseStoragePlugin: NSObject, FlutterPlugin, FirebaseSt } } - func referencePutData(app: PigeonStorageFirebaseApp, reference: PigeonStorageReference, - data: FlutterStandardTypedData, settableMetaData: PigeonSettableMetadata, + func referencePutData(app: InternalStorageFirebaseApp, reference: InternalStorageReference, + data: FlutterStandardTypedData, settableMetaData: InternalSettableMetadata, handle: Int64, completion: @escaping (Result) -> Void) { let r = ref(app: app, reference: reference) let task = r.putData(data.data, metadata: toMeta(settableMetaData)) @@ -191,8 +191,8 @@ public final class FLTFirebaseStoragePlugin: NSObject, FlutterPlugin, FirebaseSt ))) } - func referencePutString(app: PigeonStorageFirebaseApp, reference: PigeonStorageReference, - data: String, format: Int64, settableMetaData: PigeonSettableMetadata, + func referencePutString(app: InternalStorageFirebaseApp, reference: InternalStorageReference, + data: String, format: Int64, settableMetaData: InternalSettableMetadata, handle: Int64, completion: @escaping (Result) -> Void) { let r = ref(app: app, reference: reference) let d: Data @@ -212,8 +212,9 @@ public final class FLTFirebaseStoragePlugin: NSObject, FlutterPlugin, FirebaseSt ))) } - func referencePutFile(app: PigeonStorageFirebaseApp, reference: PigeonStorageReference, - filePath: String, settableMetaData: PigeonSettableMetadata?, handle: Int64, + func referencePutFile(app: InternalStorageFirebaseApp, reference: InternalStorageReference, + filePath: String, settableMetaData: InternalSettableMetadata?, + handle: Int64, completion: @escaping (Result) -> Void) { let r = ref(app: app, reference: reference) let url = URL(fileURLWithPath: filePath) @@ -228,7 +229,7 @@ public final class FLTFirebaseStoragePlugin: NSObject, FlutterPlugin, FirebaseSt ))) } - func referenceDownloadFile(app: PigeonStorageFirebaseApp, reference: PigeonStorageReference, + func referenceDownloadFile(app: InternalStorageFirebaseApp, reference: InternalStorageReference, filePath: String, handle: Int64, completion: @escaping (Result) -> Void) { let r = ref(app: app, reference: reference) @@ -242,16 +243,17 @@ public final class FLTFirebaseStoragePlugin: NSObject, FlutterPlugin, FirebaseSt ))) } - func referenceUpdateMetadata(app: PigeonStorageFirebaseApp, reference: PigeonStorageReference, - metadata: PigeonSettableMetadata, - completion: @escaping (Result) -> Void) { + func referenceUpdateMetadata(app: InternalStorageFirebaseApp, reference: InternalStorageReference, + metadata: InternalSettableMetadata, + completion: @escaping (Result) + -> Void) { ref(app: app, reference: reference).updateMetadata(toMeta(metadata)) { md, error in if let e = error { completion(.failure(self.toFlutterError(e))) } - else { completion(.success(PigeonFullMetaData(metadata: self.metaToDict(md)))) } + else { completion(.success(InternalFullMetaData(metadata: self.metaToDict(md)))) } } } - func taskPause(app: PigeonStorageFirebaseApp, handle: Int64, + func taskPause(app: InternalStorageFirebaseApp, handle: Int64, completion: @escaping (Result<[String: Any], Error>) -> Void) { if let task = handleToTask[handle] as? StorageUploadTask { task.pause() @@ -264,7 +266,7 @@ public final class FLTFirebaseStoragePlugin: NSObject, FlutterPlugin, FirebaseSt } } - func taskResume(app: PigeonStorageFirebaseApp, handle: Int64, + func taskResume(app: InternalStorageFirebaseApp, handle: Int64, completion: @escaping (Result<[String: Any], Error>) -> Void) { if let task = handleToTask[handle] as? StorageUploadTask { task.resume() @@ -277,7 +279,7 @@ public final class FLTFirebaseStoragePlugin: NSObject, FlutterPlugin, FirebaseSt } } - func taskCancel(app: PigeonStorageFirebaseApp, handle: Int64, + func taskCancel(app: InternalStorageFirebaseApp, handle: Int64, completion: @escaping (Result<[String: Any], Error>) -> Void) { if let task = handleToTask[handle] as? StorageUploadTask { task.cancel() @@ -296,7 +298,7 @@ public final class FLTFirebaseStoragePlugin: NSObject, FlutterPlugin, FirebaseSt } } - private func toMeta(_ m: PigeonSettableMetadata) -> StorageMetadata { + private func toMeta(_ m: InternalSettableMetadata) -> StorageMetadata { let md = StorageMetadata() if let v = m.cacheControl { md.cacheControl = v } if let v = m.contentType { md.contentType = v } @@ -328,12 +330,12 @@ public final class FLTFirebaseStoragePlugin: NSObject, FlutterPlugin, FirebaseSt return out } - private func listToPigeon(_ list: StorageListResult) -> PigeonListResult { + private func listToPigeon(_ list: StorageListResult) -> InternalListResult { let items = list.items.map { toPigeon($0) } let prefixes = list.prefixes.map { toPigeon($0) } - let itemsOpt: [PigeonStorageReference?] = items.map { Optional($0) } - let prefixesOpt: [PigeonStorageReference?] = prefixes.map { Optional($0) } - return PigeonListResult(items: itemsOpt, pageToken: list.pageToken, prefixs: prefixesOpt) + let itemsOpt: [InternalStorageReference?] = items.map { Optional($0) } + let prefixesOpt: [InternalStorageReference?] = prefixes.map { Optional($0) } + return InternalListResult(items: itemsOpt, pageToken: list.pageToken, prefixs: prefixesOpt) } private func registerTask(task: StorageObservableTask, appName: String, handle: Int64, diff --git a/packages/firebase_storage/firebase_storage/ios/firebase_storage/Sources/firebase_storage/FirebaseStorageMessages.g.swift b/packages/firebase_storage/firebase_storage/ios/firebase_storage/Sources/firebase_storage/FirebaseStorageMessages.g.swift index be06489ca8f0..71d157a36414 100644 --- a/packages/firebase_storage/firebase_storage/ios/firebase_storage/Sources/firebase_storage/FirebaseStorageMessages.g.swift +++ b/packages/firebase_storage/firebase_storage/ios/firebase_storage/Sources/firebase_storage/FirebaseStorageMessages.g.swift @@ -1,10 +1,11 @@ // Copyright 2023, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v11.0.1), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), do not edit directly. // See also: https://pub.dev/packages/pigeon import Foundation + #if os(iOS) import Flutter #elseif os(macOS) @@ -13,8 +14,21 @@ import Foundation #error("Unsupported platform.") #endif -private func isNullish(_ value: Any?) -> Bool { - value is NSNull || value == nil +/// Error class for passing custom error details to Dart side. +final class PigeonError: Error { + let code: String + let message: String? + let details: Sendable? + + init(code: String, message: String?, details: Sendable?) { + self.code = code + self.message = message + self.details = details + } + + var localizedDescription: String { + "PigeonError(code: \(code), message: \(message ?? ""), details: \(details ?? "")" + } } private func wrapResult(_ result: Any?) -> [Any?] { @@ -22,6 +36,13 @@ private func wrapResult(_ result: Any?) -> [Any?] { } private func wrapError(_ error: Any) -> [Any?] { + if let pigeonError = error as? PigeonError { + return [ + pigeonError.code, + pigeonError.message, + pigeonError.details, + ] + } if let flutterError = error as? FlutterError { return [ flutterError.code, @@ -31,19 +52,132 @@ private func wrapError(_ error: Any) -> [Any?] { } return [ "\(error)", - "\(type(of: error))", + "\(Swift.type(of: error))", "Stacktrace: \(Thread.callStackSymbols)", ] } +private func isNullish(_ value: Any?) -> Bool { + value is NSNull || value == nil +} + private func nilOrValue(_ value: Any?) -> T? { if value is NSNull { return nil } return value as! T? } +private func doubleEqualsFirebaseStorageMessages(_ lhs: Double, _ rhs: Double) -> Bool { + (lhs.isNaN && rhs.isNaN) || lhs == rhs +} + +private func doubleHashFirebaseStorageMessages(_ value: Double, _ hasher: inout Hasher) { + if value.isNaN { + hasher.combine(0x7FF8_0000_0000_0000) + } else { + // Normalize -0.0 to 0.0 + hasher.combine(value == 0 ? 0 : value) + } +} + +func deepEqualsFirebaseStorageMessages(_ lhs: Any?, _ rhs: Any?) -> Bool { + let cleanLhs = nilOrValue(lhs) as Any? + let cleanRhs = nilOrValue(rhs) as Any? + switch (cleanLhs, cleanRhs) { + case (nil, nil): + return true + + case (nil, _), (_, nil): + return false + + case let (lhs as AnyObject, rhs as AnyObject) where lhs === rhs: + return true + + case is (Void, Void): + return true + + case let (lhsArray, rhsArray) as ([Any?], [Any?]): + guard lhsArray.count == rhsArray.count else { return false } + for (index, element) in lhsArray.enumerated() { + if !deepEqualsFirebaseStorageMessages(element, rhsArray[index]) { + return false + } + } + return true + + case let (lhsArray, rhsArray) as ([Double], [Double]): + guard lhsArray.count == rhsArray.count else { return false } + for (index, element) in lhsArray.enumerated() { + if !doubleEqualsFirebaseStorageMessages(element, rhsArray[index]) { + return false + } + } + return true + + case let (lhsDictionary, rhsDictionary) as ([AnyHashable: Any?], [AnyHashable: Any?]): + guard lhsDictionary.count == rhsDictionary.count else { return false } + for (lhsKey, lhsValue) in lhsDictionary { + var found = false + for (rhsKey, rhsValue) in rhsDictionary { + if deepEqualsFirebaseStorageMessages(lhsKey, rhsKey) { + if deepEqualsFirebaseStorageMessages(lhsValue, rhsValue) { + found = true + break + } else { + return false + } + } + } + if !found { return false } + } + return true + + case let (lhs as Double, rhs as Double): + return doubleEqualsFirebaseStorageMessages(lhs, rhs) + + case let (lhsHashable, rhsHashable) as (AnyHashable, AnyHashable): + return lhsHashable == rhsHashable + + default: + return false + } +} + +func deepHashFirebaseStorageMessages(value: Any?, hasher: inout Hasher) { + let cleanValue = nilOrValue(value) as Any? + if let cleanValue { + if let doubleValue = cleanValue as? Double { + doubleHashFirebaseStorageMessages(doubleValue, &hasher) + } else if let valueList = cleanValue as? [Any?] { + for item in valueList { + deepHashFirebaseStorageMessages(value: item, hasher: &hasher) + } + } else if let valueList = cleanValue as? [Double] { + for item in valueList { + doubleHashFirebaseStorageMessages(item, &hasher) + } + } else if let valueDict = cleanValue as? [AnyHashable: Any?] { + var result = 0 + for (key, value) in valueDict { + var entryKeyHasher = Hasher() + deepHashFirebaseStorageMessages(value: key, hasher: &entryKeyHasher) + var entryValueHasher = Hasher() + deepHashFirebaseStorageMessages(value: value, hasher: &entryValueHasher) + result = result &+ ((entryKeyHasher.finalize() &* 31) ^ entryValueHasher.finalize()) + } + hasher.combine(result) + } else if let hashableValue = cleanValue as? AnyHashable { + hasher.combine(hashableValue) + } else { + hasher.combine(String(describing: cleanValue)) + } + } else { + hasher.combine(0) + } +} + /// The type of operation that generated the action code from calling /// [TaskState]. -enum PigeonStorageTaskState: Int { +enum InternalStorageTaskState: Int { /// Indicates the task has been paused by the user. case paused = 0 /// Indicates the task is currently in-progress. @@ -57,17 +191,18 @@ enum PigeonStorageTaskState: Int { } /// Generated class from Pigeon that represents data sent in messages. -struct PigeonStorageFirebaseApp { +struct InternalStorageFirebaseApp: Hashable { var appName: String var tenantId: String? var bucket: String - static func fromList(_ list: [Any?]) -> PigeonStorageFirebaseApp? { - let appName = list[0] as! String - let tenantId: String? = nilOrValue(list[1]) - let bucket = list[2] as! String + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> InternalStorageFirebaseApp? { + let appName = pigeonVar_list[0] as! String + let tenantId: String? = nilOrValue(pigeonVar_list[1]) + let bucket = pigeonVar_list[2] as! String - return PigeonStorageFirebaseApp( + return InternalStorageFirebaseApp( appName: appName, tenantId: tenantId, bucket: bucket @@ -81,20 +216,39 @@ struct PigeonStorageFirebaseApp { bucket, ] } + + static func == (lhs: InternalStorageFirebaseApp, rhs: InternalStorageFirebaseApp) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return deepEqualsFirebaseStorageMessages(lhs.appName, rhs.appName) && + deepEqualsFirebaseStorageMessages( + lhs.tenantId, + rhs.tenantId + ) && deepEqualsFirebaseStorageMessages(lhs.bucket, rhs.bucket) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("InternalStorageFirebaseApp") + deepHashFirebaseStorageMessages(value: appName, hasher: &hasher) + deepHashFirebaseStorageMessages(value: tenantId, hasher: &hasher) + deepHashFirebaseStorageMessages(value: bucket, hasher: &hasher) + } } /// Generated class from Pigeon that represents data sent in messages. -struct PigeonStorageReference { +struct InternalStorageReference: Hashable { var bucket: String var fullPath: String var name: String - static func fromList(_ list: [Any?]) -> PigeonStorageReference? { - let bucket = list[0] as! String - let fullPath = list[1] as! String - let name = list[2] as! String + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> InternalStorageReference? { + let bucket = pigeonVar_list[0] as! String + let fullPath = pigeonVar_list[1] as! String + let name = pigeonVar_list[2] as! String - return PigeonStorageReference( + return InternalStorageReference( bucket: bucket, fullPath: fullPath, name: name @@ -108,16 +262,35 @@ struct PigeonStorageReference { name, ] } + + static func == (lhs: InternalStorageReference, rhs: InternalStorageReference) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return deepEqualsFirebaseStorageMessages(lhs.bucket, rhs.bucket) && + deepEqualsFirebaseStorageMessages( + lhs.fullPath, + rhs.fullPath + ) && deepEqualsFirebaseStorageMessages(lhs.name, rhs.name) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("InternalStorageReference") + deepHashFirebaseStorageMessages(value: bucket, hasher: &hasher) + deepHashFirebaseStorageMessages(value: fullPath, hasher: &hasher) + deepHashFirebaseStorageMessages(value: name, hasher: &hasher) + } } /// Generated class from Pigeon that represents data sent in messages. -struct PigeonFullMetaData { +struct InternalFullMetaData: Hashable { var metadata: [String?: Any?]? - static func fromList(_ list: [Any?]) -> PigeonFullMetaData? { - let metadata: [String?: Any?]? = nilOrValue(list[0]) + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> InternalFullMetaData? { + let metadata: [String?: Any?]? = nilOrValue(pigeonVar_list[0]) - return PigeonFullMetaData( + return InternalFullMetaData( metadata: metadata ) } @@ -127,10 +300,22 @@ struct PigeonFullMetaData { metadata, ] } + + static func == (lhs: InternalFullMetaData, rhs: InternalFullMetaData) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return deepEqualsFirebaseStorageMessages(lhs.metadata, rhs.metadata) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("InternalFullMetaData") + deepHashFirebaseStorageMessages(value: metadata, hasher: &hasher) + } } /// Generated class from Pigeon that represents data sent in messages. -struct PigeonListOptions { +struct InternalListOptions: Hashable { /// If set, limits the total number of `prefixes` and `items` to return. /// /// The default and maximum maxResults is 1000. @@ -140,11 +325,12 @@ struct PigeonListOptions { /// If provided, listing is resumed from the previous position. var pageToken: String? - static func fromList(_ list: [Any?]) -> PigeonListOptions? { - let maxResults = list[0] is Int64 ? list[0] as! Int64 : Int64(list[0] as! Int32) - let pageToken: String? = nilOrValue(list[1]) + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> InternalListOptions? { + let maxResults = pigeonVar_list[0] as! Int64 + let pageToken: String? = nilOrValue(pigeonVar_list[1]) - return PigeonListOptions( + return InternalListOptions( maxResults: maxResults, pageToken: pageToken ) @@ -156,10 +342,27 @@ struct PigeonListOptions { pageToken, ] } + + static func == (lhs: InternalListOptions, rhs: InternalListOptions) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return deepEqualsFirebaseStorageMessages(lhs.maxResults, rhs.maxResults) && + deepEqualsFirebaseStorageMessages( + lhs.pageToken, + rhs.pageToken + ) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("InternalListOptions") + deepHashFirebaseStorageMessages(value: maxResults, hasher: &hasher) + deepHashFirebaseStorageMessages(value: pageToken, hasher: &hasher) + } } /// Generated class from Pigeon that represents data sent in messages. -struct PigeonSettableMetadata { +struct InternalSettableMetadata: Hashable { /// Served as the 'Cache-Control' header on object download. /// /// See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control. @@ -183,15 +386,16 @@ struct PigeonSettableMetadata { /// Additional user-defined custom metadata. var customMetadata: [String?: String?]? - static func fromList(_ list: [Any?]) -> PigeonSettableMetadata? { - let cacheControl: String? = nilOrValue(list[0]) - let contentDisposition: String? = nilOrValue(list[1]) - let contentEncoding: String? = nilOrValue(list[2]) - let contentLanguage: String? = nilOrValue(list[3]) - let contentType: String? = nilOrValue(list[4]) - let customMetadata: [String?: String?]? = nilOrValue(list[5]) + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> InternalSettableMetadata? { + let cacheControl: String? = nilOrValue(pigeonVar_list[0]) + let contentDisposition: String? = nilOrValue(pigeonVar_list[1]) + let contentEncoding: String? = nilOrValue(pigeonVar_list[2]) + let contentLanguage: String? = nilOrValue(pigeonVar_list[3]) + let contentType: String? = nilOrValue(pigeonVar_list[4]) + let customMetadata: [String?: String?]? = nilOrValue(pigeonVar_list[5]) - return PigeonSettableMetadata( + return InternalSettableMetadata( cacheControl: cacheControl, contentDisposition: contentDisposition, contentEncoding: contentEncoding, @@ -211,20 +415,105 @@ struct PigeonSettableMetadata { customMetadata, ] } + + static func == (lhs: InternalSettableMetadata, rhs: InternalSettableMetadata) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return deepEqualsFirebaseStorageMessages(lhs.cacheControl, rhs.cacheControl) && + deepEqualsFirebaseStorageMessages( + lhs.contentDisposition, + rhs.contentDisposition + ) && deepEqualsFirebaseStorageMessages(lhs.contentEncoding, rhs.contentEncoding) && + deepEqualsFirebaseStorageMessages( + lhs.contentLanguage, + rhs.contentLanguage + ) && deepEqualsFirebaseStorageMessages(lhs.contentType, rhs.contentType) && + deepEqualsFirebaseStorageMessages( + lhs.customMetadata, + rhs.customMetadata + ) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("InternalSettableMetadata") + deepHashFirebaseStorageMessages(value: cacheControl, hasher: &hasher) + deepHashFirebaseStorageMessages(value: contentDisposition, hasher: &hasher) + deepHashFirebaseStorageMessages(value: contentEncoding, hasher: &hasher) + deepHashFirebaseStorageMessages(value: contentLanguage, hasher: &hasher) + deepHashFirebaseStorageMessages(value: contentType, hasher: &hasher) + deepHashFirebaseStorageMessages(value: customMetadata, hasher: &hasher) + } } /// Generated class from Pigeon that represents data sent in messages. -struct PigeonListResult { - var items: [PigeonStorageReference?] +struct InternalStorageTaskSnapShot: Hashable { + var bytesTransferred: Int64 + var metadata: InternalFullMetaData? + var state: InternalStorageTaskState + var totalBytes: Int64 + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> InternalStorageTaskSnapShot? { + let bytesTransferred = pigeonVar_list[0] as! Int64 + let metadata: InternalFullMetaData? = nilOrValue(pigeonVar_list[1]) + let state = pigeonVar_list[2] as! InternalStorageTaskState + let totalBytes = pigeonVar_list[3] as! Int64 + + return InternalStorageTaskSnapShot( + bytesTransferred: bytesTransferred, + metadata: metadata, + state: state, + totalBytes: totalBytes + ) + } + + func toList() -> [Any?] { + [ + bytesTransferred, + metadata, + state, + totalBytes, + ] + } + + static func == (lhs: InternalStorageTaskSnapShot, rhs: InternalStorageTaskSnapShot) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return deepEqualsFirebaseStorageMessages(lhs.bytesTransferred, rhs.bytesTransferred) && + deepEqualsFirebaseStorageMessages( + lhs.metadata, + rhs.metadata + ) && deepEqualsFirebaseStorageMessages(lhs.state, rhs.state) && + deepEqualsFirebaseStorageMessages( + lhs.totalBytes, + rhs.totalBytes + ) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("InternalStorageTaskSnapShot") + deepHashFirebaseStorageMessages(value: bytesTransferred, hasher: &hasher) + deepHashFirebaseStorageMessages(value: metadata, hasher: &hasher) + deepHashFirebaseStorageMessages(value: state, hasher: &hasher) + deepHashFirebaseStorageMessages(value: totalBytes, hasher: &hasher) + } +} + +/// Generated class from Pigeon that represents data sent in messages. +struct InternalListResult: Hashable { + var items: [InternalStorageReference?] var pageToken: String? - var prefixs: [PigeonStorageReference?] + var prefixs: [InternalStorageReference?] - static func fromList(_ list: [Any?]) -> PigeonListResult? { - let items = list[0] as! [PigeonStorageReference?] - let pageToken: String? = nilOrValue(list[1]) - let prefixs = list[2] as! [PigeonStorageReference?] + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> InternalListResult? { + let items = pigeonVar_list[0] as! [InternalStorageReference?] + let pageToken: String? = nilOrValue(pigeonVar_list[1]) + let prefixs = pigeonVar_list[2] as! [InternalStorageReference?] - return PigeonListResult( + return InternalListResult( items: items, pageToken: pageToken, prefixs: prefixs @@ -238,138 +527,173 @@ struct PigeonListResult { prefixs, ] } + + static func == (lhs: InternalListResult, rhs: InternalListResult) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return deepEqualsFirebaseStorageMessages(lhs.items, rhs.items) && + deepEqualsFirebaseStorageMessages( + lhs.pageToken, + rhs.pageToken + ) && deepEqualsFirebaseStorageMessages(lhs.prefixs, rhs.prefixs) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("InternalListResult") + deepHashFirebaseStorageMessages(value: items, hasher: &hasher) + deepHashFirebaseStorageMessages(value: pageToken, hasher: &hasher) + deepHashFirebaseStorageMessages(value: prefixs, hasher: &hasher) + } } -private class FirebaseStorageHostApiCodecReader: FlutterStandardReader { +private class FirebaseStorageMessagesPigeonCodecReader: FlutterStandardReader { override func readValue(ofType type: UInt8) -> Any? { switch type { - case 128: - return PigeonFullMetaData.fromList(readValue() as! [Any?]) case 129: - return PigeonListOptions.fromList(readValue() as! [Any?]) + let enumResultAsInt: Int? = nilOrValue(readValue() as! Int?) + if let enumResultAsInt { + return InternalStorageTaskState(rawValue: enumResultAsInt) + } + return nil case 130: - return PigeonListResult.fromList(readValue() as! [Any?]) + return InternalStorageFirebaseApp.fromList(readValue() as! [Any?]) case 131: - return PigeonSettableMetadata.fromList(readValue() as! [Any?]) + return InternalStorageReference.fromList(readValue() as! [Any?]) case 132: - return PigeonStorageFirebaseApp.fromList(readValue() as! [Any?]) + return InternalFullMetaData.fromList(readValue() as! [Any?]) case 133: - return PigeonStorageReference.fromList(readValue() as! [Any?]) + return InternalListOptions.fromList(readValue() as! [Any?]) + case 134: + return InternalSettableMetadata.fromList(readValue() as! [Any?]) + case 135: + return InternalStorageTaskSnapShot.fromList(readValue() as! [Any?]) + case 136: + return InternalListResult.fromList(readValue() as! [Any?]) default: return super.readValue(ofType: type) } } } -private class FirebaseStorageHostApiCodecWriter: FlutterStandardWriter { +private class FirebaseStorageMessagesPigeonCodecWriter: FlutterStandardWriter { override func writeValue(_ value: Any) { - if let value = value as? PigeonFullMetaData { - super.writeByte(128) - super.writeValue(value.toList()) - } else if let value = value as? PigeonListOptions { + if let value = value as? InternalStorageTaskState { super.writeByte(129) - super.writeValue(value.toList()) - } else if let value = value as? PigeonListResult { + super.writeValue(value.rawValue) + } else if let value = value as? InternalStorageFirebaseApp { super.writeByte(130) super.writeValue(value.toList()) - } else if let value = value as? PigeonSettableMetadata { + } else if let value = value as? InternalStorageReference { super.writeByte(131) super.writeValue(value.toList()) - } else if let value = value as? PigeonStorageFirebaseApp { + } else if let value = value as? InternalFullMetaData { super.writeByte(132) super.writeValue(value.toList()) - } else if let value = value as? PigeonStorageReference { + } else if let value = value as? InternalListOptions { super.writeByte(133) super.writeValue(value.toList()) + } else if let value = value as? InternalSettableMetadata { + super.writeByte(134) + super.writeValue(value.toList()) + } else if let value = value as? InternalStorageTaskSnapShot { + super.writeByte(135) + super.writeValue(value.toList()) + } else if let value = value as? InternalListResult { + super.writeByte(136) + super.writeValue(value.toList()) } else { super.writeValue(value) } } } -private class FirebaseStorageHostApiCodecReaderWriter: FlutterStandardReaderWriter { +private class FirebaseStorageMessagesPigeonCodecReaderWriter: FlutterStandardReaderWriter { override func reader(with data: Data) -> FlutterStandardReader { - FirebaseStorageHostApiCodecReader(data: data) + FirebaseStorageMessagesPigeonCodecReader(data: data) } override func writer(with data: NSMutableData) -> FlutterStandardWriter { - FirebaseStorageHostApiCodecWriter(data: data) + FirebaseStorageMessagesPigeonCodecWriter(data: data) } } -class FirebaseStorageHostApiCodec: FlutterStandardMessageCodec { +class FirebaseStorageMessagesPigeonCodec: FlutterStandardMessageCodec, @unchecked Sendable { static let shared = - FirebaseStorageHostApiCodec(readerWriter: FirebaseStorageHostApiCodecReaderWriter()) + FirebaseStorageMessagesPigeonCodec( + readerWriter: FirebaseStorageMessagesPigeonCodecReaderWriter() + ) } /// Generated protocol from Pigeon that represents a handler of messages from Flutter. protocol FirebaseStorageHostApi { - func getReferencebyPath(app: PigeonStorageFirebaseApp, path: String, bucket: String?, - completion: @escaping (Result) -> Void) - func setMaxOperationRetryTime(app: PigeonStorageFirebaseApp, time: Int64, + func getReferencebyPath(app: InternalStorageFirebaseApp, path: String, bucket: String?, + completion: @escaping (Result) -> Void) + func setMaxOperationRetryTime(app: InternalStorageFirebaseApp, time: Int64, completion: @escaping (Result) -> Void) - func setMaxUploadRetryTime(app: PigeonStorageFirebaseApp, time: Int64, + func setMaxUploadRetryTime(app: InternalStorageFirebaseApp, time: Int64, completion: @escaping (Result) -> Void) - func setMaxDownloadRetryTime(app: PigeonStorageFirebaseApp, time: Int64, + func setMaxDownloadRetryTime(app: InternalStorageFirebaseApp, time: Int64, completion: @escaping (Result) -> Void) - func useStorageEmulator(app: PigeonStorageFirebaseApp, host: String, port: Int64, + func useStorageEmulator(app: InternalStorageFirebaseApp, host: String, port: Int64, completion: @escaping (Result) -> Void) - func referenceDelete(app: PigeonStorageFirebaseApp, reference: PigeonStorageReference, + func referenceDelete(app: InternalStorageFirebaseApp, reference: InternalStorageReference, completion: @escaping (Result) -> Void) - func referenceGetDownloadURL(app: PigeonStorageFirebaseApp, reference: PigeonStorageReference, + func referenceGetDownloadURL(app: InternalStorageFirebaseApp, reference: InternalStorageReference, completion: @escaping (Result) -> Void) - func referenceGetMetaData(app: PigeonStorageFirebaseApp, reference: PigeonStorageReference, - completion: @escaping (Result) -> Void) - func referenceList(app: PigeonStorageFirebaseApp, reference: PigeonStorageReference, - options: PigeonListOptions, - completion: @escaping (Result) -> Void) - func referenceListAll(app: PigeonStorageFirebaseApp, reference: PigeonStorageReference, - completion: @escaping (Result) -> Void) - func referenceGetData(app: PigeonStorageFirebaseApp, reference: PigeonStorageReference, + func referenceGetMetaData(app: InternalStorageFirebaseApp, reference: InternalStorageReference, + completion: @escaping (Result) -> Void) + func referenceList(app: InternalStorageFirebaseApp, reference: InternalStorageReference, + options: InternalListOptions, + completion: @escaping (Result) -> Void) + func referenceListAll(app: InternalStorageFirebaseApp, reference: InternalStorageReference, + completion: @escaping (Result) -> Void) + func referenceGetData(app: InternalStorageFirebaseApp, reference: InternalStorageReference, maxSize: Int64, completion: @escaping (Result) -> Void) - func referencePutData(app: PigeonStorageFirebaseApp, reference: PigeonStorageReference, - data: FlutterStandardTypedData, settableMetaData: PigeonSettableMetadata, + func referencePutData(app: InternalStorageFirebaseApp, reference: InternalStorageReference, + data: FlutterStandardTypedData, settableMetaData: InternalSettableMetadata, handle: Int64, completion: @escaping (Result) -> Void) - func referencePutString(app: PigeonStorageFirebaseApp, reference: PigeonStorageReference, - data: String, format: Int64, settableMetaData: PigeonSettableMetadata, + func referencePutString(app: InternalStorageFirebaseApp, reference: InternalStorageReference, + data: String, format: Int64, settableMetaData: InternalSettableMetadata, handle: Int64, completion: @escaping (Result) -> Void) - func referencePutFile(app: PigeonStorageFirebaseApp, reference: PigeonStorageReference, - filePath: String, settableMetaData: PigeonSettableMetadata?, handle: Int64, - completion: @escaping (Result) -> Void) - func referenceDownloadFile(app: PigeonStorageFirebaseApp, reference: PigeonStorageReference, + func referencePutFile(app: InternalStorageFirebaseApp, reference: InternalStorageReference, + filePath: String, settableMetaData: InternalSettableMetadata?, + handle: Int64, completion: @escaping (Result) -> Void) + func referenceDownloadFile(app: InternalStorageFirebaseApp, reference: InternalStorageReference, filePath: String, handle: Int64, completion: @escaping (Result) -> Void) - func referenceUpdateMetadata(app: PigeonStorageFirebaseApp, reference: PigeonStorageReference, - metadata: PigeonSettableMetadata, - completion: @escaping (Result) -> Void) - func taskPause(app: PigeonStorageFirebaseApp, handle: Int64, + func referenceUpdateMetadata(app: InternalStorageFirebaseApp, reference: InternalStorageReference, + metadata: InternalSettableMetadata, + completion: @escaping (Result) -> Void) + func taskPause(app: InternalStorageFirebaseApp, handle: Int64, completion: @escaping (Result<[String: Any], Error>) -> Void) - func taskResume(app: PigeonStorageFirebaseApp, handle: Int64, + func taskResume(app: InternalStorageFirebaseApp, handle: Int64, completion: @escaping (Result<[String: Any], Error>) -> Void) - func taskCancel(app: PigeonStorageFirebaseApp, handle: Int64, + func taskCancel(app: InternalStorageFirebaseApp, handle: Int64, completion: @escaping (Result<[String: Any], Error>) -> Void) } /// Generated setup class from Pigeon to handle messages through the `binaryMessenger`. class FirebaseStorageHostApiSetup { - /// The codec used by FirebaseStorageHostApi. static var codec: FlutterStandardMessageCodec { - FirebaseStorageHostApiCodec.shared + FirebaseStorageMessagesPigeonCodec.shared } /// Sets up an instance of `FirebaseStorageHostApi` to handle messages through the /// `binaryMessenger`. - static func setUp(binaryMessenger: FlutterBinaryMessenger, api: FirebaseStorageHostApi?) { + static func setUp(binaryMessenger: FlutterBinaryMessenger, api: FirebaseStorageHostApi?, + messageChannelSuffix: String = "") { + let channelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" let getReferencebyPathChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.getReferencebyPath", + name: "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.getReferencebyPath\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec ) if let api { getReferencebyPathChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let appArg = args[0] as! PigeonStorageFirebaseApp + let appArg = args[0] as! InternalStorageFirebaseApp let pathArg = args[1] as! String let bucketArg: String? = nilOrValue(args[2]) api.getReferencebyPath(app: appArg, path: pathArg, bucket: bucketArg) { result in @@ -385,15 +709,15 @@ class FirebaseStorageHostApiSetup { getReferencebyPathChannel.setMessageHandler(nil) } let setMaxOperationRetryTimeChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.setMaxOperationRetryTime", + name: "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.setMaxOperationRetryTime\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec ) if let api { setMaxOperationRetryTimeChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let appArg = args[0] as! PigeonStorageFirebaseApp - let timeArg = args[1] is Int64 ? args[1] as! Int64 : Int64(args[1] as! Int32) + let appArg = args[0] as! InternalStorageFirebaseApp + let timeArg = args[1] as! Int64 api.setMaxOperationRetryTime(app: appArg, time: timeArg) { result in switch result { case .success: @@ -407,15 +731,15 @@ class FirebaseStorageHostApiSetup { setMaxOperationRetryTimeChannel.setMessageHandler(nil) } let setMaxUploadRetryTimeChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.setMaxUploadRetryTime", + name: "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.setMaxUploadRetryTime\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec ) if let api { setMaxUploadRetryTimeChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let appArg = args[0] as! PigeonStorageFirebaseApp - let timeArg = args[1] is Int64 ? args[1] as! Int64 : Int64(args[1] as! Int32) + let appArg = args[0] as! InternalStorageFirebaseApp + let timeArg = args[1] as! Int64 api.setMaxUploadRetryTime(app: appArg, time: timeArg) { result in switch result { case .success: @@ -429,15 +753,15 @@ class FirebaseStorageHostApiSetup { setMaxUploadRetryTimeChannel.setMessageHandler(nil) } let setMaxDownloadRetryTimeChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.setMaxDownloadRetryTime", + name: "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.setMaxDownloadRetryTime\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec ) if let api { setMaxDownloadRetryTimeChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let appArg = args[0] as! PigeonStorageFirebaseApp - let timeArg = args[1] is Int64 ? args[1] as! Int64 : Int64(args[1] as! Int32) + let appArg = args[0] as! InternalStorageFirebaseApp + let timeArg = args[1] as! Int64 api.setMaxDownloadRetryTime(app: appArg, time: timeArg) { result in switch result { case .success: @@ -451,16 +775,16 @@ class FirebaseStorageHostApiSetup { setMaxDownloadRetryTimeChannel.setMessageHandler(nil) } let useStorageEmulatorChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.useStorageEmulator", + name: "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.useStorageEmulator\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec ) if let api { useStorageEmulatorChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let appArg = args[0] as! PigeonStorageFirebaseApp + let appArg = args[0] as! InternalStorageFirebaseApp let hostArg = args[1] as! String - let portArg = args[2] is Int64 ? args[2] as! Int64 : Int64(args[2] as! Int32) + let portArg = args[2] as! Int64 api.useStorageEmulator(app: appArg, host: hostArg, port: portArg) { result in switch result { case .success: @@ -474,15 +798,15 @@ class FirebaseStorageHostApiSetup { useStorageEmulatorChannel.setMessageHandler(nil) } let referenceDeleteChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceDelete", + name: "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceDelete\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec ) if let api { referenceDeleteChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let appArg = args[0] as! PigeonStorageFirebaseApp - let referenceArg = args[1] as! PigeonStorageReference + let appArg = args[0] as! InternalStorageFirebaseApp + let referenceArg = args[1] as! InternalStorageReference api.referenceDelete(app: appArg, reference: referenceArg) { result in switch result { case .success: @@ -496,15 +820,15 @@ class FirebaseStorageHostApiSetup { referenceDeleteChannel.setMessageHandler(nil) } let referenceGetDownloadURLChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceGetDownloadURL", + name: "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceGetDownloadURL\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec ) if let api { referenceGetDownloadURLChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let appArg = args[0] as! PigeonStorageFirebaseApp - let referenceArg = args[1] as! PigeonStorageReference + let appArg = args[0] as! InternalStorageFirebaseApp + let referenceArg = args[1] as! InternalStorageReference api.referenceGetDownloadURL(app: appArg, reference: referenceArg) { result in switch result { case let .success(res): @@ -518,15 +842,15 @@ class FirebaseStorageHostApiSetup { referenceGetDownloadURLChannel.setMessageHandler(nil) } let referenceGetMetaDataChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceGetMetaData", + name: "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceGetMetaData\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec ) if let api { referenceGetMetaDataChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let appArg = args[0] as! PigeonStorageFirebaseApp - let referenceArg = args[1] as! PigeonStorageReference + let appArg = args[0] as! InternalStorageFirebaseApp + let referenceArg = args[1] as! InternalStorageReference api.referenceGetMetaData(app: appArg, reference: referenceArg) { result in switch result { case let .success(res): @@ -540,16 +864,16 @@ class FirebaseStorageHostApiSetup { referenceGetMetaDataChannel.setMessageHandler(nil) } let referenceListChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceList", + name: "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceList\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec ) if let api { referenceListChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let appArg = args[0] as! PigeonStorageFirebaseApp - let referenceArg = args[1] as! PigeonStorageReference - let optionsArg = args[2] as! PigeonListOptions + let appArg = args[0] as! InternalStorageFirebaseApp + let referenceArg = args[1] as! InternalStorageReference + let optionsArg = args[2] as! InternalListOptions api.referenceList(app: appArg, reference: referenceArg, options: optionsArg) { result in switch result { case let .success(res): @@ -563,15 +887,15 @@ class FirebaseStorageHostApiSetup { referenceListChannel.setMessageHandler(nil) } let referenceListAllChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceListAll", + name: "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceListAll\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec ) if let api { referenceListAllChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let appArg = args[0] as! PigeonStorageFirebaseApp - let referenceArg = args[1] as! PigeonStorageReference + let appArg = args[0] as! InternalStorageFirebaseApp + let referenceArg = args[1] as! InternalStorageReference api.referenceListAll(app: appArg, reference: referenceArg) { result in switch result { case let .success(res): @@ -585,16 +909,16 @@ class FirebaseStorageHostApiSetup { referenceListAllChannel.setMessageHandler(nil) } let referenceGetDataChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceGetData", + name: "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceGetData\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec ) if let api { referenceGetDataChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let appArg = args[0] as! PigeonStorageFirebaseApp - let referenceArg = args[1] as! PigeonStorageReference - let maxSizeArg = args[2] is Int64 ? args[2] as! Int64 : Int64(args[2] as! Int32) + let appArg = args[0] as! InternalStorageFirebaseApp + let referenceArg = args[1] as! InternalStorageReference + let maxSizeArg = args[2] as! Int64 api.referenceGetData(app: appArg, reference: referenceArg, maxSize: maxSizeArg) { result in switch result { case let .success(res): @@ -608,18 +932,18 @@ class FirebaseStorageHostApiSetup { referenceGetDataChannel.setMessageHandler(nil) } let referencePutDataChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referencePutData", + name: "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referencePutData\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec ) if let api { referencePutDataChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let appArg = args[0] as! PigeonStorageFirebaseApp - let referenceArg = args[1] as! PigeonStorageReference + let appArg = args[0] as! InternalStorageFirebaseApp + let referenceArg = args[1] as! InternalStorageReference let dataArg = args[2] as! FlutterStandardTypedData - let settableMetaDataArg = args[3] as! PigeonSettableMetadata - let handleArg = args[4] is Int64 ? args[4] as! Int64 : Int64(args[4] as! Int32) + let settableMetaDataArg = args[3] as! InternalSettableMetadata + let handleArg = args[4] as! Int64 api.referencePutData( app: appArg, reference: referenceArg, @@ -639,19 +963,19 @@ class FirebaseStorageHostApiSetup { referencePutDataChannel.setMessageHandler(nil) } let referencePutStringChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referencePutString", + name: "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referencePutString\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec ) if let api { referencePutStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let appArg = args[0] as! PigeonStorageFirebaseApp - let referenceArg = args[1] as! PigeonStorageReference + let appArg = args[0] as! InternalStorageFirebaseApp + let referenceArg = args[1] as! InternalStorageReference let dataArg = args[2] as! String - let formatArg = args[3] is Int64 ? args[3] as! Int64 : Int64(args[3] as! Int32) - let settableMetaDataArg = args[4] as! PigeonSettableMetadata - let handleArg = args[5] is Int64 ? args[5] as! Int64 : Int64(args[5] as! Int32) + let formatArg = args[3] as! Int64 + let settableMetaDataArg = args[4] as! InternalSettableMetadata + let handleArg = args[5] as! Int64 api.referencePutString( app: appArg, reference: referenceArg, @@ -672,18 +996,18 @@ class FirebaseStorageHostApiSetup { referencePutStringChannel.setMessageHandler(nil) } let referencePutFileChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referencePutFile", + name: "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referencePutFile\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec ) if let api { referencePutFileChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let appArg = args[0] as! PigeonStorageFirebaseApp - let referenceArg = args[1] as! PigeonStorageReference + let appArg = args[0] as! InternalStorageFirebaseApp + let referenceArg = args[1] as! InternalStorageReference let filePathArg = args[2] as! String - let settableMetaDataArg: PigeonSettableMetadata? = nilOrValue(args[3]) - let handleArg = args[4] is Int64 ? args[4] as! Int64 : Int64(args[4] as! Int32) + let settableMetaDataArg: InternalSettableMetadata? = nilOrValue(args[3]) + let handleArg = args[4] as! Int64 api.referencePutFile( app: appArg, reference: referenceArg, @@ -703,17 +1027,17 @@ class FirebaseStorageHostApiSetup { referencePutFileChannel.setMessageHandler(nil) } let referenceDownloadFileChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceDownloadFile", + name: "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceDownloadFile\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec ) if let api { referenceDownloadFileChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let appArg = args[0] as! PigeonStorageFirebaseApp - let referenceArg = args[1] as! PigeonStorageReference + let appArg = args[0] as! InternalStorageFirebaseApp + let referenceArg = args[1] as! InternalStorageReference let filePathArg = args[2] as! String - let handleArg = args[3] is Int64 ? args[3] as! Int64 : Int64(args[3] as! Int32) + let handleArg = args[3] as! Int64 api.referenceDownloadFile( app: appArg, reference: referenceArg, @@ -732,16 +1056,16 @@ class FirebaseStorageHostApiSetup { referenceDownloadFileChannel.setMessageHandler(nil) } let referenceUpdateMetadataChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceUpdateMetadata", + name: "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceUpdateMetadata\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec ) if let api { referenceUpdateMetadataChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let appArg = args[0] as! PigeonStorageFirebaseApp - let referenceArg = args[1] as! PigeonStorageReference - let metadataArg = args[2] as! PigeonSettableMetadata + let appArg = args[0] as! InternalStorageFirebaseApp + let referenceArg = args[1] as! InternalStorageReference + let metadataArg = args[2] as! InternalSettableMetadata api .referenceUpdateMetadata(app: appArg, reference: referenceArg, metadata: metadataArg) { result in @@ -757,15 +1081,15 @@ class FirebaseStorageHostApiSetup { referenceUpdateMetadataChannel.setMessageHandler(nil) } let taskPauseChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.taskPause", + name: "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.taskPause\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec ) if let api { taskPauseChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let appArg = args[0] as! PigeonStorageFirebaseApp - let handleArg = args[1] is Int64 ? args[1] as! Int64 : Int64(args[1] as! Int32) + let appArg = args[0] as! InternalStorageFirebaseApp + let handleArg = args[1] as! Int64 api.taskPause(app: appArg, handle: handleArg) { result in switch result { case let .success(res): @@ -779,15 +1103,15 @@ class FirebaseStorageHostApiSetup { taskPauseChannel.setMessageHandler(nil) } let taskResumeChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.taskResume", + name: "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.taskResume\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec ) if let api { taskResumeChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let appArg = args[0] as! PigeonStorageFirebaseApp - let handleArg = args[1] is Int64 ? args[1] as! Int64 : Int64(args[1] as! Int32) + let appArg = args[0] as! InternalStorageFirebaseApp + let handleArg = args[1] as! Int64 api.taskResume(app: appArg, handle: handleArg) { result in switch result { case let .success(res): @@ -801,15 +1125,15 @@ class FirebaseStorageHostApiSetup { taskResumeChannel.setMessageHandler(nil) } let taskCancelChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.taskCancel", + name: "dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.taskCancel\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec ) if let api { taskCancelChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let appArg = args[0] as! PigeonStorageFirebaseApp - let handleArg = args[1] is Int64 ? args[1] as! Int64 : Int64(args[1] as! Int32) + let appArg = args[0] as! InternalStorageFirebaseApp + let handleArg = args[1] as! Int64 api.taskCancel(app: appArg, handle: handleArg) { result in switch result { case let .success(res): diff --git a/packages/firebase_storage/firebase_storage/windows/firebase_storage_plugin.cpp b/packages/firebase_storage/firebase_storage/windows/firebase_storage_plugin.cpp index 8d318c57196e..6ae3a7e1d69d 100644 --- a/packages/firebase_storage/firebase_storage/windows/firebase_storage_plugin.cpp +++ b/packages/firebase_storage/firebase_storage/windows/firebase_storage_plugin.cpp @@ -69,7 +69,7 @@ FirebaseStoragePlugin::FirebaseStoragePlugin() {} FirebaseStoragePlugin::~FirebaseStoragePlugin() = default; -Storage* GetCPPStorageFromPigeon(const PigeonStorageFirebaseApp& pigeonApp, +Storage* GetCPPStorageFromPigeon(const InternalStorageFirebaseApp& pigeonApp, const std::string& bucket_path) { std::string default_url = std::string("gs://") + bucket_path; App* app = App::GetInstance(pigeonApp.app_name().c_str()); @@ -79,8 +79,8 @@ Storage* GetCPPStorageFromPigeon(const PigeonStorageFirebaseApp& pigeonApp, } StorageReference GetCPPStorageReferenceFromPigeon( - const PigeonStorageFirebaseApp& pigeonApp, - const PigeonStorageReference& pigeonReference) { + const InternalStorageFirebaseApp& pigeonApp, + const InternalStorageReference& pigeonReference) { Storage* cpp_storage = GetCPPStorageFromPigeon(pigeonApp, pigeonReference.bucket()); return cpp_storage->GetReference(pigeonReference.full_path()); @@ -215,8 +215,8 @@ flutter::EncodableMap FirebaseStoragePlugin::ErrorStreamEvent( flutter::EncodableMap event; event[flutter::EncodableValue("appName")] = flutter::EncodableValue(app_name); - event[flutter::EncodableValue("taskState")] = - flutter::EncodableValue(static_cast(PigeonStorageTaskState::error)); + event[flutter::EncodableValue("taskState")] = flutter::EncodableValue( + static_cast(InternalStorageTaskState::kError)); event[flutter::EncodableValue("error")] = error; return event; @@ -231,39 +231,40 @@ FlutterError FirebaseStoragePlugin::ParseError( } void FirebaseStoragePlugin::GetReferencebyPath( - const PigeonStorageFirebaseApp& app, const std::string& path, + const InternalStorageFirebaseApp& app, const std::string& path, const std::string* bucket, - std::function reply)> result) { + std::function reply)> result) { Storage* cpp_storage = GetCPPStorageFromPigeon(app, *bucket); StorageReference cpp_reference = cpp_storage->GetReference(path); - PigeonStorageReference* value_ptr = new PigeonStorageReference( + InternalStorageReference* value_ptr = new InternalStorageReference( cpp_reference.bucket(), cpp_reference.full_path(), cpp_reference.name()); result(*value_ptr); } void FirebaseStoragePlugin::SetMaxOperationRetryTime( - const PigeonStorageFirebaseApp& app, int64_t time, + const InternalStorageFirebaseApp& app, int64_t time, std::function reply)> result) { Storage* cpp_storage = GetCPPStorageFromPigeon(app, ""); cpp_storage->set_max_operation_retry_time((double)time); } void FirebaseStoragePlugin::SetMaxUploadRetryTime( - const PigeonStorageFirebaseApp& app, int64_t time, + const InternalStorageFirebaseApp& app, int64_t time, std::function reply)> result) { Storage* cpp_storage = GetCPPStorageFromPigeon(app, ""); cpp_storage->set_max_upload_retry_time((double)time); } void FirebaseStoragePlugin::SetMaxDownloadRetryTime( - const PigeonStorageFirebaseApp& app, int64_t time, + const InternalStorageFirebaseApp& app, int64_t time, std::function reply)> result) { Storage* cpp_storage = GetCPPStorageFromPigeon(app, ""); cpp_storage->set_max_download_retry_time((double)time); } void FirebaseStoragePlugin::UseStorageEmulator( - const PigeonStorageFirebaseApp& app, const std::string& host, int64_t port, + const InternalStorageFirebaseApp& app, const std::string& host, + int64_t port, std::function reply)> result) { Storage* cpp_storage = GetCPPStorageFromPigeon(app, ""); cpp_storage->UseEmulator(host, static_cast(port)); @@ -271,8 +272,8 @@ void FirebaseStoragePlugin::UseStorageEmulator( } void FirebaseStoragePlugin::ReferenceDelete( - const PigeonStorageFirebaseApp& app, - const PigeonStorageReference& reference, + const InternalStorageFirebaseApp& app, + const InternalStorageReference& reference, std::function reply)> result) { StorageReference cpp_reference = GetCPPStorageReferenceFromPigeon(app, reference); @@ -287,8 +288,8 @@ void FirebaseStoragePlugin::ReferenceDelete( }); } void FirebaseStoragePlugin::ReferenceGetDownloadURL( - const PigeonStorageFirebaseApp& app, - const PigeonStorageReference& reference, + const InternalStorageFirebaseApp& app, + const InternalStorageReference& reference, std::function reply)> result) { StorageReference cpp_reference = GetCPPStorageReferenceFromPigeon(app, reference); @@ -306,7 +307,7 @@ void FirebaseStoragePlugin::ReferenceGetDownloadURL( firebase::storage::Metadata* FirebaseStoragePlugin::CreateStorageMetadataFromPigeon( - const PigeonSettableMetadata* pigeonMetaData) { + const InternalSettableMetadata* pigeonMetaData) { if (pigeonMetaData == nullptr) { return nullptr; // No metadata to process } @@ -444,16 +445,16 @@ flutter::EncodableMap ConvertMedadataToPigeon(const Metadata* meta) { } void FirebaseStoragePlugin::ReferenceGetMetaData( - const PigeonStorageFirebaseApp& app, - const PigeonStorageReference& reference, - std::function reply)> result) { + const InternalStorageFirebaseApp& app, + const InternalStorageReference& reference, + std::function reply)> result) { StorageReference cpp_reference = GetCPPStorageReferenceFromPigeon(app, reference); Future future_result = cpp_reference.GetMetadata(); ::Sleep(1); // timing for c++ sdk grabbing a mutex future_result.OnCompletion([result](const Future& metadata_result) { if (metadata_result.error() == firebase::storage::kErrorNone) { - PigeonFullMetaData pigeon_meta = PigeonFullMetaData(); + InternalFullMetaData pigeon_meta = InternalFullMetaData(); pigeon_meta.set_metadata( ConvertMedadataToPigeon(metadata_result.result())); @@ -465,30 +466,31 @@ void FirebaseStoragePlugin::ReferenceGetMetaData( } void FirebaseStoragePlugin::ReferenceList( - const PigeonStorageFirebaseApp& app, - const PigeonStorageReference& reference, const PigeonListOptions& options, - std::function reply)> result) { + const InternalStorageFirebaseApp& app, + const InternalStorageReference& reference, + const InternalListOptions& options, + std::function reply)> result) { // C++ doesn't support list yet flutter::EncodableList items = flutter::EncodableList(); flutter::EncodableList prefixs = flutter::EncodableList(); - PigeonListResult pigeon_result = PigeonListResult(items, prefixs); + InternalListResult pigeon_result = InternalListResult(items, prefixs); result(pigeon_result); } void FirebaseStoragePlugin::ReferenceListAll( - const PigeonStorageFirebaseApp& app, - const PigeonStorageReference& reference, - std::function reply)> result) { + const InternalStorageFirebaseApp& app, + const InternalStorageReference& reference, + std::function reply)> result) { // C++ doesn't support listAll yet flutter::EncodableList items = flutter::EncodableList(); flutter::EncodableList prefixs = flutter::EncodableList(); - PigeonListResult pigeon_result = PigeonListResult(items, prefixs); + InternalListResult pigeon_result = InternalListResult(items, prefixs); result(pigeon_result); } void FirebaseStoragePlugin::ReferenceGetData( - const PigeonStorageFirebaseApp& app, - const PigeonStorageReference& reference, int64_t max_size, + const InternalStorageFirebaseApp& app, + const InternalStorageReference& reference, int64_t max_size, std::function>> reply)> result) { StorageReference cpp_reference = @@ -530,7 +532,8 @@ class TaskStateListener : public Listener { } virtual void OnProgress(firebase::storage::Controller* controller) { flutter::EncodableMap event = flutter::EncodableMap(); - event[kTaskStateName] = static_cast(PigeonStorageTaskState::running); + event[kTaskStateName] = + static_cast(InternalStorageTaskState::kRunning); event[kTaskAppName] = controller->GetReference().storage()->app()->name(); flutter::EncodableMap snapshot = flutter::EncodableMap(); snapshot[kTaskSnapshotPath] = controller->GetReference().full_path(); @@ -543,7 +546,7 @@ class TaskStateListener : public Listener { virtual void OnPaused(firebase::storage::Controller* controller) { flutter::EncodableMap event = flutter::EncodableMap(); - event[kTaskStateName] = static_cast(PigeonStorageTaskState::paused); + event[kTaskStateName] = static_cast(InternalStorageTaskState::kPaused); event[kTaskAppName] = controller->GetReference().storage()->app()->name(); flutter::EncodableMap snapshot = flutter::EncodableMap(); snapshot[kTaskSnapshotPath] = controller->GetReference().full_path(); @@ -563,7 +566,7 @@ class PutDataStreamHandler PutDataStreamHandler(Storage* storage, std::string reference_path, const void* data, size_t buffer_size, Controller* controller, - const PigeonSettableMetadata& pigeon_meta_data) + const InternalSettableMetadata& pigeon_meta_data) : meta_data_(pigeon_meta_data) { storage_ = storage; reference_path_ = reference_path; @@ -600,7 +603,7 @@ class PutDataStreamHandler if (data_result.error() == firebase::storage::kErrorNone) { flutter::EncodableMap event = flutter::EncodableMap(); event[kTaskStateName] = - static_cast(PigeonStorageTaskState::success); + static_cast(InternalStorageTaskState::kSuccess); event[kTaskAppName] = std::string(storage_->app()->name()); flutter::EncodableMap snapshot = flutter::EncodableMap(); snapshot[kTaskSnapshotPath] = data_result.result()->path(); @@ -630,7 +633,7 @@ class PutDataStreamHandler Storage* storage_; std::string reference_path_; std::vector data_; - PigeonSettableMetadata meta_data_; + InternalSettableMetadata meta_data_; Controller* controller_; std::unique_ptr>&& events_ = nullptr; @@ -641,9 +644,9 @@ class PutFileStreamHandler public: PutFileStreamHandler(Storage* storage, std::string reference_path, std::string file_path, Controller* controller, - const PigeonSettableMetadata* pigeon_meta_data) + const InternalSettableMetadata* pigeon_meta_data) : meta_data_( - std::make_unique(*pigeon_meta_data)) { + std::make_unique(*pigeon_meta_data)) { storage_ = storage; reference_path_ = reference_path; file_path_ = file_path; @@ -678,7 +681,7 @@ class PutFileStreamHandler if (data_result.error() == firebase::storage::kErrorNone) { flutter::EncodableMap event = flutter::EncodableMap(); event[kTaskStateName] = - static_cast(PigeonStorageTaskState::success); + static_cast(InternalStorageTaskState::kSuccess); event[kTaskAppName] = std::string(storage_->app()->name()); flutter::EncodableMap snapshot = flutter::EncodableMap(); snapshot[kTaskSnapshotPath] = data_result.result()->path(); @@ -711,7 +714,7 @@ class PutFileStreamHandler Controller* controller_; std::unique_ptr>&& events_ = nullptr; - std::unique_ptr meta_data_; + std::unique_ptr meta_data_; }; class GetFileStreamHandler @@ -743,7 +746,7 @@ class GetFileStreamHandler if (data_result.error() == firebase::storage::kErrorNone) { flutter::EncodableMap event = flutter::EncodableMap(); event[kTaskStateName] = - static_cast(PigeonStorageTaskState::success); + static_cast(InternalStorageTaskState::kSuccess); event[kTaskAppName] = std::string(storage_->app()->name()); flutter::EncodableMap snapshot = flutter::EncodableMap(); size_t data_size = *data_result.result(); @@ -783,10 +786,10 @@ class GetFileStreamHandler }; void FirebaseStoragePlugin::ReferencePutData( - const PigeonStorageFirebaseApp& pigeon_app, - const PigeonStorageReference& pigeon_reference, + const InternalStorageFirebaseApp& pigeon_app, + const InternalStorageReference& pigeon_reference, const std::vector& data, - const PigeonSettableMetadata& pigeon_meta_data, int64_t handle, + const InternalSettableMetadata& pigeon_meta_data, int64_t handle, std::function reply)> result) { Storage* cpp_storage = GetCPPStorageFromPigeon(pigeon_app, pigeon_reference.bucket()); @@ -804,9 +807,9 @@ void FirebaseStoragePlugin::ReferencePutData( } void FirebaseStoragePlugin::ReferencePutString( - const PigeonStorageFirebaseApp& pigeon_app, - const PigeonStorageReference& pigeon_reference, const std::string& data, - int64_t format, const PigeonSettableMetadata& settable_meta_data, + const InternalStorageFirebaseApp& pigeon_app, + const InternalStorageReference& pigeon_reference, const std::string& data, + int64_t format, const InternalSettableMetadata& settable_meta_data, int64_t handle, std::function reply)> result) { Storage* cpp_storage = GetCPPStorageFromPigeon(pigeon_app, pigeon_reference.bucket()); @@ -827,10 +830,10 @@ void FirebaseStoragePlugin::ReferencePutString( } void FirebaseStoragePlugin::ReferencePutFile( - const PigeonStorageFirebaseApp& pigeon_app, - const PigeonStorageReference& pigeon_reference, + const InternalStorageFirebaseApp& pigeon_app, + const InternalStorageReference& pigeon_reference, const std::string& file_path, - const PigeonSettableMetadata* settable_meta_data, int64_t handle, + const InternalSettableMetadata* settable_meta_data, int64_t handle, std::function reply)> result) { Storage* cpp_storage = GetCPPStorageFromPigeon(pigeon_app, pigeon_reference.bucket()); @@ -848,8 +851,8 @@ void FirebaseStoragePlugin::ReferencePutFile( } void FirebaseStoragePlugin::ReferenceDownloadFile( - const PigeonStorageFirebaseApp& pigeon_app, - const PigeonStorageReference& pigeon_reference, + const InternalStorageFirebaseApp& pigeon_app, + const InternalStorageReference& pigeon_reference, const std::string& file_path, int64_t handle, std::function reply)> result) { Storage* cpp_storage = @@ -868,10 +871,10 @@ void FirebaseStoragePlugin::ReferenceDownloadFile( } void FirebaseStoragePlugin::ReferenceUpdateMetadata( - const PigeonStorageFirebaseApp& app, - const PigeonStorageReference& reference, - const PigeonSettableMetadata& metadata, - std::function reply)> result) { + const InternalStorageFirebaseApp& app, + const InternalStorageReference& reference, + const InternalSettableMetadata& metadata, + std::function reply)> result) { StorageReference cpp_reference = GetCPPStorageReferenceFromPigeon(app, reference); Metadata* cpp_meta = @@ -882,7 +885,7 @@ void FirebaseStoragePlugin::ReferenceUpdateMetadata( future_result.OnCompletion([result](const Future& data_result) { if (data_result.error() == firebase::storage::kErrorNone) { const Metadata* result_meta = data_result.result(); - PigeonFullMetaData pigeonData; + InternalFullMetaData pigeonData; pigeonData.set_metadata(ConvertMedadataToPigeon(result_meta)); result(pigeonData); @@ -893,7 +896,7 @@ void FirebaseStoragePlugin::ReferenceUpdateMetadata( } void FirebaseStoragePlugin::TaskPause( - const PigeonStorageFirebaseApp& app, int64_t handle, + const InternalStorageFirebaseApp& app, int64_t handle, std::function reply)> result) { bool status = controllers_[handle]->Pause(); flutter::EncodableMap task_result = flutter::EncodableMap(); @@ -911,7 +914,7 @@ void FirebaseStoragePlugin::TaskPause( } void FirebaseStoragePlugin::TaskResume( - const PigeonStorageFirebaseApp& app, int64_t handle, + const InternalStorageFirebaseApp& app, int64_t handle, std::function reply)> result) { bool status = controllers_[handle]->Resume(); flutter::EncodableMap task_result = flutter::EncodableMap(); @@ -928,7 +931,7 @@ void FirebaseStoragePlugin::TaskResume( } void FirebaseStoragePlugin::TaskCancel( - const PigeonStorageFirebaseApp& app, int64_t handle, + const InternalStorageFirebaseApp& app, int64_t handle, std::function reply)> result) { bool status = controllers_[handle]->Cancel(); flutter::EncodableMap task_result = flutter::EncodableMap(); diff --git a/packages/firebase_storage/firebase_storage/windows/firebase_storage_plugin.h b/packages/firebase_storage/firebase_storage/windows/firebase_storage_plugin.h index 8c4487d9e351..ed5191fbee8b 100644 --- a/packages/firebase_storage/firebase_storage/windows/firebase_storage_plugin.h +++ b/packages/firebase_storage/firebase_storage/windows/firebase_storage_plugin.h @@ -37,7 +37,7 @@ class FirebaseStoragePlugin : public flutter::Plugin, // Static function declarations // Helper functions static firebase::storage::Metadata* CreateStorageMetadataFromPigeon( - const PigeonSettableMetadata* pigeonMetaData); + const InternalSettableMetadata* pigeonMetaData); static std::map ProcessCustomMetadataMap( const flutter::EncodableMap& customMetadata); static std::vector StringToByteData(const std::string& data, @@ -53,84 +53,86 @@ class FirebaseStoragePlugin : public flutter::Plugin, // FirebaseStorageHostApi virtual void GetReferencebyPath( - const PigeonStorageFirebaseApp& app, const std::string& path, + const InternalStorageFirebaseApp& app, const std::string& path, const std::string* bucket, - std::function reply)> result) + std::function reply)> result) override; virtual void SetMaxOperationRetryTime( - const PigeonStorageFirebaseApp& app, int64_t time, + const InternalStorageFirebaseApp& app, int64_t time, std::function reply)> result) override; virtual void SetMaxUploadRetryTime( - const PigeonStorageFirebaseApp& app, int64_t time, + const InternalStorageFirebaseApp& app, int64_t time, std::function reply)> result) override; virtual void SetMaxDownloadRetryTime( - const PigeonStorageFirebaseApp& app, int64_t time, + const InternalStorageFirebaseApp& app, int64_t time, std::function reply)> result) override; virtual void UseStorageEmulator( - const PigeonStorageFirebaseApp& app, const std::string& host, + const InternalStorageFirebaseApp& app, const std::string& host, int64_t port, std::function reply)> result) override; virtual void ReferenceDelete( - const PigeonStorageFirebaseApp& app, - const PigeonStorageReference& reference, + const InternalStorageFirebaseApp& app, + const InternalStorageReference& reference, std::function reply)> result) override; virtual void ReferenceGetDownloadURL( - const PigeonStorageFirebaseApp& app, - const PigeonStorageReference& reference, + const InternalStorageFirebaseApp& app, + const InternalStorageReference& reference, std::function reply)> result) override; virtual void ReferenceGetMetaData( - const PigeonStorageFirebaseApp& app, - const PigeonStorageReference& reference, - std::function reply)> result) override; + const InternalStorageFirebaseApp& app, + const InternalStorageReference& reference, + std::function reply)> result) override; virtual void ReferenceList( - const PigeonStorageFirebaseApp& app, - const PigeonStorageReference& reference, const PigeonListOptions& options, - std::function reply)> result) override; + const InternalStorageFirebaseApp& app, + const InternalStorageReference& reference, + const InternalListOptions& options, + std::function reply)> result) override; virtual void ReferenceListAll( - const PigeonStorageFirebaseApp& app, - const PigeonStorageReference& reference, - std::function reply)> result) override; + const InternalStorageFirebaseApp& app, + const InternalStorageReference& reference, + std::function reply)> result) override; virtual void ReferenceGetData( - const PigeonStorageFirebaseApp& app, - const PigeonStorageReference& reference, int64_t max_size, + const InternalStorageFirebaseApp& app, + const InternalStorageReference& reference, int64_t max_size, std::function>> reply)> result) override; virtual void ReferencePutData( - const PigeonStorageFirebaseApp& app, - const PigeonStorageReference& reference, const std::vector& data, - const PigeonSettableMetadata& settable_meta_data, int64_t handle, + const InternalStorageFirebaseApp& app, + const InternalStorageReference& reference, + const std::vector& data, + const InternalSettableMetadata& settable_meta_data, int64_t handle, std::function reply)> result) override; virtual void ReferencePutString( - const PigeonStorageFirebaseApp& app, - const PigeonStorageReference& reference, const std::string& data, - int64_t format, const PigeonSettableMetadata& settable_meta_data, + const InternalStorageFirebaseApp& app, + const InternalStorageReference& reference, const std::string& data, + int64_t format, const InternalSettableMetadata& settable_meta_data, int64_t handle, std::function reply)> result) override; virtual void ReferencePutFile( - const PigeonStorageFirebaseApp& app, - const PigeonStorageReference& reference, const std::string& file_path, - const PigeonSettableMetadata* settable_meta_data, int64_t handle, + const InternalStorageFirebaseApp& app, + const InternalStorageReference& reference, const std::string& file_path, + const InternalSettableMetadata* settable_meta_data, int64_t handle, std::function reply)> result) override; virtual void ReferenceDownloadFile( - const PigeonStorageFirebaseApp& app, - const PigeonStorageReference& reference, const std::string& file_path, + const InternalStorageFirebaseApp& app, + const InternalStorageReference& reference, const std::string& file_path, int64_t handle, std::function reply)> result) override; virtual void ReferenceUpdateMetadata( - const PigeonStorageFirebaseApp& app, - const PigeonStorageReference& reference, - const PigeonSettableMetadata& metadata, - std::function reply)> result) override; + const InternalStorageFirebaseApp& app, + const InternalStorageReference& reference, + const InternalSettableMetadata& metadata, + std::function reply)> result) override; virtual void TaskPause( - const PigeonStorageFirebaseApp& app, int64_t handle, + const InternalStorageFirebaseApp& app, int64_t handle, std::function reply)> result) override; virtual void TaskResume( - const PigeonStorageFirebaseApp& app, int64_t handle, + const InternalStorageFirebaseApp& app, int64_t handle, std::function reply)> result) override; virtual void TaskCancel( - const PigeonStorageFirebaseApp& app, int64_t handle, + const InternalStorageFirebaseApp& app, int64_t handle, std::function reply)> result) override; diff --git a/packages/firebase_storage/firebase_storage/windows/messages.g.cpp b/packages/firebase_storage/firebase_storage/windows/messages.g.cpp index c4f093b94f48..ace21074604b 100644 --- a/packages/firebase_storage/firebase_storage/windows/messages.g.cpp +++ b/packages/firebase_storage/firebase_storage/windows/messages.g.cpp @@ -1,7 +1,7 @@ // Copyright 2023, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v11.0.1), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), do not edit directly. // See also: https://pub.dev/packages/pigeon #undef _HAS_EXCEPTIONS @@ -13,60 +13,277 @@ #include #include +#include +#include #include #include #include namespace firebase_storage_windows { -using flutter::BasicMessageChannel; -using flutter::CustomEncodableValue; -using flutter::EncodableList; -using flutter::EncodableMap; -using flutter::EncodableValue; +using ::flutter::BasicMessageChannel; +using ::flutter::CustomEncodableValue; +using ::flutter::EncodableList; +using ::flutter::EncodableMap; +using ::flutter::EncodableValue; + +FlutterError CreateConnectionError(const std::string channel_name) { + return FlutterError( + "channel-error", + "Unable to establish connection on channel: '" + channel_name + "'.", + EncodableValue("")); +} + +namespace { +template +bool PigeonInternalDeepEquals(const T& a, const T& b); + +bool PigeonInternalDeepEquals(const double& a, const double& b); + +template +bool PigeonInternalDeepEquals(const std::vector& a, const std::vector& b); + +template +bool PigeonInternalDeepEquals(const std::map& a, const std::map& b); + +template +bool PigeonInternalDeepEquals(const std::optional& a, + const std::optional& b); + +template +bool PigeonInternalDeepEquals(const std::unique_ptr& a, + const std::unique_ptr& b); + +bool PigeonInternalDeepEquals(const ::flutter::EncodableValue& a, + const ::flutter::EncodableValue& b); + +template +bool PigeonInternalDeepEquals(const T& a, const T& b) { + return a == b; +} + +template +bool PigeonInternalDeepEquals(const std::vector& a, + const std::vector& b) { + if (a.size() != b.size()) { + return false; + } + for (size_t i = 0; i < a.size(); ++i) { + if (!PigeonInternalDeepEquals(a[i], b[i])) { + return false; + } + } + return true; +} + +template +bool PigeonInternalDeepEquals(const std::map& a, + const std::map& b) { + if (a.size() != b.size()) { + return false; + } + for (const auto& kv : a) { + bool found = false; + for (const auto& b_kv : b) { + if (PigeonInternalDeepEquals(kv.first, b_kv.first)) { + if (PigeonInternalDeepEquals(kv.second, b_kv.second)) { + found = true; + break; + } else { + return false; + } + } + } + if (!found) { + return false; + } + } + return true; +} + +bool PigeonInternalDeepEquals(const double& a, const double& b) { + // Normalize -0.0 to 0.0 and handle NaN equality. + return (a == b) || (std::isnan(a) && std::isnan(b)); +} -// PigeonStorageFirebaseApp +template +bool PigeonInternalDeepEquals(const std::optional& a, + const std::optional& b) { + if (!a && !b) { + return true; + } + if (!a || !b) { + return false; + } + return PigeonInternalDeepEquals(*a, *b); +} + +template +bool PigeonInternalDeepEquals(const std::unique_ptr& a, + const std::unique_ptr& b) { + if (a.get() == b.get()) { + return true; + } + if (!a || !b) { + return false; + } + return PigeonInternalDeepEquals(*a, *b); +} + +bool PigeonInternalDeepEquals(const ::flutter::EncodableValue& a, + const ::flutter::EncodableValue& b) { + if (a.index() != b.index()) { + return false; + } + if (const double* da = std::get_if(&a)) { + return PigeonInternalDeepEquals(*da, std::get(b)); + } else if (const ::flutter::EncodableList* la = + std::get_if<::flutter::EncodableList>(&a)) { + return PigeonInternalDeepEquals(*la, std::get<::flutter::EncodableList>(b)); + } else if (const ::flutter::EncodableMap* ma = + std::get_if<::flutter::EncodableMap>(&a)) { + return PigeonInternalDeepEquals(*ma, std::get<::flutter::EncodableMap>(b)); + } + return a == b; +} + +template +size_t PigeonInternalDeepHash(const T& v); + +size_t PigeonInternalDeepHash(const double& v); + +template +size_t PigeonInternalDeepHash(const std::vector& v); + +template +size_t PigeonInternalDeepHash(const std::map& v); + +template +size_t PigeonInternalDeepHash(const std::optional& v); + +template +size_t PigeonInternalDeepHash(const std::unique_ptr& v); + +size_t PigeonInternalDeepHash(const ::flutter::EncodableValue& v); + +template +size_t PigeonInternalDeepHash(const T& v) { + return std::hash()(v); +} + +template +size_t PigeonInternalDeepHash(const std::vector& v) { + size_t result = 1; + for (const auto& item : v) { + result = result * 31 + PigeonInternalDeepHash(item); + } + return result; +} -PigeonStorageFirebaseApp::PigeonStorageFirebaseApp(const std::string& app_name, - const std::string& bucket) +template +size_t PigeonInternalDeepHash(const std::map& v) { + size_t result = 0; + for (const auto& kv : v) { + result += ((PigeonInternalDeepHash(kv.first) * 31) ^ + PigeonInternalDeepHash(kv.second)); + } + return result; +} + +size_t PigeonInternalDeepHash(const double& v) { + if (std::isnan(v)) { + // Normalize NaN to a consistent hash. + return std::hash()(std::numeric_limits::quiet_NaN()); + } + if (v == 0.0) { + // Normalize -0.0 to 0.0 so they have the same hash code. + return std::hash()(0.0); + } + return std::hash()(v); +} + +template +size_t PigeonInternalDeepHash(const std::optional& v) { + return v ? PigeonInternalDeepHash(*v) : 0; +} + +template +size_t PigeonInternalDeepHash(const std::unique_ptr& v) { + return v ? PigeonInternalDeepHash(*v) : 0; +} + +size_t PigeonInternalDeepHash(const ::flutter::EncodableValue& v) { + size_t result = v.index(); + if (const double* dv = std::get_if(&v)) { + result = result * 31 + PigeonInternalDeepHash(*dv); + } else if (const ::flutter::EncodableList* lv = + std::get_if<::flutter::EncodableList>(&v)) { + result = result * 31 + PigeonInternalDeepHash(*lv); + } else if (const ::flutter::EncodableMap* mv = + std::get_if<::flutter::EncodableMap>(&v)) { + result = result * 31 + PigeonInternalDeepHash(*mv); + } else { + std::visit( + [&result](const auto& val) { + using T = std::decay_t; + if constexpr (!std::is_same_v && + !std::is_same_v && + !std::is_same_v && + !std::is_same_v && + !std::is_same_v) { + result = result * 31 + PigeonInternalDeepHash(val); + } + }, + v); + } + return result; +} + +} // namespace +// InternalStorageFirebaseApp + +InternalStorageFirebaseApp::InternalStorageFirebaseApp( + const std::string& app_name, const std::string& bucket) : app_name_(app_name), bucket_(bucket) {} -PigeonStorageFirebaseApp::PigeonStorageFirebaseApp(const std::string& app_name, - const std::string* tenant_id, - const std::string& bucket) +InternalStorageFirebaseApp::InternalStorageFirebaseApp( + const std::string& app_name, const std::string* tenant_id, + const std::string& bucket) : app_name_(app_name), tenant_id_(tenant_id ? std::optional(*tenant_id) : std::nullopt), bucket_(bucket) {} -const std::string& PigeonStorageFirebaseApp::app_name() const { +const std::string& InternalStorageFirebaseApp::app_name() const { return app_name_; } -void PigeonStorageFirebaseApp::set_app_name(std::string_view value_arg) { +void InternalStorageFirebaseApp::set_app_name(std::string_view value_arg) { app_name_ = value_arg; } -const std::string* PigeonStorageFirebaseApp::tenant_id() const { +const std::string* InternalStorageFirebaseApp::tenant_id() const { return tenant_id_ ? &(*tenant_id_) : nullptr; } -void PigeonStorageFirebaseApp::set_tenant_id( +void InternalStorageFirebaseApp::set_tenant_id( const std::string_view* value_arg) { tenant_id_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonStorageFirebaseApp::set_tenant_id(std::string_view value_arg) { +void InternalStorageFirebaseApp::set_tenant_id(std::string_view value_arg) { tenant_id_ = value_arg; } -const std::string& PigeonStorageFirebaseApp::bucket() const { return bucket_; } +const std::string& InternalStorageFirebaseApp::bucket() const { + return bucket_; +} -void PigeonStorageFirebaseApp::set_bucket(std::string_view value_arg) { +void InternalStorageFirebaseApp::set_bucket(std::string_view value_arg) { bucket_ = value_arg; } -EncodableList PigeonStorageFirebaseApp::ToEncodableList() const { +EncodableList InternalStorageFirebaseApp::ToEncodableList() const { EncodableList list; list.reserve(3); list.push_back(EncodableValue(app_name_)); @@ -75,10 +292,10 @@ EncodableList PigeonStorageFirebaseApp::ToEncodableList() const { return list; } -PigeonStorageFirebaseApp PigeonStorageFirebaseApp::FromEncodableList( +InternalStorageFirebaseApp InternalStorageFirebaseApp::FromEncodableList( const EncodableList& list) { - PigeonStorageFirebaseApp decoded(std::get(list[0]), - std::get(list[2])); + InternalStorageFirebaseApp decoded(std::get(list[0]), + std::get(list[2])); auto& encodable_tenant_id = list[1]; if (!encodable_tenant_id.IsNull()) { decoded.set_tenant_id(std::get(encodable_tenant_id)); @@ -86,34 +303,58 @@ PigeonStorageFirebaseApp PigeonStorageFirebaseApp::FromEncodableList( return decoded; } -// PigeonStorageReference +bool InternalStorageFirebaseApp::operator==( + const InternalStorageFirebaseApp& other) const { + return PigeonInternalDeepEquals(app_name_, other.app_name_) && + PigeonInternalDeepEquals(tenant_id_, other.tenant_id_) && + PigeonInternalDeepEquals(bucket_, other.bucket_); +} -PigeonStorageReference::PigeonStorageReference(const std::string& bucket, - const std::string& full_path, - const std::string& name) +bool InternalStorageFirebaseApp::operator!=( + const InternalStorageFirebaseApp& other) const { + return !(*this == other); +} + +size_t InternalStorageFirebaseApp::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(app_name_); + result = result * 31 + PigeonInternalDeepHash(tenant_id_); + result = result * 31 + PigeonInternalDeepHash(bucket_); + return result; +} + +size_t PigeonInternalDeepHash(const InternalStorageFirebaseApp& v) { + return v.Hash(); +} + +// InternalStorageReference + +InternalStorageReference::InternalStorageReference(const std::string& bucket, + const std::string& full_path, + const std::string& name) : bucket_(bucket), full_path_(full_path), name_(name) {} -const std::string& PigeonStorageReference::bucket() const { return bucket_; } +const std::string& InternalStorageReference::bucket() const { return bucket_; } -void PigeonStorageReference::set_bucket(std::string_view value_arg) { +void InternalStorageReference::set_bucket(std::string_view value_arg) { bucket_ = value_arg; } -const std::string& PigeonStorageReference::full_path() const { +const std::string& InternalStorageReference::full_path() const { return full_path_; } -void PigeonStorageReference::set_full_path(std::string_view value_arg) { +void InternalStorageReference::set_full_path(std::string_view value_arg) { full_path_ = value_arg; } -const std::string& PigeonStorageReference::name() const { return name_; } +const std::string& InternalStorageReference::name() const { return name_; } -void PigeonStorageReference::set_name(std::string_view value_arg) { +void InternalStorageReference::set_name(std::string_view value_arg) { name_ = value_arg; } -EncodableList PigeonStorageReference::ToEncodableList() const { +EncodableList InternalStorageReference::ToEncodableList() const { EncodableList list; list.reserve(3); list.push_back(EncodableValue(bucket_)); @@ -122,45 +363,69 @@ EncodableList PigeonStorageReference::ToEncodableList() const { return list; } -PigeonStorageReference PigeonStorageReference::FromEncodableList( +InternalStorageReference InternalStorageReference::FromEncodableList( const EncodableList& list) { - PigeonStorageReference decoded(std::get(list[0]), - std::get(list[1]), - std::get(list[2])); + InternalStorageReference decoded(std::get(list[0]), + std::get(list[1]), + std::get(list[2])); return decoded; } -// PigeonFullMetaData +bool InternalStorageReference::operator==( + const InternalStorageReference& other) const { + return PigeonInternalDeepEquals(bucket_, other.bucket_) && + PigeonInternalDeepEquals(full_path_, other.full_path_) && + PigeonInternalDeepEquals(name_, other.name_); +} + +bool InternalStorageReference::operator!=( + const InternalStorageReference& other) const { + return !(*this == other); +} + +size_t InternalStorageReference::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(bucket_); + result = result * 31 + PigeonInternalDeepHash(full_path_); + result = result * 31 + PigeonInternalDeepHash(name_); + return result; +} + +size_t PigeonInternalDeepHash(const InternalStorageReference& v) { + return v.Hash(); +} + +// InternalFullMetaData -PigeonFullMetaData::PigeonFullMetaData() {} +InternalFullMetaData::InternalFullMetaData() {} -PigeonFullMetaData::PigeonFullMetaData(const EncodableMap* metadata) +InternalFullMetaData::InternalFullMetaData(const EncodableMap* metadata) : metadata_(metadata ? std::optional(*metadata) : std::nullopt) {} -const EncodableMap* PigeonFullMetaData::metadata() const { +const EncodableMap* InternalFullMetaData::metadata() const { return metadata_ ? &(*metadata_) : nullptr; } -void PigeonFullMetaData::set_metadata(const EncodableMap* value_arg) { +void InternalFullMetaData::set_metadata(const EncodableMap* value_arg) { metadata_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonFullMetaData::set_metadata(const EncodableMap& value_arg) { +void InternalFullMetaData::set_metadata(const EncodableMap& value_arg) { metadata_ = value_arg; } -EncodableList PigeonFullMetaData::ToEncodableList() const { +EncodableList InternalFullMetaData::ToEncodableList() const { EncodableList list; list.reserve(1); list.push_back(metadata_ ? EncodableValue(*metadata_) : EncodableValue()); return list; } -PigeonFullMetaData PigeonFullMetaData::FromEncodableList( +InternalFullMetaData InternalFullMetaData::FromEncodableList( const EncodableList& list) { - PigeonFullMetaData decoded; + InternalFullMetaData decoded; auto& encodable_metadata = list[0]; if (!encodable_metadata.IsNull()) { decoded.set_metadata(std::get(encodable_metadata)); @@ -168,37 +433,55 @@ PigeonFullMetaData PigeonFullMetaData::FromEncodableList( return decoded; } -// PigeonListOptions +bool InternalFullMetaData::operator==(const InternalFullMetaData& other) const { + return PigeonInternalDeepEquals(metadata_, other.metadata_); +} + +bool InternalFullMetaData::operator!=(const InternalFullMetaData& other) const { + return !(*this == other); +} -PigeonListOptions::PigeonListOptions(int64_t max_results) +size_t InternalFullMetaData::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(metadata_); + return result; +} + +size_t PigeonInternalDeepHash(const InternalFullMetaData& v) { + return v.Hash(); +} + +// InternalListOptions + +InternalListOptions::InternalListOptions(int64_t max_results) : max_results_(max_results) {} -PigeonListOptions::PigeonListOptions(int64_t max_results, - const std::string* page_token) +InternalListOptions::InternalListOptions(int64_t max_results, + const std::string* page_token) : max_results_(max_results), page_token_(page_token ? std::optional(*page_token) : std::nullopt) {} -int64_t PigeonListOptions::max_results() const { return max_results_; } +int64_t InternalListOptions::max_results() const { return max_results_; } -void PigeonListOptions::set_max_results(int64_t value_arg) { +void InternalListOptions::set_max_results(int64_t value_arg) { max_results_ = value_arg; } -const std::string* PigeonListOptions::page_token() const { +const std::string* InternalListOptions::page_token() const { return page_token_ ? &(*page_token_) : nullptr; } -void PigeonListOptions::set_page_token(const std::string_view* value_arg) { +void InternalListOptions::set_page_token(const std::string_view* value_arg) { page_token_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonListOptions::set_page_token(std::string_view value_arg) { +void InternalListOptions::set_page_token(std::string_view value_arg) { page_token_ = value_arg; } -EncodableList PigeonListOptions::ToEncodableList() const { +EncodableList InternalListOptions::ToEncodableList() const { EncodableList list; list.reserve(2); list.push_back(EncodableValue(max_results_)); @@ -206,9 +489,9 @@ EncodableList PigeonListOptions::ToEncodableList() const { return list; } -PigeonListOptions PigeonListOptions::FromEncodableList( +InternalListOptions InternalListOptions::FromEncodableList( const EncodableList& list) { - PigeonListOptions decoded(list[0].LongValue()); + InternalListOptions decoded(std::get(list[0])); auto& encodable_page_token = list[1]; if (!encodable_page_token.IsNull()) { decoded.set_page_token(std::get(encodable_page_token)); @@ -216,11 +499,29 @@ PigeonListOptions PigeonListOptions::FromEncodableList( return decoded; } -// PigeonSettableMetadata +bool InternalListOptions::operator==(const InternalListOptions& other) const { + return PigeonInternalDeepEquals(max_results_, other.max_results_) && + PigeonInternalDeepEquals(page_token_, other.page_token_); +} -PigeonSettableMetadata::PigeonSettableMetadata() {} +bool InternalListOptions::operator!=(const InternalListOptions& other) const { + return !(*this == other); +} -PigeonSettableMetadata::PigeonSettableMetadata( +size_t InternalListOptions::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(max_results_); + result = result * 31 + PigeonInternalDeepHash(page_token_); + return result; +} + +size_t PigeonInternalDeepHash(const InternalListOptions& v) { return v.Hash(); } + +// InternalSettableMetadata + +InternalSettableMetadata::InternalSettableMetadata() {} + +InternalSettableMetadata::InternalSettableMetadata( const std::string* cache_control, const std::string* content_disposition, const std::string* content_encoding, const std::string* content_language, const std::string* content_type, const EncodableMap* custom_metadata) @@ -241,93 +542,95 @@ PigeonSettableMetadata::PigeonSettableMetadata( ? std::optional(*custom_metadata) : std::nullopt) {} -const std::string* PigeonSettableMetadata::cache_control() const { +const std::string* InternalSettableMetadata::cache_control() const { return cache_control_ ? &(*cache_control_) : nullptr; } -void PigeonSettableMetadata::set_cache_control( +void InternalSettableMetadata::set_cache_control( const std::string_view* value_arg) { cache_control_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonSettableMetadata::set_cache_control(std::string_view value_arg) { +void InternalSettableMetadata::set_cache_control(std::string_view value_arg) { cache_control_ = value_arg; } -const std::string* PigeonSettableMetadata::content_disposition() const { +const std::string* InternalSettableMetadata::content_disposition() const { return content_disposition_ ? &(*content_disposition_) : nullptr; } -void PigeonSettableMetadata::set_content_disposition( +void InternalSettableMetadata::set_content_disposition( const std::string_view* value_arg) { content_disposition_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonSettableMetadata::set_content_disposition( +void InternalSettableMetadata::set_content_disposition( std::string_view value_arg) { content_disposition_ = value_arg; } -const std::string* PigeonSettableMetadata::content_encoding() const { +const std::string* InternalSettableMetadata::content_encoding() const { return content_encoding_ ? &(*content_encoding_) : nullptr; } -void PigeonSettableMetadata::set_content_encoding( +void InternalSettableMetadata::set_content_encoding( const std::string_view* value_arg) { content_encoding_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonSettableMetadata::set_content_encoding(std::string_view value_arg) { +void InternalSettableMetadata::set_content_encoding( + std::string_view value_arg) { content_encoding_ = value_arg; } -const std::string* PigeonSettableMetadata::content_language() const { +const std::string* InternalSettableMetadata::content_language() const { return content_language_ ? &(*content_language_) : nullptr; } -void PigeonSettableMetadata::set_content_language( +void InternalSettableMetadata::set_content_language( const std::string_view* value_arg) { content_language_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonSettableMetadata::set_content_language(std::string_view value_arg) { +void InternalSettableMetadata::set_content_language( + std::string_view value_arg) { content_language_ = value_arg; } -const std::string* PigeonSettableMetadata::content_type() const { +const std::string* InternalSettableMetadata::content_type() const { return content_type_ ? &(*content_type_) : nullptr; } -void PigeonSettableMetadata::set_content_type( +void InternalSettableMetadata::set_content_type( const std::string_view* value_arg) { content_type_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonSettableMetadata::set_content_type(std::string_view value_arg) { +void InternalSettableMetadata::set_content_type(std::string_view value_arg) { content_type_ = value_arg; } -const EncodableMap* PigeonSettableMetadata::custom_metadata() const { +const EncodableMap* InternalSettableMetadata::custom_metadata() const { return custom_metadata_ ? &(*custom_metadata_) : nullptr; } -void PigeonSettableMetadata::set_custom_metadata( +void InternalSettableMetadata::set_custom_metadata( const EncodableMap* value_arg) { custom_metadata_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonSettableMetadata::set_custom_metadata( +void InternalSettableMetadata::set_custom_metadata( const EncodableMap& value_arg) { custom_metadata_ = value_arg; } -EncodableList PigeonSettableMetadata::ToEncodableList() const { +EncodableList InternalSettableMetadata::ToEncodableList() const { EncodableList list; list.reserve(6); list.push_back(cache_control_ ? EncodableValue(*cache_control_) @@ -345,9 +648,9 @@ EncodableList PigeonSettableMetadata::ToEncodableList() const { return list; } -PigeonSettableMetadata PigeonSettableMetadata::FromEncodableList( +InternalSettableMetadata InternalSettableMetadata::FromEncodableList( const EncodableList& list) { - PigeonSettableMetadata decoded; + InternalSettableMetadata decoded; auto& encodable_cache_control = list[0]; if (!encodable_cache_control.IsNull()) { decoded.set_cache_control(std::get(encodable_cache_control)); @@ -379,46 +682,208 @@ PigeonSettableMetadata PigeonSettableMetadata::FromEncodableList( return decoded; } -// PigeonListResult +bool InternalSettableMetadata::operator==( + const InternalSettableMetadata& other) const { + return PigeonInternalDeepEquals(cache_control_, other.cache_control_) && + PigeonInternalDeepEquals(content_disposition_, + other.content_disposition_) && + PigeonInternalDeepEquals(content_encoding_, other.content_encoding_) && + PigeonInternalDeepEquals(content_language_, other.content_language_) && + PigeonInternalDeepEquals(content_type_, other.content_type_) && + PigeonInternalDeepEquals(custom_metadata_, other.custom_metadata_); +} + +bool InternalSettableMetadata::operator!=( + const InternalSettableMetadata& other) const { + return !(*this == other); +} + +size_t InternalSettableMetadata::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(cache_control_); + result = result * 31 + PigeonInternalDeepHash(content_disposition_); + result = result * 31 + PigeonInternalDeepHash(content_encoding_); + result = result * 31 + PigeonInternalDeepHash(content_language_); + result = result * 31 + PigeonInternalDeepHash(content_type_); + result = result * 31 + PigeonInternalDeepHash(custom_metadata_); + return result; +} + +size_t PigeonInternalDeepHash(const InternalSettableMetadata& v) { + return v.Hash(); +} + +// InternalStorageTaskSnapShot + +InternalStorageTaskSnapShot::InternalStorageTaskSnapShot( + int64_t bytes_transferred, const InternalStorageTaskState& state, + int64_t total_bytes) + : bytes_transferred_(bytes_transferred), + state_(state), + total_bytes_(total_bytes) {} + +InternalStorageTaskSnapShot::InternalStorageTaskSnapShot( + int64_t bytes_transferred, const InternalFullMetaData* metadata, + const InternalStorageTaskState& state, int64_t total_bytes) + : bytes_transferred_(bytes_transferred), + metadata_(metadata ? std::make_unique(*metadata) + : nullptr), + state_(state), + total_bytes_(total_bytes) {} + +InternalStorageTaskSnapShot::InternalStorageTaskSnapShot( + const InternalStorageTaskSnapShot& other) + : bytes_transferred_(other.bytes_transferred_), + metadata_(other.metadata_ + ? std::make_unique(*other.metadata_) + : nullptr), + state_(other.state_), + total_bytes_(other.total_bytes_) {} + +InternalStorageTaskSnapShot& InternalStorageTaskSnapShot::operator=( + const InternalStorageTaskSnapShot& other) { + bytes_transferred_ = other.bytes_transferred_; + metadata_ = other.metadata_ + ? std::make_unique(*other.metadata_) + : nullptr; + state_ = other.state_; + total_bytes_ = other.total_bytes_; + return *this; +} + +int64_t InternalStorageTaskSnapShot::bytes_transferred() const { + return bytes_transferred_; +} + +void InternalStorageTaskSnapShot::set_bytes_transferred(int64_t value_arg) { + bytes_transferred_ = value_arg; +} + +const InternalFullMetaData* InternalStorageTaskSnapShot::metadata() const { + return metadata_.get(); +} + +void InternalStorageTaskSnapShot::set_metadata( + const InternalFullMetaData* value_arg) { + metadata_ = + value_arg ? std::make_unique(*value_arg) : nullptr; +} + +void InternalStorageTaskSnapShot::set_metadata( + const InternalFullMetaData& value_arg) { + metadata_ = std::make_unique(value_arg); +} + +const InternalStorageTaskState& InternalStorageTaskSnapShot::state() const { + return state_; +} + +void InternalStorageTaskSnapShot::set_state( + const InternalStorageTaskState& value_arg) { + state_ = value_arg; +} + +int64_t InternalStorageTaskSnapShot::total_bytes() const { + return total_bytes_; +} + +void InternalStorageTaskSnapShot::set_total_bytes(int64_t value_arg) { + total_bytes_ = value_arg; +} + +EncodableList InternalStorageTaskSnapShot::ToEncodableList() const { + EncodableList list; + list.reserve(4); + list.push_back(EncodableValue(bytes_transferred_)); + list.push_back(metadata_ ? CustomEncodableValue(*metadata_) + : EncodableValue()); + list.push_back(CustomEncodableValue(state_)); + list.push_back(EncodableValue(total_bytes_)); + return list; +} + +InternalStorageTaskSnapShot InternalStorageTaskSnapShot::FromEncodableList( + const EncodableList& list) { + InternalStorageTaskSnapShot decoded( + std::get(list[0]), + std::any_cast( + std::get(list[2])), + std::get(list[3])); + auto& encodable_metadata = list[1]; + if (!encodable_metadata.IsNull()) { + decoded.set_metadata(std::any_cast( + std::get(encodable_metadata))); + } + return decoded; +} + +bool InternalStorageTaskSnapShot::operator==( + const InternalStorageTaskSnapShot& other) const { + return PigeonInternalDeepEquals(bytes_transferred_, + other.bytes_transferred_) && + PigeonInternalDeepEquals(metadata_, other.metadata_) && + PigeonInternalDeepEquals(state_, other.state_) && + PigeonInternalDeepEquals(total_bytes_, other.total_bytes_); +} + +bool InternalStorageTaskSnapShot::operator!=( + const InternalStorageTaskSnapShot& other) const { + return !(*this == other); +} + +size_t InternalStorageTaskSnapShot::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(bytes_transferred_); + result = result * 31 + PigeonInternalDeepHash(metadata_); + result = result * 31 + PigeonInternalDeepHash(state_); + result = result * 31 + PigeonInternalDeepHash(total_bytes_); + return result; +} + +size_t PigeonInternalDeepHash(const InternalStorageTaskSnapShot& v) { + return v.Hash(); +} + +// InternalListResult -PigeonListResult::PigeonListResult(const EncodableList& items, - const EncodableList& prefixs) +InternalListResult::InternalListResult(const EncodableList& items, + const EncodableList& prefixs) : items_(items), prefixs_(prefixs) {} -PigeonListResult::PigeonListResult(const EncodableList& items, - const std::string* page_token, - const EncodableList& prefixs) +InternalListResult::InternalListResult(const EncodableList& items, + const std::string* page_token, + const EncodableList& prefixs) : items_(items), page_token_(page_token ? std::optional(*page_token) : std::nullopt), prefixs_(prefixs) {} -const EncodableList& PigeonListResult::items() const { return items_; } +const EncodableList& InternalListResult::items() const { return items_; } -void PigeonListResult::set_items(const EncodableList& value_arg) { +void InternalListResult::set_items(const EncodableList& value_arg) { items_ = value_arg; } -const std::string* PigeonListResult::page_token() const { +const std::string* InternalListResult::page_token() const { return page_token_ ? &(*page_token_) : nullptr; } -void PigeonListResult::set_page_token(const std::string_view* value_arg) { +void InternalListResult::set_page_token(const std::string_view* value_arg) { page_token_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void PigeonListResult::set_page_token(std::string_view value_arg) { +void InternalListResult::set_page_token(std::string_view value_arg) { page_token_ = value_arg; } -const EncodableList& PigeonListResult::prefixs() const { return prefixs_; } +const EncodableList& InternalListResult::prefixs() const { return prefixs_; } -void PigeonListResult::set_prefixs(const EncodableList& value_arg) { +void InternalListResult::set_prefixs(const EncodableList& value_arg) { prefixs_ = value_arg; } -EncodableList PigeonListResult::ToEncodableList() const { +EncodableList InternalListResult::ToEncodableList() const { EncodableList list; list.reserve(3); list.push_back(EncodableValue(items_)); @@ -427,10 +892,10 @@ EncodableList PigeonListResult::ToEncodableList() const { return list; } -PigeonListResult PigeonListResult::FromEncodableList( +InternalListResult InternalListResult::FromEncodableList( const EncodableList& list) { - PigeonListResult decoded(std::get(list[0]), - std::get(list[2])); + InternalListResult decoded(std::get(list[0]), + std::get(list[2])); auto& encodable_page_token = list[1]; if (!encodable_page_token.IsNull()) { decoded.set_page_token(std::get(encodable_page_token)); @@ -438,109 +903,175 @@ PigeonListResult PigeonListResult::FromEncodableList( return decoded; } -FirebaseStorageHostApiCodecSerializer::FirebaseStorageHostApiCodecSerializer() { +bool InternalListResult::operator==(const InternalListResult& other) const { + return PigeonInternalDeepEquals(items_, other.items_) && + PigeonInternalDeepEquals(page_token_, other.page_token_) && + PigeonInternalDeepEquals(prefixs_, other.prefixs_); +} + +bool InternalListResult::operator!=(const InternalListResult& other) const { + return !(*this == other); +} + +size_t InternalListResult::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(items_); + result = result * 31 + PigeonInternalDeepHash(page_token_); + result = result * 31 + PigeonInternalDeepHash(prefixs_); + return result; } -EncodableValue FirebaseStorageHostApiCodecSerializer::ReadValueOfType( - uint8_t type, flutter::ByteStreamReader* stream) const { +size_t PigeonInternalDeepHash(const InternalListResult& v) { return v.Hash(); } + +PigeonInternalCodecSerializer::PigeonInternalCodecSerializer() {} + +EncodableValue PigeonInternalCodecSerializer::ReadValueOfType( + uint8_t type, ::flutter::ByteStreamReader* stream) const { switch (type) { - case 128: - return CustomEncodableValue(PigeonFullMetaData::FromEncodableList( + case 129: { + const auto& encodable_enum_arg = ReadValue(stream); + const int64_t enum_arg_value = + encodable_enum_arg.IsNull() ? 0 : encodable_enum_arg.LongValue(); + return encodable_enum_arg.IsNull() + ? EncodableValue() + : CustomEncodableValue( + static_cast(enum_arg_value)); + } + case 130: { + return CustomEncodableValue(InternalStorageFirebaseApp::FromEncodableList( std::get(ReadValue(stream)))); - case 129: - return CustomEncodableValue(PigeonListOptions::FromEncodableList( + } + case 131: { + return CustomEncodableValue(InternalStorageReference::FromEncodableList( std::get(ReadValue(stream)))); - case 130: - return CustomEncodableValue(PigeonListResult::FromEncodableList( + } + case 132: { + return CustomEncodableValue(InternalFullMetaData::FromEncodableList( std::get(ReadValue(stream)))); - case 131: - return CustomEncodableValue(PigeonSettableMetadata::FromEncodableList( + } + case 133: { + return CustomEncodableValue(InternalListOptions::FromEncodableList( std::get(ReadValue(stream)))); - case 132: - return CustomEncodableValue(PigeonStorageFirebaseApp::FromEncodableList( + } + case 134: { + return CustomEncodableValue(InternalSettableMetadata::FromEncodableList( std::get(ReadValue(stream)))); - case 133: - return CustomEncodableValue(PigeonStorageReference::FromEncodableList( + } + case 135: { + return CustomEncodableValue( + InternalStorageTaskSnapShot::FromEncodableList( + std::get(ReadValue(stream)))); + } + case 136: { + return CustomEncodableValue(InternalListResult::FromEncodableList( std::get(ReadValue(stream)))); + } default: - return flutter::StandardCodecSerializer::ReadValueOfType(type, stream); + return ::flutter::StandardCodecSerializer::ReadValueOfType(type, stream); } } -void FirebaseStorageHostApiCodecSerializer::WriteValue( - const EncodableValue& value, flutter::ByteStreamWriter* stream) const { +void PigeonInternalCodecSerializer::WriteValue( + const EncodableValue& value, ::flutter::ByteStreamWriter* stream) const { if (const CustomEncodableValue* custom_value = std::get_if(&value)) { - if (custom_value->type() == typeid(PigeonFullMetaData)) { - stream->WriteByte(128); - WriteValue(EncodableValue(std::any_cast(*custom_value) - .ToEncodableList()), - stream); - return; - } - if (custom_value->type() == typeid(PigeonListOptions)) { + if (custom_value->type() == typeid(InternalStorageTaskState)) { stream->WriteByte(129); - WriteValue(EncodableValue(std::any_cast(*custom_value) - .ToEncodableList()), + WriteValue(EncodableValue(static_cast( + std::any_cast(*custom_value))), stream); return; } - if (custom_value->type() == typeid(PigeonListResult)) { + if (custom_value->type() == typeid(InternalStorageFirebaseApp)) { stream->WriteByte(130); - WriteValue( - EncodableValue( - std::any_cast(*custom_value).ToEncodableList()), - stream); + WriteValue(EncodableValue( + std::any_cast(*custom_value) + .ToEncodableList()), + stream); return; } - if (custom_value->type() == typeid(PigeonSettableMetadata)) { + if (custom_value->type() == typeid(InternalStorageReference)) { stream->WriteByte(131); WriteValue( - EncodableValue(std::any_cast(*custom_value) + EncodableValue(std::any_cast(*custom_value) .ToEncodableList()), stream); return; } - if (custom_value->type() == typeid(PigeonStorageFirebaseApp)) { + if (custom_value->type() == typeid(InternalFullMetaData)) { stream->WriteByte(132); WriteValue( - EncodableValue(std::any_cast(*custom_value) + EncodableValue(std::any_cast(*custom_value) .ToEncodableList()), stream); return; } - if (custom_value->type() == typeid(PigeonStorageReference)) { + if (custom_value->type() == typeid(InternalListOptions)) { stream->WriteByte(133); WriteValue( - EncodableValue(std::any_cast(*custom_value) + EncodableValue(std::any_cast(*custom_value) + .ToEncodableList()), + stream); + return; + } + if (custom_value->type() == typeid(InternalSettableMetadata)) { + stream->WriteByte(134); + WriteValue( + EncodableValue(std::any_cast(*custom_value) .ToEncodableList()), stream); return; } + if (custom_value->type() == typeid(InternalStorageTaskSnapShot)) { + stream->WriteByte(135); + WriteValue(EncodableValue( + std::any_cast(*custom_value) + .ToEncodableList()), + stream); + return; + } + if (custom_value->type() == typeid(InternalListResult)) { + stream->WriteByte(136); + WriteValue(EncodableValue(std::any_cast(*custom_value) + .ToEncodableList()), + stream); + return; + } } - flutter::StandardCodecSerializer::WriteValue(value, stream); + ::flutter::StandardCodecSerializer::WriteValue(value, stream); } /// The codec used by FirebaseStorageHostApi. -const flutter::StandardMessageCodec& FirebaseStorageHostApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance( - &FirebaseStorageHostApiCodecSerializer::GetInstance()); +const ::flutter::StandardMessageCodec& FirebaseStorageHostApi::GetCodec() { + return ::flutter::StandardMessageCodec::GetInstance( + &PigeonInternalCodecSerializer::GetInstance()); } // Sets up an instance of `FirebaseStorageHostApi` to handle messages through // the `binary_messenger`. -void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, +void FirebaseStorageHostApi::SetUp(::flutter::BinaryMessenger* binary_messenger, FirebaseStorageHostApi* api) { + FirebaseStorageHostApi::SetUp(binary_messenger, api, ""); +} + +void FirebaseStorageHostApi::SetUp(::flutter::BinaryMessenger* binary_messenger, + FirebaseStorageHostApi* api, + const std::string& message_channel_suffix) { + const std::string prepended_suffix = + message_channel_suffix.length() > 0 + ? std::string(".") + message_channel_suffix + : ""; { - auto channel = std::make_unique>( + BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.firebase_storage_platform_interface." - "FirebaseStorageHostApi.getReferencebyPath", + "FirebaseStorageHostApi.getReferencebyPath" + + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( + channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -549,7 +1080,7 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, return; } const auto& app_arg = - std::any_cast( + std::any_cast( std::get(encodable_app_arg)); const auto& encodable_path_arg = args.at(1); if (encodable_path_arg.IsNull()) { @@ -562,7 +1093,7 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, std::get_if(&encodable_bucket_arg); api->GetReferencebyPath( app_arg, path_arg, bucket_arg, - [reply](ErrorOr&& output) { + [reply](ErrorOr&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; @@ -577,19 +1108,20 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, } }); } else { - channel->SetMessageHandler(nullptr); + channel.SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( + BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.firebase_storage_platform_interface." - "FirebaseStorageHostApi.setMaxOperationRetryTime", + "FirebaseStorageHostApi.setMaxOperationRetryTime" + + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( + channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -598,7 +1130,7 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, return; } const auto& app_arg = - std::any_cast( + std::any_cast( std::get(encodable_app_arg)); const auto& encodable_time_arg = args.at(1); if (encodable_time_arg.IsNull()) { @@ -622,19 +1154,20 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, } }); } else { - channel->SetMessageHandler(nullptr); + channel.SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( + BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.firebase_storage_platform_interface." - "FirebaseStorageHostApi.setMaxUploadRetryTime", + "FirebaseStorageHostApi.setMaxUploadRetryTime" + + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( + channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -643,7 +1176,7 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, return; } const auto& app_arg = - std::any_cast( + std::any_cast( std::get(encodable_app_arg)); const auto& encodable_time_arg = args.at(1); if (encodable_time_arg.IsNull()) { @@ -667,19 +1200,20 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, } }); } else { - channel->SetMessageHandler(nullptr); + channel.SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( + BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.firebase_storage_platform_interface." - "FirebaseStorageHostApi.setMaxDownloadRetryTime", + "FirebaseStorageHostApi.setMaxDownloadRetryTime" + + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( + channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -688,7 +1222,7 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, return; } const auto& app_arg = - std::any_cast( + std::any_cast( std::get(encodable_app_arg)); const auto& encodable_time_arg = args.at(1); if (encodable_time_arg.IsNull()) { @@ -712,19 +1246,20 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, } }); } else { - channel->SetMessageHandler(nullptr); + channel.SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( + BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.firebase_storage_platform_interface." - "FirebaseStorageHostApi.useStorageEmulator", + "FirebaseStorageHostApi.useStorageEmulator" + + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( + channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -733,7 +1268,7 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, return; } const auto& app_arg = - std::any_cast( + std::any_cast( std::get(encodable_app_arg)); const auto& encodable_host_arg = args.at(1); if (encodable_host_arg.IsNull()) { @@ -763,19 +1298,20 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, } }); } else { - channel->SetMessageHandler(nullptr); + channel.SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( + BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.firebase_storage_platform_interface." - "FirebaseStorageHostApi.referenceDelete", + "FirebaseStorageHostApi.referenceDelete" + + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( + channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -784,7 +1320,7 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, return; } const auto& app_arg = - std::any_cast( + std::any_cast( std::get(encodable_app_arg)); const auto& encodable_reference_arg = args.at(1); if (encodable_reference_arg.IsNull()) { @@ -792,7 +1328,7 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, return; } const auto& reference_arg = - std::any_cast( + std::any_cast( std::get(encodable_reference_arg)); api->ReferenceDelete( app_arg, reference_arg, @@ -810,19 +1346,20 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, } }); } else { - channel->SetMessageHandler(nullptr); + channel.SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( + BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.firebase_storage_platform_interface." - "FirebaseStorageHostApi.referenceGetDownloadURL", + "FirebaseStorageHostApi.referenceGetDownloadURL" + + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( + channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -831,7 +1368,7 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, return; } const auto& app_arg = - std::any_cast( + std::any_cast( std::get(encodable_app_arg)); const auto& encodable_reference_arg = args.at(1); if (encodable_reference_arg.IsNull()) { @@ -839,7 +1376,7 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, return; } const auto& reference_arg = - std::any_cast( + std::any_cast( std::get(encodable_reference_arg)); api->ReferenceGetDownloadURL( app_arg, reference_arg, @@ -858,19 +1395,20 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, } }); } else { - channel->SetMessageHandler(nullptr); + channel.SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( + BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.firebase_storage_platform_interface." - "FirebaseStorageHostApi.referenceGetMetaData", + "FirebaseStorageHostApi.referenceGetMetaData" + + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( + channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -879,7 +1417,7 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, return; } const auto& app_arg = - std::any_cast( + std::any_cast( std::get(encodable_app_arg)); const auto& encodable_reference_arg = args.at(1); if (encodable_reference_arg.IsNull()) { @@ -887,11 +1425,11 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, return; } const auto& reference_arg = - std::any_cast( + std::any_cast( std::get(encodable_reference_arg)); api->ReferenceGetMetaData( app_arg, reference_arg, - [reply](ErrorOr&& output) { + [reply](ErrorOr&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; @@ -906,19 +1444,20 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, } }); } else { - channel->SetMessageHandler(nullptr); + channel.SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( + BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.firebase_storage_platform_interface." - "FirebaseStorageHostApi.referenceList", + "FirebaseStorageHostApi.referenceList" + + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( + channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -927,7 +1466,7 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, return; } const auto& app_arg = - std::any_cast( + std::any_cast( std::get(encodable_app_arg)); const auto& encodable_reference_arg = args.at(1); if (encodable_reference_arg.IsNull()) { @@ -935,17 +1474,18 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, return; } const auto& reference_arg = - std::any_cast( + std::any_cast( std::get(encodable_reference_arg)); const auto& encodable_options_arg = args.at(2); if (encodable_options_arg.IsNull()) { reply(WrapError("options_arg unexpectedly null.")); return; } - const auto& options_arg = std::any_cast( - std::get(encodable_options_arg)); + const auto& options_arg = + std::any_cast( + std::get(encodable_options_arg)); api->ReferenceList(app_arg, reference_arg, options_arg, - [reply](ErrorOr&& output) { + [reply](ErrorOr&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; @@ -960,19 +1500,20 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, } }); } else { - channel->SetMessageHandler(nullptr); + channel.SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( + BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.firebase_storage_platform_interface." - "FirebaseStorageHostApi.referenceListAll", + "FirebaseStorageHostApi.referenceListAll" + + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( + channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -981,7 +1522,7 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, return; } const auto& app_arg = - std::any_cast( + std::any_cast( std::get(encodable_app_arg)); const auto& encodable_reference_arg = args.at(1); if (encodable_reference_arg.IsNull()) { @@ -989,11 +1530,11 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, return; } const auto& reference_arg = - std::any_cast( + std::any_cast( std::get(encodable_reference_arg)); api->ReferenceListAll( app_arg, reference_arg, - [reply](ErrorOr&& output) { + [reply](ErrorOr&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; @@ -1008,19 +1549,20 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, } }); } else { - channel->SetMessageHandler(nullptr); + channel.SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( + BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.firebase_storage_platform_interface." - "FirebaseStorageHostApi.referenceGetData", + "FirebaseStorageHostApi.referenceGetData" + + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( + channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -1029,7 +1571,7 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, return; } const auto& app_arg = - std::any_cast( + std::any_cast( std::get(encodable_app_arg)); const auto& encodable_reference_arg = args.at(1); if (encodable_reference_arg.IsNull()) { @@ -1037,7 +1579,7 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, return; } const auto& reference_arg = - std::any_cast( + std::any_cast( std::get(encodable_reference_arg)); const auto& encodable_max_size_arg = args.at(2); if (encodable_max_size_arg.IsNull()) { @@ -1068,19 +1610,20 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, } }); } else { - channel->SetMessageHandler(nullptr); + channel.SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( + BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.firebase_storage_platform_interface." - "FirebaseStorageHostApi.referencePutData", + "FirebaseStorageHostApi.referencePutData" + + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( + channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -1089,7 +1632,7 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, return; } const auto& app_arg = - std::any_cast( + std::any_cast( std::get(encodable_app_arg)); const auto& encodable_reference_arg = args.at(1); if (encodable_reference_arg.IsNull()) { @@ -1097,7 +1640,7 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, return; } const auto& reference_arg = - std::any_cast( + std::any_cast( std::get(encodable_reference_arg)); const auto& encodable_data_arg = args.at(2); if (encodable_data_arg.IsNull()) { @@ -1112,7 +1655,7 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, return; } const auto& settable_meta_data_arg = - std::any_cast( + std::any_cast( std::get( encodable_settable_meta_data_arg)); const auto& encodable_handle_arg = args.at(4); @@ -1138,19 +1681,20 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, } }); } else { - channel->SetMessageHandler(nullptr); + channel.SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( + BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.firebase_storage_platform_interface." - "FirebaseStorageHostApi.referencePutString", + "FirebaseStorageHostApi.referencePutString" + + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( + channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -1159,7 +1703,7 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, return; } const auto& app_arg = - std::any_cast( + std::any_cast( std::get(encodable_app_arg)); const auto& encodable_reference_arg = args.at(1); if (encodable_reference_arg.IsNull()) { @@ -1167,7 +1711,7 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, return; } const auto& reference_arg = - std::any_cast( + std::any_cast( std::get(encodable_reference_arg)); const auto& encodable_data_arg = args.at(2); if (encodable_data_arg.IsNull()) { @@ -1187,7 +1731,7 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, return; } const auto& settable_meta_data_arg = - std::any_cast( + std::any_cast( std::get( encodable_settable_meta_data_arg)); const auto& encodable_handle_arg = args.at(5); @@ -1214,19 +1758,20 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, } }); } else { - channel->SetMessageHandler(nullptr); + channel.SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( + BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.firebase_storage_platform_interface." - "FirebaseStorageHostApi.referencePutFile", + "FirebaseStorageHostApi.referencePutFile" + + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( + channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -1235,7 +1780,7 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, return; } const auto& app_arg = - std::any_cast( + std::any_cast( std::get(encodable_app_arg)); const auto& encodable_reference_arg = args.at(1); if (encodable_reference_arg.IsNull()) { @@ -1243,7 +1788,7 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, return; } const auto& reference_arg = - std::any_cast( + std::any_cast( std::get(encodable_reference_arg)); const auto& encodable_file_path_arg = args.at(2); if (encodable_file_path_arg.IsNull()) { @@ -1254,9 +1799,11 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, std::get(encodable_file_path_arg); const auto& encodable_settable_meta_data_arg = args.at(3); const auto* settable_meta_data_arg = - &(std::any_cast( - std::get( - encodable_settable_meta_data_arg))); + encodable_settable_meta_data_arg.IsNull() + ? nullptr + : &(std::any_cast( + std::get( + encodable_settable_meta_data_arg))); const auto& encodable_handle_arg = args.at(4); if (encodable_handle_arg.IsNull()) { reply(WrapError("handle_arg unexpectedly null.")); @@ -1280,19 +1827,20 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, } }); } else { - channel->SetMessageHandler(nullptr); + channel.SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( + BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.firebase_storage_platform_interface." - "FirebaseStorageHostApi.referenceDownloadFile", + "FirebaseStorageHostApi.referenceDownloadFile" + + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( + channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -1301,7 +1849,7 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, return; } const auto& app_arg = - std::any_cast( + std::any_cast( std::get(encodable_app_arg)); const auto& encodable_reference_arg = args.at(1); if (encodable_reference_arg.IsNull()) { @@ -1309,7 +1857,7 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, return; } const auto& reference_arg = - std::any_cast( + std::any_cast( std::get(encodable_reference_arg)); const auto& encodable_file_path_arg = args.at(2); if (encodable_file_path_arg.IsNull()) { @@ -1341,19 +1889,20 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, } }); } else { - channel->SetMessageHandler(nullptr); + channel.SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( + BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.firebase_storage_platform_interface." - "FirebaseStorageHostApi.referenceUpdateMetadata", + "FirebaseStorageHostApi.referenceUpdateMetadata" + + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( + channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -1362,7 +1911,7 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, return; } const auto& app_arg = - std::any_cast( + std::any_cast( std::get(encodable_app_arg)); const auto& encodable_reference_arg = args.at(1); if (encodable_reference_arg.IsNull()) { @@ -1370,7 +1919,7 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, return; } const auto& reference_arg = - std::any_cast( + std::any_cast( std::get(encodable_reference_arg)); const auto& encodable_metadata_arg = args.at(2); if (encodable_metadata_arg.IsNull()) { @@ -1378,11 +1927,11 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, return; } const auto& metadata_arg = - std::any_cast( + std::any_cast( std::get(encodable_metadata_arg)); api->ReferenceUpdateMetadata( app_arg, reference_arg, metadata_arg, - [reply](ErrorOr&& output) { + [reply](ErrorOr&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; @@ -1397,19 +1946,20 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, } }); } else { - channel->SetMessageHandler(nullptr); + channel.SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( + BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.firebase_storage_platform_interface." - "FirebaseStorageHostApi.taskPause", + "FirebaseStorageHostApi.taskPause" + + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( + channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -1418,7 +1968,7 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, return; } const auto& app_arg = - std::any_cast( + std::any_cast( std::get(encodable_app_arg)); const auto& encodable_handle_arg = args.at(1); if (encodable_handle_arg.IsNull()) { @@ -1442,19 +1992,20 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, } }); } else { - channel->SetMessageHandler(nullptr); + channel.SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( + BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.firebase_storage_platform_interface." - "FirebaseStorageHostApi.taskResume", + "FirebaseStorageHostApi.taskResume" + + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( + channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -1463,7 +2014,7 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, return; } const auto& app_arg = - std::any_cast( + std::any_cast( std::get(encodable_app_arg)); const auto& encodable_handle_arg = args.at(1); if (encodable_handle_arg.IsNull()) { @@ -1487,19 +2038,20 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, } }); } else { - channel->SetMessageHandler(nullptr); + channel.SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( + BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.firebase_storage_platform_interface." - "FirebaseStorageHostApi.taskCancel", + "FirebaseStorageHostApi.taskCancel" + + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( + channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_app_arg = args.at(0); @@ -1508,7 +2060,7 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, return; } const auto& app_arg = - std::any_cast( + std::any_cast( std::get(encodable_app_arg)); const auto& encodable_handle_arg = args.at(1); if (encodable_handle_arg.IsNull()) { @@ -1532,7 +2084,7 @@ void FirebaseStorageHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, } }); } else { - channel->SetMessageHandler(nullptr); + channel.SetMessageHandler(nullptr); } } } @@ -1550,4 +2102,4 @@ EncodableValue FirebaseStorageHostApi::WrapError(const FlutterError& error) { error.details()}); } -} // namespace firebase_storage_windows \ No newline at end of file +} // namespace firebase_storage_windows diff --git a/packages/firebase_storage/firebase_storage/windows/messages.g.h b/packages/firebase_storage/firebase_storage/windows/messages.g.h index 307747a7320b..35ca69bdf997 100644 --- a/packages/firebase_storage/firebase_storage/windows/messages.g.h +++ b/packages/firebase_storage/firebase_storage/windows/messages.g.h @@ -1,7 +1,7 @@ // Copyright 2023, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v11.0.1), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), do not edit directly. // See also: https://pub.dev/packages/pigeon #ifndef PIGEON_MESSAGES_G_H_ @@ -25,17 +25,17 @@ class FlutterError { explicit FlutterError(const std::string& code, const std::string& message) : code_(code), message_(message) {} explicit FlutterError(const std::string& code, const std::string& message, - const flutter::EncodableValue& details) + const ::flutter::EncodableValue& details) : code_(code), message_(message), details_(details) {} const std::string& code() const { return code_; } const std::string& message() const { return message_; } - const flutter::EncodableValue& details() const { return details_; } + const ::flutter::EncodableValue& details() const { return details_; } private: std::string code_; std::string message_; - flutter::EncodableValue details_; + ::flutter::EncodableValue details_; }; template @@ -60,30 +60,30 @@ class ErrorOr { // The type of operation that generated the action code from calling // [TaskState]. -enum class PigeonStorageTaskState { +enum class InternalStorageTaskState { // Indicates the task has been paused by the user. - paused = 0, + kPaused = 0, // Indicates the task is currently in-progress. - running = 1, + kRunning = 1, // Indicates the task has successfully completed. - success = 2, + kSuccess = 2, // Indicates the task was canceled. - canceled = 3, + kCanceled = 3, // Indicates the task failed with an error. - error = 4 + kError = 4 }; // Generated class from Pigeon that represents data sent in messages. -class PigeonStorageFirebaseApp { +class InternalStorageFirebaseApp { public: // Constructs an object setting all non-nullable fields. - explicit PigeonStorageFirebaseApp(const std::string& app_name, - const std::string& bucket); + explicit InternalStorageFirebaseApp(const std::string& app_name, + const std::string& bucket); // Constructs an object setting all fields. - explicit PigeonStorageFirebaseApp(const std::string& app_name, - const std::string* tenant_id, - const std::string& bucket); + explicit InternalStorageFirebaseApp(const std::string& app_name, + const std::string* tenant_id, + const std::string& bucket); const std::string& app_name() const; void set_app_name(std::string_view value_arg); @@ -95,24 +95,36 @@ class PigeonStorageFirebaseApp { const std::string& bucket() const; void set_bucket(std::string_view value_arg); + bool operator==(const InternalStorageFirebaseApp& other) const; + bool operator!=(const InternalStorageFirebaseApp& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + + private: + static InternalStorageFirebaseApp FromEncodableList( + const ::flutter::EncodableList& list); + + public: + public: + ::flutter::EncodableList ToEncodableList() const; + + private: private: - static PigeonStorageFirebaseApp FromEncodableList( - const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; friend class FirebaseStorageHostApi; - friend class FirebaseStorageHostApiCodecSerializer; + friend class PigeonInternalCodecSerializer; std::string app_name_; std::optional tenant_id_; std::string bucket_; }; // Generated class from Pigeon that represents data sent in messages. -class PigeonStorageReference { +class InternalStorageReference { public: // Constructs an object setting all fields. - explicit PigeonStorageReference(const std::string& bucket, - const std::string& full_path, - const std::string& name); + explicit InternalStorageReference(const std::string& bucket, + const std::string& full_path, + const std::string& name); const std::string& bucket() const; void set_bucket(std::string_view value_arg); @@ -123,48 +135,73 @@ class PigeonStorageReference { const std::string& name() const; void set_name(std::string_view value_arg); + bool operator==(const InternalStorageReference& other) const; + bool operator!=(const InternalStorageReference& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + + private: + static InternalStorageReference FromEncodableList( + const ::flutter::EncodableList& list); + + public: + public: + ::flutter::EncodableList ToEncodableList() const; + + private: private: - static PigeonStorageReference FromEncodableList( - const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; friend class FirebaseStorageHostApi; - friend class FirebaseStorageHostApiCodecSerializer; + friend class PigeonInternalCodecSerializer; std::string bucket_; std::string full_path_; std::string name_; }; // Generated class from Pigeon that represents data sent in messages. -class PigeonFullMetaData { +class InternalFullMetaData { public: // Constructs an object setting all non-nullable fields. - PigeonFullMetaData(); + InternalFullMetaData(); // Constructs an object setting all fields. - explicit PigeonFullMetaData(const flutter::EncodableMap* metadata); + explicit InternalFullMetaData(const ::flutter::EncodableMap* metadata); + + const ::flutter::EncodableMap* metadata() const; + void set_metadata(const ::flutter::EncodableMap* value_arg); + void set_metadata(const ::flutter::EncodableMap& value_arg); - const flutter::EncodableMap* metadata() const; - void set_metadata(const flutter::EncodableMap* value_arg); - void set_metadata(const flutter::EncodableMap& value_arg); + bool operator==(const InternalFullMetaData& other) const; + bool operator!=(const InternalFullMetaData& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; private: - static PigeonFullMetaData FromEncodableList( - const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; + static InternalFullMetaData FromEncodableList( + const ::flutter::EncodableList& list); + + public: + public: + ::flutter::EncodableList ToEncodableList() const; + + private: + private: + friend class InternalStorageTaskSnapShot; friend class FirebaseStorageHostApi; - friend class FirebaseStorageHostApiCodecSerializer; - std::optional metadata_; + friend class PigeonInternalCodecSerializer; + std::optional<::flutter::EncodableMap> metadata_; }; // Generated class from Pigeon that represents data sent in messages. -class PigeonListOptions { +class InternalListOptions { public: // Constructs an object setting all non-nullable fields. - explicit PigeonListOptions(int64_t max_results); + explicit InternalListOptions(int64_t max_results); // Constructs an object setting all fields. - explicit PigeonListOptions(int64_t max_results, - const std::string* page_token); + explicit InternalListOptions(int64_t max_results, + const std::string* page_token); // If set, limits the total number of `prefixes` and `items` to return. // @@ -179,29 +216,40 @@ class PigeonListOptions { void set_page_token(const std::string_view* value_arg); void set_page_token(std::string_view value_arg); + bool operator==(const InternalListOptions& other) const; + bool operator!=(const InternalListOptions& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + + private: + static InternalListOptions FromEncodableList( + const ::flutter::EncodableList& list); + + public: + public: + ::flutter::EncodableList ToEncodableList() const; + + private: private: - static PigeonListOptions FromEncodableList( - const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; friend class FirebaseStorageHostApi; - friend class FirebaseStorageHostApiCodecSerializer; + friend class PigeonInternalCodecSerializer; int64_t max_results_; std::optional page_token_; }; // Generated class from Pigeon that represents data sent in messages. -class PigeonSettableMetadata { +class InternalSettableMetadata { public: // Constructs an object setting all non-nullable fields. - PigeonSettableMetadata(); + InternalSettableMetadata(); // Constructs an object setting all fields. - explicit PigeonSettableMetadata(const std::string* cache_control, - const std::string* content_disposition, - const std::string* content_encoding, - const std::string* content_language, - const std::string* content_type, - const flutter::EncodableMap* custom_metadata); + explicit InternalSettableMetadata( + const std::string* cache_control, const std::string* content_disposition, + const std::string* content_encoding, const std::string* content_language, + const std::string* content_type, + const ::flutter::EncodableMap* custom_metadata); // Served as the 'Cache-Control' header on object download. // @@ -243,71 +291,154 @@ class PigeonSettableMetadata { void set_content_type(std::string_view value_arg); // Additional user-defined custom metadata. - const flutter::EncodableMap* custom_metadata() const; - void set_custom_metadata(const flutter::EncodableMap* value_arg); - void set_custom_metadata(const flutter::EncodableMap& value_arg); + const ::flutter::EncodableMap* custom_metadata() const; + void set_custom_metadata(const ::flutter::EncodableMap* value_arg); + void set_custom_metadata(const ::flutter::EncodableMap& value_arg); + + bool operator==(const InternalSettableMetadata& other) const; + bool operator!=(const InternalSettableMetadata& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; private: - static PigeonSettableMetadata FromEncodableList( - const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; + static InternalSettableMetadata FromEncodableList( + const ::flutter::EncodableList& list); + + public: + public: + ::flutter::EncodableList ToEncodableList() const; + + private: + private: friend class FirebaseStorageHostApi; - friend class FirebaseStorageHostApiCodecSerializer; + friend class PigeonInternalCodecSerializer; std::optional cache_control_; std::optional content_disposition_; std::optional content_encoding_; std::optional content_language_; std::optional content_type_; - std::optional custom_metadata_; + std::optional<::flutter::EncodableMap> custom_metadata_; }; // Generated class from Pigeon that represents data sent in messages. -class PigeonListResult { +class InternalStorageTaskSnapShot { public: // Constructs an object setting all non-nullable fields. - explicit PigeonListResult(const flutter::EncodableList& items, - const flutter::EncodableList& prefixs); + explicit InternalStorageTaskSnapShot(int64_t bytes_transferred, + const InternalStorageTaskState& state, + int64_t total_bytes); // Constructs an object setting all fields. - explicit PigeonListResult(const flutter::EncodableList& items, - const std::string* page_token, - const flutter::EncodableList& prefixs); + explicit InternalStorageTaskSnapShot(int64_t bytes_transferred, + const InternalFullMetaData* metadata, + const InternalStorageTaskState& state, + int64_t total_bytes); + + ~InternalStorageTaskSnapShot() = default; + InternalStorageTaskSnapShot(const InternalStorageTaskSnapShot& other); + InternalStorageTaskSnapShot& operator=( + const InternalStorageTaskSnapShot& other); + InternalStorageTaskSnapShot(InternalStorageTaskSnapShot&& other) = default; + InternalStorageTaskSnapShot& operator=( + InternalStorageTaskSnapShot&& other) noexcept = default; + int64_t bytes_transferred() const; + void set_bytes_transferred(int64_t value_arg); + + const InternalFullMetaData* metadata() const; + void set_metadata(const InternalFullMetaData* value_arg); + void set_metadata(const InternalFullMetaData& value_arg); + + const InternalStorageTaskState& state() const; + void set_state(const InternalStorageTaskState& value_arg); + + int64_t total_bytes() const; + void set_total_bytes(int64_t value_arg); + + bool operator==(const InternalStorageTaskSnapShot& other) const; + bool operator!=(const InternalStorageTaskSnapShot& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + + private: + static InternalStorageTaskSnapShot FromEncodableList( + const ::flutter::EncodableList& list); - const flutter::EncodableList& items() const; - void set_items(const flutter::EncodableList& value_arg); + public: + public: + ::flutter::EncodableList ToEncodableList() const; + + private: + private: + friend class FirebaseStorageHostApi; + friend class PigeonInternalCodecSerializer; + int64_t bytes_transferred_; + std::unique_ptr metadata_; + InternalStorageTaskState state_; + int64_t total_bytes_; +}; + +// Generated class from Pigeon that represents data sent in messages. +class InternalListResult { + public: + // Constructs an object setting all non-nullable fields. + explicit InternalListResult(const ::flutter::EncodableList& items, + const ::flutter::EncodableList& prefixs); + + // Constructs an object setting all fields. + explicit InternalListResult(const ::flutter::EncodableList& items, + const std::string* page_token, + const ::flutter::EncodableList& prefixs); + + const ::flutter::EncodableList& items() const; + void set_items(const ::flutter::EncodableList& value_arg); const std::string* page_token() const; void set_page_token(const std::string_view* value_arg); void set_page_token(std::string_view value_arg); - const flutter::EncodableList& prefixs() const; - void set_prefixs(const flutter::EncodableList& value_arg); + const ::flutter::EncodableList& prefixs() const; + void set_prefixs(const ::flutter::EncodableList& value_arg); + bool operator==(const InternalListResult& other) const; + bool operator!=(const InternalListResult& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + + private: + static InternalListResult FromEncodableList( + const ::flutter::EncodableList& list); + + public: + public: + ::flutter::EncodableList ToEncodableList() const; + + private: private: - static PigeonListResult FromEncodableList(const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; friend class FirebaseStorageHostApi; - friend class FirebaseStorageHostApiCodecSerializer; - flutter::EncodableList items_; + friend class PigeonInternalCodecSerializer; + ::flutter::EncodableList items_; std::optional page_token_; - flutter::EncodableList prefixs_; + ::flutter::EncodableList prefixs_; }; -class FirebaseStorageHostApiCodecSerializer - : public flutter::StandardCodecSerializer { +class PigeonInternalCodecSerializer + : public ::flutter::StandardCodecSerializer { public: - FirebaseStorageHostApiCodecSerializer(); - inline static FirebaseStorageHostApiCodecSerializer& GetInstance() { - static FirebaseStorageHostApiCodecSerializer sInstance; + PigeonInternalCodecSerializer(); + inline static PigeonInternalCodecSerializer& GetInstance() { + static PigeonInternalCodecSerializer sInstance; return sInstance; } - void WriteValue(const flutter::EncodableValue& value, - flutter::ByteStreamWriter* stream) const override; + void WriteValue(const ::flutter::EncodableValue& value, + ::flutter::ByteStreamWriter* stream) const override; protected: - flutter::EncodableValue ReadValueOfType( - uint8_t type, flutter::ByteStreamReader* stream) const override; + ::flutter::EncodableValue ReadValueOfType( + uint8_t type, ::flutter::ByteStreamReader* stream) const override; }; // Generated interface from Pigeon that represents a handler of messages from @@ -318,91 +449,96 @@ class FirebaseStorageHostApi { FirebaseStorageHostApi& operator=(const FirebaseStorageHostApi&) = delete; virtual ~FirebaseStorageHostApi() {} virtual void GetReferencebyPath( - const PigeonStorageFirebaseApp& app, const std::string& path, + const InternalStorageFirebaseApp& app, const std::string& path, const std::string* bucket, - std::function reply)> result) = 0; + std::function reply)> result) = 0; virtual void SetMaxOperationRetryTime( - const PigeonStorageFirebaseApp& app, int64_t time, + const InternalStorageFirebaseApp& app, int64_t time, std::function reply)> result) = 0; virtual void SetMaxUploadRetryTime( - const PigeonStorageFirebaseApp& app, int64_t time, + const InternalStorageFirebaseApp& app, int64_t time, std::function reply)> result) = 0; virtual void SetMaxDownloadRetryTime( - const PigeonStorageFirebaseApp& app, int64_t time, + const InternalStorageFirebaseApp& app, int64_t time, std::function reply)> result) = 0; virtual void UseStorageEmulator( - const PigeonStorageFirebaseApp& app, const std::string& host, + const InternalStorageFirebaseApp& app, const std::string& host, int64_t port, std::function reply)> result) = 0; virtual void ReferenceDelete( - const PigeonStorageFirebaseApp& app, - const PigeonStorageReference& reference, + const InternalStorageFirebaseApp& app, + const InternalStorageReference& reference, std::function reply)> result) = 0; virtual void ReferenceGetDownloadURL( - const PigeonStorageFirebaseApp& app, - const PigeonStorageReference& reference, + const InternalStorageFirebaseApp& app, + const InternalStorageReference& reference, std::function reply)> result) = 0; virtual void ReferenceGetMetaData( - const PigeonStorageFirebaseApp& app, - const PigeonStorageReference& reference, - std::function reply)> result) = 0; + const InternalStorageFirebaseApp& app, + const InternalStorageReference& reference, + std::function reply)> result) = 0; virtual void ReferenceList( - const PigeonStorageFirebaseApp& app, - const PigeonStorageReference& reference, const PigeonListOptions& options, - std::function reply)> result) = 0; + const InternalStorageFirebaseApp& app, + const InternalStorageReference& reference, + const InternalListOptions& options, + std::function reply)> result) = 0; virtual void ReferenceListAll( - const PigeonStorageFirebaseApp& app, - const PigeonStorageReference& reference, - std::function reply)> result) = 0; + const InternalStorageFirebaseApp& app, + const InternalStorageReference& reference, + std::function reply)> result) = 0; virtual void ReferenceGetData( - const PigeonStorageFirebaseApp& app, - const PigeonStorageReference& reference, int64_t max_size, + const InternalStorageFirebaseApp& app, + const InternalStorageReference& reference, int64_t max_size, std::function>> reply)> result) = 0; virtual void ReferencePutData( - const PigeonStorageFirebaseApp& app, - const PigeonStorageReference& reference, const std::vector& data, - const PigeonSettableMetadata& settable_meta_data, int64_t handle, + const InternalStorageFirebaseApp& app, + const InternalStorageReference& reference, + const std::vector& data, + const InternalSettableMetadata& settable_meta_data, int64_t handle, std::function reply)> result) = 0; virtual void ReferencePutString( - const PigeonStorageFirebaseApp& app, - const PigeonStorageReference& reference, const std::string& data, - int64_t format, const PigeonSettableMetadata& settable_meta_data, + const InternalStorageFirebaseApp& app, + const InternalStorageReference& reference, const std::string& data, + int64_t format, const InternalSettableMetadata& settable_meta_data, int64_t handle, std::function reply)> result) = 0; virtual void ReferencePutFile( - const PigeonStorageFirebaseApp& app, - const PigeonStorageReference& reference, const std::string& file_path, - const PigeonSettableMetadata* settable_meta_data, int64_t handle, + const InternalStorageFirebaseApp& app, + const InternalStorageReference& reference, const std::string& file_path, + const InternalSettableMetadata* settable_meta_data, int64_t handle, std::function reply)> result) = 0; virtual void ReferenceDownloadFile( - const PigeonStorageFirebaseApp& app, - const PigeonStorageReference& reference, const std::string& file_path, + const InternalStorageFirebaseApp& app, + const InternalStorageReference& reference, const std::string& file_path, int64_t handle, std::function reply)> result) = 0; virtual void ReferenceUpdateMetadata( - const PigeonStorageFirebaseApp& app, - const PigeonStorageReference& reference, - const PigeonSettableMetadata& metadata, - std::function reply)> result) = 0; + const InternalStorageFirebaseApp& app, + const InternalStorageReference& reference, + const InternalSettableMetadata& metadata, + std::function reply)> result) = 0; virtual void TaskPause( - const PigeonStorageFirebaseApp& app, int64_t handle, - std::function reply)> result) = 0; + const InternalStorageFirebaseApp& app, int64_t handle, + std::function reply)> result) = 0; virtual void TaskResume( - const PigeonStorageFirebaseApp& app, int64_t handle, - std::function reply)> result) = 0; + const InternalStorageFirebaseApp& app, int64_t handle, + std::function reply)> result) = 0; virtual void TaskCancel( - const PigeonStorageFirebaseApp& app, int64_t handle, - std::function reply)> result) = 0; + const InternalStorageFirebaseApp& app, int64_t handle, + std::function reply)> result) = 0; // The codec used by FirebaseStorageHostApi. - static const flutter::StandardMessageCodec& GetCodec(); + static const ::flutter::StandardMessageCodec& GetCodec(); // Sets up an instance of `FirebaseStorageHostApi` to handle messages through // the `binary_messenger`. - static void SetUp(flutter::BinaryMessenger* binary_messenger, + static void SetUp(::flutter::BinaryMessenger* binary_messenger, FirebaseStorageHostApi* api); - static flutter::EncodableValue WrapError(std::string_view error_message); - static flutter::EncodableValue WrapError(const FlutterError& error); + static void SetUp(::flutter::BinaryMessenger* binary_messenger, + FirebaseStorageHostApi* api, + const std::string& message_channel_suffix); + static ::flutter::EncodableValue WrapError(std::string_view error_message); + static ::flutter::EncodableValue WrapError(const FlutterError& error); protected: FirebaseStorageHostApi() = default; diff --git a/packages/firebase_storage/firebase_storage_platform_interface/lib/src/method_channel/method_channel_firebase_storage.dart b/packages/firebase_storage/firebase_storage_platform_interface/lib/src/method_channel/method_channel_firebase_storage.dart index ec3544856a96..85cc085517c2 100644 --- a/packages/firebase_storage/firebase_storage_platform_interface/lib/src/method_channel/method_channel_firebase_storage.dart +++ b/packages/firebase_storage/firebase_storage_platform_interface/lib/src/method_channel/method_channel_firebase_storage.dart @@ -43,8 +43,8 @@ class MethodChannelFirebaseStorage extends FirebaseStoragePlatform { static final FirebaseStorageHostApi pigeonChannel = FirebaseStorageHostApi(); /// FirebaseApp pigeon instance - PigeonStorageFirebaseApp get pigeonFirebaseApp { - return PigeonStorageFirebaseApp( + InternalStorageFirebaseApp get pigeonFirebaseApp { + return InternalStorageFirebaseApp( appName: app.name, bucket: bucket, ); @@ -71,28 +71,28 @@ class MethodChannelFirebaseStorage extends FirebaseStoragePlatform { return MethodChannelFirebaseStorage._(); } - /// Return an instance of a [PigeonStorageReference] - static PigeonStorageReference getPigeonReference( + /// Return an instance of a [InternalStorageReference] + static InternalStorageReference getPigeonReference( String bucket, String fullPath, String name) { - return PigeonStorageReference( + return InternalStorageReference( bucket: bucket, fullPath: fullPath, name: name); } - /// Return an instance of a [PigeonStorageFirebaseApp] - PigeonStorageFirebaseApp getPigeonFirebaseApp(String appName) { - return PigeonStorageFirebaseApp( + /// Return an instance of a [InternalStorageFirebaseApp] + InternalStorageFirebaseApp getPigeonFirebaseApp(String appName) { + return InternalStorageFirebaseApp( appName: appName, bucket: bucket, ); } - /// Convert a [SettableMetadata] to [PigeonSettableMetadata] - static PigeonSettableMetadata getPigeonSettableMetaData( + /// Convert a [SettableMetadata] to [InternalSettableMetadata] + static InternalSettableMetadata getPigeonSettableMetaData( SettableMetadata? metaData) { if (metaData == null) { - return PigeonSettableMetadata(); + return InternalSettableMetadata(); } - return PigeonSettableMetadata( + return InternalSettableMetadata( cacheControl: metaData.cacheControl, contentDisposition: metaData.contentDisposition, contentEncoding: metaData.contentEncoding, diff --git a/packages/firebase_storage/firebase_storage_platform_interface/lib/src/method_channel/method_channel_reference.dart b/packages/firebase_storage/firebase_storage_platform_interface/lib/src/method_channel/method_channel_reference.dart index 22b05190161a..bc279770919b 100644 --- a/packages/firebase_storage/firebase_storage_platform_interface/lib/src/method_channel/method_channel_reference.dart +++ b/packages/firebase_storage/firebase_storage_platform_interface/lib/src/method_channel/method_channel_reference.dart @@ -22,16 +22,16 @@ class MethodChannelReference extends ReferencePlatform { : super(storage, path); /// FirebaseApp pigeon instance - PigeonStorageFirebaseApp get pigeonFirebaseApp { - return PigeonStorageFirebaseApp( + InternalStorageFirebaseApp get pigeonFirebaseApp { + return InternalStorageFirebaseApp( appName: storage.app.name, bucket: storage.bucket, ); } /// Default of FirebaseReference pigeon instance - PigeonStorageReference get pigeonReference { - return PigeonStorageReference( + InternalStorageReference get pigeonReference { + return InternalStorageReference( bucket: storage.bucket, fullPath: fullPath, name: name, @@ -59,8 +59,8 @@ class MethodChannelReference extends ReferencePlatform { } } - /// Convert a [PigeonFullMetaData] to [FullMetadata] - static FullMetadata convertMetadata(PigeonFullMetaData pigeonMetadata) { + /// Convert a [InternalFullMetaData] to [FullMetadata] + static FullMetadata convertMetadata(InternalFullMetaData pigeonMetadata) { Map _metadata = {}; pigeonMetadata.metadata?.forEach((key, value) { if (key != null) { @@ -73,7 +73,7 @@ class MethodChannelReference extends ReferencePlatform { @override Future getMetadata() async { try { - PigeonFullMetaData metaData = await MethodChannelFirebaseStorage + InternalFullMetaData metaData = await MethodChannelFirebaseStorage .pigeonChannel .referenceGetMetaData(pigeonFirebaseApp, pigeonReference); return convertMetadata(metaData); @@ -82,20 +82,20 @@ class MethodChannelReference extends ReferencePlatform { } } - /// Convert a [ListOptions] to [PigeonListOptions] - static PigeonListOptions convertOptions(ListOptions? options) { + /// Convert a [ListOptions] to [InternalListOptions] + static InternalListOptions convertOptions(ListOptions? options) { if (options == null) { - return PigeonListOptions(maxResults: 1000); + return InternalListOptions(maxResults: 1000); } - return PigeonListOptions( + return InternalListOptions( maxResults: options.maxResults ?? 1000, pageToken: options.pageToken, ); } - /// Convert a [PigeonListResult] to [ListResultPlatform] + /// Convert a [InternalListResult] to [ListResultPlatform] ListResultPlatform convertListReference( - PigeonListResult pigeonReferenceList) { + InternalListResult pigeonReferenceList) { List referencePaths = []; for (final reference in pigeonReferenceList.items) { referencePaths.add(reference!.fullPath); @@ -115,10 +115,10 @@ class MethodChannelReference extends ReferencePlatform { @override Future list([ListOptions? options]) async { try { - PigeonListOptions pigeonOptions = convertOptions(options); - PigeonListResult pigeonReferenceList = await MethodChannelFirebaseStorage - .pigeonChannel - .referenceList(pigeonFirebaseApp, pigeonReference, pigeonOptions); + InternalListOptions pigeonOptions = convertOptions(options); + InternalListResult pigeonReferenceList = + await MethodChannelFirebaseStorage.pigeonChannel + .referenceList(pigeonFirebaseApp, pigeonReference, pigeonOptions); return convertListReference(pigeonReferenceList); } catch (e, stack) { convertPlatformException(e, stack); @@ -128,9 +128,9 @@ class MethodChannelReference extends ReferencePlatform { @override Future listAll() async { try { - PigeonListResult pigeonReferenceList = await MethodChannelFirebaseStorage - .pigeonChannel - .referenceListAll(pigeonFirebaseApp, pigeonReference); + InternalListResult pigeonReferenceList = + await MethodChannelFirebaseStorage.pigeonChannel + .referenceListAll(pigeonFirebaseApp, pigeonReference); return convertListReference(pigeonReferenceList); } catch (e, stack) { convertPlatformException(e, stack); @@ -173,9 +173,9 @@ class MethodChannelReference extends ReferencePlatform { handle, storage, fullPath, data, format, metadata); } - /// Convert a [SettableMetadata] to [PigeonSettableMetadata] - PigeonSettableMetadata convertToPigeonMetaData(SettableMetadata data) { - return PigeonSettableMetadata( + /// Convert a [SettableMetadata] to [InternalSettableMetadata] + InternalSettableMetadata convertToPigeonMetaData(SettableMetadata data) { + return InternalSettableMetadata( cacheControl: data.cacheControl, contentDisposition: data.contentDisposition, contentEncoding: data.contentEncoding, @@ -188,7 +188,7 @@ class MethodChannelReference extends ReferencePlatform { @override Future updateMetadata(SettableMetadata metadata) async { try { - PigeonFullMetaData updatedMetaData = await MethodChannelFirebaseStorage + InternalFullMetaData updatedMetaData = await MethodChannelFirebaseStorage .pigeonChannel .referenceUpdateMetadata(pigeonFirebaseApp, pigeonReference, convertToPigeonMetaData(metadata)); diff --git a/packages/firebase_storage/firebase_storage_platform_interface/lib/src/method_channel/method_channel_task.dart b/packages/firebase_storage/firebase_storage_platform_interface/lib/src/method_channel/method_channel_task.dart index cb10a718cc6b..71524a2c441e 100644 --- a/packages/firebase_storage/firebase_storage_platform_interface/lib/src/method_channel/method_channel_task.dart +++ b/packages/firebase_storage/firebase_storage_platform_interface/lib/src/method_channel/method_channel_task.dart @@ -126,27 +126,27 @@ abstract class MethodChannelTask extends TaskPlatform { bool _userListening = false; /// FirebaseApp pigeon instance - static PigeonStorageFirebaseApp pigeonFirebaseApp( + static InternalStorageFirebaseApp pigeonFirebaseApp( FirebaseStoragePlatform storage) { - return PigeonStorageFirebaseApp( + return InternalStorageFirebaseApp( appName: storage.app.name, bucket: storage.bucket, ); } - /// Convert [TaskState] to [PigeonStorageTaskState] - PigeonStorageTaskState convertToPigeonTaskState(TaskState state) { + /// Convert [TaskState] to [InternalStorageTaskState] + InternalStorageTaskState convertToPigeonTaskState(TaskState state) { switch (state) { case TaskState.canceled: - return PigeonStorageTaskState.canceled; + return InternalStorageTaskState.canceled; case TaskState.error: - return PigeonStorageTaskState.error; + return InternalStorageTaskState.error; case TaskState.paused: - return PigeonStorageTaskState.paused; + return InternalStorageTaskState.paused; case TaskState.running: - return PigeonStorageTaskState.running; + return InternalStorageTaskState.running; case TaskState.success: - return PigeonStorageTaskState.success; + return InternalStorageTaskState.success; } } @@ -263,7 +263,7 @@ class MethodChannelPutFileTask extends MethodChannelTask { static Future _getTask(int handle, FirebaseStoragePlatform storage, String path, File file, SettableMetadata? metadata) { - PigeonSettableMetadata? pigeonSettableMetadata; + InternalSettableMetadata? pigeonSettableMetadata; if (defaultTargetPlatform == TargetPlatform.windows) { // TODO(russellwheatley): sending null to windows throws exception so we pass empty metadata pigeonSettableMetadata = diff --git a/packages/firebase_storage/firebase_storage_platform_interface/lib/src/pigeon/messages.pigeon.dart b/packages/firebase_storage/firebase_storage_platform_interface/lib/src/pigeon/messages.pigeon.dart index d5f1ca5617df..ceb6abb3e6e0 100644 --- a/packages/firebase_storage/firebase_storage_platform_interface/lib/src/pigeon/messages.pigeon.dart +++ b/packages/firebase_storage/firebase_storage_platform_interface/lib/src/pigeon/messages.pigeon.dart @@ -1,19 +1,118 @@ // Copyright 2023, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v11.0.1), do not edit directly. +// Autogenerated from Pigeon (v26.3.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 +// ignore_for_file: unused_import, unused_shown_name +// ignore_for_file: type=lint import 'dart:async'; -import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; +import 'dart:typed_data' show Float64List, Int32List, Int64List; -import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer; import 'package:flutter/services.dart'; +import 'package:meta/meta.dart' show immutable, protected, visibleForTesting; + +Object? _extractReplyValueOrThrow( + List? replyList, + String channelName, { + required bool isNullValid, +}) { + if (replyList == null) { + throw PlatformException( + code: 'channel-error', + message: 'Unable to establish connection on channel: "$channelName".', + ); + } else if (replyList.length > 1) { + throw PlatformException( + code: replyList[0]! as String, + message: replyList[1] as String?, + details: replyList[2], + ); + } else if (!isNullValid && (replyList.isNotEmpty && replyList[0] == null)) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } + return replyList.firstOrNull; +} + +List wrapResponse( + {Object? result, PlatformException? error, bool empty = false}) { + if (empty) { + return []; + } + if (error == null) { + return [result]; + } + return [error.code, error.message, error.details]; +} + +bool _deepEquals(Object? a, Object? b) { + if (identical(a, b)) { + return true; + } + if (a is double && b is double) { + if (a.isNaN && b.isNaN) { + return true; + } + return a == b; + } + if (a is List && b is List) { + return a.length == b.length && + a.indexed + .every(((int, dynamic) item) => _deepEquals(item.$2, b[item.$1])); + } + if (a is Map && b is Map) { + if (a.length != b.length) { + return false; + } + for (final MapEntry entryA in a.entries) { + bool found = false; + for (final MapEntry entryB in b.entries) { + if (_deepEquals(entryA.key, entryB.key)) { + if (_deepEquals(entryA.value, entryB.value)) { + found = true; + break; + } else { + return false; + } + } + } + if (!found) { + return false; + } + } + return true; + } + return a == b; +} + +int _deepHash(Object? value) { + if (value is List) { + return Object.hashAll(value.map(_deepHash)); + } + if (value is Map) { + int result = 0; + for (final MapEntry entry in value.entries) { + result += (_deepHash(entry.key) * 31) ^ _deepHash(entry.value); + } + return result; + } + if (value is double && value.isNaN) { + // Normalize NaN to a consistent hash. + return 0x7FF8000000000000.hashCode; + } + if (value is double && value == 0.0) { + // Normalize -0.0 to 0.0 so they have the same hash code. + return 0.0.hashCode; + } + return value.hashCode; +} /// The type of operation that generated the action code from calling /// [TaskState]. -enum PigeonStorageTaskState { +enum InternalStorageTaskState { /// Indicates the task has been paused by the user. paused, @@ -30,8 +129,8 @@ enum PigeonStorageTaskState { error, } -class PigeonStorageFirebaseApp { - PigeonStorageFirebaseApp({ +class InternalStorageFirebaseApp { + InternalStorageFirebaseApp({ required this.appName, this.tenantId, required this.bucket, @@ -43,7 +142,7 @@ class PigeonStorageFirebaseApp { String bucket; - Object encode() { + List _toList() { return [ appName, tenantId, @@ -51,18 +150,41 @@ class PigeonStorageFirebaseApp { ]; } - static PigeonStorageFirebaseApp decode(Object result) { + Object encode() { + return _toList(); + } + + static InternalStorageFirebaseApp decode(Object result) { result as List; - return PigeonStorageFirebaseApp( + return InternalStorageFirebaseApp( appName: result[0]! as String, tenantId: result[1] as String?, bucket: result[2]! as String, ); } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + bool operator ==(Object other) { + if (other is! InternalStorageFirebaseApp || + other.runtimeType != runtimeType) { + return false; + } + if (identical(this, other)) { + return true; + } + return _deepEquals(appName, other.appName) && + _deepEquals(tenantId, other.tenantId) && + _deepEquals(bucket, other.bucket); + } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + int get hashCode => _deepHash([runtimeType, ..._toList()]); } -class PigeonStorageReference { - PigeonStorageReference({ +class InternalStorageReference { + InternalStorageReference({ required this.bucket, required this.fullPath, required this.name, @@ -74,7 +196,7 @@ class PigeonStorageReference { String name; - Object encode() { + List _toList() { return [ bucket, fullPath, @@ -82,39 +204,82 @@ class PigeonStorageReference { ]; } - static PigeonStorageReference decode(Object result) { + Object encode() { + return _toList(); + } + + static InternalStorageReference decode(Object result) { result as List; - return PigeonStorageReference( + return InternalStorageReference( bucket: result[0]! as String, fullPath: result[1]! as String, name: result[2]! as String, ); } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + bool operator ==(Object other) { + if (other is! InternalStorageReference || + other.runtimeType != runtimeType) { + return false; + } + if (identical(this, other)) { + return true; + } + return _deepEquals(bucket, other.bucket) && + _deepEquals(fullPath, other.fullPath) && + _deepEquals(name, other.name); + } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + int get hashCode => _deepHash([runtimeType, ..._toList()]); } -class PigeonFullMetaData { - PigeonFullMetaData({ +class InternalFullMetaData { + InternalFullMetaData({ this.metadata, }); Map? metadata; - Object encode() { + List _toList() { return [ metadata, ]; } - static PigeonFullMetaData decode(Object result) { + Object encode() { + return _toList(); + } + + static InternalFullMetaData decode(Object result) { result as List; - return PigeonFullMetaData( + return InternalFullMetaData( metadata: (result[0] as Map?)?.cast(), ); } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + bool operator ==(Object other) { + if (other is! InternalFullMetaData || other.runtimeType != runtimeType) { + return false; + } + if (identical(this, other)) { + return true; + } + return _deepEquals(metadata, other.metadata); + } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + int get hashCode => _deepHash([runtimeType, ..._toList()]); } -class PigeonListOptions { - PigeonListOptions({ +class InternalListOptions { + InternalListOptions({ required this.maxResults, this.pageToken, }); @@ -129,24 +294,45 @@ class PigeonListOptions { /// If provided, listing is resumed from the previous position. String? pageToken; - Object encode() { + List _toList() { return [ maxResults, pageToken, ]; } - static PigeonListOptions decode(Object result) { + Object encode() { + return _toList(); + } + + static InternalListOptions decode(Object result) { result as List; - return PigeonListOptions( + return InternalListOptions( maxResults: result[0]! as int, pageToken: result[1] as String?, ); } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + bool operator ==(Object other) { + if (other is! InternalListOptions || other.runtimeType != runtimeType) { + return false; + } + if (identical(this, other)) { + return true; + } + return _deepEquals(maxResults, other.maxResults) && + _deepEquals(pageToken, other.pageToken); + } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + int get hashCode => _deepHash([runtimeType, ..._toList()]); } -class PigeonSettableMetadata { - PigeonSettableMetadata({ +class InternalSettableMetadata { + InternalSettableMetadata({ this.cacheControl, this.contentDisposition, this.contentEncoding, @@ -183,7 +369,7 @@ class PigeonSettableMetadata { /// Additional user-defined custom metadata. Map? customMetadata; - Object encode() { + List _toList() { return [ cacheControl, contentDisposition, @@ -194,9 +380,13 @@ class PigeonSettableMetadata { ]; } - static PigeonSettableMetadata decode(Object result) { + Object encode() { + return _toList(); + } + + static InternalSettableMetadata decode(Object result) { result as List; - return PigeonSettableMetadata( + return InternalSettableMetadata( cacheControl: result[0] as String?, contentDisposition: result[1] as String?, contentEncoding: result[2] as String?, @@ -206,22 +396,104 @@ class PigeonSettableMetadata { (result[5] as Map?)?.cast(), ); } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + bool operator ==(Object other) { + if (other is! InternalSettableMetadata || + other.runtimeType != runtimeType) { + return false; + } + if (identical(this, other)) { + return true; + } + return _deepEquals(cacheControl, other.cacheControl) && + _deepEquals(contentDisposition, other.contentDisposition) && + _deepEquals(contentEncoding, other.contentEncoding) && + _deepEquals(contentLanguage, other.contentLanguage) && + _deepEquals(contentType, other.contentType) && + _deepEquals(customMetadata, other.customMetadata); + } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + int get hashCode => _deepHash([runtimeType, ..._toList()]); } -class PigeonListResult { - PigeonListResult({ +class InternalStorageTaskSnapShot { + InternalStorageTaskSnapShot({ + required this.bytesTransferred, + this.metadata, + required this.state, + required this.totalBytes, + }); + + int bytesTransferred; + + InternalFullMetaData? metadata; + + InternalStorageTaskState state; + + int totalBytes; + + List _toList() { + return [ + bytesTransferred, + metadata, + state, + totalBytes, + ]; + } + + Object encode() { + return _toList(); + } + + static InternalStorageTaskSnapShot decode(Object result) { + result as List; + return InternalStorageTaskSnapShot( + bytesTransferred: result[0]! as int, + metadata: result[1] as InternalFullMetaData?, + state: result[2]! as InternalStorageTaskState, + totalBytes: result[3]! as int, + ); + } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + bool operator ==(Object other) { + if (other is! InternalStorageTaskSnapShot || + other.runtimeType != runtimeType) { + return false; + } + if (identical(this, other)) { + return true; + } + return _deepEquals(bytesTransferred, other.bytesTransferred) && + _deepEquals(metadata, other.metadata) && + _deepEquals(state, other.state) && + _deepEquals(totalBytes, other.totalBytes); + } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + int get hashCode => _deepHash([runtimeType, ..._toList()]); +} + +class InternalListResult { + InternalListResult({ required this.items, this.pageToken, required this.prefixs, }); - List items; + List items; String? pageToken; - List prefixs; + List prefixs; - Object encode() { + List _toList() { return [ items, pageToken, @@ -229,38 +501,69 @@ class PigeonListResult { ]; } - static PigeonListResult decode(Object result) { + Object encode() { + return _toList(); + } + + static InternalListResult decode(Object result) { result as List; - return PigeonListResult( - items: (result[0] as List?)!.cast(), + return InternalListResult( + items: (result[0]! as List).cast(), pageToken: result[1] as String?, - prefixs: (result[2] as List?)!.cast(), + prefixs: (result[2]! as List).cast(), ); } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + bool operator ==(Object other) { + if (other is! InternalListResult || other.runtimeType != runtimeType) { + return false; + } + if (identical(this, other)) { + return true; + } + return _deepEquals(items, other.items) && + _deepEquals(pageToken, other.pageToken) && + _deepEquals(prefixs, other.prefixs); + } + + @override + // ignore: avoid_equals_and_hash_code_on_mutable_classes + int get hashCode => _deepHash([runtimeType, ..._toList()]); } -class _FirebaseStorageHostApiCodec extends StandardMessageCodec { - const _FirebaseStorageHostApiCodec(); +class _PigeonCodec extends StandardMessageCodec { + const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is PigeonFullMetaData) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else if (value is PigeonListOptions) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is InternalStorageTaskState) { buffer.putUint8(129); - writeValue(buffer, value.encode()); - } else if (value is PigeonListResult) { + writeValue(buffer, value.index); + } else if (value is InternalStorageFirebaseApp) { buffer.putUint8(130); writeValue(buffer, value.encode()); - } else if (value is PigeonSettableMetadata) { + } else if (value is InternalStorageReference) { buffer.putUint8(131); writeValue(buffer, value.encode()); - } else if (value is PigeonStorageFirebaseApp) { + } else if (value is InternalFullMetaData) { buffer.putUint8(132); writeValue(buffer, value.encode()); - } else if (value is PigeonStorageReference) { + } else if (value is InternalListOptions) { buffer.putUint8(133); writeValue(buffer, value.encode()); + } else if (value is InternalSettableMetadata) { + buffer.putUint8(134); + writeValue(buffer, value.encode()); + } else if (value is InternalStorageTaskSnapShot) { + buffer.putUint8(135); + writeValue(buffer, value.encode()); + } else if (value is InternalListResult) { + buffer.putUint8(136); + writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); } @@ -269,18 +572,23 @@ class _FirebaseStorageHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: - return PigeonFullMetaData.decode(readValue(buffer)!); case 129: - return PigeonListOptions.decode(readValue(buffer)!); + final value = readValue(buffer) as int?; + return value == null ? null : InternalStorageTaskState.values[value]; case 130: - return PigeonListResult.decode(readValue(buffer)!); + return InternalStorageFirebaseApp.decode(readValue(buffer)!); case 131: - return PigeonSettableMetadata.decode(readValue(buffer)!); + return InternalStorageReference.decode(readValue(buffer)!); case 132: - return PigeonStorageFirebaseApp.decode(readValue(buffer)!); + return InternalFullMetaData.decode(readValue(buffer)!); case 133: - return PigeonStorageReference.decode(readValue(buffer)!); + return InternalListOptions.decode(readValue(buffer)!); + case 134: + return InternalSettableMetadata.decode(readValue(buffer)!); + case 135: + return InternalStorageTaskSnapShot.decode(readValue(buffer)!); + case 136: + return InternalListResult.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); } @@ -291,571 +599,427 @@ class FirebaseStorageHostApi { /// Constructor for [FirebaseStorageHostApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - FirebaseStorageHostApi({BinaryMessenger? binaryMessenger}) - : _binaryMessenger = binaryMessenger; - final BinaryMessenger? _binaryMessenger; - - static const MessageCodec codec = _FirebaseStorageHostApiCodec(); - - Future getReferencebyPath( - PigeonStorageFirebaseApp arg_app, - String arg_path, - String? arg_bucket) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.getReferencebyPath', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_app, arg_path, arg_bucket]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else if (replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (replyList[0] as PigeonStorageReference?)!; - } + FirebaseStorageHostApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + : pigeonVar_binaryMessenger = binaryMessenger, + pigeonVar_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final BinaryMessenger? pigeonVar_binaryMessenger; + + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); + + final String pigeonVar_messageChannelSuffix; + + Future getReferencebyPath( + InternalStorageFirebaseApp app, String path, String? bucket) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.getReferencebyPath$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, path, bucket]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as InternalStorageReference; } Future setMaxOperationRetryTime( - PigeonStorageFirebaseApp arg_app, int arg_time) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.setMaxOperationRetryTime', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_app, arg_time]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else { - return; - } + InternalStorageFirebaseApp app, int time) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.setMaxOperationRetryTime$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, time]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future setMaxUploadRetryTime( - PigeonStorageFirebaseApp arg_app, int arg_time) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.setMaxUploadRetryTime', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_app, arg_time]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else { - return; - } + InternalStorageFirebaseApp app, int time) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.setMaxUploadRetryTime$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, time]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future setMaxDownloadRetryTime( - PigeonStorageFirebaseApp arg_app, int arg_time) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.setMaxDownloadRetryTime', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_app, arg_time]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else { - return; - } + InternalStorageFirebaseApp app, int time) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.setMaxDownloadRetryTime$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, time]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } Future useStorageEmulator( - PigeonStorageFirebaseApp arg_app, String arg_host, int arg_port) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.useStorageEmulator', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_app, arg_host, arg_port]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else { - return; - } + InternalStorageFirebaseApp app, String host, int port) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.useStorageEmulator$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, host, port]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } - Future referenceDelete(PigeonStorageFirebaseApp arg_app, - PigeonStorageReference arg_reference) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceDelete', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_app, arg_reference]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else { - return; - } + Future referenceDelete(InternalStorageFirebaseApp app, + InternalStorageReference reference) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceDelete$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, reference]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } - Future referenceGetDownloadURL(PigeonStorageFirebaseApp arg_app, - PigeonStorageReference arg_reference) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceGetDownloadURL', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_app, arg_reference]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else if (replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (replyList[0] as String?)!; - } + Future referenceGetDownloadURL(InternalStorageFirebaseApp app, + InternalStorageReference reference) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceGetDownloadURL$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, reference]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as String; } - Future referenceGetMetaData( - PigeonStorageFirebaseApp arg_app, - PigeonStorageReference arg_reference) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceGetMetaData', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_app, arg_reference]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else if (replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (replyList[0] as PigeonFullMetaData?)!; - } + Future referenceGetMetaData( + InternalStorageFirebaseApp app, + InternalStorageReference reference) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceGetMetaData$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, reference]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as InternalFullMetaData; } - Future referenceList( - PigeonStorageFirebaseApp arg_app, - PigeonStorageReference arg_reference, - PigeonListOptions arg_options) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceList', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_app, arg_reference, arg_options]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else if (replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (replyList[0] as PigeonListResult?)!; - } + Future referenceList(InternalStorageFirebaseApp app, + InternalStorageReference reference, InternalListOptions options) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceList$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, reference, options]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as InternalListResult; } - Future referenceListAll(PigeonStorageFirebaseApp arg_app, - PigeonStorageReference arg_reference) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceListAll', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_app, arg_reference]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else if (replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (replyList[0] as PigeonListResult?)!; - } + Future referenceListAll(InternalStorageFirebaseApp app, + InternalStorageReference reference) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceListAll$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, reference]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as InternalListResult; } - Future referenceGetData(PigeonStorageFirebaseApp arg_app, - PigeonStorageReference arg_reference, int arg_maxSize) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceGetData', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_app, arg_reference, arg_maxSize]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else { - return (replyList[0] as Uint8List?); - } + Future referenceGetData(InternalStorageFirebaseApp app, + InternalStorageReference reference, int maxSize) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceGetData$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, reference, maxSize]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); + return pigeonVar_replyValue as Uint8List?; } Future referencePutData( - PigeonStorageFirebaseApp arg_app, - PigeonStorageReference arg_reference, - Uint8List arg_data, - PigeonSettableMetadata arg_settableMetaData, - int arg_handle) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referencePutData', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send([ - arg_app, - arg_reference, - arg_data, - arg_settableMetaData, - arg_handle - ]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else if (replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (replyList[0] as String?)!; - } + InternalStorageFirebaseApp app, + InternalStorageReference reference, + Uint8List data, + InternalSettableMetadata settableMetaData, + int handle) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referencePutData$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = pigeonVar_channel + .send([app, reference, data, settableMetaData, handle]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as String; } Future referencePutString( - PigeonStorageFirebaseApp arg_app, - PigeonStorageReference arg_reference, - String arg_data, - int arg_format, - PigeonSettableMetadata arg_settableMetaData, - int arg_handle) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referencePutString', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send([ - arg_app, - arg_reference, - arg_data, - arg_format, - arg_settableMetaData, - arg_handle - ]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else if (replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (replyList[0] as String?)!; - } + InternalStorageFirebaseApp app, + InternalStorageReference reference, + String data, + int format, + InternalSettableMetadata settableMetaData, + int handle) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referencePutString$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = pigeonVar_channel.send( + [app, reference, data, format, settableMetaData, handle]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as String; } Future referencePutFile( - PigeonStorageFirebaseApp arg_app, - PigeonStorageReference arg_reference, - String arg_filePath, - PigeonSettableMetadata? arg_settableMetaData, - int arg_handle) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referencePutFile', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send([ - arg_app, - arg_reference, - arg_filePath, - arg_settableMetaData, - arg_handle - ]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else if (replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (replyList[0] as String?)!; - } + InternalStorageFirebaseApp app, + InternalStorageReference reference, + String filePath, + InternalSettableMetadata? settableMetaData, + int handle) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referencePutFile$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = pigeonVar_channel + .send([app, reference, filePath, settableMetaData, handle]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as String; } - Future referenceDownloadFile( - PigeonStorageFirebaseApp arg_app, - PigeonStorageReference arg_reference, - String arg_filePath, - int arg_handle) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceDownloadFile', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_app, arg_reference, arg_filePath, arg_handle]) - as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else if (replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (replyList[0] as String?)!; - } + Future referenceDownloadFile(InternalStorageFirebaseApp app, + InternalStorageReference reference, String filePath, int handle) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceDownloadFile$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, reference, filePath, handle]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as String; } - Future referenceUpdateMetadata( - PigeonStorageFirebaseApp arg_app, - PigeonStorageReference arg_reference, - PigeonSettableMetadata arg_metadata) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceUpdateMetadata', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_app, arg_reference, arg_metadata]) - as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else if (replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (replyList[0] as PigeonFullMetaData?)!; - } + Future referenceUpdateMetadata( + InternalStorageFirebaseApp app, + InternalStorageReference reference, + InternalSettableMetadata metadata) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceUpdateMetadata$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, reference, metadata]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as InternalFullMetaData; } - Future> taskPause( - PigeonStorageFirebaseApp arg_app, int arg_handle) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.taskPause', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_app, arg_handle]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else if (replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (replyList[0] as Map?)!.cast(); - } + Future> taskPause( + InternalStorageFirebaseApp app, int handle) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.taskPause$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, handle]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return (pigeonVar_replyValue! as Map) + .cast(); } - Future> taskResume( - PigeonStorageFirebaseApp arg_app, int arg_handle) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.taskResume', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_app, arg_handle]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else if (replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (replyList[0] as Map?)!.cast(); - } + Future> taskResume( + InternalStorageFirebaseApp app, int handle) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.taskResume$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, handle]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return (pigeonVar_replyValue! as Map) + .cast(); } - Future> taskCancel( - PigeonStorageFirebaseApp arg_app, int arg_handle) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.taskCancel', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_app, arg_handle]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else if (replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (replyList[0] as Map?)!.cast(); - } + Future> taskCancel( + InternalStorageFirebaseApp app, int handle) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.taskCancel$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([app, handle]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return (pigeonVar_replyValue! as Map) + .cast(); } } diff --git a/packages/firebase_storage/firebase_storage_platform_interface/pigeons/messages.dart b/packages/firebase_storage/firebase_storage_platform_interface/pigeons/messages.dart index bd36f3a6b57d..2cade8ddbef5 100644 --- a/packages/firebase_storage/firebase_storage_platform_interface/pigeons/messages.dart +++ b/packages/firebase_storage/firebase_storage_platform_interface/pigeons/messages.dart @@ -24,8 +24,8 @@ import 'package:pigeon/pigeon.dart'; copyrightHeader: 'pigeons/copyright.txt', ), ) -class PigeonStorageFirebaseApp { - const PigeonStorageFirebaseApp({ +class InternalStorageFirebaseApp { + const InternalStorageFirebaseApp({ required this.appName, required this.tenantId, required this.bucket, @@ -38,7 +38,7 @@ class PigeonStorageFirebaseApp { /// The type of operation that generated the action code from calling /// [TaskState]. -enum PigeonStorageTaskState { +enum InternalStorageTaskState { /// Indicates the task has been paused by the user. paused, @@ -55,8 +55,8 @@ enum PigeonStorageTaskState { error, } -class PigeonStorageReference { - const PigeonStorageReference({ +class InternalStorageReference { + const InternalStorageReference({ required this.bucket, required this.fullPath, required this.name, @@ -67,15 +67,15 @@ class PigeonStorageReference { final String name; } -class PigeonFullMetaData { - const PigeonFullMetaData({ +class InternalFullMetaData { + const InternalFullMetaData({ required this.metadata, }); final Map? metadata; } -class PigeonListOptions { - const PigeonListOptions({ +class InternalListOptions { + const InternalListOptions({ required this.maxResults, this.pageToken, }); @@ -91,9 +91,9 @@ class PigeonListOptions { final String? pageToken; } -class PigeonSettableMetadata { - /// Creates a new [PigeonSettableMetadata] instance. - PigeonSettableMetadata({ +class InternalSettableMetadata { + /// Creates a new [InternalSettableMetadata] instance. + InternalSettableMetadata({ this.cacheControl, this.contentDisposition, this.contentEncoding, @@ -131,8 +131,8 @@ class PigeonSettableMetadata { final Map? customMetadata; } -class PigeonStorageTaskSnapShot { - const PigeonStorageTaskSnapShot({ +class InternalStorageTaskSnapShot { + const InternalStorageTaskSnapShot({ required this.bytesTransferred, required this.metadata, required this.state, @@ -140,50 +140,50 @@ class PigeonStorageTaskSnapShot { }); final int bytesTransferred; - final PigeonFullMetaData? metadata; - final PigeonStorageTaskState state; + final InternalFullMetaData? metadata; + final InternalStorageTaskState state; final int totalBytes; } -class PigeonListResult { - const PigeonListResult({ +class InternalListResult { + const InternalListResult({ required this.items, required this.pageToken, required this.prefixs, }); - final List items; + final List items; final String? pageToken; - final List prefixs; + final List prefixs; } @HostApi(dartHostTestHandler: 'TestFirebaseStorageHostApi') abstract class FirebaseStorageHostApi { @async - PigeonStorageReference getReferencebyPath( - PigeonStorageFirebaseApp app, + InternalStorageReference getReferencebyPath( + InternalStorageFirebaseApp app, String path, String? bucket, ); @async void setMaxOperationRetryTime( - PigeonStorageFirebaseApp app, + InternalStorageFirebaseApp app, int time, ); @async void setMaxUploadRetryTime( - PigeonStorageFirebaseApp app, + InternalStorageFirebaseApp app, int time, ); @async void setMaxDownloadRetryTime( - PigeonStorageFirebaseApp app, + InternalStorageFirebaseApp app, int time, ); @async void useStorageEmulator( - PigeonStorageFirebaseApp app, + InternalStorageFirebaseApp app, String host, int port, ); @@ -192,101 +192,101 @@ abstract class FirebaseStorageHostApi { @async void referenceDelete( - PigeonStorageFirebaseApp app, - PigeonStorageReference reference, + InternalStorageFirebaseApp app, + InternalStorageReference reference, ); @async String referenceGetDownloadURL( - PigeonStorageFirebaseApp app, - PigeonStorageReference reference, + InternalStorageFirebaseApp app, + InternalStorageReference reference, ); @async - PigeonFullMetaData referenceGetMetaData( - PigeonStorageFirebaseApp app, - PigeonStorageReference reference, + InternalFullMetaData referenceGetMetaData( + InternalStorageFirebaseApp app, + InternalStorageReference reference, ); @async - PigeonListResult referenceList( - PigeonStorageFirebaseApp app, - PigeonStorageReference reference, - PigeonListOptions options, + InternalListResult referenceList( + InternalStorageFirebaseApp app, + InternalStorageReference reference, + InternalListOptions options, ); @async - PigeonListResult referenceListAll( - PigeonStorageFirebaseApp app, - PigeonStorageReference reference, + InternalListResult referenceListAll( + InternalStorageFirebaseApp app, + InternalStorageReference reference, ); @async Uint8List? referenceGetData( - PigeonStorageFirebaseApp app, - PigeonStorageReference reference, + InternalStorageFirebaseApp app, + InternalStorageReference reference, int maxSize, ); @async String referencePutData( - PigeonStorageFirebaseApp app, - PigeonStorageReference reference, + InternalStorageFirebaseApp app, + InternalStorageReference reference, Uint8List data, - PigeonSettableMetadata settableMetaData, + InternalSettableMetadata settableMetaData, int handle, ); @async String referencePutString( - PigeonStorageFirebaseApp app, - PigeonStorageReference reference, + InternalStorageFirebaseApp app, + InternalStorageReference reference, String data, int format, - PigeonSettableMetadata settableMetaData, + InternalSettableMetadata settableMetaData, int handle, ); @async String referencePutFile( - PigeonStorageFirebaseApp app, - PigeonStorageReference reference, + InternalStorageFirebaseApp app, + InternalStorageReference reference, String filePath, - PigeonSettableMetadata? settableMetaData, + InternalSettableMetadata? settableMetaData, int handle, ); @async String referenceDownloadFile( - PigeonStorageFirebaseApp app, - PigeonStorageReference reference, + InternalStorageFirebaseApp app, + InternalStorageReference reference, String filePath, int handle, ); @async - PigeonFullMetaData referenceUpdateMetadata( - PigeonStorageFirebaseApp app, - PigeonStorageReference reference, - PigeonSettableMetadata metadata, + InternalFullMetaData referenceUpdateMetadata( + InternalStorageFirebaseApp app, + InternalStorageReference reference, + InternalSettableMetadata metadata, ); // APIs for Task class @async Map taskPause( - PigeonStorageFirebaseApp app, + InternalStorageFirebaseApp app, int handle, ); @async Map taskResume( - PigeonStorageFirebaseApp app, + InternalStorageFirebaseApp app, int handle, ); @async Map taskCancel( - PigeonStorageFirebaseApp app, + InternalStorageFirebaseApp app, int handle, ); } diff --git a/packages/firebase_storage/firebase_storage_platform_interface/pubspec.yaml b/packages/firebase_storage/firebase_storage_platform_interface/pubspec.yaml index 50456ad4f18a..6cbd4094710a 100644 --- a/packages/firebase_storage/firebase_storage_platform_interface/pubspec.yaml +++ b/packages/firebase_storage/firebase_storage_platform_interface/pubspec.yaml @@ -22,4 +22,4 @@ dev_dependencies: flutter_test: sdk: flutter mockito: ^5.0.0 - pigeon: 11.0.1 + pigeon: 26.3.4 diff --git a/packages/firebase_storage/firebase_storage_platform_interface/test/pigeon/test_api.dart b/packages/firebase_storage/firebase_storage_platform_interface/test/pigeon/test_api.dart index d11d0f21236b..13214ad904ab 100644 --- a/packages/firebase_storage/firebase_storage_platform_interface/test/pigeon/test_api.dart +++ b/packages/firebase_storage/firebase_storage_platform_interface/test/pigeon/test_api.dart @@ -1,39 +1,49 @@ // Copyright 2023, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Autogenerated from Pigeon (v11.0.1), do not edit directly. +// Autogenerated from Pigeon (v26.3.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, unnecessary_import +// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, unnecessary_import, no_leading_underscores_for_local_identifiers, omit_obvious_local_variable_types // ignore_for_file: avoid_relative_lib_imports import 'dart:async'; -import 'dart:typed_data' show Uint8List; -import 'package:firebase_storage_platform_interface/src/pigeon/messages.pigeon.dart'; +import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -class _TestFirebaseStorageHostApiCodec extends StandardMessageCodec { - const _TestFirebaseStorageHostApiCodec(); +import 'package:firebase_storage_platform_interface/src/pigeon/messages.pigeon.dart'; + +class _PigeonCodec extends StandardMessageCodec { + const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is PigeonFullMetaData) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else if (value is PigeonListOptions) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is InternalStorageTaskState) { buffer.putUint8(129); - writeValue(buffer, value.encode()); - } else if (value is PigeonListResult) { + writeValue(buffer, value.index); + } else if (value is InternalStorageFirebaseApp) { buffer.putUint8(130); writeValue(buffer, value.encode()); - } else if (value is PigeonSettableMetadata) { + } else if (value is InternalStorageReference) { buffer.putUint8(131); writeValue(buffer, value.encode()); - } else if (value is PigeonStorageFirebaseApp) { + } else if (value is InternalFullMetaData) { buffer.putUint8(132); writeValue(buffer, value.encode()); - } else if (value is PigeonStorageReference) { + } else if (value is InternalListOptions) { buffer.putUint8(133); writeValue(buffer, value.encode()); + } else if (value is InternalSettableMetadata) { + buffer.putUint8(134); + writeValue(buffer, value.encode()); + } else if (value is InternalStorageTaskSnapShot) { + buffer.putUint8(135); + writeValue(buffer, value.encode()); + } else if (value is InternalListResult) { + buffer.putUint8(136); + writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); } @@ -42,18 +52,23 @@ class _TestFirebaseStorageHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: - return PigeonFullMetaData.decode(readValue(buffer)!); case 129: - return PigeonListOptions.decode(readValue(buffer)!); + final value = readValue(buffer) as int?; + return value == null ? null : InternalStorageTaskState.values[value]; case 130: - return PigeonListResult.decode(readValue(buffer)!); + return InternalStorageFirebaseApp.decode(readValue(buffer)!); case 131: - return PigeonSettableMetadata.decode(readValue(buffer)!); + return InternalStorageReference.decode(readValue(buffer)!); case 132: - return PigeonStorageFirebaseApp.decode(readValue(buffer)!); + return InternalFullMetaData.decode(readValue(buffer)!); case 133: - return PigeonStorageReference.decode(readValue(buffer)!); + return InternalListOptions.decode(readValue(buffer)!); + case 134: + return InternalSettableMetadata.decode(readValue(buffer)!); + case 135: + return InternalStorageTaskSnapShot.decode(readValue(buffer)!); + case 136: + return InternalListResult.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); } @@ -63,671 +78,667 @@ class _TestFirebaseStorageHostApiCodec extends StandardMessageCodec { abstract class TestFirebaseStorageHostApi { static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec codec = _TestFirebaseStorageHostApiCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); - Future getReferencebyPath( - PigeonStorageFirebaseApp app, String path, String? bucket); + Future getReferencebyPath( + InternalStorageFirebaseApp app, String path, String? bucket); - Future setMaxOperationRetryTime(PigeonStorageFirebaseApp app, int time); + Future setMaxOperationRetryTime( + InternalStorageFirebaseApp app, int time); - Future setMaxUploadRetryTime(PigeonStorageFirebaseApp app, int time); + Future setMaxUploadRetryTime(InternalStorageFirebaseApp app, int time); - Future setMaxDownloadRetryTime(PigeonStorageFirebaseApp app, int time); + Future setMaxDownloadRetryTime( + InternalStorageFirebaseApp app, int time); Future useStorageEmulator( - PigeonStorageFirebaseApp app, String host, int port); + InternalStorageFirebaseApp app, String host, int port); Future referenceDelete( - PigeonStorageFirebaseApp app, PigeonStorageReference reference); + InternalStorageFirebaseApp app, InternalStorageReference reference); Future referenceGetDownloadURL( - PigeonStorageFirebaseApp app, PigeonStorageReference reference); + InternalStorageFirebaseApp app, InternalStorageReference reference); - Future referenceGetMetaData( - PigeonStorageFirebaseApp app, PigeonStorageReference reference); + Future referenceGetMetaData( + InternalStorageFirebaseApp app, InternalStorageReference reference); - Future referenceList(PigeonStorageFirebaseApp app, - PigeonStorageReference reference, PigeonListOptions options); + Future referenceList(InternalStorageFirebaseApp app, + InternalStorageReference reference, InternalListOptions options); - Future referenceListAll( - PigeonStorageFirebaseApp app, PigeonStorageReference reference); + Future referenceListAll( + InternalStorageFirebaseApp app, InternalStorageReference reference); - Future referenceGetData(PigeonStorageFirebaseApp app, - PigeonStorageReference reference, int maxSize); + Future referenceGetData(InternalStorageFirebaseApp app, + InternalStorageReference reference, int maxSize); Future referencePutData( - PigeonStorageFirebaseApp app, - PigeonStorageReference reference, + InternalStorageFirebaseApp app, + InternalStorageReference reference, Uint8List data, - PigeonSettableMetadata settableMetaData, + InternalSettableMetadata settableMetaData, int handle); Future referencePutString( - PigeonStorageFirebaseApp app, - PigeonStorageReference reference, + InternalStorageFirebaseApp app, + InternalStorageReference reference, String data, int format, - PigeonSettableMetadata settableMetaData, + InternalSettableMetadata settableMetaData, int handle); Future referencePutFile( - PigeonStorageFirebaseApp app, - PigeonStorageReference reference, + InternalStorageFirebaseApp app, + InternalStorageReference reference, String filePath, - PigeonSettableMetadata? settableMetaData, + InternalSettableMetadata? settableMetaData, int handle); - Future referenceDownloadFile(PigeonStorageFirebaseApp app, - PigeonStorageReference reference, String filePath, int handle); + Future referenceDownloadFile(InternalStorageFirebaseApp app, + InternalStorageReference reference, String filePath, int handle); - Future referenceUpdateMetadata( - PigeonStorageFirebaseApp app, - PigeonStorageReference reference, - PigeonSettableMetadata metadata); + Future referenceUpdateMetadata( + InternalStorageFirebaseApp app, + InternalStorageReference reference, + InternalSettableMetadata metadata); - Future> taskPause( - PigeonStorageFirebaseApp app, int handle); + Future> taskPause( + InternalStorageFirebaseApp app, int handle); - Future> taskResume( - PigeonStorageFirebaseApp app, int handle); + Future> taskResume( + InternalStorageFirebaseApp app, int handle); - Future> taskCancel( - PigeonStorageFirebaseApp app, int handle); + Future> taskCancel( + InternalStorageFirebaseApp app, int handle); - static void setup(TestFirebaseStorageHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setUp( + TestFirebaseStorageHostApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.getReferencebyPath', - codec, + final pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.getReferencebyPath$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.getReferencebyPath was null.'); - final List args = (message as List?)!; - final PigeonStorageFirebaseApp? arg_app = - (args[0] as PigeonStorageFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.getReferencebyPath was null, expected non-null PigeonStorageFirebaseApp.'); - final String? arg_path = (args[1] as String?); - assert(arg_path != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.getReferencebyPath was null, expected non-null String.'); - final String? arg_bucket = (args[2] as String?); - final PigeonStorageReference output = - await api.getReferencebyPath(arg_app!, arg_path!, arg_bucket); - return [output]; + final List args = message! as List; + final InternalStorageFirebaseApp arg_app = + args[0]! as InternalStorageFirebaseApp; + final String arg_path = args[1]! as String; + final String? arg_bucket = args[2] as String?; + try { + final InternalStorageReference output = + await api.getReferencebyPath(arg_app, arg_path, arg_bucket); + return [output]; + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.setMaxOperationRetryTime', - codec, + final pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.setMaxOperationRetryTime$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.setMaxOperationRetryTime was null.'); - final List args = (message as List?)!; - final PigeonStorageFirebaseApp? arg_app = - (args[0] as PigeonStorageFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.setMaxOperationRetryTime was null, expected non-null PigeonStorageFirebaseApp.'); - final int? arg_time = (args[1] as int?); - assert(arg_time != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.setMaxOperationRetryTime was null, expected non-null int.'); - await api.setMaxOperationRetryTime(arg_app!, arg_time!); - return []; + final List args = message! as List; + final InternalStorageFirebaseApp arg_app = + args[0]! as InternalStorageFirebaseApp; + final int arg_time = args[1]! as int; + try { + await api.setMaxOperationRetryTime(arg_app, arg_time); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.setMaxUploadRetryTime', - codec, + final pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.setMaxUploadRetryTime$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.setMaxUploadRetryTime was null.'); - final List args = (message as List?)!; - final PigeonStorageFirebaseApp? arg_app = - (args[0] as PigeonStorageFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.setMaxUploadRetryTime was null, expected non-null PigeonStorageFirebaseApp.'); - final int? arg_time = (args[1] as int?); - assert(arg_time != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.setMaxUploadRetryTime was null, expected non-null int.'); - await api.setMaxUploadRetryTime(arg_app!, arg_time!); - return []; + final List args = message! as List; + final InternalStorageFirebaseApp arg_app = + args[0]! as InternalStorageFirebaseApp; + final int arg_time = args[1]! as int; + try { + await api.setMaxUploadRetryTime(arg_app, arg_time); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.setMaxDownloadRetryTime', - codec, + final pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.setMaxDownloadRetryTime$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.setMaxDownloadRetryTime was null.'); - final List args = (message as List?)!; - final PigeonStorageFirebaseApp? arg_app = - (args[0] as PigeonStorageFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.setMaxDownloadRetryTime was null, expected non-null PigeonStorageFirebaseApp.'); - final int? arg_time = (args[1] as int?); - assert(arg_time != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.setMaxDownloadRetryTime was null, expected non-null int.'); - await api.setMaxDownloadRetryTime(arg_app!, arg_time!); - return []; + final List args = message! as List; + final InternalStorageFirebaseApp arg_app = + args[0]! as InternalStorageFirebaseApp; + final int arg_time = args[1]! as int; + try { + await api.setMaxDownloadRetryTime(arg_app, arg_time); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.useStorageEmulator', - codec, + final pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.useStorageEmulator$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.useStorageEmulator was null.'); - final List args = (message as List?)!; - final PigeonStorageFirebaseApp? arg_app = - (args[0] as PigeonStorageFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.useStorageEmulator was null, expected non-null PigeonStorageFirebaseApp.'); - final String? arg_host = (args[1] as String?); - assert(arg_host != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.useStorageEmulator was null, expected non-null String.'); - final int? arg_port = (args[2] as int?); - assert(arg_port != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.useStorageEmulator was null, expected non-null int.'); - await api.useStorageEmulator(arg_app!, arg_host!, arg_port!); - return []; + final List args = message! as List; + final InternalStorageFirebaseApp arg_app = + args[0]! as InternalStorageFirebaseApp; + final String arg_host = args[1]! as String; + final int arg_port = args[2]! as int; + try { + await api.useStorageEmulator(arg_app, arg_host, arg_port); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceDelete', - codec, + final pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceDelete$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceDelete was null.'); - final List args = (message as List?)!; - final PigeonStorageFirebaseApp? arg_app = - (args[0] as PigeonStorageFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceDelete was null, expected non-null PigeonStorageFirebaseApp.'); - final PigeonStorageReference? arg_reference = - (args[1] as PigeonStorageReference?); - assert(arg_reference != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceDelete was null, expected non-null PigeonStorageReference.'); - await api.referenceDelete(arg_app!, arg_reference!); - return []; + final List args = message! as List; + final InternalStorageFirebaseApp arg_app = + args[0]! as InternalStorageFirebaseApp; + final InternalStorageReference arg_reference = + args[1]! as InternalStorageReference; + try { + await api.referenceDelete(arg_app, arg_reference); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceGetDownloadURL', - codec, + final pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceGetDownloadURL$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceGetDownloadURL was null.'); - final List args = (message as List?)!; - final PigeonStorageFirebaseApp? arg_app = - (args[0] as PigeonStorageFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceGetDownloadURL was null, expected non-null PigeonStorageFirebaseApp.'); - final PigeonStorageReference? arg_reference = - (args[1] as PigeonStorageReference?); - assert(arg_reference != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceGetDownloadURL was null, expected non-null PigeonStorageReference.'); - final String output = - await api.referenceGetDownloadURL(arg_app!, arg_reference!); - return [output]; + final List args = message! as List; + final InternalStorageFirebaseApp arg_app = + args[0]! as InternalStorageFirebaseApp; + final InternalStorageReference arg_reference = + args[1]! as InternalStorageReference; + try { + final String output = + await api.referenceGetDownloadURL(arg_app, arg_reference); + return [output]; + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceGetMetaData', - codec, + final pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceGetMetaData$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceGetMetaData was null.'); - final List args = (message as List?)!; - final PigeonStorageFirebaseApp? arg_app = - (args[0] as PigeonStorageFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceGetMetaData was null, expected non-null PigeonStorageFirebaseApp.'); - final PigeonStorageReference? arg_reference = - (args[1] as PigeonStorageReference?); - assert(arg_reference != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceGetMetaData was null, expected non-null PigeonStorageReference.'); - final PigeonFullMetaData output = - await api.referenceGetMetaData(arg_app!, arg_reference!); - return [output]; + final List args = message! as List; + final InternalStorageFirebaseApp arg_app = + args[0]! as InternalStorageFirebaseApp; + final InternalStorageReference arg_reference = + args[1]! as InternalStorageReference; + try { + final InternalFullMetaData output = + await api.referenceGetMetaData(arg_app, arg_reference); + return [output]; + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceList', - codec, + final pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceList$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceList was null.'); - final List args = (message as List?)!; - final PigeonStorageFirebaseApp? arg_app = - (args[0] as PigeonStorageFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceList was null, expected non-null PigeonStorageFirebaseApp.'); - final PigeonStorageReference? arg_reference = - (args[1] as PigeonStorageReference?); - assert(arg_reference != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceList was null, expected non-null PigeonStorageReference.'); - final PigeonListOptions? arg_options = - (args[2] as PigeonListOptions?); - assert(arg_options != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceList was null, expected non-null PigeonListOptions.'); - final PigeonListResult output = - await api.referenceList(arg_app!, arg_reference!, arg_options!); - return [output]; + final List args = message! as List; + final InternalStorageFirebaseApp arg_app = + args[0]! as InternalStorageFirebaseApp; + final InternalStorageReference arg_reference = + args[1]! as InternalStorageReference; + final InternalListOptions arg_options = + args[2]! as InternalListOptions; + try { + final InternalListResult output = + await api.referenceList(arg_app, arg_reference, arg_options); + return [output]; + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceListAll', - codec, + final pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceListAll$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceListAll was null.'); - final List args = (message as List?)!; - final PigeonStorageFirebaseApp? arg_app = - (args[0] as PigeonStorageFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceListAll was null, expected non-null PigeonStorageFirebaseApp.'); - final PigeonStorageReference? arg_reference = - (args[1] as PigeonStorageReference?); - assert(arg_reference != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceListAll was null, expected non-null PigeonStorageReference.'); - final PigeonListResult output = - await api.referenceListAll(arg_app!, arg_reference!); - return [output]; + final List args = message! as List; + final InternalStorageFirebaseApp arg_app = + args[0]! as InternalStorageFirebaseApp; + final InternalStorageReference arg_reference = + args[1]! as InternalStorageReference; + try { + final InternalListResult output = + await api.referenceListAll(arg_app, arg_reference); + return [output]; + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceGetData', - codec, + final pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceGetData$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceGetData was null.'); - final List args = (message as List?)!; - final PigeonStorageFirebaseApp? arg_app = - (args[0] as PigeonStorageFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceGetData was null, expected non-null PigeonStorageFirebaseApp.'); - final PigeonStorageReference? arg_reference = - (args[1] as PigeonStorageReference?); - assert(arg_reference != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceGetData was null, expected non-null PigeonStorageReference.'); - final int? arg_maxSize = (args[2] as int?); - assert(arg_maxSize != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceGetData was null, expected non-null int.'); - final Uint8List? output = await api.referenceGetData( - arg_app!, arg_reference!, arg_maxSize!); - return [output]; + final List args = message! as List; + final InternalStorageFirebaseApp arg_app = + args[0]! as InternalStorageFirebaseApp; + final InternalStorageReference arg_reference = + args[1]! as InternalStorageReference; + final int arg_maxSize = args[2]! as int; + try { + final Uint8List? output = + await api.referenceGetData(arg_app, arg_reference, arg_maxSize); + return [output]; + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referencePutData', - codec, + final pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referencePutData$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referencePutData was null.'); - final List args = (message as List?)!; - final PigeonStorageFirebaseApp? arg_app = - (args[0] as PigeonStorageFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referencePutData was null, expected non-null PigeonStorageFirebaseApp.'); - final PigeonStorageReference? arg_reference = - (args[1] as PigeonStorageReference?); - assert(arg_reference != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referencePutData was null, expected non-null PigeonStorageReference.'); - final Uint8List? arg_data = (args[2] as Uint8List?); - assert(arg_data != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referencePutData was null, expected non-null Uint8List.'); - final PigeonSettableMetadata? arg_settableMetaData = - (args[3] as PigeonSettableMetadata?); - assert(arg_settableMetaData != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referencePutData was null, expected non-null PigeonSettableMetadata.'); - final int? arg_handle = (args[4] as int?); - assert(arg_handle != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referencePutData was null, expected non-null int.'); - final String output = await api.referencePutData(arg_app!, - arg_reference!, arg_data!, arg_settableMetaData!, arg_handle!); - return [output]; + final List args = message! as List; + final InternalStorageFirebaseApp arg_app = + args[0]! as InternalStorageFirebaseApp; + final InternalStorageReference arg_reference = + args[1]! as InternalStorageReference; + final Uint8List arg_data = args[2]! as Uint8List; + final InternalSettableMetadata arg_settableMetaData = + args[3]! as InternalSettableMetadata; + final int arg_handle = args[4]! as int; + try { + final String output = await api.referencePutData(arg_app, + arg_reference, arg_data, arg_settableMetaData, arg_handle); + return [output]; + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referencePutString', - codec, + final pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referencePutString$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referencePutString was null.'); - final List args = (message as List?)!; - final PigeonStorageFirebaseApp? arg_app = - (args[0] as PigeonStorageFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referencePutString was null, expected non-null PigeonStorageFirebaseApp.'); - final PigeonStorageReference? arg_reference = - (args[1] as PigeonStorageReference?); - assert(arg_reference != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referencePutString was null, expected non-null PigeonStorageReference.'); - final String? arg_data = (args[2] as String?); - assert(arg_data != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referencePutString was null, expected non-null String.'); - final int? arg_format = (args[3] as int?); - assert(arg_format != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referencePutString was null, expected non-null int.'); - final PigeonSettableMetadata? arg_settableMetaData = - (args[4] as PigeonSettableMetadata?); - assert(arg_settableMetaData != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referencePutString was null, expected non-null PigeonSettableMetadata.'); - final int? arg_handle = (args[5] as int?); - assert(arg_handle != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referencePutString was null, expected non-null int.'); - final String output = await api.referencePutString( - arg_app!, - arg_reference!, - arg_data!, - arg_format!, - arg_settableMetaData!, - arg_handle!); - return [output]; + final List args = message! as List; + final InternalStorageFirebaseApp arg_app = + args[0]! as InternalStorageFirebaseApp; + final InternalStorageReference arg_reference = + args[1]! as InternalStorageReference; + final String arg_data = args[2]! as String; + final int arg_format = args[3]! as int; + final InternalSettableMetadata arg_settableMetaData = + args[4]! as InternalSettableMetadata; + final int arg_handle = args[5]! as int; + try { + final String output = await api.referencePutString( + arg_app, + arg_reference, + arg_data, + arg_format, + arg_settableMetaData, + arg_handle); + return [output]; + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referencePutFile', - codec, + final pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referencePutFile$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referencePutFile was null.'); - final List args = (message as List?)!; - final PigeonStorageFirebaseApp? arg_app = - (args[0] as PigeonStorageFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referencePutFile was null, expected non-null PigeonStorageFirebaseApp.'); - final PigeonStorageReference? arg_reference = - (args[1] as PigeonStorageReference?); - assert(arg_reference != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referencePutFile was null, expected non-null PigeonStorageReference.'); - final String? arg_filePath = (args[2] as String?); - assert(arg_filePath != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referencePutFile was null, expected non-null String.'); - final PigeonSettableMetadata? arg_settableMetaData = - (args[3] as PigeonSettableMetadata?); - final int? arg_handle = (args[4] as int?); - assert(arg_handle != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referencePutFile was null, expected non-null int.'); - final String output = await api.referencePutFile(arg_app!, - arg_reference!, arg_filePath!, arg_settableMetaData, arg_handle!); - return [output]; + final List args = message! as List; + final InternalStorageFirebaseApp arg_app = + args[0]! as InternalStorageFirebaseApp; + final InternalStorageReference arg_reference = + args[1]! as InternalStorageReference; + final String arg_filePath = args[2]! as String; + final InternalSettableMetadata? arg_settableMetaData = + args[3] as InternalSettableMetadata?; + final int arg_handle = args[4]! as int; + try { + final String output = await api.referencePutFile(arg_app, + arg_reference, arg_filePath, arg_settableMetaData, arg_handle); + return [output]; + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceDownloadFile', - codec, + final pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceDownloadFile$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceDownloadFile was null.'); - final List args = (message as List?)!; - final PigeonStorageFirebaseApp? arg_app = - (args[0] as PigeonStorageFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceDownloadFile was null, expected non-null PigeonStorageFirebaseApp.'); - final PigeonStorageReference? arg_reference = - (args[1] as PigeonStorageReference?); - assert(arg_reference != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceDownloadFile was null, expected non-null PigeonStorageReference.'); - final String? arg_filePath = (args[2] as String?); - assert(arg_filePath != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceDownloadFile was null, expected non-null String.'); - final int? arg_handle = (args[3] as int?); - assert(arg_handle != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceDownloadFile was null, expected non-null int.'); - final String output = await api.referenceDownloadFile( - arg_app!, arg_reference!, arg_filePath!, arg_handle!); - return [output]; + final List args = message! as List; + final InternalStorageFirebaseApp arg_app = + args[0]! as InternalStorageFirebaseApp; + final InternalStorageReference arg_reference = + args[1]! as InternalStorageReference; + final String arg_filePath = args[2]! as String; + final int arg_handle = args[3]! as int; + try { + final String output = await api.referenceDownloadFile( + arg_app, arg_reference, arg_filePath, arg_handle); + return [output]; + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceUpdateMetadata', - codec, + final pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceUpdateMetadata$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceUpdateMetadata was null.'); - final List args = (message as List?)!; - final PigeonStorageFirebaseApp? arg_app = - (args[0] as PigeonStorageFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceUpdateMetadata was null, expected non-null PigeonStorageFirebaseApp.'); - final PigeonStorageReference? arg_reference = - (args[1] as PigeonStorageReference?); - assert(arg_reference != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceUpdateMetadata was null, expected non-null PigeonStorageReference.'); - final PigeonSettableMetadata? arg_metadata = - (args[2] as PigeonSettableMetadata?); - assert(arg_metadata != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.referenceUpdateMetadata was null, expected non-null PigeonSettableMetadata.'); - final PigeonFullMetaData output = await api.referenceUpdateMetadata( - arg_app!, arg_reference!, arg_metadata!); - return [output]; + final List args = message! as List; + final InternalStorageFirebaseApp arg_app = + args[0]! as InternalStorageFirebaseApp; + final InternalStorageReference arg_reference = + args[1]! as InternalStorageReference; + final InternalSettableMetadata arg_metadata = + args[2]! as InternalSettableMetadata; + try { + final InternalFullMetaData output = await api + .referenceUpdateMetadata(arg_app, arg_reference, arg_metadata); + return [output]; + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.taskPause', - codec, + final pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.taskPause$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.taskPause was null.'); - final List args = (message as List?)!; - final PigeonStorageFirebaseApp? arg_app = - (args[0] as PigeonStorageFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.taskPause was null, expected non-null PigeonStorageFirebaseApp.'); - final int? arg_handle = (args[1] as int?); - assert(arg_handle != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.taskPause was null, expected non-null int.'); - final Map output = - await api.taskPause(arg_app!, arg_handle!); - return [output]; + final List args = message! as List; + final InternalStorageFirebaseApp arg_app = + args[0]! as InternalStorageFirebaseApp; + final int arg_handle = args[1]! as int; + try { + final Map output = + await api.taskPause(arg_app, arg_handle); + return [output]; + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.taskResume', - codec, + final pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.taskResume$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.taskResume was null.'); - final List args = (message as List?)!; - final PigeonStorageFirebaseApp? arg_app = - (args[0] as PigeonStorageFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.taskResume was null, expected non-null PigeonStorageFirebaseApp.'); - final int? arg_handle = (args[1] as int?); - assert(arg_handle != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.taskResume was null, expected non-null int.'); - final Map output = - await api.taskResume(arg_app!, arg_handle!); - return [output]; + final List args = message! as List; + final InternalStorageFirebaseApp arg_app = + args[0]! as InternalStorageFirebaseApp; + final int arg_handle = args[1]! as int; + try { + final Map output = + await api.taskResume(arg_app, arg_handle); + return [output]; + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.taskCancel', - codec, + final pigeonVar_channel = BasicMessageChannel( + 'dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.taskCancel$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.taskCancel was null.'); - final List args = (message as List?)!; - final PigeonStorageFirebaseApp? arg_app = - (args[0] as PigeonStorageFirebaseApp?); - assert(arg_app != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.taskCancel was null, expected non-null PigeonStorageFirebaseApp.'); - final int? arg_handle = (args[1] as int?); - assert(arg_handle != null, - 'Argument for dev.flutter.pigeon.firebase_storage_platform_interface.FirebaseStorageHostApi.taskCancel was null, expected non-null int.'); - final Map output = - await api.taskCancel(arg_app!, arg_handle!); - return [output]; + final List args = message! as List; + final InternalStorageFirebaseApp arg_app = + args[0]! as InternalStorageFirebaseApp; + final int arg_handle = args[1]! as int; + try { + final Map output = + await api.taskCancel(arg_app, arg_handle); + return [output]; + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } }); } }