From b78d7e92d4facfe56aaa8cee2511fa4799af6559 Mon Sep 17 00:00:00 2001 From: tarrinneal Date: Thu, 30 Apr 2026 15:41:52 -0700 Subject: [PATCH 1/2] toString and isNullish --- packages/pigeon/CHANGELOG.md | 21 +- packages/pigeon/CONTRIBUTING.md | 12 +- packages/pigeon/README.md | 4 +- .../java/io/flutter/plugins/Messages.java | 17 + .../EventChannelMessages.g.kt | 8 + .../flutter/pigeon_example_app/Messages.g.kt | 4 + .../ios/Runner/EventChannelMessages.g.swift | 40 +- .../example/app/ios/Runner/Messages.g.swift | 35 +- .../app/lib/src/event_channel_messages.g.dart | 10 + .../example/app/lib/src/messages.g.dart | 9 +- .../pigeon/example/app/linux/messages.g.cc | 24 + .../pigeon/example/app/linux/messages.g.h | 11 + .../example/app/macos/Runner/messages.g.m | 5 + .../example/app/windows/runner/messages.g.cpp | 479 +- .../example/app/windows/runner/messages.g.h | 1 + .../pigeon/lib/src/cpp/cpp_generator.dart | 44 + .../pigeon/lib/src/dart/dart_generator.dart | 19 +- packages/pigeon/lib/src/functional.dart | 4 +- packages/pigeon/lib/src/generator_tools.dart | 2 +- .../lib/src/gobject/gobject_generator.dart | 95 + .../pigeon/lib/src/java/java_generator.dart | 28 + .../lib/src/kotlin/kotlin_generator.dart | 38 + packages/pigeon/lib/src/kotlin/templates.dart | 2 +- .../pigeon/lib/src/objc/objc_generator.dart | 44 +- packages/pigeon/lib/src/pigeon_cl.dart | 2 +- packages/pigeon/lib/src/pigeon_lib.dart | 12 +- .../pigeon/lib/src/swift/swift_generator.dart | 64 +- .../CoreTests.java | 312 + .../CoreTests.gen.m | 67 + .../background_platform_channels.gen.dart | 4 +- .../lib/src/generated/core_tests.gen.dart | 42 +- .../lib/src/generated/enum.gen.dart | 9 +- .../generated/event_channel_tests.gen.dart | 40 + .../src/generated/flutter_unittests.gen.dart | 24 +- .../lib/src/generated/message.gen.dart | 23 +- .../lib/src/generated/multiple_arity.gen.dart | 4 +- .../src/generated/non_null_fields.gen.dart | 19 +- .../lib/src/generated/null_fields.gen.dart | 14 +- .../src/generated/nullable_returns.gen.dart | 16 +- .../lib/src/generated/primitive.gen.dart | 4 +- .../com/example/test_plugin/CoreTests.gen.kt | 24 + .../test_plugin/EventChannelTests.gen.kt | 32 + .../Sources/test_plugin/CoreTests.gen.swift | 70 +- .../test_plugin/EventChannelTests.gen.swift | 77 +- .../test_plugin/ProxyApiTests.gen.swift | 28 +- .../ios/RunnerTests/IsNullishTests.swift | 58 + .../linux/pigeon/core_tests.gen.cc | 317 + .../test_plugin/linux/pigeon/core_tests.gen.h | 69 + .../windows/pigeon/core_tests.gen.cpp | 31971 +++++++++++----- .../windows/pigeon/core_tests.gen.h | 6 + packages/pigeon/pubspec.yaml | 2 +- packages/pigeon/test/cpp_generator_test.dart | 39 + packages/pigeon/test/dart_generator_test.dart | 28 + .../pigeon/test/gobject_generator_test.dart | 36 + packages/pigeon/test/java_generator_test.dart | 29 + .../pigeon/test/kotlin_generator_test.dart | 29 + packages/pigeon/test/objc_generator_test.dart | 43 + packages/pigeon/test/pigeon_lib_test.dart | 2 +- .../pigeon/test/swift_generator_test.dart | 30 + 59 files changed, 23608 insertions(+), 10894 deletions(-) create mode 100644 packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/IsNullishTests.swift diff --git a/packages/pigeon/CHANGELOG.md b/packages/pigeon/CHANGELOG.md index 1d8884d3e71c..b1e2b6f2ff62 100644 --- a/packages/pigeon/CHANGELOG.md +++ b/packages/pigeon/CHANGELOG.md @@ -1,3 +1,8 @@ +## 26.4.0 + +* Overrides `toString` (or equivalent) methods on generated data classes. +* [swift] Updates `isNullish` to handle double nested `Any?` values. + ## 26.3.4 * [kotlin] Updates generated error class to inherit from `RuntimeException` @@ -915,7 +920,7 @@ ## 3.0.3 -* Adds ability for generators to do AST validation. This can help generators +* Adds ability for generators to do AST validation. This can help generators without complete implementations to report gaps in coverage. ## 3.0.2 @@ -1078,11 +1083,11 @@ `dart:mirrors` doesn't support null-safe code so there were a class of features we couldn't implement without this migration. * **BREAKING CHANGE** - the `configurePigeon` function has been migrated to a - `@ConfigurePigeon` annotation. See `./pigeons/message.dart` for an example. + `@ConfigurePigeon` annotation. See `./pigeons/message.dart` for an example. The annotation can be attached to anything in the file to take effect. * **BREAKING CHANGE** - Now Pigeon files must be in one file per invocation of - Pigeon. For example, the classes your APIs use must be in the same file as - your APIs. If your Pigeon file imports another source file, it won't actually + Pigeon. For example, the classes your APIs use must be in the same file as + your APIs. If your Pigeon file imports another source file, it won't actually import it. ## 0.2.4 @@ -1104,10 +1109,10 @@ ## 0.2.0 -* **BREAKING CHANGE** - Pigeon files must be null-safe now. That means the +* **BREAKING CHANGE** - Pigeon files must be null-safe now. That means the fields inside of the classes must be declared nullable ( [non-null fields](https://github.com/flutter/flutter/issues/59118) aren't yet - supported). Migration example: + supported). Migration example: ```dart // Version 0.1.x @@ -1123,7 +1128,7 @@ class Foo { } ``` -* **BREAKING CHANGE** - The default output from Pigeon is now null-safe. If you +* **BREAKING CHANGE** - The default output from Pigeon is now null-safe. If you want non-null-safe code you must provide the `--no-dart_null_safety` flag. * The Pigeon source code is now null-safe. * Fixed niladic non-value returning async functions in the Java generator. @@ -1209,7 +1214,7 @@ class Foo { ## 0.1.8 -* Started spawning pigeon_lib in an isolate instead of a subprocess. The +* Started spawning pigeon_lib in an isolate instead of a subprocess. The subprocess could have lead to errors if the dart version on $PATH didn't match the one that comes with flutter. diff --git a/packages/pigeon/CONTRIBUTING.md b/packages/pigeon/CONTRIBUTING.md index 41ead7842651..304d1a8c7906 100644 --- a/packages/pigeon/CONTRIBUTING.md +++ b/packages/pigeon/CONTRIBUTING.md @@ -3,7 +3,7 @@ ## Description Pigeon is a code generation tool that adds type safety to Flutter’s Platform -Channels. This document serves as an overview of how it functions to help +Channels. This document serves as an overview of how it functions to help people who would like to contribute to the project. ## Source Index @@ -32,15 +32,15 @@ Pigeon has 3 types of tests; you'll find them all in * Unit tests - These are the fastest tests that are just typical unit tests, they may be generating code and checking it against a regular expression to - see if it's correct. Example: + see if it's correct. Example: [dart_generator_test.dart](./test/dart_generator_test.dart) * Compilation tests - These tests generate code, then attempt to compile that - code. These are tests are much slower than unit tests, but not as slow as - integration tests. These tests are typically run against the Pigeon files in + code. These are tests are much slower than unit tests, but not as slow as + integration tests. These tests are typically run against the Pigeon files in [pigeons](./pigeons). * Integration tests - These tests generate code, then compile the generated - code, then execute the generated code. It can be thought of as unit-tests run - against the generated code. Examples: [platform_tests](./platform_tests) + code, then execute the generated code. It can be thought of as unit-tests run + against the generated code. Examples: [platform_tests](./platform_tests) For local testing, always use `test.dart` rather than `run_tests.dart`, as `run_tests.dart` is specifically a CI entrypoint. When iterating on a specific diff --git a/packages/pigeon/README.md b/packages/pigeon/README.md index 0e5b91c25128..1029d51f3be9 100644 --- a/packages/pigeon/README.md +++ b/packages/pigeon/README.md @@ -101,7 +101,7 @@ to the api to allow for multiple instances to be created and operate in parallel 1) Custom classes used by APIs are defined as classes with fields of the supported datatypes (see the supported Datatypes section). 1) APIs should be defined as an `abstract class` with either `@HostApi()` or - `@FlutterApi()` as metadata. `@HostApi()` being for procedures that are defined + `@FlutterApi()` as metadata. `@HostApi()` being for procedures that are defined on the host platform and the `@FlutterApi()` for procedures that are defined in Dart. 1) Method declarations on the API classes should have arguments and a return value whose types are defined in the file, are supported datatypes, or are @@ -150,7 +150,7 @@ to the api to allow for multiple instances to be created and operate in parallel ### Calling into Flutter from the host platform Pigeon also supports calling in the opposite direction. The steps are similar -but reversed. For more information look at the annotation `@FlutterApi()` which +but reversed. For more information look at the annotation `@FlutterApi()` which denotes APIs that live in Flutter but are invoked from the host platform. [Example](./example/README.md#FlutterApi_Example). diff --git a/packages/pigeon/example/app/android/app/src/main/java/io/flutter/plugins/Messages.java b/packages/pigeon/example/app/android/app/src/main/java/io/flutter/plugins/Messages.java index b649738648ab..03e0ada8b642 100644 --- a/packages/pigeon/example/app/android/app/src/main/java/io/flutter/plugins/Messages.java +++ b/packages/pigeon/example/app/android/app/src/main/java/io/flutter/plugins/Messages.java @@ -311,6 +311,23 @@ public int hashCode() { return pigeonDeepHashCode(fields); } + @Override + public String toString() { + return "MessageData{" + + "name=" + + name + + ", " + + "description=" + + description + + ", " + + "code=" + + code + + ", " + + "data=" + + data + + "}"; + } + public static final class Builder { private @Nullable String name; diff --git a/packages/pigeon/example/app/android/app/src/main/kotlin/dev/flutter/pigeon_example_app/EventChannelMessages.g.kt b/packages/pigeon/example/app/android/app/src/main/kotlin/dev/flutter/pigeon_example_app/EventChannelMessages.g.kt index 9029c9425018..c2e8d93cf99a 100644 --- a/packages/pigeon/example/app/android/app/src/main/kotlin/dev/flutter/pigeon_example_app/EventChannelMessages.g.kt +++ b/packages/pigeon/example/app/android/app/src/main/kotlin/dev/flutter/pigeon_example_app/EventChannelMessages.g.kt @@ -194,6 +194,10 @@ data class IntEvent(val data: Long) : PlatformEvent() { result = 31 * result + EventChannelMessagesPigeonUtils.deepHash(this.data) return result } + + override fun toString(): String { + return "IntEvent(data=$data)" + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -227,6 +231,10 @@ data class StringEvent(val data: String) : PlatformEvent() { result = 31 * result + EventChannelMessagesPigeonUtils.deepHash(this.data) return result } + + override fun toString(): String { + return "StringEvent(data=$data)" + } } private open class EventChannelMessagesPigeonCodec : StandardMessageCodec() { diff --git a/packages/pigeon/example/app/android/app/src/main/kotlin/dev/flutter/pigeon_example_app/Messages.g.kt b/packages/pigeon/example/app/android/app/src/main/kotlin/dev/flutter/pigeon_example_app/Messages.g.kt index 9557d8c13297..cb82bcddc884 100644 --- a/packages/pigeon/example/app/android/app/src/main/kotlin/dev/flutter/pigeon_example_app/Messages.g.kt +++ b/packages/pigeon/example/app/android/app/src/main/kotlin/dev/flutter/pigeon_example_app/Messages.g.kt @@ -252,6 +252,10 @@ data class MessageData( result = 31 * result + MessagesPigeonUtils.deepHash(this.data) return result } + + override fun toString(): String { + return "MessageData(name=$name, description=$description, code=$code, data=$data)" + } } private open class MessagesPigeonCodec : StandardMessageCodec() { diff --git a/packages/pigeon/example/app/ios/Runner/EventChannelMessages.g.swift b/packages/pigeon/example/app/ios/Runner/EventChannelMessages.g.swift index 70cab0a27bec..568b75b12813 100644 --- a/packages/pigeon/example/app/ios/Runner/EventChannelMessages.g.swift +++ b/packages/pigeon/example/app/ios/Runner/EventChannelMessages.g.swift @@ -14,9 +14,31 @@ import Foundation #error("Unsupported platform.") #endif -private func isNullish(_ value: Any?) -> Bool { - return value is NSNull || value == nil -} +#if DEBUG + func isNullish(_ value: Any?) -> Bool { + guard let innerValue = value else { + return true + } + + if case Optional.some(Optional.none) = value { + return true + } + + return innerValue is NSNull + } +#else + private func isNullish(_ value: Any?) -> Bool { + guard let innerValue = value else { + return true + } + + if case Optional.some(Optional.none) = value { + return true + } + + return innerValue is NSNull + } +#endif private func nilOrValue(_ value: Any?) -> T? { if value is NSNull { return nil } @@ -139,7 +161,7 @@ protocol PlatformEvent { } /// Generated class from Pigeon that represents data sent in messages. -struct IntEvent: PlatformEvent { +struct IntEvent: PlatformEvent, CustomStringConvertible { var data: Int64 // swift-format-ignore: AlwaysUseLowerCamelCase @@ -166,10 +188,14 @@ struct IntEvent: PlatformEvent { hasher.combine("IntEvent") deepHashEventChannelMessages(value: data, hasher: &hasher) } + + public var description: String { + return "IntEvent(data: \(data))" + } } /// Generated class from Pigeon that represents data sent in messages. -struct StringEvent: PlatformEvent { +struct StringEvent: PlatformEvent, CustomStringConvertible { var data: String // swift-format-ignore: AlwaysUseLowerCamelCase @@ -196,6 +222,10 @@ struct StringEvent: PlatformEvent { hasher.combine("StringEvent") deepHashEventChannelMessages(value: data, hasher: &hasher) } + + public var description: String { + return "StringEvent(data: \(data))" + } } private class EventChannelMessagesPigeonCodecReader: FlutterStandardReader { diff --git a/packages/pigeon/example/app/ios/Runner/Messages.g.swift b/packages/pigeon/example/app/ios/Runner/Messages.g.swift index f8b12f846c22..481f9ddd1176 100644 --- a/packages/pigeon/example/app/ios/Runner/Messages.g.swift +++ b/packages/pigeon/example/app/ios/Runner/Messages.g.swift @@ -64,9 +64,31 @@ private func createConnectionError(withChannelName channelName: String) -> Pigeo details: "") } -private func isNullish(_ value: Any?) -> Bool { - return value is NSNull || value == nil -} +#if DEBUG + func isNullish(_ value: Any?) -> Bool { + guard let innerValue = value else { + return true + } + + if case Optional.some(Optional.none) = value { + return true + } + + return innerValue is NSNull + } +#else + private func isNullish(_ value: Any?) -> Bool { + guard let innerValue = value else { + return true + } + + if case Optional.some(Optional.none) = value { + return true + } + + return innerValue is NSNull + } +#endif private func nilOrValue(_ value: Any?) -> T? { if value is NSNull { return nil } @@ -188,7 +210,7 @@ enum Code: Int { } /// Generated class from Pigeon that represents data sent in messages. -struct MessageData: Hashable { +struct MessageData: Hashable, CustomStringConvertible { var name: String? = nil var description: String? = nil var code: Code @@ -232,6 +254,10 @@ struct MessageData: Hashable { deepHashMessages(value: code, hasher: &hasher) deepHashMessages(value: data, hasher: &hasher) } + + public var description: String { + return "MessageData(name: \(name), description: \(description), code: \(code), data: \(data))" + } } private class MessagesPigeonCodecReader: FlutterStandardReader { @@ -349,6 +375,7 @@ class ExampleHostApiSetup { } } } + /// Generated protocol from Pigeon that represents Flutter messages that can be called from Swift. protocol MessageFlutterApiProtocol { func flutterMethod( diff --git a/packages/pigeon/example/app/lib/src/event_channel_messages.g.dart b/packages/pigeon/example/app/lib/src/event_channel_messages.g.dart index 8fdd1c22e5c5..abc02462ac60 100644 --- a/packages/pigeon/example/app/lib/src/event_channel_messages.g.dart +++ b/packages/pigeon/example/app/lib/src/event_channel_messages.g.dart @@ -110,6 +110,11 @@ class IntEvent extends PlatformEvent { @override // ignore: avoid_equals_and_hash_code_on_mutable_classes int get hashCode => _deepHash([runtimeType, ..._toList()]); + + @override + String toString() { + return 'IntEvent(data: $data)'; + } } class StringEvent extends PlatformEvent { @@ -145,6 +150,11 @@ class StringEvent extends PlatformEvent { @override // ignore: avoid_equals_and_hash_code_on_mutable_classes int get hashCode => _deepHash([runtimeType, ..._toList()]); + + @override + String toString() { + return 'StringEvent(data: $data)'; + } } class _PigeonCodec extends StandardMessageCodec { diff --git a/packages/pigeon/example/app/lib/src/messages.g.dart b/packages/pigeon/example/app/lib/src/messages.g.dart index 699368ba5b3d..5af45ca6db96 100644 --- a/packages/pigeon/example/app/lib/src/messages.g.dart +++ b/packages/pigeon/example/app/lib/src/messages.g.dart @@ -168,6 +168,11 @@ class MessageData { @override // ignore: avoid_equals_and_hash_code_on_mutable_classes int get hashCode => _deepHash([runtimeType, ..._toList()]); + + @override + String toString() { + return 'MessageData(name: $name, description: $description, code: $code, data: $data)'; + } } class _PigeonCodec extends StandardMessageCodec { @@ -203,8 +208,8 @@ class _PigeonCodec extends StandardMessageCodec { } class ExampleHostApi { - /// Constructor for [ExampleHostApi]. The [binaryMessenger] named argument is - /// available for dependency injection. If it is left null, the default + /// Constructor for [ExampleHostApi]. 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. ExampleHostApi({ BinaryMessenger? binaryMessenger, diff --git a/packages/pigeon/example/app/linux/messages.g.cc b/packages/pigeon/example/app/linux/messages.g.cc index f1b0e818d11f..81da50ca9d31 100644 --- a/packages/pigeon/example/app/linux/messages.g.cc +++ b/packages/pigeon/example/app/linux/messages.g.cc @@ -345,6 +345,30 @@ guint pigeon_example_package_message_data_hash( return result; } +gchar* pigeon_example_package_message_data_to_string( + PigeonExamplePackageMessageData* self) { + g_return_val_if_fail(PIGEON_EXAMPLE_PACKAGE_IS_MESSAGE_DATA(self), NULL); + GString* str = g_string_new("MessageData("); + g_string_append(str, "name: "); + if (self->name != nullptr) { + g_string_append_printf(str, "\"%s\"", self->name); + } else { + g_string_append(str, "null"); + } + g_string_append(str, ", description: "); + if (self->description != nullptr) { + g_string_append_printf(str, "\"%s\"", self->description); + } else { + g_string_append(str, "null"); + } + g_string_append(str, ", code: "); + g_string_append(str, "..."); + g_string_append(str, ", data: "); + g_string_append(str, "..."); + g_string_append(str, ")"); + return g_string_free(str, FALSE); +} + struct _PigeonExamplePackageMessageCodec { FlStandardMessageCodec parent_instance; }; diff --git a/packages/pigeon/example/app/linux/messages.g.h b/packages/pigeon/example/app/linux/messages.g.h index c03ecb20a01d..ac57669f71ba 100644 --- a/packages/pigeon/example/app/linux/messages.g.h +++ b/packages/pigeon/example/app/linux/messages.g.h @@ -113,6 +113,17 @@ gboolean pigeon_example_package_message_data_equals( guint pigeon_example_package_message_data_hash( PigeonExamplePackageMessageData* object); +/** + * pigeon_example_package_message_data_to_string: + * @object: a #PigeonExamplePackageMessageData. + * + * Returns a string representation of a #PigeonExamplePackageMessageData object. + * + * Returns: (transfer full): a new string, free with g_free(). + */ +gchar* pigeon_example_package_message_data_to_string( + PigeonExamplePackageMessageData* object); + G_DECLARE_FINAL_TYPE(PigeonExamplePackageMessageCodec, pigeon_example_package_message_codec, PIGEON_EXAMPLE_PACKAGE, MESSAGE_CODEC, diff --git a/packages/pigeon/example/app/macos/Runner/messages.g.m b/packages/pigeon/example/app/macos/Runner/messages.g.m index ed7655039d25..0b7f8b3a9ce1 100644 --- a/packages/pigeon/example/app/macos/Runner/messages.g.m +++ b/packages/pigeon/example/app/macos/Runner/messages.g.m @@ -195,6 +195,11 @@ - (NSUInteger)hash { result = result * 31 + FLTPigeonDeepHash(self.data); return result; } +- (NSString *)description { + return + [NSString stringWithFormat:@"PGNMessageData(name: %@, description: %@, code: %@, data: %@)", + self.name, self.description, @(self.code), self.data]; +} @end @interface PGNMessagesPigeonCodecReader : FlutterStandardReader diff --git a/packages/pigeon/example/app/windows/runner/messages.g.cpp b/packages/pigeon/example/app/windows/runner/messages.g.cpp index 11453da4e053..eb316c989edf 100644 --- a/packages/pigeon/example/app/windows/runner/messages.g.cpp +++ b/packages/pigeon/example/app/windows/runner/messages.g.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include namespace pigeon_example { @@ -330,246 +331,274 @@ size_t MessageData::Hash() const { return result; } -size_t PigeonInternalDeepHash(const MessageData& v) { return v.Hash(); } +std::string MessageData::ToString() const { + std::stringstream ss; + ss << "MessageData("; + ss << "name: "; + if (name_.has_value()) { + ss << *name_; + } else { + ss << "null"; + ss << ", description: "; + if (description_.has_value()) { + ss << *description_; + } else { + ss << "null"; + ss << ", code: "; + ss << code_; + ss << ", data: "; + ss << data_; + ss << ")"; + return ss.str(); + } -PigeonInternalCodecSerializer::PigeonInternalCodecSerializer() {} + size_t PigeonInternalDeepHash(const MessageData& v) { return v.Hash(); } -EncodableValue PigeonInternalCodecSerializer::ReadValueOfType( - uint8_t type, ::flutter::ByteStreamReader* stream) const { - switch (type) { - 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(MessageData::FromEncodableList( - std::get(ReadValue(stream)))); - } - default: - return ::flutter::StandardCodecSerializer::ReadValueOfType(type, stream); - } -} + PigeonInternalCodecSerializer::PigeonInternalCodecSerializer() {} -void PigeonInternalCodecSerializer::WriteValue( - const EncodableValue& value, ::flutter::ByteStreamWriter* stream) const { - if (const CustomEncodableValue* custom_value = - std::get_if(&value)) { - if (custom_value->type() == typeid(Code)) { - stream->WriteByte(129); - WriteValue( - EncodableValue(static_cast(std::any_cast(*custom_value))), - stream); - return; - } - if (custom_value->type() == typeid(MessageData)) { - stream->WriteByte(130); - WriteValue( - EncodableValue( - std::any_cast(*custom_value).ToEncodableList()), - stream); - return; + EncodableValue PigeonInternalCodecSerializer::ReadValueOfType( + uint8_t type, ::flutter::ByteStreamReader* stream) const { + switch (type) { + 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(MessageData::FromEncodableList( + std::get(ReadValue(stream)))); + } + default: + return ::flutter::StandardCodecSerializer::ReadValueOfType(type, + stream); + } } - } - ::flutter::StandardCodecSerializer::WriteValue(value, stream); -} - -/// The codec used by ExampleHostApi. -const ::flutter::StandardMessageCodec& ExampleHostApi::GetCodec() { - return ::flutter::StandardMessageCodec::GetInstance( - &PigeonInternalCodecSerializer::GetInstance()); -} -// Sets up an instance of `ExampleHostApi` to handle messages through the -// `binary_messenger`. -void ExampleHostApi::SetUp(::flutter::BinaryMessenger* binary_messenger, - ExampleHostApi* api) { - ExampleHostApi::SetUp(binary_messenger, api, ""); -} + void PigeonInternalCodecSerializer::WriteValue( + const EncodableValue& value, ::flutter::ByteStreamWriter* stream) + const { + if (const CustomEncodableValue* custom_value = + std::get_if(&value)) { + if (custom_value->type() == typeid(Code)) { + stream->WriteByte(129); + WriteValue(EncodableValue( + static_cast(std::any_cast(*custom_value))), + stream); + return; + } + if (custom_value->type() == typeid(MessageData)) { + stream->WriteByte(130); + WriteValue( + EncodableValue( + std::any_cast(*custom_value).ToEncodableList()), + stream); + return; + } + } + ::flutter::StandardCodecSerializer::WriteValue(value, stream); + } -void ExampleHostApi::SetUp(::flutter::BinaryMessenger* binary_messenger, - ExampleHostApi* api, - const std::string& message_channel_suffix) { - const std::string prepended_suffix = - message_channel_suffix.length() > 0 - ? std::string(".") + message_channel_suffix - : ""; - { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_example_package." - "ExampleHostApi.getHostLanguage" + - prepended_suffix, - &GetCodec()); - if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const ::flutter::MessageReply& reply) { - try { - ErrorOr output = api->GetHostLanguage(); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); - } else { - channel.SetMessageHandler(nullptr); + /// The codec used by ExampleHostApi. + const ::flutter::StandardMessageCodec& ExampleHostApi::GetCodec() { + return ::flutter::StandardMessageCodec::GetInstance( + &PigeonInternalCodecSerializer::GetInstance()); } - } - { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.add" + - 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_a_arg = args.at(0); - if (encodable_a_arg.IsNull()) { - reply(WrapError("a_arg unexpectedly null.")); - return; - } - const int64_t a_arg = encodable_a_arg.LongValue(); - const auto& encodable_b_arg = args.at(1); - if (encodable_b_arg.IsNull()) { - reply(WrapError("b_arg unexpectedly null.")); - return; - } - const int64_t b_arg = encodable_b_arg.LongValue(); - ErrorOr output = api->Add(a_arg, b_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); - } else { - channel.SetMessageHandler(nullptr); + + // Sets up an instance of `ExampleHostApi` to handle messages through the + // `binary_messenger`. + void ExampleHostApi::SetUp(::flutter::BinaryMessenger * binary_messenger, + ExampleHostApi * api) { + ExampleHostApi::SetUp(binary_messenger, api, ""); } - } - { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.sendMessage" + - 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_message_arg = args.at(0); - if (encodable_message_arg.IsNull()) { - reply(WrapError("message_arg unexpectedly null.")); - return; - } - const auto& message_arg = std::any_cast( - std::get(encodable_message_arg)); - api->SendMessage(message_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; + + void ExampleHostApi::SetUp(::flutter::BinaryMessenger * binary_messenger, + ExampleHostApi * api, + const std::string& message_channel_suffix) { + const std::string prepended_suffix = + message_channel_suffix.length() > 0 + ? std::string(".") + message_channel_suffix + : ""; + { + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_example_" + "package.ExampleHostApi.getHostLanguage" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const ::flutter::MessageReply& reply) { + try { + ErrorOr output = api->GetHostLanguage(); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); - } else { - channel.SetMessageHandler(nullptr); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.add" + + 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_a_arg = args.at(0); + if (encodable_a_arg.IsNull()) { + reply(WrapError("a_arg unexpectedly null.")); + return; + } + const int64_t a_arg = encodable_a_arg.LongValue(); + const auto& encodable_b_arg = args.at(1); + if (encodable_b_arg.IsNull()) { + reply(WrapError("b_arg unexpectedly null.")); + return; + } + const int64_t b_arg = encodable_b_arg.LongValue(); + ErrorOr output = api->Add(a_arg, b_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + 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.pigeon_example_" + "package.ExampleHostApi.sendMessage" + + 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_message_arg = args.at(0); + if (encodable_message_arg.IsNull()) { + reply(WrapError("message_arg unexpectedly null.")); + return; + } + const auto& message_arg = std::any_cast( + std::get(encodable_message_arg)); + api->SendMessage( + message_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } } - } -} -EncodableValue ExampleHostApi::WrapError(std::string_view error_message) { - return EncodableValue( - EncodableList{EncodableValue(std::string(error_message)), - EncodableValue("Error"), EncodableValue()}); -} + EncodableValue ExampleHostApi::WrapError(std::string_view error_message) { + return EncodableValue( + EncodableList{EncodableValue(std::string(error_message)), + EncodableValue("Error"), EncodableValue()}); + } -EncodableValue ExampleHostApi::WrapError(const FlutterError& error) { - return EncodableValue(EncodableList{EncodableValue(error.code()), - EncodableValue(error.message()), - error.details()}); -} + EncodableValue ExampleHostApi::WrapError(const FlutterError& error) { + return EncodableValue(EncodableList{EncodableValue(error.code()), + EncodableValue(error.message()), + error.details()}); + } -// Generated class from Pigeon that represents Flutter messages that can be -// called from C++. -MessageFlutterApi::MessageFlutterApi( - ::flutter::BinaryMessenger* binary_messenger) - : binary_messenger_(binary_messenger), message_channel_suffix_("") {} - -MessageFlutterApi::MessageFlutterApi( - ::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& MessageFlutterApi::GetCodec() { - return ::flutter::StandardMessageCodec::GetInstance( - &PigeonInternalCodecSerializer::GetInstance()); -} + // Generated class from Pigeon that represents Flutter messages that can be + // called from C++. + MessageFlutterApi::MessageFlutterApi(::flutter::BinaryMessenger * + binary_messenger) + : binary_messenger_(binary_messenger), message_channel_suffix_("") {} + + MessageFlutterApi::MessageFlutterApi( + ::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& MessageFlutterApi::GetCodec() { + return ::flutter::StandardMessageCodec::GetInstance( + &PigeonInternalCodecSerializer::GetInstance()); + } -void MessageFlutterApi::FlutterMethod( - const std::string* a_string_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_example_package.MessageFlutterApi." - "flutterMethod" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - a_string_arg ? EncodableValue(*a_string_arg) : EncodableValue(), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), + void MessageFlutterApi::FlutterMethod( + const std::string* a_string_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_example_package.MessageFlutterApi." + "flutterMethod" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + a_string_arg ? EncodableValue(*a_string_arg) : EncodableValue(), + }); + channel.Send(encoded_api_arguments, + [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)](const uint8_t* reply, + size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError( + std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); - } else { - const auto& return_value = - std::get(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} + } else { + const auto& return_value = + std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); + } -} // namespace pigeon_example + } // namespace pigeon_example diff --git a/packages/pigeon/example/app/windows/runner/messages.g.h b/packages/pigeon/example/app/windows/runner/messages.g.h index b23312baccff..681e53c2d73e 100644 --- a/packages/pigeon/example/app/windows/runner/messages.g.h +++ b/packages/pigeon/example/app/windows/runner/messages.g.h @@ -90,6 +90,7 @@ class MessageData { /// Returns a hash code value for the object. This method is supported for the /// benefit of hash tables. size_t Hash() const; + std::string ToString() const; private: static MessageData FromEncodableList(const ::flutter::EncodableList& list); diff --git a/packages/pigeon/lib/src/cpp/cpp_generator.dart b/packages/pigeon/lib/src/cpp/cpp_generator.dart index ffaf56787d66..00bb8507352d 100644 --- a/packages/pigeon/lib/src/cpp/cpp_generator.dart +++ b/packages/pigeon/lib/src/cpp/cpp_generator.dart @@ -483,6 +483,12 @@ class CppHeaderGenerator extends StructuredGenerator { returnType: 'size_t', isConst: true, ); + _writeFunctionDeclaration( + indent, + 'ToString', + returnType: 'std::string', + isConst: true, + ); }); _writeAccessBlock(indent, _ClassAccess.private, () { @@ -966,6 +972,7 @@ class CppSourceGenerator extends StructuredGenerator { 'map', 'string', 'optional', + 'sstream', ]); indent.newln(); } @@ -1133,6 +1140,43 @@ class CppSourceGenerator extends StructuredGenerator { }, ); + _writeFunctionDefinition( + indent, + 'ToString', + scope: classDefinition.name, + returnType: 'std::string', + isConst: true, + body: () { + indent.writeln('std::stringstream ss;'); + indent.writeln('ss << "${classDefinition.name}(";'); + enumerate(orderedFields, (int index, final NamedType field) { + final String name = _makeInstanceVariableName(field); + final comma = index == 0 ? '' : ', '; + indent.writeln('ss << "$comma${field.name}: ";'); + if (field.type.isNullable) { + indent.writeScoped('if ($name.has_value()) {', '} else {', () { + if (field.type.isClass) { + indent.writeln('ss << $name->ToString();'); + } else { + indent.writeln('ss << *$name;'); + } + }); + indent.nest(1, () { + indent.writeln('ss << "null";'); + }); + } else { + if (field.type.isClass) { + indent.writeln('ss << $name.ToString();'); + } else { + indent.writeln('ss << $name;'); + } + } + }); + indent.writeln('ss << ")";'); + indent.writeln('return ss.str();'); + }, + ); + _writeFunctionDefinition( indent, 'PigeonInternalDeepHash', diff --git a/packages/pigeon/lib/src/dart/dart_generator.dart b/packages/pigeon/lib/src/dart/dart_generator.dart index 435df247c0c2..68ede69b0dd6 100644 --- a/packages/pigeon/lib/src/dart/dart_generator.dart +++ b/packages/pigeon/lib/src/dart/dart_generator.dart @@ -398,6 +398,19 @@ class DartGenerator extends StructuredGenerator { indent.writeln( 'int get hashCode => _deepHash([runtimeType, ..._toList()]);', ); + + indent.newln(); + indent.writeln('@override'); + indent.writeScoped('String toString() {', '}', () { + final Iterable fields = getFieldsInSerializationOrder( + classDefinition, + ); + final Iterable fieldStrings = fields.map((NamedType field) { + return '${field.name}: \$${field.name}'; + }); + final String fieldsConcat = fieldStrings.join(', '); + indent.writeln("return '${classDefinition.name}($fieldsConcat)';"); + }); } @override @@ -645,8 +658,8 @@ class DartGenerator extends StructuredGenerator { indent.write('class ${api.name} '); indent.addScoped('{', '}', () { indent.format(''' -/// Constructor for [${api.name}]. The [binaryMessenger] named argument is -/// available for dependency injection. If it is left null, the default +/// Constructor for [${api.name}]. 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. ${api.name}({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : ${varNamePrefix}binaryMessenger = binaryMessenger, @@ -1272,7 +1285,7 @@ Object? _extractReplyValueOrThrow( \t\t\tdetails: replyList[2], \t\t);'''); // On iOS we can return nil from functions to accommodate error - // handling. Returning a nil value and not returning an error is an + // handling. Returning a nil value and not returning an error is an // exception. indent.format(''' \t} else if (!isNullValid && (replyList.isNotEmpty && replyList[0] == null)) { diff --git a/packages/pigeon/lib/src/functional.dart b/packages/pigeon/lib/src/functional.dart index 01a9cf8b30a0..7ef3bf0da6dc 100644 --- a/packages/pigeon/lib/src/functional.dart +++ b/packages/pigeon/lib/src/functional.dart @@ -24,7 +24,7 @@ void enumerate(Iterable iterable, void Function(int, T) func) { } } -/// A [map] function that takes in 2 iterables. The [Iterable]s must be of +/// A [map] function that takes in 2 iterables. The [Iterable]s must be of /// equal length. Iterable map2( Iterable ts, @@ -41,7 +41,7 @@ Iterable map2( } } -/// A [map] function that takes in 3 iterables. The [Iterable]s must be of +/// A [map] function that takes in 3 iterables. The [Iterable]s must be of /// equal length. Iterable map3( Iterable ts, diff --git a/packages/pigeon/lib/src/generator_tools.dart b/packages/pigeon/lib/src/generator_tools.dart index 55874a95684a..0902718890dc 100644 --- a/packages/pigeon/lib/src/generator_tools.dart +++ b/packages/pigeon/lib/src/generator_tools.dart @@ -15,7 +15,7 @@ import 'generator.dart'; /// The current version of pigeon. /// /// This must match the version in pubspec.yaml. -const String pigeonVersion = '26.3.4'; +const String pigeonVersion = '26.4.0'; /// Default plugin package name. const String defaultPluginPackageName = 'dev.flutter.pigeon'; diff --git a/packages/pigeon/lib/src/gobject/gobject_generator.dart b/packages/pigeon/lib/src/gobject/gobject_generator.dart index 0906c005d78a..328118de6733 100644 --- a/packages/pigeon/lib/src/gobject/gobject_generator.dart +++ b/packages/pigeon/lib/src/gobject/gobject_generator.dart @@ -5,6 +5,7 @@ import 'package:path/path.dart' as path; import '../ast.dart'; +import '../functional.dart'; import '../generator.dart'; import '../generator_tools.dart'; @@ -352,6 +353,17 @@ class GObjectHeaderGenerator 'Returns: the hash code.', ], _docCommentSpec); indent.writeln('guint ${methodPrefix}_hash($className* object);'); + + indent.newln(); + addDocumentationComments(indent, [ + '${methodPrefix}_to_string:', + '@object: a #$className.', + '', + 'Returns a string representation of a #$className object.', + '', + 'Returns: (transfer full): a new string, free with g_free().', + ], _docCommentSpec); + indent.writeln('gchar* ${methodPrefix}_to_string($className* object);'); } @override @@ -1346,6 +1358,89 @@ class GObjectSourceGenerator } indent.writeln('return result;'); }); + + indent.newln(); + indent.writeScoped('gchar* ${methodPrefix}_to_string($className* self) {', '}', () { + indent.writeln('g_return_val_if_fail($testMacro(self), NULL);'); + indent.writeln( + 'GString* str = g_string_new("${classDefinition.name}(");', + ); + + enumerate(classDefinition.fields, (int index, final NamedType field) { + final String fieldName = _getFieldName(field.name); + final comma = index == 0 ? '' : ', '; + indent.writeln('g_string_append(str, "$comma$fieldName: ");'); + + if (field.type.isClass) { + final String fieldMethodPrefix = _getMethodPrefix( + module, + field.type.baseName, + ); + indent.writeScoped('if (self->$fieldName != nullptr) {', '}', () { + indent.writeln( + 'gchar* field_str = ${fieldMethodPrefix}_to_string(self->$fieldName);', + ); + indent.writeln('g_string_append(str, field_str);'); + indent.writeln('g_free(field_str);'); + }); + indent.writeScoped('else {', '}', () { + indent.writeln('g_string_append(str, "null");'); + }); + } else if (field.type.baseName == 'String') { + indent.writeScoped('if (self->$fieldName != nullptr) {', '}', () { + indent.writeln( + 'g_string_append_printf(str, "\\"%s\\"", self->$fieldName);', + ); + }); + indent.writeScoped('else {', '}', () { + indent.writeln('g_string_append(str, "null");'); + }); + } else if (_isNumericListType(field.type)) { + indent.writeln( + 'g_string_append_printf(str, "[...], length: %zu", self->${fieldName}_length);', + ); + } else if (field.type.baseName == 'bool') { + indent.writeln( + 'g_string_append(str, self->$fieldName ? "true" : "false");', + ); + } else if (field.type.baseName == 'int') { + if (field.type.isNullable) { + indent.writeScoped('if (self->$fieldName != nullptr) {', '}', () { + indent.writeln( + 'g_string_append_printf(str, "%" G_GINT64_FORMAT, *self->$fieldName);', + ); + }); + indent.writeScoped('else {', '}', () { + indent.writeln('g_string_append(str, "null");'); + }); + } else { + indent.writeln( + 'g_string_append_printf(str, "%" G_GINT64_FORMAT, self->$fieldName);', + ); + } + } else if (field.type.baseName == 'double') { + if (field.type.isNullable) { + indent.writeScoped('if (self->$fieldName != nullptr) {', '}', () { + indent.writeln( + 'g_string_append_printf(str, "%g", *self->$fieldName);', + ); + }); + indent.writeScoped('else {', '}', () { + indent.writeln('g_string_append(str, "null");'); + }); + } else { + indent.writeln( + 'g_string_append_printf(str, "%g", self->$fieldName);', + ); + } + } else { + indent.writeln('g_string_append(str, "...");'); + } + }); + + indent.writeln('g_string_append(str, ")");'); + indent.writeln('return g_string_free(str, FALSE);'); + }); } @override diff --git a/packages/pigeon/lib/src/java/java_generator.dart b/packages/pigeon/lib/src/java/java_generator.dart index 4b7f792dc1c3..e9485e17db93 100644 --- a/packages/pigeon/lib/src/java/java_generator.dart +++ b/packages/pigeon/lib/src/java/java_generator.dart @@ -289,6 +289,7 @@ class JavaGenerator extends StructuredGenerator { indent.newln(); } _writeEquality(indent, classDefinition); + _writeToString(indent, classDefinition); _writeClassBuilder(generatorOptions, root, indent, classDefinition); writeClassEncode( @@ -410,6 +411,33 @@ class JavaGenerator extends StructuredGenerator { indent.newln(); } + void _writeToString(Indent indent, Class classDefinition) { + indent.writeln('@Override'); + indent.writeScoped('public String toString() {', '}', () { + final Iterable fieldStrings = classDefinition.fields.map(( + NamedType field, + ) { + final String fieldName = field.name; + if (field.type.baseName == 'Uint8List' || + field.type.baseName == 'Int32List' || + field.type.baseName == 'Int64List' || + field.type.baseName == 'Float64List') { + return '"$fieldName=" + java.util.Arrays.toString($fieldName)'; + } + return '"$fieldName=" + $fieldName'; + }); + final String fieldsConcat = fieldStrings.join(' + ", " + '); + if (fieldsConcat.isEmpty) { + indent.writeln('return "${classDefinition.name}{}";'); + } else { + indent.writeln( + 'return "${classDefinition.name}{" + $fieldsConcat + "}";', + ); + } + }); + indent.newln(); + } + void _writeDeepEquals(Indent indent) { indent.writeScoped( 'static boolean pigeonDeepEquals(Object a, Object b) {', diff --git a/packages/pigeon/lib/src/kotlin/kotlin_generator.dart b/packages/pigeon/lib/src/kotlin/kotlin_generator.dart index 41e6a880f0a2..c04639aa2f5f 100644 --- a/packages/pigeon/lib/src/kotlin/kotlin_generator.dart +++ b/packages/pigeon/lib/src/kotlin/kotlin_generator.dart @@ -333,6 +333,13 @@ class KotlinGenerator extends StructuredGenerator { classDefinition, dartPackageName: dartPackageName, ); + writeClassToString( + generatorOptions, + root, + indent, + classDefinition, + dartPackageName: dartPackageName, + ); }); } @@ -390,6 +397,37 @@ class KotlinGenerator extends StructuredGenerator { }); } + /// Writes the `toString` method for a class. + void writeClassToString( + InternalKotlinOptions generatorOptions, + Root root, + Indent indent, + Class classDefinition, { + required String dartPackageName, + }) { + indent.writeScoped('override fun toString(): String {', '}', () { + final Iterable fieldStrings = classDefinition.fields.map(( + NamedType field, + ) { + final String name = field.name; + if (field.type.baseName == 'Uint8List' || + field.type.baseName == 'Int32List' || + field.type.baseName == 'Int64List' || + field.type.baseName == 'Float64List') { + final nullSafe = field.type.isNullable ? '?' : ''; + return '$name=\${$name$nullSafe.contentToString()}'; + } + return '$name=\$$name'; + }); + final String fieldsConcat = fieldStrings.join(', '); + if (fieldsConcat.isEmpty) { + indent.writeln('return "${classDefinition.name}()"'); + } else { + indent.writeln('return "${classDefinition.name}($fieldsConcat)"'); + } + }); + } + void _writeDataClassSignature( Indent indent, Class classDefinition, { diff --git a/packages/pigeon/lib/src/kotlin/templates.dart b/packages/pigeon/lib/src/kotlin/templates.dart index f8afe99fe980..ad9b752c175f 100644 --- a/packages/pigeon/lib/src/kotlin/templates.dart +++ b/packages/pigeon/lib/src/kotlin/templates.dart @@ -37,7 +37,7 @@ String instanceManagerTemplate(InternalKotlinOptions options) { */ @Suppress("UNCHECKED_CAST", "MemberVisibilityCanBePrivate") class ${kotlinInstanceManagerClassName(options)}(private val finalizationListener: $_finalizationListenerClassName) { - /** Interface for listening when a weak reference of an instance is removed from the manager. */ + /** Interface for listening when a weak reference of an instance is removed from the manager. */ interface $_finalizationListenerClassName { fun onFinalize(identifier: Long) } diff --git a/packages/pigeon/lib/src/objc/objc_generator.dart b/packages/pigeon/lib/src/objc/objc_generator.dart index af0ad6d1ea2a..0cec49bdfebe 100644 --- a/packages/pigeon/lib/src/objc/objc_generator.dart +++ b/packages/pigeon/lib/src/objc/objc_generator.dart @@ -617,6 +617,7 @@ class ObjcSourceGenerator extends StructuredGenerator { dartPackageName: dartPackageName, ); _writeObjcEquality(generatorOptions, indent, classDefinition); + _writeObjcDescription(generatorOptions, indent, classDefinition); indent.writeln('@end'); indent.newln(); } @@ -686,6 +687,39 @@ class ObjcSourceGenerator extends StructuredGenerator { }); } + void _writeObjcDescription( + InternalObjcOptions languageOptions, + Indent indent, + Class classDefinition, + ) { + final String className = _className( + languageOptions.prefix, + classDefinition.name, + ); + indent.writeScoped('- (NSString *)description {', '}', () { + final Iterable fieldLabels = classDefinition.fields.map(( + NamedType field, + ) { + return '${field.name}: %@'; + }); + final formatString = '$className(${fieldLabels.join(', ')})'; + + final Iterable fieldValues = classDefinition.fields.map(( + NamedType field, + ) { + if (_usesPrimitive(field.type)) { + return '@(self.${field.name})'; + } + return 'self.${field.name}'; + }); + + final args = fieldValues.isEmpty ? '' : ', ${fieldValues.join(', ')}'; + indent.writeln( + 'return [NSString stringWithFormat:@"$formatString"$args];', + ); + }); + } + @override void writeClassEncode( InternalObjcOptions generatorOptions, @@ -1913,7 +1947,7 @@ String _capitalize(String str) => str.isEmpty ? '' : str[0].toUpperCase() + str.substring(1); /// Returns the components of the objc selector that will be generated from -/// [func], ie the strings between the semicolons. [lastSelectorComponent] is +/// [func], ie the strings between the semicolons. [lastSelectorComponent] is /// the last component of the selector aka the label of the last parameter which /// isn't included in [func]. /// Example: @@ -1945,13 +1979,13 @@ Iterable _getSelectorComponents( } } -/// Generates the objc source code method signature for [func]. [returnType] is +/// Generates the objc source code method signature for [func]. [returnType] is /// the return value of method, this may not match the return value in [func] -/// since [func] may be asynchronous. The function requires you specify a +/// since [func] may be asynchronous. The function requires you specify a /// [lastArgType] and [lastArgName] for arguments that aren't represented in -/// [func]. This is typically used for passing in 'error' or 'completion' +/// [func]. This is typically used for passing in 'error' or 'completion' /// arguments that don't exist in the pigeon file but are required in the objc -/// output. [argNameFunc] is the function used to generate the argument name +/// output. [argNameFunc] is the function used to generate the argument name /// [func.parameters]. String _makeObjcSignature({ required Method func, diff --git a/packages/pigeon/lib/src/pigeon_cl.dart b/packages/pigeon/lib/src/pigeon_cl.dart index 75504154bfcd..78e39f672d73 100644 --- a/packages/pigeon/lib/src/pigeon_cl.dart +++ b/packages/pigeon/lib/src/pigeon_cl.dart @@ -5,7 +5,7 @@ import 'dart:async'; import 'pigeon_lib.dart'; -/// This is the main entrypoint for the command-line tool. [args] are the +/// This is the main entrypoint for the command-line tool. [args] are the /// command line arguments and there is an optional [packageConfig] to /// accommodate users that want to integrate pigeon with other build systems. /// [sdkPath] for specifying an optional Dart SDK path. diff --git a/packages/pigeon/lib/src/pigeon_lib.dart b/packages/pigeon/lib/src/pigeon_lib.dart index fd6b6c827b2b..9c38d8068d3c 100644 --- a/packages/pigeon/lib/src/pigeon_lib.dart +++ b/packages/pigeon/lib/src/pigeon_lib.dart @@ -110,7 +110,7 @@ class HostApi { /// to specify where to generate the test file. /// /// Prefer to use a mock of the real [HostApi] with a mocking library for unit - /// tests. Generating this Dart handler is sometimes useful in integration + /// tests. Generating this Dart handler is sometimes useful in integration /// testing. /// /// Defaults to `null` in which case no handler will be generated. @@ -629,7 +629,7 @@ ${_argParser.usage}'''; /// Convert command-line arguments to [PigeonOptions]. static PigeonOptions parseArgs(List args) { // Note: This function shouldn't perform any logic, just translate the args - // to PigeonOptions. Synthesized values inside of the PigeonOption should + // to PigeonOptions. Synthesized values inside of the PigeonOption should // get set in the `run` function to accommodate users that are using the // `configurePigeon` function. final ArgResults results = _argParser.parse(args); @@ -691,8 +691,8 @@ ${_argParser.usage}'''; } } - /// The 'main' entrypoint used by the command-line tool. [args] are the - /// command-line arguments. The optional parameter [adapters] allows you to + /// The 'main' entrypoint used by the command-line tool. [args] are the + /// command-line arguments. The optional parameter [adapters] allows you to /// customize the generators that pigeon will use. The optional parameter /// [sdkPath] allows you to specify the Dart SDK path. static Future run( @@ -704,8 +704,8 @@ ${_argParser.usage}'''; return runWithOptions(options, adapters: adapters, sdkPath: sdkPath); } - /// The 'main' entrypoint used by external packages. [options] is - /// used when running the code generator. The optional parameter [adapters] allows you to + /// The 'main' entrypoint used by external packages. [options] is + /// used when running the code generator. The optional parameter [adapters] allows you to /// customize the generators that pigeon will use. The optional parameter /// [sdkPath] allows you to specify the Dart SDK path. static Future runWithOptions( diff --git a/packages/pigeon/lib/src/swift/swift_generator.dart b/packages/pigeon/lib/src/swift/swift_generator.dart index 45b968ed4d10..35712f684870 100644 --- a/packages/pigeon/lib/src/swift/swift_generator.dart +++ b/packages/pigeon/lib/src/swift/swift_generator.dart @@ -421,10 +421,10 @@ class SwiftGenerator extends StructuredGenerator { }) { final privateString = private ? 'private ' : ''; final extendsString = classDefinition.superClass != null - ? ': ${classDefinition.superClass!.name}' + ? ': ${classDefinition.superClass!.name}, CustomStringConvertible' : hashable - ? ': Hashable' - : ''; + ? ': Hashable, CustomStringConvertible' + : ': CustomStringConvertible'; if (classDefinition.isSwiftClass) { indent.write( '${privateString}class ${classDefinition.name}$extendsString ', @@ -593,6 +593,14 @@ if (wrapped == nil) { classDefinition, dartPackageName: dartPackageName, ); + indent.newln(); + writeClassToString( + generatorOptions, + root, + indent, + classDefinition, + dartPackageName: dartPackageName, + ); }); } @@ -704,6 +712,25 @@ if (wrapped == nil) { }); } + /// Writes the `CustomStringConvertible` conformance for a class. + void writeClassToString( + InternalSwiftOptions generatorOptions, + Root root, + Indent indent, + Class classDefinition, { + required String dartPackageName, + }) { + indent.writeScoped('public var description: String {', '}', () { + final Iterable fieldStrings = classDefinition.fields.map(( + NamedType field, + ) { + return '${field.name}: \\(${field.name})'; + }); + final String fieldsConcat = fieldStrings.join(', '); + indent.writeln('return "${classDefinition.name}($fieldsConcat)"'); + }); + } + @override void writeClassDecode( InternalSwiftOptions generatorOptions, @@ -799,6 +826,7 @@ if (wrapped == nil) { AstFlutterApi api, { required String dartPackageName, }) { + indent.newln(); const generatedComments = [ ' Generated protocol from Pigeon that represents Flutter messages that can be called from Swift.', ]; @@ -1433,10 +1461,32 @@ if (wrapped == nil) { void _writeIsNullish(Indent indent) { indent.newln(); - indent.write('private func isNullish(_ value: Any?) -> Bool '); - indent.addScoped('{', '}', () { - indent.writeln('return value is NSNull || value == nil'); - }); + indent.format(''' +#if DEBUG + func isNullish(_ value: Any?) -> Bool { + guard let innerValue = value else { + return true + } + + if case Optional.some(Optional.none) = value { + return true + } + + return innerValue is NSNull + } +#else + private func isNullish(_ value: Any?) -> Bool { + guard let innerValue = value else { + return true + } + + if case Optional.some(Optional.none) = value { + return true + } + + return innerValue is NSNull + } +#endif'''); } void _writeWrapResult(Indent indent) { diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/main/java/com/example/alternate_language_test_plugin/CoreTests.java b/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/main/java/com/example/alternate_language_test_plugin/CoreTests.java index a21588a5c9df..1412c1fa1d6e 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/main/java/com/example/alternate_language_test_plugin/CoreTests.java +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/main/java/com/example/alternate_language_test_plugin/CoreTests.java @@ -285,6 +285,11 @@ public int hashCode() { return pigeonDeepHashCode(fields); } + @Override + public String toString() { + return "UnusedClass{" + "aField=" + aField + "}"; + } + public static final class Builder { private @Nullable Object aField; @@ -766,6 +771,95 @@ public int hashCode() { return pigeonDeepHashCode(fields); } + @Override + public String toString() { + return "AllTypes{" + + "aBool=" + + aBool + + ", " + + "anInt=" + + anInt + + ", " + + "anInt64=" + + anInt64 + + ", " + + "aDouble=" + + aDouble + + ", " + + "aByteArray=" + + java.util.Arrays.toString(aByteArray) + + ", " + + "a4ByteArray=" + + java.util.Arrays.toString(a4ByteArray) + + ", " + + "a8ByteArray=" + + java.util.Arrays.toString(a8ByteArray) + + ", " + + "aFloatArray=" + + java.util.Arrays.toString(aFloatArray) + + ", " + + "anEnum=" + + anEnum + + ", " + + "anotherEnum=" + + anotherEnum + + ", " + + "aString=" + + aString + + ", " + + "anObject=" + + anObject + + ", " + + "list=" + + list + + ", " + + "stringList=" + + stringList + + ", " + + "intList=" + + intList + + ", " + + "doubleList=" + + doubleList + + ", " + + "boolList=" + + boolList + + ", " + + "enumList=" + + enumList + + ", " + + "objectList=" + + objectList + + ", " + + "listList=" + + listList + + ", " + + "mapList=" + + mapList + + ", " + + "map=" + + map + + ", " + + "stringMap=" + + stringMap + + ", " + + "intMap=" + + intMap + + ", " + + "enumMap=" + + enumMap + + ", " + + "objectMap=" + + objectMap + + ", " + + "listMap=" + + listMap + + ", " + + "mapMap=" + + mapMap + + "}"; + } + public static final class Builder { private @Nullable Boolean aBool; @@ -1520,6 +1614,104 @@ public int hashCode() { return pigeonDeepHashCode(fields); } + @Override + public String toString() { + return "AllNullableTypes{" + + "aNullableBool=" + + aNullableBool + + ", " + + "aNullableInt=" + + aNullableInt + + ", " + + "aNullableInt64=" + + aNullableInt64 + + ", " + + "aNullableDouble=" + + aNullableDouble + + ", " + + "aNullableByteArray=" + + java.util.Arrays.toString(aNullableByteArray) + + ", " + + "aNullable4ByteArray=" + + java.util.Arrays.toString(aNullable4ByteArray) + + ", " + + "aNullable8ByteArray=" + + java.util.Arrays.toString(aNullable8ByteArray) + + ", " + + "aNullableFloatArray=" + + java.util.Arrays.toString(aNullableFloatArray) + + ", " + + "aNullableEnum=" + + aNullableEnum + + ", " + + "anotherNullableEnum=" + + anotherNullableEnum + + ", " + + "aNullableString=" + + aNullableString + + ", " + + "aNullableObject=" + + aNullableObject + + ", " + + "allNullableTypes=" + + allNullableTypes + + ", " + + "list=" + + list + + ", " + + "stringList=" + + stringList + + ", " + + "intList=" + + intList + + ", " + + "doubleList=" + + doubleList + + ", " + + "boolList=" + + boolList + + ", " + + "enumList=" + + enumList + + ", " + + "objectList=" + + objectList + + ", " + + "listList=" + + listList + + ", " + + "mapList=" + + mapList + + ", " + + "recursiveClassList=" + + recursiveClassList + + ", " + + "map=" + + map + + ", " + + "stringMap=" + + stringMap + + ", " + + "intMap=" + + intMap + + ", " + + "enumMap=" + + enumMap + + ", " + + "objectMap=" + + objectMap + + ", " + + "listMap=" + + listMap + + ", " + + "mapMap=" + + mapMap + + ", " + + "recursiveClassMap=" + + recursiveClassMap + + "}"; + } + public static final class Builder { private @Nullable Boolean aNullableBool; @@ -2276,6 +2468,95 @@ public int hashCode() { return pigeonDeepHashCode(fields); } + @Override + public String toString() { + return "AllNullableTypesWithoutRecursion{" + + "aNullableBool=" + + aNullableBool + + ", " + + "aNullableInt=" + + aNullableInt + + ", " + + "aNullableInt64=" + + aNullableInt64 + + ", " + + "aNullableDouble=" + + aNullableDouble + + ", " + + "aNullableByteArray=" + + java.util.Arrays.toString(aNullableByteArray) + + ", " + + "aNullable4ByteArray=" + + java.util.Arrays.toString(aNullable4ByteArray) + + ", " + + "aNullable8ByteArray=" + + java.util.Arrays.toString(aNullable8ByteArray) + + ", " + + "aNullableFloatArray=" + + java.util.Arrays.toString(aNullableFloatArray) + + ", " + + "aNullableEnum=" + + aNullableEnum + + ", " + + "anotherNullableEnum=" + + anotherNullableEnum + + ", " + + "aNullableString=" + + aNullableString + + ", " + + "aNullableObject=" + + aNullableObject + + ", " + + "list=" + + list + + ", " + + "stringList=" + + stringList + + ", " + + "intList=" + + intList + + ", " + + "doubleList=" + + doubleList + + ", " + + "boolList=" + + boolList + + ", " + + "enumList=" + + enumList + + ", " + + "objectList=" + + objectList + + ", " + + "listList=" + + listList + + ", " + + "mapList=" + + mapList + + ", " + + "map=" + + map + + ", " + + "stringMap=" + + stringMap + + ", " + + "intMap=" + + intMap + + ", " + + "enumMap=" + + enumMap + + ", " + + "objectMap=" + + objectMap + + ", " + + "listMap=" + + listMap + + ", " + + "mapMap=" + + mapMap + + "}"; + } + public static final class Builder { private @Nullable Boolean aNullableBool; @@ -2762,6 +3043,32 @@ public int hashCode() { return pigeonDeepHashCode(fields); } + @Override + public String toString() { + return "AllClassesWrapper{" + + "allNullableTypes=" + + allNullableTypes + + ", " + + "allNullableTypesWithoutRecursion=" + + allNullableTypesWithoutRecursion + + ", " + + "allTypes=" + + allTypes + + ", " + + "classList=" + + classList + + ", " + + "nullableClassList=" + + nullableClassList + + ", " + + "classMap=" + + classMap + + ", " + + "nullableClassMap=" + + nullableClassMap + + "}"; + } + public static final class Builder { private @Nullable AllNullableTypes allNullableTypes; @@ -2905,6 +3212,11 @@ public int hashCode() { return pigeonDeepHashCode(fields); } + @Override + public String toString() { + return "TestMessage{" + "testList=" + testList + "}"; + } + public static final class Builder { private @Nullable List testList; diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/darwin/alternate_language_test_plugin/Sources/alternate_language_test_plugin/CoreTests.gen.m b/packages/pigeon/platform_tests/alternate_language_test_plugin/darwin/alternate_language_test_plugin/Sources/alternate_language_test_plugin/CoreTests.gen.m index 7c114f8fa47b..f999a0fb6d53 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/darwin/alternate_language_test_plugin/Sources/alternate_language_test_plugin/CoreTests.gen.m +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/darwin/alternate_language_test_plugin/Sources/alternate_language_test_plugin/CoreTests.gen.m @@ -218,6 +218,9 @@ - (NSUInteger)hash { result = result * 31 + FLTPigeonDeepHash(self.aField); return result; } +- (NSString *)description { + return [NSString stringWithFormat:@"FLTUnusedClass(aField: %@)", self.aField]; +} @end @implementation FLTAllTypes @@ -417,6 +420,20 @@ - (NSUInteger)hash { result = result * 31 + FLTPigeonDeepHash(self.mapMap); return result; } +- (NSString *)description { + return [NSString + stringWithFormat: + @"FLTAllTypes(aBool: %@, anInt: %@, anInt64: %@, aDouble: %@, aByteArray: %@, " + @"a4ByteArray: %@, a8ByteArray: %@, aFloatArray: %@, anEnum: %@, anotherEnum: %@, " + @"aString: %@, anObject: %@, list: %@, stringList: %@, intList: %@, doubleList: %@, " + @"boolList: %@, enumList: %@, objectList: %@, listList: %@, mapList: %@, map: %@, " + @"stringMap: %@, intMap: %@, enumMap: %@, objectMap: %@, listMap: %@, mapMap: %@)", + @(self.aBool), @(self.anInt), @(self.anInt64), @(self.aDouble), self.aByteArray, + self.a4ByteArray, self.a8ByteArray, self.aFloatArray, @(self.anEnum), @(self.anotherEnum), + self.aString, self.anObject, self.list, self.stringList, self.intList, self.doubleList, + self.boolList, self.enumList, self.objectList, self.listList, self.mapList, self.map, + self.stringMap, self.intMap, self.enumMap, self.objectMap, self.listMap, self.mapMap]; +} @end @implementation FLTAllNullableTypes @@ -636,6 +653,26 @@ - (NSUInteger)hash { result = result * 31 + FLTPigeonDeepHash(self.recursiveClassMap); return result; } +- (NSString *)description { + return [NSString + stringWithFormat:@"FLTAllNullableTypes(aNullableBool: %@, aNullableInt: %@, aNullableInt64: " + @"%@, aNullableDouble: %@, aNullableByteArray: %@, aNullable4ByteArray: %@, " + @"aNullable8ByteArray: %@, aNullableFloatArray: %@, aNullableEnum: %@, " + @"anotherNullableEnum: %@, aNullableString: %@, aNullableObject: %@, " + @"allNullableTypes: %@, list: %@, stringList: %@, intList: %@, doubleList: " + @"%@, boolList: %@, enumList: %@, objectList: %@, listList: %@, mapList: " + @"%@, recursiveClassList: %@, map: %@, stringMap: %@, intMap: %@, enumMap: " + @"%@, objectMap: %@, listMap: %@, mapMap: %@, recursiveClassMap: %@)", + self.aNullableBool, self.aNullableInt, self.aNullableInt64, + self.aNullableDouble, self.aNullableByteArray, self.aNullable4ByteArray, + self.aNullable8ByteArray, self.aNullableFloatArray, self.aNullableEnum, + self.anotherNullableEnum, self.aNullableString, self.aNullableObject, + self.allNullableTypes, self.list, self.stringList, self.intList, + self.doubleList, self.boolList, self.enumList, self.objectList, + self.listList, self.mapList, self.recursiveClassList, self.map, + self.stringMap, self.intMap, self.enumMap, self.objectMap, self.listMap, + self.mapMap, self.recursiveClassMap]; +} @end @implementation FLTAllNullableTypesWithoutRecursion @@ -838,6 +875,24 @@ - (NSUInteger)hash { result = result * 31 + FLTPigeonDeepHash(self.mapMap); return result; } +- (NSString *)description { + return [NSString + stringWithFormat: + @"FLTAllNullableTypesWithoutRecursion(aNullableBool: %@, aNullableInt: %@, " + @"aNullableInt64: %@, aNullableDouble: %@, aNullableByteArray: %@, aNullable4ByteArray: " + @"%@, aNullable8ByteArray: %@, aNullableFloatArray: %@, aNullableEnum: %@, " + @"anotherNullableEnum: %@, aNullableString: %@, aNullableObject: %@, list: %@, " + @"stringList: %@, intList: %@, doubleList: %@, boolList: %@, enumList: %@, objectList: " + @"%@, listList: %@, mapList: %@, map: %@, stringMap: %@, intMap: %@, enumMap: %@, " + @"objectMap: %@, listMap: %@, mapMap: %@)", + self.aNullableBool, self.aNullableInt, self.aNullableInt64, self.aNullableDouble, + self.aNullableByteArray, self.aNullable4ByteArray, self.aNullable8ByteArray, + self.aNullableFloatArray, self.aNullableEnum, self.anotherNullableEnum, + self.aNullableString, self.aNullableObject, self.list, self.stringList, self.intList, + self.doubleList, self.boolList, self.enumList, self.objectList, self.listList, + self.mapList, self.map, self.stringMap, self.intMap, self.enumMap, self.objectMap, + self.listMap, self.mapMap]; +} @end @implementation FLTAllClassesWrapper @@ -917,6 +972,15 @@ - (NSUInteger)hash { result = result * 31 + FLTPigeonDeepHash(self.nullableClassMap); return result; } +- (NSString *)description { + return + [NSString stringWithFormat:@"FLTAllClassesWrapper(allNullableTypes: %@, " + @"allNullableTypesWithoutRecursion: %@, allTypes: %@, classList: " + @"%@, nullableClassList: %@, classMap: %@, nullableClassMap: %@)", + self.allNullableTypes, self.allNullableTypesWithoutRecursion, + self.allTypes, self.classList, self.nullableClassList, + self.classMap, self.nullableClassMap]; +} @end @implementation FLTTestMessage @@ -954,6 +1018,9 @@ - (NSUInteger)hash { result = result * 31 + FLTPigeonDeepHash(self.testList); return result; } +- (NSString *)description { + return [NSString stringWithFormat:@"FLTTestMessage(testList: %@)", self.testList]; +} @end @interface FLTCoreTestsPigeonCodecReader : FlutterStandardReader diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/background_platform_channels.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/background_platform_channels.gen.dart index d6e49a4b33b3..1ba37b3eae22 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/background_platform_channels.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/background_platform_channels.gen.dart @@ -41,8 +41,8 @@ class _PigeonCodec extends StandardMessageCodec { } class BackgroundApi2Host { - /// Constructor for [BackgroundApi2Host]. The [binaryMessenger] named argument is - /// available for dependency injection. If it is left null, the default + /// Constructor for [BackgroundApi2Host]. 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. BackgroundApi2Host({ BinaryMessenger? binaryMessenger, diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/core_tests.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/core_tests.gen.dart index 482368add83b..3178b27fd494 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/core_tests.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/core_tests.gen.dart @@ -152,6 +152,11 @@ class UnusedClass { @override // ignore: avoid_equals_and_hash_code_on_mutable_classes int get hashCode => _deepHash([runtimeType, ..._toList()]); + + @override + String toString() { + return 'UnusedClass(aField: $aField)'; + } } /// A class containing all supported types. @@ -358,6 +363,11 @@ class AllTypes { @override // ignore: avoid_equals_and_hash_code_on_mutable_classes int get hashCode => _deepHash([runtimeType, ..._toList()]); + + @override + String toString() { + return 'AllTypes(aBool: $aBool, anInt: $anInt, anInt64: $anInt64, aDouble: $aDouble, aByteArray: $aByteArray, a4ByteArray: $a4ByteArray, a8ByteArray: $a8ByteArray, aFloatArray: $aFloatArray, anEnum: $anEnum, anotherEnum: $anotherEnum, aString: $aString, anObject: $anObject, list: $list, stringList: $stringList, intList: $intList, doubleList: $doubleList, boolList: $boolList, enumList: $enumList, objectList: $objectList, listList: $listList, mapList: $mapList, map: $map, stringMap: $stringMap, intMap: $intMap, enumMap: $enumMap, objectMap: $objectMap, listMap: $listMap, mapMap: $mapMap)'; + } } /// A class containing all supported nullable types. @@ -585,6 +595,11 @@ class AllNullableTypes { @override // ignore: avoid_equals_and_hash_code_on_mutable_classes int get hashCode => _deepHash([runtimeType, ..._toList()]); + + @override + String toString() { + return 'AllNullableTypes(aNullableBool: $aNullableBool, aNullableInt: $aNullableInt, aNullableInt64: $aNullableInt64, aNullableDouble: $aNullableDouble, aNullableByteArray: $aNullableByteArray, aNullable4ByteArray: $aNullable4ByteArray, aNullable8ByteArray: $aNullable8ByteArray, aNullableFloatArray: $aNullableFloatArray, aNullableEnum: $aNullableEnum, anotherNullableEnum: $anotherNullableEnum, aNullableString: $aNullableString, aNullableObject: $aNullableObject, allNullableTypes: $allNullableTypes, list: $list, stringList: $stringList, intList: $intList, doubleList: $doubleList, boolList: $boolList, enumList: $enumList, objectList: $objectList, listList: $listList, mapList: $mapList, recursiveClassList: $recursiveClassList, map: $map, stringMap: $stringMap, intMap: $intMap, enumMap: $enumMap, objectMap: $objectMap, listMap: $listMap, mapMap: $mapMap, recursiveClassMap: $recursiveClassMap)'; + } } /// The primary purpose for this class is to ensure coverage of Swift structs @@ -795,6 +810,11 @@ class AllNullableTypesWithoutRecursion { @override // ignore: avoid_equals_and_hash_code_on_mutable_classes int get hashCode => _deepHash([runtimeType, ..._toList()]); + + @override + String toString() { + return 'AllNullableTypesWithoutRecursion(aNullableBool: $aNullableBool, aNullableInt: $aNullableInt, aNullableInt64: $aNullableInt64, aNullableDouble: $aNullableDouble, aNullableByteArray: $aNullableByteArray, aNullable4ByteArray: $aNullable4ByteArray, aNullable8ByteArray: $aNullable8ByteArray, aNullableFloatArray: $aNullableFloatArray, aNullableEnum: $aNullableEnum, anotherNullableEnum: $anotherNullableEnum, aNullableString: $aNullableString, aNullableObject: $aNullableObject, list: $list, stringList: $stringList, intList: $intList, doubleList: $doubleList, boolList: $boolList, enumList: $enumList, objectList: $objectList, listList: $listList, mapList: $mapList, map: $map, stringMap: $stringMap, intMap: $intMap, enumMap: $enumMap, objectMap: $objectMap, listMap: $listMap, mapMap: $mapMap)'; + } } /// A class for testing nested class handling. @@ -883,6 +903,11 @@ class AllClassesWrapper { @override // ignore: avoid_equals_and_hash_code_on_mutable_classes int get hashCode => _deepHash([runtimeType, ..._toList()]); + + @override + String toString() { + return 'AllClassesWrapper(allNullableTypes: $allNullableTypes, allNullableTypesWithoutRecursion: $allNullableTypesWithoutRecursion, allTypes: $allTypes, classList: $classList, nullableClassList: $nullableClassList, classMap: $classMap, nullableClassMap: $nullableClassMap)'; + } } /// A data class containing a List, used in unit tests. @@ -919,6 +944,11 @@ class TestMessage { @override // ignore: avoid_equals_and_hash_code_on_mutable_classes int get hashCode => _deepHash([runtimeType, ..._toList()]); + + @override + String toString() { + return 'TestMessage(testList: $testList)'; + } } class _PigeonCodec extends StandardMessageCodec { @@ -987,8 +1017,8 @@ class _PigeonCodec extends StandardMessageCodec { /// The core interface that each host language plugin must implement in /// platform_test integration tests. class HostIntegrationCoreApi { - /// Constructor for [HostIntegrationCoreApi]. The [binaryMessenger] named argument is - /// available for dependency injection. If it is left null, the default + /// Constructor for [HostIntegrationCoreApi]. 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. HostIntegrationCoreApi({ BinaryMessenger? binaryMessenger, @@ -6123,8 +6153,8 @@ abstract class FlutterIntegrationCoreApi { /// An API that can be implemented for minimal, compile-only tests. class HostTrivialApi { - /// Constructor for [HostTrivialApi]. The [binaryMessenger] named argument is - /// available for dependency injection. If it is left null, the default + /// Constructor for [HostTrivialApi]. 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. HostTrivialApi({ BinaryMessenger? binaryMessenger, @@ -6160,8 +6190,8 @@ class HostTrivialApi { /// A simple API implemented in some unit tests. class HostSmallApi { - /// Constructor for [HostSmallApi]. The [binaryMessenger] named argument is - /// available for dependency injection. If it is left null, the default + /// Constructor for [HostSmallApi]. 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. HostSmallApi({ BinaryMessenger? binaryMessenger, diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/enum.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/enum.gen.dart index 202b98268626..3e577db1832f 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/enum.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/enum.gen.dart @@ -165,6 +165,11 @@ class DataWithEnum { @override // ignore: avoid_equals_and_hash_code_on_mutable_classes int get hashCode => _deepHash([runtimeType, ..._toList()]); + + @override + String toString() { + return 'DataWithEnum(state: $state)'; + } } class _PigeonCodec extends StandardMessageCodec { @@ -201,8 +206,8 @@ class _PigeonCodec extends StandardMessageCodec { /// This comment is to test api documentation comments. class EnumApi2Host { - /// Constructor for [EnumApi2Host]. The [binaryMessenger] named argument is - /// available for dependency injection. If it is left null, the default + /// Constructor for [EnumApi2Host]. 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. EnumApi2Host({ BinaryMessenger? binaryMessenger, diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/event_channel_tests.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/event_channel_tests.gen.dart index 4734c4b0cdb0..41bbc7ef8351 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/event_channel_tests.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/event_channel_tests.gen.dart @@ -306,6 +306,11 @@ class EventAllNullableTypes { @override // ignore: avoid_equals_and_hash_code_on_mutable_classes int get hashCode => _deepHash([runtimeType, ..._toList()]); + + @override + String toString() { + return 'EventAllNullableTypes(aNullableBool: $aNullableBool, aNullableInt: $aNullableInt, aNullableInt64: $aNullableInt64, aNullableDouble: $aNullableDouble, aNullableByteArray: $aNullableByteArray, aNullable4ByteArray: $aNullable4ByteArray, aNullable8ByteArray: $aNullable8ByteArray, aNullableFloatArray: $aNullableFloatArray, aNullableEnum: $aNullableEnum, anotherNullableEnum: $anotherNullableEnum, aNullableString: $aNullableString, aNullableObject: $aNullableObject, allNullableTypes: $allNullableTypes, list: $list, stringList: $stringList, intList: $intList, doubleList: $doubleList, boolList: $boolList, enumList: $enumList, objectList: $objectList, listList: $listList, mapList: $mapList, recursiveClassList: $recursiveClassList, map: $map, stringMap: $stringMap, intMap: $intMap, enumMap: $enumMap, objectMap: $objectMap, listMap: $listMap, mapMap: $mapMap, recursiveClassMap: $recursiveClassMap)'; + } } sealed class PlatformEvent {} @@ -343,6 +348,11 @@ class IntEvent extends PlatformEvent { @override // ignore: avoid_equals_and_hash_code_on_mutable_classes int get hashCode => _deepHash([runtimeType, ..._toList()]); + + @override + String toString() { + return 'IntEvent(value: $value)'; + } } class StringEvent extends PlatformEvent { @@ -378,6 +388,11 @@ class StringEvent extends PlatformEvent { @override // ignore: avoid_equals_and_hash_code_on_mutable_classes int get hashCode => _deepHash([runtimeType, ..._toList()]); + + @override + String toString() { + return 'StringEvent(value: $value)'; + } } class BoolEvent extends PlatformEvent { @@ -413,6 +428,11 @@ class BoolEvent extends PlatformEvent { @override // ignore: avoid_equals_and_hash_code_on_mutable_classes int get hashCode => _deepHash([runtimeType, ..._toList()]); + + @override + String toString() { + return 'BoolEvent(value: $value)'; + } } class DoubleEvent extends PlatformEvent { @@ -448,6 +468,11 @@ class DoubleEvent extends PlatformEvent { @override // ignore: avoid_equals_and_hash_code_on_mutable_classes int get hashCode => _deepHash([runtimeType, ..._toList()]); + + @override + String toString() { + return 'DoubleEvent(value: $value)'; + } } class ObjectsEvent extends PlatformEvent { @@ -483,6 +508,11 @@ class ObjectsEvent extends PlatformEvent { @override // ignore: avoid_equals_and_hash_code_on_mutable_classes int get hashCode => _deepHash([runtimeType, ..._toList()]); + + @override + String toString() { + return 'ObjectsEvent(value: $value)'; + } } class EnumEvent extends PlatformEvent { @@ -518,6 +548,11 @@ class EnumEvent extends PlatformEvent { @override // ignore: avoid_equals_and_hash_code_on_mutable_classes int get hashCode => _deepHash([runtimeType, ..._toList()]); + + @override + String toString() { + return 'EnumEvent(value: $value)'; + } } class ClassEvent extends PlatformEvent { @@ -553,6 +588,11 @@ class ClassEvent extends PlatformEvent { @override // ignore: avoid_equals_and_hash_code_on_mutable_classes int get hashCode => _deepHash([runtimeType, ..._toList()]); + + @override + String toString() { + return 'ClassEvent(value: $value)'; + } } class _PigeonCodec extends StandardMessageCodec { diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/flutter_unittests.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/flutter_unittests.gen.dart index 3fe4b498ee2d..940a8df6993f 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/flutter_unittests.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/flutter_unittests.gen.dart @@ -134,6 +134,11 @@ class FlutterSearchRequest { @override // ignore: avoid_equals_and_hash_code_on_mutable_classes int get hashCode => _deepHash([runtimeType, ..._toList()]); + + @override + String toString() { + return 'FlutterSearchRequest(query: $query)'; + } } class FlutterSearchReply { @@ -174,6 +179,11 @@ class FlutterSearchReply { @override // ignore: avoid_equals_and_hash_code_on_mutable_classes int get hashCode => _deepHash([runtimeType, ..._toList()]); + + @override + String toString() { + return 'FlutterSearchReply(result: $result, error: $error)'; + } } class FlutterSearchRequests { @@ -209,6 +219,11 @@ class FlutterSearchRequests { @override // ignore: avoid_equals_and_hash_code_on_mutable_classes int get hashCode => _deepHash([runtimeType, ..._toList()]); + + @override + String toString() { + return 'FlutterSearchRequests(requests: $requests)'; + } } class FlutterSearchReplies { @@ -244,6 +259,11 @@ class FlutterSearchReplies { @override // ignore: avoid_equals_and_hash_code_on_mutable_classes int get hashCode => _deepHash([runtimeType, ..._toList()]); + + @override + String toString() { + return 'FlutterSearchReplies(replies: $replies)'; + } } class _PigeonCodec extends StandardMessageCodec { @@ -288,8 +308,8 @@ class _PigeonCodec extends StandardMessageCodec { } class Api { - /// Constructor for [Api]. The [binaryMessenger] named argument is - /// available for dependency injection. If it is left null, the default + /// Constructor for [Api]. 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. Api({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : pigeonVar_binaryMessenger = binaryMessenger, diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/message.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/message.gen.dart index 9013d5973196..08b51cf0867d 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/message.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/message.gen.dart @@ -173,6 +173,11 @@ class MessageSearchRequest { @override // ignore: avoid_equals_and_hash_code_on_mutable_classes int get hashCode => _deepHash([runtimeType, ..._toList()]); + + @override + String toString() { + return 'MessageSearchRequest(query: $query, anInt: $anInt, aBool: $aBool)'; + } } /// This comment is to test class documentation comments. @@ -224,6 +229,11 @@ class MessageSearchReply { @override // ignore: avoid_equals_and_hash_code_on_mutable_classes int get hashCode => _deepHash([runtimeType, ..._toList()]); + + @override + String toString() { + return 'MessageSearchReply(result: $result, error: $error, state: $state)'; + } } /// This comment is to test class documentation comments. @@ -261,6 +271,11 @@ class MessageNested { @override // ignore: avoid_equals_and_hash_code_on_mutable_classes int get hashCode => _deepHash([runtimeType, ..._toList()]); + + @override + String toString() { + return 'MessageNested(request: $request)'; + } } class _PigeonCodec extends StandardMessageCodec { @@ -309,8 +324,8 @@ class _PigeonCodec extends StandardMessageCodec { /// /// This comment also tests multiple line comments. class MessageApi { - /// Constructor for [MessageApi]. The [binaryMessenger] named argument is - /// available for dependency injection. If it is left null, the default + /// Constructor for [MessageApi]. 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. MessageApi({ BinaryMessenger? binaryMessenger, @@ -371,8 +386,8 @@ class MessageApi { /// This comment is to test api documentation comments. class MessageNestedApi { - /// Constructor for [MessageNestedApi]. The [binaryMessenger] named argument is - /// available for dependency injection. If it is left null, the default + /// Constructor for [MessageNestedApi]. 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. MessageNestedApi({ BinaryMessenger? binaryMessenger, diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/multiple_arity.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/multiple_arity.gen.dart index 7b2ebf15d84e..f431295f9022 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/multiple_arity.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/multiple_arity.gen.dart @@ -74,8 +74,8 @@ class _PigeonCodec extends StandardMessageCodec { } class MultipleArityHostApi { - /// Constructor for [MultipleArityHostApi]. The [binaryMessenger] named argument is - /// available for dependency injection. If it is left null, the default + /// Constructor for [MultipleArityHostApi]. 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. MultipleArityHostApi({ BinaryMessenger? binaryMessenger, diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/non_null_fields.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/non_null_fields.gen.dart index 476917a52f9f..0af20b35e5cb 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/non_null_fields.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/non_null_fields.gen.dart @@ -151,6 +151,11 @@ class NonNullFieldSearchRequest { @override // ignore: avoid_equals_and_hash_code_on_mutable_classes int get hashCode => _deepHash([runtimeType, ..._toList()]); + + @override + String toString() { + return 'NonNullFieldSearchRequest(query: $query)'; + } } class ExtraData { @@ -192,6 +197,11 @@ class ExtraData { @override // ignore: avoid_equals_and_hash_code_on_mutable_classes int get hashCode => _deepHash([runtimeType, ..._toList()]); + + @override + String toString() { + return 'ExtraData(detailA: $detailA, detailB: $detailB)'; + } } class NonNullFieldSearchReply { @@ -251,6 +261,11 @@ class NonNullFieldSearchReply { @override // ignore: avoid_equals_and_hash_code_on_mutable_classes int get hashCode => _deepHash([runtimeType, ..._toList()]); + + @override + String toString() { + return 'NonNullFieldSearchReply(result: $result, error: $error, indices: $indices, extraData: $extraData, type: $type)'; + } } class _PigeonCodec extends StandardMessageCodec { @@ -296,8 +311,8 @@ class _PigeonCodec extends StandardMessageCodec { } class NonNullFieldHostApi { - /// Constructor for [NonNullFieldHostApi]. The [binaryMessenger] named argument is - /// available for dependency injection. If it is left null, the default + /// Constructor for [NonNullFieldHostApi]. 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. NonNullFieldHostApi({ BinaryMessenger? binaryMessenger, diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/null_fields.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/null_fields.gen.dart index e861dbaa62ed..a24a07771761 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/null_fields.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/null_fields.gen.dart @@ -156,6 +156,11 @@ class NullFieldsSearchRequest { @override // ignore: avoid_equals_and_hash_code_on_mutable_classes int get hashCode => _deepHash([runtimeType, ..._toList()]); + + @override + String toString() { + return 'NullFieldsSearchRequest(query: $query, identifier: $identifier)'; + } } class NullFieldsSearchReply { @@ -215,6 +220,11 @@ class NullFieldsSearchReply { @override // ignore: avoid_equals_and_hash_code_on_mutable_classes int get hashCode => _deepHash([runtimeType, ..._toList()]); + + @override + String toString() { + return 'NullFieldsSearchReply(result: $result, error: $error, indices: $indices, request: $request, type: $type)'; + } } class _PigeonCodec extends StandardMessageCodec { @@ -255,8 +265,8 @@ class _PigeonCodec extends StandardMessageCodec { } class NullFieldsHostApi { - /// Constructor for [NullFieldsHostApi]. The [binaryMessenger] named argument is - /// available for dependency injection. If it is left null, the default + /// Constructor for [NullFieldsHostApi]. 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. NullFieldsHostApi({ BinaryMessenger? binaryMessenger, diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/nullable_returns.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/nullable_returns.gen.dart index 2c9c03a02426..a55bcf80b0a2 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/nullable_returns.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/nullable_returns.gen.dart @@ -74,8 +74,8 @@ class _PigeonCodec extends StandardMessageCodec { } class NullableReturnHostApi { - /// Constructor for [NullableReturnHostApi]. The [binaryMessenger] named argument is - /// available for dependency injection. If it is left null, the default + /// Constructor for [NullableReturnHostApi]. 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. NullableReturnHostApi({ BinaryMessenger? binaryMessenger, @@ -150,8 +150,8 @@ abstract class NullableReturnFlutterApi { } class NullableArgHostApi { - /// Constructor for [NullableArgHostApi]. The [binaryMessenger] named argument is - /// available for dependency injection. If it is left null, the default + /// Constructor for [NullableArgHostApi]. 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. NullableArgHostApi({ BinaryMessenger? binaryMessenger, @@ -230,8 +230,8 @@ abstract class NullableArgFlutterApi { } class NullableCollectionReturnHostApi { - /// Constructor for [NullableCollectionReturnHostApi]. The [binaryMessenger] named argument is - /// available for dependency injection. If it is left null, the default + /// Constructor for [NullableCollectionReturnHostApi]. 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. NullableCollectionReturnHostApi({ BinaryMessenger? binaryMessenger, @@ -306,8 +306,8 @@ abstract class NullableCollectionReturnFlutterApi { } class NullableCollectionArgHostApi { - /// Constructor for [NullableCollectionArgHostApi]. The [binaryMessenger] named argument is - /// available for dependency injection. If it is left null, the default + /// Constructor for [NullableCollectionArgHostApi]. 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. NullableCollectionArgHostApi({ BinaryMessenger? binaryMessenger, diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/primitive.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/primitive.gen.dart index b86058696a44..618b132d5047 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/primitive.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/primitive.gen.dart @@ -74,8 +74,8 @@ class _PigeonCodec extends StandardMessageCodec { } class PrimitiveHostApi { - /// Constructor for [PrimitiveHostApi]. The [binaryMessenger] named argument is - /// available for dependency injection. If it is left null, the default + /// Constructor for [PrimitiveHostApi]. 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. PrimitiveHostApi({ BinaryMessenger? binaryMessenger, diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/CoreTests.gen.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/CoreTests.gen.kt index 938204b49782..c2a4db44242e 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/CoreTests.gen.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/CoreTests.gen.kt @@ -251,6 +251,10 @@ data class UnusedClass(val aField: Any? = null) { result = 31 * result + CoreTestsPigeonUtils.deepHash(this.aField) return result } + + override fun toString(): String { + return "UnusedClass(aField=$aField)" + } } /** @@ -453,6 +457,10 @@ data class AllTypes( result = 31 * result + CoreTestsPigeonUtils.deepHash(this.mapMap) return result } + + override fun toString(): String { + return "AllTypes(aBool=$aBool, anInt=$anInt, anInt64=$anInt64, aDouble=$aDouble, aByteArray=${aByteArray.contentToString()}, a4ByteArray=${a4ByteArray.contentToString()}, a8ByteArray=${a8ByteArray.contentToString()}, aFloatArray=${aFloatArray.contentToString()}, anEnum=$anEnum, anotherEnum=$anotherEnum, aString=$aString, anObject=$anObject, list=$list, stringList=$stringList, intList=$intList, doubleList=$doubleList, boolList=$boolList, enumList=$enumList, objectList=$objectList, listList=$listList, mapList=$mapList, map=$map, stringMap=$stringMap, intMap=$intMap, enumMap=$enumMap, objectMap=$objectMap, listMap=$listMap, mapMap=$mapMap)" + } } /** @@ -673,6 +681,10 @@ data class AllNullableTypes( result = 31 * result + CoreTestsPigeonUtils.deepHash(this.recursiveClassMap) return result } + + override fun toString(): String { + return "AllNullableTypes(aNullableBool=$aNullableBool, aNullableInt=$aNullableInt, aNullableInt64=$aNullableInt64, aNullableDouble=$aNullableDouble, aNullableByteArray=${aNullableByteArray?.contentToString()}, aNullable4ByteArray=${aNullable4ByteArray?.contentToString()}, aNullable8ByteArray=${aNullable8ByteArray?.contentToString()}, aNullableFloatArray=${aNullableFloatArray?.contentToString()}, aNullableEnum=$aNullableEnum, anotherNullableEnum=$anotherNullableEnum, aNullableString=$aNullableString, aNullableObject=$aNullableObject, allNullableTypes=$allNullableTypes, list=$list, stringList=$stringList, intList=$intList, doubleList=$doubleList, boolList=$boolList, enumList=$enumList, objectList=$objectList, listList=$listList, mapList=$mapList, recursiveClassList=$recursiveClassList, map=$map, stringMap=$stringMap, intMap=$intMap, enumMap=$enumMap, objectMap=$objectMap, listMap=$listMap, mapMap=$mapMap, recursiveClassMap=$recursiveClassMap)" + } } /** @@ -876,6 +888,10 @@ data class AllNullableTypesWithoutRecursion( result = 31 * result + CoreTestsPigeonUtils.deepHash(this.mapMap) return result } + + override fun toString(): String { + return "AllNullableTypesWithoutRecursion(aNullableBool=$aNullableBool, aNullableInt=$aNullableInt, aNullableInt64=$aNullableInt64, aNullableDouble=$aNullableDouble, aNullableByteArray=${aNullableByteArray?.contentToString()}, aNullable4ByteArray=${aNullable4ByteArray?.contentToString()}, aNullable8ByteArray=${aNullable8ByteArray?.contentToString()}, aNullableFloatArray=${aNullableFloatArray?.contentToString()}, aNullableEnum=$aNullableEnum, anotherNullableEnum=$anotherNullableEnum, aNullableString=$aNullableString, aNullableObject=$aNullableObject, list=$list, stringList=$stringList, intList=$intList, doubleList=$doubleList, boolList=$boolList, enumList=$enumList, objectList=$objectList, listList=$listList, mapList=$mapList, map=$map, stringMap=$stringMap, intMap=$intMap, enumMap=$enumMap, objectMap=$objectMap, listMap=$listMap, mapMap=$mapMap)" + } } /** @@ -957,6 +973,10 @@ data class AllClassesWrapper( result = 31 * result + CoreTestsPigeonUtils.deepHash(this.nullableClassMap) return result } + + override fun toString(): String { + return "AllClassesWrapper(allNullableTypes=$allNullableTypes, allNullableTypesWithoutRecursion=$allNullableTypesWithoutRecursion, allTypes=$allTypes, classList=$classList, nullableClassList=$nullableClassList, classMap=$classMap, nullableClassMap=$nullableClassMap)" + } } /** @@ -994,6 +1014,10 @@ data class TestMessage(val testList: List? = null) { result = 31 * result + CoreTestsPigeonUtils.deepHash(this.testList) return result } + + override fun toString(): String { + return "TestMessage(testList=$testList)" + } } private open class CoreTestsPigeonCodec : StandardMessageCodec() { diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/EventChannelTests.gen.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/EventChannelTests.gen.kt index 9e55d6984836..a9f3d6575308 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/EventChannelTests.gen.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/EventChannelTests.gen.kt @@ -422,6 +422,10 @@ data class EventAllNullableTypes( result = 31 * result + EventChannelTestsPigeonUtils.deepHash(this.recursiveClassMap) return result } + + override fun toString(): String { + return "EventAllNullableTypes(aNullableBool=$aNullableBool, aNullableInt=$aNullableInt, aNullableInt64=$aNullableInt64, aNullableDouble=$aNullableDouble, aNullableByteArray=${aNullableByteArray?.contentToString()}, aNullable4ByteArray=${aNullable4ByteArray?.contentToString()}, aNullable8ByteArray=${aNullable8ByteArray?.contentToString()}, aNullableFloatArray=${aNullableFloatArray?.contentToString()}, aNullableEnum=$aNullableEnum, anotherNullableEnum=$anotherNullableEnum, aNullableString=$aNullableString, aNullableObject=$aNullableObject, allNullableTypes=$allNullableTypes, list=$list, stringList=$stringList, intList=$intList, doubleList=$doubleList, boolList=$boolList, enumList=$enumList, objectList=$objectList, listList=$listList, mapList=$mapList, recursiveClassList=$recursiveClassList, map=$map, stringMap=$stringMap, intMap=$intMap, enumMap=$enumMap, objectMap=$objectMap, listMap=$listMap, mapMap=$mapMap, recursiveClassMap=$recursiveClassMap)" + } } /** @@ -460,6 +464,10 @@ data class IntEvent(val value: Long) : PlatformEvent() { result = 31 * result + EventChannelTestsPigeonUtils.deepHash(this.value) return result } + + override fun toString(): String { + return "IntEvent(value=$value)" + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -493,6 +501,10 @@ data class StringEvent(val value: String) : PlatformEvent() { result = 31 * result + EventChannelTestsPigeonUtils.deepHash(this.value) return result } + + override fun toString(): String { + return "StringEvent(value=$value)" + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -526,6 +538,10 @@ data class BoolEvent(val value: Boolean) : PlatformEvent() { result = 31 * result + EventChannelTestsPigeonUtils.deepHash(this.value) return result } + + override fun toString(): String { + return "BoolEvent(value=$value)" + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -559,6 +575,10 @@ data class DoubleEvent(val value: Double) : PlatformEvent() { result = 31 * result + EventChannelTestsPigeonUtils.deepHash(this.value) return result } + + override fun toString(): String { + return "DoubleEvent(value=$value)" + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -592,6 +612,10 @@ data class ObjectsEvent(val value: Any) : PlatformEvent() { result = 31 * result + EventChannelTestsPigeonUtils.deepHash(this.value) return result } + + override fun toString(): String { + return "ObjectsEvent(value=$value)" + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -625,6 +649,10 @@ data class EnumEvent(val value: EventEnum) : PlatformEvent() { result = 31 * result + EventChannelTestsPigeonUtils.deepHash(this.value) return result } + + override fun toString(): String { + return "EnumEvent(value=$value)" + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -658,6 +686,10 @@ data class ClassEvent(val value: EventAllNullableTypes) : PlatformEvent() { result = 31 * result + EventChannelTestsPigeonUtils.deepHash(this.value) return result } + + override fun toString(): String { + return "ClassEvent(value=$value)" + } } private open class EventChannelTestsPigeonCodec : StandardMessageCodec() { diff --git a/packages/pigeon/platform_tests/test_plugin/darwin/test_plugin/Sources/test_plugin/CoreTests.gen.swift b/packages/pigeon/platform_tests/test_plugin/darwin/test_plugin/Sources/test_plugin/CoreTests.gen.swift index 606d58783837..a831882ba8c1 100644 --- a/packages/pigeon/platform_tests/test_plugin/darwin/test_plugin/Sources/test_plugin/CoreTests.gen.swift +++ b/packages/pigeon/platform_tests/test_plugin/darwin/test_plugin/Sources/test_plugin/CoreTests.gen.swift @@ -65,9 +65,31 @@ private func createConnectionError(withChannelName channelName: String) -> Pigeo details: "") } -private func isNullish(_ value: Any?) -> Bool { - return value is NSNull || value == nil -} +#if DEBUG + func isNullish(_ value: Any?) -> Bool { + guard let innerValue = value else { + return true + } + + if case Optional.some(Optional.none) = value { + return true + } + + return innerValue is NSNull + } +#else + private func isNullish(_ value: Any?) -> Bool { + guard let innerValue = value else { + return true + } + + if case Optional.some(Optional.none) = value { + return true + } + + return innerValue is NSNull + } +#endif private func nilOrValue(_ value: Any?) -> T? { if value is NSNull { return nil } @@ -196,7 +218,7 @@ enum AnotherEnum: Int { } /// Generated class from Pigeon that represents data sent in messages. -struct UnusedClass: Hashable { +struct UnusedClass: Hashable, CustomStringConvertible { var aField: Any? = nil // swift-format-ignore: AlwaysUseLowerCamelCase @@ -223,12 +245,16 @@ struct UnusedClass: Hashable { hasher.combine("UnusedClass") deepHashCoreTests(value: aField, hasher: &hasher) } + + public var description: String { + return "UnusedClass(aField: \(aField))" + } } /// A class containing all supported types. /// /// Generated class from Pigeon that represents data sent in messages. -struct AllTypes: Hashable { +struct AllTypes: Hashable, CustomStringConvertible { var aBool: Bool var anInt: Int64 var anInt64: Int64 @@ -414,12 +440,17 @@ struct AllTypes: Hashable { deepHashCoreTests(value: listMap, hasher: &hasher) deepHashCoreTests(value: mapMap, hasher: &hasher) } + + public var description: String { + return + "AllTypes(aBool: \(aBool), anInt: \(anInt), anInt64: \(anInt64), aDouble: \(aDouble), aByteArray: \(aByteArray), a4ByteArray: \(a4ByteArray), a8ByteArray: \(a8ByteArray), aFloatArray: \(aFloatArray), anEnum: \(anEnum), anotherEnum: \(anotherEnum), aString: \(aString), anObject: \(anObject), list: \(list), stringList: \(stringList), intList: \(intList), doubleList: \(doubleList), boolList: \(boolList), enumList: \(enumList), objectList: \(objectList), listList: \(listList), mapList: \(mapList), map: \(map), stringMap: \(stringMap), intMap: \(intMap), enumMap: \(enumMap), objectMap: \(objectMap), listMap: \(listMap), mapMap: \(mapMap))" + } } /// A class containing all supported nullable types. /// /// Generated class from Pigeon that represents data sent in messages. -class AllNullableTypes: Hashable { +class AllNullableTypes: Hashable, CustomStringConvertible { init( aNullableBool: Bool? = nil, aNullableInt: Int64? = nil, @@ -693,6 +724,11 @@ class AllNullableTypes: Hashable { deepHashCoreTests(value: mapMap, hasher: &hasher) deepHashCoreTests(value: recursiveClassMap, hasher: &hasher) } + + public var description: String { + return + "AllNullableTypes(aNullableBool: \(aNullableBool), aNullableInt: \(aNullableInt), aNullableInt64: \(aNullableInt64), aNullableDouble: \(aNullableDouble), aNullableByteArray: \(aNullableByteArray), aNullable4ByteArray: \(aNullable4ByteArray), aNullable8ByteArray: \(aNullable8ByteArray), aNullableFloatArray: \(aNullableFloatArray), aNullableEnum: \(aNullableEnum), anotherNullableEnum: \(anotherNullableEnum), aNullableString: \(aNullableString), aNullableObject: \(aNullableObject), allNullableTypes: \(allNullableTypes), list: \(list), stringList: \(stringList), intList: \(intList), doubleList: \(doubleList), boolList: \(boolList), enumList: \(enumList), objectList: \(objectList), listList: \(listList), mapList: \(mapList), recursiveClassList: \(recursiveClassList), map: \(map), stringMap: \(stringMap), intMap: \(intMap), enumMap: \(enumMap), objectMap: \(objectMap), listMap: \(listMap), mapMap: \(mapMap), recursiveClassMap: \(recursiveClassMap))" + } } /// The primary purpose for this class is to ensure coverage of Swift structs @@ -700,7 +736,7 @@ class AllNullableTypes: Hashable { /// test Swift classes. /// /// Generated class from Pigeon that represents data sent in messages. -struct AllNullableTypesWithoutRecursion: Hashable { +struct AllNullableTypesWithoutRecursion: Hashable, CustomStringConvertible { var aNullableBool: Bool? = nil var aNullableInt: Int64? = nil var aNullableInt64: Int64? = nil @@ -890,6 +926,11 @@ struct AllNullableTypesWithoutRecursion: Hashable { deepHashCoreTests(value: listMap, hasher: &hasher) deepHashCoreTests(value: mapMap, hasher: &hasher) } + + public var description: String { + return + "AllNullableTypesWithoutRecursion(aNullableBool: \(aNullableBool), aNullableInt: \(aNullableInt), aNullableInt64: \(aNullableInt64), aNullableDouble: \(aNullableDouble), aNullableByteArray: \(aNullableByteArray), aNullable4ByteArray: \(aNullable4ByteArray), aNullable8ByteArray: \(aNullable8ByteArray), aNullableFloatArray: \(aNullableFloatArray), aNullableEnum: \(aNullableEnum), anotherNullableEnum: \(anotherNullableEnum), aNullableString: \(aNullableString), aNullableObject: \(aNullableObject), list: \(list), stringList: \(stringList), intList: \(intList), doubleList: \(doubleList), boolList: \(boolList), enumList: \(enumList), objectList: \(objectList), listList: \(listList), mapList: \(mapList), map: \(map), stringMap: \(stringMap), intMap: \(intMap), enumMap: \(enumMap), objectMap: \(objectMap), listMap: \(listMap), mapMap: \(mapMap))" + } } /// A class for testing nested class handling. @@ -899,7 +940,7 @@ struct AllNullableTypesWithoutRecursion: Hashable { /// than `AllTypes` when testing doesn't require both (ie. testing null classes). /// /// Generated class from Pigeon that represents data sent in messages. -struct AllClassesWrapper: Hashable { +struct AllClassesWrapper: Hashable, CustomStringConvertible { var allNullableTypes: AllNullableTypes var allNullableTypesWithoutRecursion: AllNullableTypesWithoutRecursion? = nil var allTypes: AllTypes? = nil @@ -965,12 +1006,17 @@ struct AllClassesWrapper: Hashable { deepHashCoreTests(value: classMap, hasher: &hasher) deepHashCoreTests(value: nullableClassMap, hasher: &hasher) } + + public var description: String { + return + "AllClassesWrapper(allNullableTypes: \(allNullableTypes), allNullableTypesWithoutRecursion: \(allNullableTypesWithoutRecursion), allTypes: \(allTypes), classList: \(classList), nullableClassList: \(nullableClassList), classMap: \(classMap), nullableClassMap: \(nullableClassMap))" + } } /// A data class containing a List, used in unit tests. /// /// Generated class from Pigeon that represents data sent in messages. -struct TestMessage: Hashable { +struct TestMessage: Hashable, CustomStringConvertible { var testList: [Any?]? = nil // swift-format-ignore: AlwaysUseLowerCamelCase @@ -997,6 +1043,10 @@ struct TestMessage: Hashable { hasher.combine("TestMessage") deepHashCoreTests(value: testList, hasher: &hasher) } + + public var description: String { + return "TestMessage(testList: \(testList))" + } } private class CoreTestsPigeonCodecReader: FlutterStandardReader { @@ -4558,6 +4608,7 @@ class HostIntegrationCoreApiSetup { } } } + /// The core interface that the Dart platform_test code implements for host /// integration tests to call into. /// @@ -6253,6 +6304,7 @@ class HostSmallApiSetup { } } } + /// A simple API called in some unit tests. /// /// Generated protocol from Pigeon that represents Flutter messages that can be called from Swift. diff --git a/packages/pigeon/platform_tests/test_plugin/darwin/test_plugin/Sources/test_plugin/EventChannelTests.gen.swift b/packages/pigeon/platform_tests/test_plugin/darwin/test_plugin/Sources/test_plugin/EventChannelTests.gen.swift index da3e19626382..d5c47e8c543c 100644 --- a/packages/pigeon/platform_tests/test_plugin/darwin/test_plugin/Sources/test_plugin/EventChannelTests.gen.swift +++ b/packages/pigeon/platform_tests/test_plugin/darwin/test_plugin/Sources/test_plugin/EventChannelTests.gen.swift @@ -33,9 +33,31 @@ final class EventChannelTestsError: Error { } } -private func isNullish(_ value: Any?) -> Bool { - return value is NSNull || value == nil -} +#if DEBUG + func isNullish(_ value: Any?) -> Bool { + guard let innerValue = value else { + return true + } + + if case Optional.some(Optional.none) = value { + return true + } + + return innerValue is NSNull + } +#else + private func isNullish(_ value: Any?) -> Bool { + guard let innerValue = value else { + return true + } + + if case Optional.some(Optional.none) = value { + return true + } + + return innerValue is NSNull + } +#endif private func nilOrValue(_ value: Any?) -> T? { if value is NSNull { return nil } @@ -166,7 +188,7 @@ enum AnotherEventEnum: Int { /// A class containing all supported nullable types. /// /// Generated class from Pigeon that represents data sent in messages. -class EventAllNullableTypes: Hashable { +class EventAllNullableTypes: Hashable, CustomStringConvertible { init( aNullableBool: Bool? = nil, aNullableInt: Int64? = nil, @@ -441,6 +463,11 @@ class EventAllNullableTypes: Hashable { deepHashEventChannelTests(value: mapMap, hasher: &hasher) deepHashEventChannelTests(value: recursiveClassMap, hasher: &hasher) } + + public var description: String { + return + "EventAllNullableTypes(aNullableBool: \(aNullableBool), aNullableInt: \(aNullableInt), aNullableInt64: \(aNullableInt64), aNullableDouble: \(aNullableDouble), aNullableByteArray: \(aNullableByteArray), aNullable4ByteArray: \(aNullable4ByteArray), aNullable8ByteArray: \(aNullable8ByteArray), aNullableFloatArray: \(aNullableFloatArray), aNullableEnum: \(aNullableEnum), anotherNullableEnum: \(anotherNullableEnum), aNullableString: \(aNullableString), aNullableObject: \(aNullableObject), allNullableTypes: \(allNullableTypes), list: \(list), stringList: \(stringList), intList: \(intList), doubleList: \(doubleList), boolList: \(boolList), enumList: \(enumList), objectList: \(objectList), listList: \(listList), mapList: \(mapList), recursiveClassList: \(recursiveClassList), map: \(map), stringMap: \(stringMap), intMap: \(intMap), enumMap: \(enumMap), objectMap: \(objectMap), listMap: \(listMap), mapMap: \(mapMap), recursiveClassMap: \(recursiveClassMap))" + } } /// Generated class from Pigeon that represents data sent in messages. @@ -450,7 +477,7 @@ protocol PlatformEvent { } /// Generated class from Pigeon that represents data sent in messages. -struct IntEvent: PlatformEvent { +struct IntEvent: PlatformEvent, CustomStringConvertible { var value: Int64 // swift-format-ignore: AlwaysUseLowerCamelCase @@ -477,10 +504,14 @@ struct IntEvent: PlatformEvent { hasher.combine("IntEvent") deepHashEventChannelTests(value: value, hasher: &hasher) } + + public var description: String { + return "IntEvent(value: \(value))" + } } /// Generated class from Pigeon that represents data sent in messages. -struct StringEvent: PlatformEvent { +struct StringEvent: PlatformEvent, CustomStringConvertible { var value: String // swift-format-ignore: AlwaysUseLowerCamelCase @@ -507,10 +538,14 @@ struct StringEvent: PlatformEvent { hasher.combine("StringEvent") deepHashEventChannelTests(value: value, hasher: &hasher) } + + public var description: String { + return "StringEvent(value: \(value))" + } } /// Generated class from Pigeon that represents data sent in messages. -struct BoolEvent: PlatformEvent { +struct BoolEvent: PlatformEvent, CustomStringConvertible { var value: Bool // swift-format-ignore: AlwaysUseLowerCamelCase @@ -537,10 +572,14 @@ struct BoolEvent: PlatformEvent { hasher.combine("BoolEvent") deepHashEventChannelTests(value: value, hasher: &hasher) } + + public var description: String { + return "BoolEvent(value: \(value))" + } } /// Generated class from Pigeon that represents data sent in messages. -struct DoubleEvent: PlatformEvent { +struct DoubleEvent: PlatformEvent, CustomStringConvertible { var value: Double // swift-format-ignore: AlwaysUseLowerCamelCase @@ -567,10 +606,14 @@ struct DoubleEvent: PlatformEvent { hasher.combine("DoubleEvent") deepHashEventChannelTests(value: value, hasher: &hasher) } + + public var description: String { + return "DoubleEvent(value: \(value))" + } } /// Generated class from Pigeon that represents data sent in messages. -struct ObjectsEvent: PlatformEvent { +struct ObjectsEvent: PlatformEvent, CustomStringConvertible { var value: Any // swift-format-ignore: AlwaysUseLowerCamelCase @@ -597,10 +640,14 @@ struct ObjectsEvent: PlatformEvent { hasher.combine("ObjectsEvent") deepHashEventChannelTests(value: value, hasher: &hasher) } + + public var description: String { + return "ObjectsEvent(value: \(value))" + } } /// Generated class from Pigeon that represents data sent in messages. -struct EnumEvent: PlatformEvent { +struct EnumEvent: PlatformEvent, CustomStringConvertible { var value: EventEnum // swift-format-ignore: AlwaysUseLowerCamelCase @@ -627,10 +674,14 @@ struct EnumEvent: PlatformEvent { hasher.combine("EnumEvent") deepHashEventChannelTests(value: value, hasher: &hasher) } + + public var description: String { + return "EnumEvent(value: \(value))" + } } /// Generated class from Pigeon that represents data sent in messages. -struct ClassEvent: PlatformEvent { +struct ClassEvent: PlatformEvent, CustomStringConvertible { var value: EventAllNullableTypes // swift-format-ignore: AlwaysUseLowerCamelCase @@ -657,6 +708,10 @@ struct ClassEvent: PlatformEvent { hasher.combine("ClassEvent") deepHashEventChannelTests(value: value, hasher: &hasher) } + + public var description: String { + return "ClassEvent(value: \(value))" + } } private class EventChannelTestsPigeonCodecReader: FlutterStandardReader { diff --git a/packages/pigeon/platform_tests/test_plugin/darwin/test_plugin/Sources/test_plugin/ProxyApiTests.gen.swift b/packages/pigeon/platform_tests/test_plugin/darwin/test_plugin/Sources/test_plugin/ProxyApiTests.gen.swift index 5eb4b81803ad..15c41e1c9b67 100644 --- a/packages/pigeon/platform_tests/test_plugin/darwin/test_plugin/Sources/test_plugin/ProxyApiTests.gen.swift +++ b/packages/pigeon/platform_tests/test_plugin/darwin/test_plugin/Sources/test_plugin/ProxyApiTests.gen.swift @@ -65,9 +65,31 @@ private func createConnectionError(withChannelName channelName: String) -> Proxy details: "") } -private func isNullish(_ value: Any?) -> Bool { - return value is NSNull || value == nil -} +#if DEBUG + func isNullish(_ value: Any?) -> Bool { + guard let innerValue = value else { + return true + } + + if case Optional.some(Optional.none) = value { + return true + } + + return innerValue is NSNull + } +#else + private func isNullish(_ value: Any?) -> Bool { + guard let innerValue = value else { + return true + } + + if case Optional.some(Optional.none) = value { + return true + } + + return innerValue is NSNull + } +#endif private func nilOrValue(_ value: Any?) -> T? { if value is NSNull { return nil } diff --git a/packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/IsNullishTests.swift b/packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/IsNullishTests.swift new file mode 100644 index 000000000000..8f2b5d62cb08 --- /dev/null +++ b/packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/IsNullishTests.swift @@ -0,0 +1,58 @@ +// Copyright 2013 The Flutter Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import Foundation +import Testing + +@testable import test_plugin + +struct IsNullishTests { + + @Test + func testNil() { + let value: Any? = nil + #expect(isNullish(value) == true) + } + + @Test + func testNSNull() { + let value: Any? = NSNull() + #expect(isNullish(value) == true) + } + + @Test + func testNestedNil() { + let inner: Any? = nil + let value: Any? = inner + #expect(isNullish(value) == true) + } + + @Test + func testDoubleNestedNil() { + let innerMost: Any? = nil + let inner: Any?? = innerMost + let value: Any? = inner + #expect(isNullish(value) == true) + } + + @Test + func testTypedNil() { + let typedNil: String? = nil + let value: Any? = typedNil + #expect(isNullish(value) == true) + } + + @Test + func testNestedNSNull() { + let inner: Any? = NSNull() + let value: Any? = inner + #expect(isNullish(value) == true) + } + + @Test + func testNonNullValue() { + let value: Any? = "Hello" + #expect(isNullish(value) == false) + } +} diff --git a/packages/pigeon/platform_tests/test_plugin/linux/pigeon/core_tests.gen.cc b/packages/pigeon/platform_tests/test_plugin/linux/pigeon/core_tests.gen.cc index 023cd1ed85db..4c1866684d3e 100644 --- a/packages/pigeon/platform_tests/test_plugin/linux/pigeon/core_tests.gen.cc +++ b/packages/pigeon/platform_tests/test_plugin/linux/pigeon/core_tests.gen.cc @@ -282,6 +282,16 @@ guint core_tests_pigeon_test_unused_class_hash( return result; } +gchar* core_tests_pigeon_test_unused_class_to_string( + CoreTestsPigeonTestUnusedClass* self) { + g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_UNUSED_CLASS(self), NULL); + GString* str = g_string_new("UnusedClass("); + g_string_append(str, "a_field: "); + g_string_append(str, "..."); + g_string_append(str, ")"); + return g_string_free(str, FALSE); +} + struct _CoreTestsPigeonTestAllTypes { GObject parent_instance; @@ -909,6 +919,74 @@ guint core_tests_pigeon_test_all_types_hash(CoreTestsPigeonTestAllTypes* self) { return result; } +gchar* core_tests_pigeon_test_all_types_to_string( + CoreTestsPigeonTestAllTypes* self) { + g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_TYPES(self), NULL); + GString* str = g_string_new("AllTypes("); + g_string_append(str, "a_bool: "); + g_string_append(str, self->a_bool ? "true" : "false"); + g_string_append(str, ", an_int: "); + g_string_append_printf(str, "%" G_GINT64_FORMAT, self->an_int); + g_string_append(str, ", an_int64: "); + g_string_append_printf(str, "%" G_GINT64_FORMAT, self->an_int64); + g_string_append(str, ", a_double: "); + g_string_append_printf(str, "%g", self->a_double); + g_string_append(str, ", a_byte_array: "); + g_string_append_printf(str, "[...], length: %zu", self->a_byte_array_length); + g_string_append(str, ", a4_byte_array: "); + g_string_append_printf(str, "[...], length: %zu", self->a4_byte_array_length); + g_string_append(str, ", a8_byte_array: "); + g_string_append_printf(str, "[...], length: %zu", self->a8_byte_array_length); + g_string_append(str, ", a_float_array: "); + g_string_append_printf(str, "[...], length: %zu", self->a_float_array_length); + g_string_append(str, ", an_enum: "); + g_string_append(str, "..."); + g_string_append(str, ", another_enum: "); + g_string_append(str, "..."); + g_string_append(str, ", a_string: "); + if (self->a_string != nullptr) { + g_string_append_printf(str, "\"%s\"", self->a_string); + } else { + g_string_append(str, "null"); + } + g_string_append(str, ", an_object: "); + g_string_append(str, "..."); + g_string_append(str, ", list: "); + g_string_append(str, "..."); + g_string_append(str, ", string_list: "); + g_string_append(str, "..."); + g_string_append(str, ", int_list: "); + g_string_append(str, "..."); + g_string_append(str, ", double_list: "); + g_string_append(str, "..."); + g_string_append(str, ", bool_list: "); + g_string_append(str, "..."); + g_string_append(str, ", enum_list: "); + g_string_append(str, "..."); + g_string_append(str, ", object_list: "); + g_string_append(str, "..."); + g_string_append(str, ", list_list: "); + g_string_append(str, "..."); + g_string_append(str, ", map_list: "); + g_string_append(str, "..."); + g_string_append(str, ", map: "); + g_string_append(str, "..."); + g_string_append(str, ", string_map: "); + g_string_append(str, "..."); + g_string_append(str, ", int_map: "); + g_string_append(str, "..."); + g_string_append(str, ", enum_map: "); + g_string_append(str, "..."); + g_string_append(str, ", object_map: "); + g_string_append(str, "..."); + g_string_append(str, ", list_map: "); + g_string_append(str, "..."); + g_string_append(str, ", map_map: "); + g_string_append(str, "..."); + g_string_append(str, ")"); + return g_string_free(str, FALSE); +} + struct _CoreTestsPigeonTestAllNullableTypes { GObject parent_instance; @@ -2001,6 +2079,104 @@ guint core_tests_pigeon_test_all_nullable_types_hash( return result; } +gchar* core_tests_pigeon_test_all_nullable_types_to_string( + CoreTestsPigeonTestAllNullableTypes* self) { + g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES(self), + NULL); + GString* str = g_string_new("AllNullableTypes("); + g_string_append(str, "a_nullable_bool: "); + g_string_append(str, self->a_nullable_bool ? "true" : "false"); + g_string_append(str, ", a_nullable_int: "); + if (self->a_nullable_int != nullptr) { + g_string_append_printf(str, "%" G_GINT64_FORMAT, *self->a_nullable_int); + } else { + g_string_append(str, "null"); + } + g_string_append(str, ", a_nullable_int64: "); + if (self->a_nullable_int64 != nullptr) { + g_string_append_printf(str, "%" G_GINT64_FORMAT, *self->a_nullable_int64); + } else { + g_string_append(str, "null"); + } + g_string_append(str, ", a_nullable_double: "); + if (self->a_nullable_double != nullptr) { + g_string_append_printf(str, "%g", *self->a_nullable_double); + } else { + g_string_append(str, "null"); + } + g_string_append(str, ", a_nullable_byte_array: "); + g_string_append_printf(str, "[...], length: %zu", + self->a_nullable_byte_array_length); + g_string_append(str, ", a_nullable4_byte_array: "); + g_string_append_printf(str, "[...], length: %zu", + self->a_nullable4_byte_array_length); + g_string_append(str, ", a_nullable8_byte_array: "); + g_string_append_printf(str, "[...], length: %zu", + self->a_nullable8_byte_array_length); + g_string_append(str, ", a_nullable_float_array: "); + g_string_append_printf(str, "[...], length: %zu", + self->a_nullable_float_array_length); + g_string_append(str, ", a_nullable_enum: "); + g_string_append(str, "..."); + g_string_append(str, ", another_nullable_enum: "); + g_string_append(str, "..."); + g_string_append(str, ", a_nullable_string: "); + if (self->a_nullable_string != nullptr) { + g_string_append_printf(str, "\"%s\"", self->a_nullable_string); + } else { + g_string_append(str, "null"); + } + g_string_append(str, ", a_nullable_object: "); + g_string_append(str, "..."); + g_string_append(str, ", all_nullable_types: "); + if (self->all_nullable_types != nullptr) { + gchar* field_str = core_tests_pigeon_test_all_nullable_types_to_string( + self->all_nullable_types); + g_string_append(str, field_str); + g_free(field_str); + } else { + g_string_append(str, "null"); + } + g_string_append(str, ", list: "); + g_string_append(str, "..."); + g_string_append(str, ", string_list: "); + g_string_append(str, "..."); + g_string_append(str, ", int_list: "); + g_string_append(str, "..."); + g_string_append(str, ", double_list: "); + g_string_append(str, "..."); + g_string_append(str, ", bool_list: "); + g_string_append(str, "..."); + g_string_append(str, ", enum_list: "); + g_string_append(str, "..."); + g_string_append(str, ", object_list: "); + g_string_append(str, "..."); + g_string_append(str, ", list_list: "); + g_string_append(str, "..."); + g_string_append(str, ", map_list: "); + g_string_append(str, "..."); + g_string_append(str, ", recursive_class_list: "); + g_string_append(str, "..."); + g_string_append(str, ", map: "); + g_string_append(str, "..."); + g_string_append(str, ", string_map: "); + g_string_append(str, "..."); + g_string_append(str, ", int_map: "); + g_string_append(str, "..."); + g_string_append(str, ", enum_map: "); + g_string_append(str, "..."); + g_string_append(str, ", object_map: "); + g_string_append(str, "..."); + g_string_append(str, ", list_map: "); + g_string_append(str, "..."); + g_string_append(str, ", map_map: "); + g_string_append(str, "..."); + g_string_append(str, ", recursive_class_map: "); + g_string_append(str, "..."); + g_string_append(str, ")"); + return g_string_free(str, FALSE); +} + struct _CoreTestsPigeonTestAllNullableTypesWithoutRecursion { GObject parent_instance; @@ -3060,6 +3236,92 @@ guint core_tests_pigeon_test_all_nullable_types_without_recursion_hash( return result; } +gchar* core_tests_pigeon_test_all_nullable_types_without_recursion_to_string( + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES_WITHOUT_RECURSION(self), + NULL); + GString* str = g_string_new("AllNullableTypesWithoutRecursion("); + g_string_append(str, "a_nullable_bool: "); + g_string_append(str, self->a_nullable_bool ? "true" : "false"); + g_string_append(str, ", a_nullable_int: "); + if (self->a_nullable_int != nullptr) { + g_string_append_printf(str, "%" G_GINT64_FORMAT, *self->a_nullable_int); + } else { + g_string_append(str, "null"); + } + g_string_append(str, ", a_nullable_int64: "); + if (self->a_nullable_int64 != nullptr) { + g_string_append_printf(str, "%" G_GINT64_FORMAT, *self->a_nullable_int64); + } else { + g_string_append(str, "null"); + } + g_string_append(str, ", a_nullable_double: "); + if (self->a_nullable_double != nullptr) { + g_string_append_printf(str, "%g", *self->a_nullable_double); + } else { + g_string_append(str, "null"); + } + g_string_append(str, ", a_nullable_byte_array: "); + g_string_append_printf(str, "[...], length: %zu", + self->a_nullable_byte_array_length); + g_string_append(str, ", a_nullable4_byte_array: "); + g_string_append_printf(str, "[...], length: %zu", + self->a_nullable4_byte_array_length); + g_string_append(str, ", a_nullable8_byte_array: "); + g_string_append_printf(str, "[...], length: %zu", + self->a_nullable8_byte_array_length); + g_string_append(str, ", a_nullable_float_array: "); + g_string_append_printf(str, "[...], length: %zu", + self->a_nullable_float_array_length); + g_string_append(str, ", a_nullable_enum: "); + g_string_append(str, "..."); + g_string_append(str, ", another_nullable_enum: "); + g_string_append(str, "..."); + g_string_append(str, ", a_nullable_string: "); + if (self->a_nullable_string != nullptr) { + g_string_append_printf(str, "\"%s\"", self->a_nullable_string); + } else { + g_string_append(str, "null"); + } + g_string_append(str, ", a_nullable_object: "); + g_string_append(str, "..."); + g_string_append(str, ", list: "); + g_string_append(str, "..."); + g_string_append(str, ", string_list: "); + g_string_append(str, "..."); + g_string_append(str, ", int_list: "); + g_string_append(str, "..."); + g_string_append(str, ", double_list: "); + g_string_append(str, "..."); + g_string_append(str, ", bool_list: "); + g_string_append(str, "..."); + g_string_append(str, ", enum_list: "); + g_string_append(str, "..."); + g_string_append(str, ", object_list: "); + g_string_append(str, "..."); + g_string_append(str, ", list_list: "); + g_string_append(str, "..."); + g_string_append(str, ", map_list: "); + g_string_append(str, "..."); + g_string_append(str, ", map: "); + g_string_append(str, "..."); + g_string_append(str, ", string_map: "); + g_string_append(str, "..."); + g_string_append(str, ", int_map: "); + g_string_append(str, "..."); + g_string_append(str, ", enum_map: "); + g_string_append(str, "..."); + g_string_append(str, ", object_map: "); + g_string_append(str, "..."); + g_string_append(str, ", list_map: "); + g_string_append(str, "..."); + g_string_append(str, ", map_map: "); + g_string_append(str, "..."); + g_string_append(str, ")"); + return g_string_free(str, FALSE); +} + struct _CoreTestsPigeonTestAllClassesWrapper { GObject parent_instance; @@ -3315,6 +3577,51 @@ guint core_tests_pigeon_test_all_classes_wrapper_hash( return result; } +gchar* core_tests_pigeon_test_all_classes_wrapper_to_string( + CoreTestsPigeonTestAllClassesWrapper* self) { + g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_CLASSES_WRAPPER(self), + NULL); + GString* str = g_string_new("AllClassesWrapper("); + g_string_append(str, "all_nullable_types: "); + if (self->all_nullable_types != nullptr) { + gchar* field_str = core_tests_pigeon_test_all_nullable_types_to_string( + self->all_nullable_types); + g_string_append(str, field_str); + g_free(field_str); + } else { + g_string_append(str, "null"); + } + g_string_append(str, ", all_nullable_types_without_recursion: "); + if (self->all_nullable_types_without_recursion != nullptr) { + gchar* field_str = + core_tests_pigeon_test_all_nullable_types_without_recursion_to_string( + self->all_nullable_types_without_recursion); + g_string_append(str, field_str); + g_free(field_str); + } else { + g_string_append(str, "null"); + } + g_string_append(str, ", all_types: "); + if (self->all_types != nullptr) { + gchar* field_str = + core_tests_pigeon_test_all_types_to_string(self->all_types); + g_string_append(str, field_str); + g_free(field_str); + } else { + g_string_append(str, "null"); + } + g_string_append(str, ", class_list: "); + g_string_append(str, "..."); + g_string_append(str, ", nullable_class_list: "); + g_string_append(str, "..."); + g_string_append(str, ", class_map: "); + g_string_append(str, "..."); + g_string_append(str, ", nullable_class_map: "); + g_string_append(str, "..."); + g_string_append(str, ")"); + return g_string_free(str, FALSE); +} + struct _CoreTestsPigeonTestTestMessage { GObject parent_instance; @@ -3399,6 +3706,16 @@ guint core_tests_pigeon_test_test_message_hash( return result; } +gchar* core_tests_pigeon_test_test_message_to_string( + CoreTestsPigeonTestTestMessage* self) { + g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_TEST_MESSAGE(self), NULL); + GString* str = g_string_new("TestMessage("); + g_string_append(str, "test_list: "); + g_string_append(str, "..."); + g_string_append(str, ")"); + return g_string_free(str, FALSE); +} + struct _CoreTestsPigeonTestMessageCodec { FlStandardMessageCodec parent_instance; }; diff --git a/packages/pigeon/platform_tests/test_plugin/linux/pigeon/core_tests.gen.h b/packages/pigeon/platform_tests/test_plugin/linux/pigeon/core_tests.gen.h index 322b9bc8a6b5..455c0d95fae3 100644 --- a/packages/pigeon/platform_tests/test_plugin/linux/pigeon/core_tests.gen.h +++ b/packages/pigeon/platform_tests/test_plugin/linux/pigeon/core_tests.gen.h @@ -92,6 +92,17 @@ gboolean core_tests_pigeon_test_unused_class_equals( guint core_tests_pigeon_test_unused_class_hash( CoreTestsPigeonTestUnusedClass* object); +/** + * core_tests_pigeon_test_unused_class_to_string: + * @object: a #CoreTestsPigeonTestUnusedClass. + * + * Returns a string representation of a #CoreTestsPigeonTestUnusedClass object. + * + * Returns: (transfer full): a new string, free with g_free(). + */ +gchar* core_tests_pigeon_test_unused_class_to_string( + CoreTestsPigeonTestUnusedClass* object); + /** * CoreTestsPigeonTestAllTypes: * @@ -491,6 +502,17 @@ gboolean core_tests_pigeon_test_all_types_equals( guint core_tests_pigeon_test_all_types_hash( CoreTestsPigeonTestAllTypes* object); +/** + * core_tests_pigeon_test_all_types_to_string: + * @object: a #CoreTestsPigeonTestAllTypes. + * + * Returns a string representation of a #CoreTestsPigeonTestAllTypes object. + * + * Returns: (transfer full): a new string, free with g_free(). + */ +gchar* core_tests_pigeon_test_all_types_to_string( + CoreTestsPigeonTestAllTypes* object); + /** * CoreTestsPigeonTestAllNullableTypes: * @@ -938,6 +960,18 @@ gboolean core_tests_pigeon_test_all_nullable_types_equals( guint core_tests_pigeon_test_all_nullable_types_hash( CoreTestsPigeonTestAllNullableTypes* object); +/** + * core_tests_pigeon_test_all_nullable_types_to_string: + * @object: a #CoreTestsPigeonTestAllNullableTypes. + * + * Returns a string representation of a #CoreTestsPigeonTestAllNullableTypes + * object. + * + * Returns: (transfer full): a new string, free with g_free(). + */ +gchar* core_tests_pigeon_test_all_nullable_types_to_string( + CoreTestsPigeonTestAllNullableTypes* object); + /** * CoreTestsPigeonTestAllNullableTypesWithoutRecursion: * @@ -1375,6 +1409,18 @@ gboolean core_tests_pigeon_test_all_nullable_types_without_recursion_equals( guint core_tests_pigeon_test_all_nullable_types_without_recursion_hash( CoreTestsPigeonTestAllNullableTypesWithoutRecursion* object); +/** + * core_tests_pigeon_test_all_nullable_types_without_recursion_to_string: + * @object: a #CoreTestsPigeonTestAllNullableTypesWithoutRecursion. + * + * Returns a string representation of a + * #CoreTestsPigeonTestAllNullableTypesWithoutRecursion object. + * + * Returns: (transfer full): a new string, free with g_free(). + */ +gchar* core_tests_pigeon_test_all_nullable_types_without_recursion_to_string( + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* object); + /** * CoreTestsPigeonTestAllClassesWrapper: * @@ -1516,6 +1562,18 @@ gboolean core_tests_pigeon_test_all_classes_wrapper_equals( guint core_tests_pigeon_test_all_classes_wrapper_hash( CoreTestsPigeonTestAllClassesWrapper* object); +/** + * core_tests_pigeon_test_all_classes_wrapper_to_string: + * @object: a #CoreTestsPigeonTestAllClassesWrapper. + * + * Returns a string representation of a #CoreTestsPigeonTestAllClassesWrapper + * object. + * + * Returns: (transfer full): a new string, free with g_free(). + */ +gchar* core_tests_pigeon_test_all_classes_wrapper_to_string( + CoreTestsPigeonTestAllClassesWrapper* object); + /** * CoreTestsPigeonTestTestMessage: * @@ -1571,6 +1629,17 @@ gboolean core_tests_pigeon_test_test_message_equals( guint core_tests_pigeon_test_test_message_hash( CoreTestsPigeonTestTestMessage* object); +/** + * core_tests_pigeon_test_test_message_to_string: + * @object: a #CoreTestsPigeonTestTestMessage. + * + * Returns a string representation of a #CoreTestsPigeonTestTestMessage object. + * + * Returns: (transfer full): a new string, free with g_free(). + */ +gchar* core_tests_pigeon_test_test_message_to_string( + CoreTestsPigeonTestTestMessage* object); + G_DECLARE_FINAL_TYPE(CoreTestsPigeonTestMessageCodec, core_tests_pigeon_test_message_codec, CORE_TESTS_PIGEON_TEST, MESSAGE_CODEC, diff --git a/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.cpp b/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.cpp index f50c8eff918c..6d8d4a96524e 100644 --- a/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.cpp +++ b/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include namespace core_tests_pigeontest { @@ -291,10740 +292,21592 @@ size_t UnusedClass::Hash() const { return result; } -size_t PigeonInternalDeepHash(const UnusedClass& v) { return v.Hash(); } - -// AllTypes - -AllTypes::AllTypes(bool a_bool, int64_t an_int, int64_t an_int64, - double a_double, const std::vector& a_byte_array, - const std::vector& a4_byte_array, - const std::vector& a8_byte_array, - const std::vector& a_float_array, - const AnEnum& an_enum, const AnotherEnum& another_enum, - const std::string& a_string, const EncodableValue& an_object, - const EncodableList& list, const EncodableList& string_list, - const EncodableList& int_list, - const EncodableList& double_list, - const EncodableList& bool_list, - const EncodableList& enum_list, - const EncodableList& object_list, - const EncodableList& list_list, - const EncodableList& map_list, const EncodableMap& map, - const EncodableMap& string_map, const EncodableMap& int_map, - const EncodableMap& enum_map, const EncodableMap& object_map, - const EncodableMap& list_map, const EncodableMap& map_map) - : a_bool_(a_bool), - an_int_(an_int), - an_int64_(an_int64), - a_double_(a_double), - a_byte_array_(a_byte_array), - a4_byte_array_(a4_byte_array), - a8_byte_array_(a8_byte_array), - a_float_array_(a_float_array), - an_enum_(an_enum), - another_enum_(another_enum), - a_string_(a_string), - an_object_(an_object), - list_(list), - string_list_(string_list), - int_list_(int_list), - double_list_(double_list), - bool_list_(bool_list), - enum_list_(enum_list), - object_list_(object_list), - list_list_(list_list), - map_list_(map_list), - map_(map), - string_map_(string_map), - int_map_(int_map), - enum_map_(enum_map), - object_map_(object_map), - list_map_(list_map), - map_map_(map_map) {} - -bool AllTypes::a_bool() const { return a_bool_; } - -void AllTypes::set_a_bool(bool value_arg) { a_bool_ = value_arg; } - -int64_t AllTypes::an_int() const { return an_int_; } - -void AllTypes::set_an_int(int64_t value_arg) { an_int_ = value_arg; } - -int64_t AllTypes::an_int64() const { return an_int64_; } - -void AllTypes::set_an_int64(int64_t value_arg) { an_int64_ = value_arg; } - -double AllTypes::a_double() const { return a_double_; } - -void AllTypes::set_a_double(double value_arg) { a_double_ = value_arg; } - -const std::vector& AllTypes::a_byte_array() const { - return a_byte_array_; -} +std::string UnusedClass::ToString() const { + std::stringstream ss; + ss << "UnusedClass("; + ss << "aField: "; + if (a_field_.has_value()) { + ss << *a_field_; + } else { + ss << "null"; + ss << ")"; + return ss.str(); + } -void AllTypes::set_a_byte_array(const std::vector& value_arg) { - a_byte_array_ = value_arg; -} + size_t PigeonInternalDeepHash(const UnusedClass& v) { return v.Hash(); } + + // AllTypes + + AllTypes::AllTypes( + bool a_bool, int64_t an_int, int64_t an_int64, double a_double, + const std::vector& a_byte_array, + const std::vector& a4_byte_array, + const std::vector& a8_byte_array, + const std::vector& a_float_array, const AnEnum& an_enum, + const AnotherEnum& another_enum, const std::string& a_string, + const EncodableValue& an_object, const EncodableList& list, + const EncodableList& string_list, const EncodableList& int_list, + const EncodableList& double_list, const EncodableList& bool_list, + const EncodableList& enum_list, const EncodableList& object_list, + const EncodableList& list_list, const EncodableList& map_list, + const EncodableMap& map, const EncodableMap& string_map, + const EncodableMap& int_map, const EncodableMap& enum_map, + const EncodableMap& object_map, const EncodableMap& list_map, + const EncodableMap& map_map) + : a_bool_(a_bool), + an_int_(an_int), + an_int64_(an_int64), + a_double_(a_double), + a_byte_array_(a_byte_array), + a4_byte_array_(a4_byte_array), + a8_byte_array_(a8_byte_array), + a_float_array_(a_float_array), + an_enum_(an_enum), + another_enum_(another_enum), + a_string_(a_string), + an_object_(an_object), + list_(list), + string_list_(string_list), + int_list_(int_list), + double_list_(double_list), + bool_list_(bool_list), + enum_list_(enum_list), + object_list_(object_list), + list_list_(list_list), + map_list_(map_list), + map_(map), + string_map_(string_map), + int_map_(int_map), + enum_map_(enum_map), + object_map_(object_map), + list_map_(list_map), + map_map_(map_map) {} + + bool AllTypes::a_bool() const { return a_bool_; } + + void AllTypes::set_a_bool(bool value_arg) { a_bool_ = value_arg; } + + int64_t AllTypes::an_int() const { return an_int_; } + + void AllTypes::set_an_int(int64_t value_arg) { an_int_ = value_arg; } + + int64_t AllTypes::an_int64() const { return an_int64_; } + + void AllTypes::set_an_int64(int64_t value_arg) { an_int64_ = value_arg; } + + double AllTypes::a_double() const { return a_double_; } + + void AllTypes::set_a_double(double value_arg) { a_double_ = value_arg; } + + const std::vector& AllTypes::a_byte_array() const { + return a_byte_array_; + } -const std::vector& AllTypes::a4_byte_array() const { - return a4_byte_array_; -} + void AllTypes::set_a_byte_array(const std::vector& value_arg) { + a_byte_array_ = value_arg; + } -void AllTypes::set_a4_byte_array(const std::vector& value_arg) { - a4_byte_array_ = value_arg; -} + const std::vector& AllTypes::a4_byte_array() const { + return a4_byte_array_; + } -const std::vector& AllTypes::a8_byte_array() const { - return a8_byte_array_; -} + void AllTypes::set_a4_byte_array(const std::vector& value_arg) { + a4_byte_array_ = value_arg; + } -void AllTypes::set_a8_byte_array(const std::vector& value_arg) { - a8_byte_array_ = value_arg; -} + const std::vector& AllTypes::a8_byte_array() const { + return a8_byte_array_; + } -const std::vector& AllTypes::a_float_array() const { - return a_float_array_; -} + void AllTypes::set_a8_byte_array(const std::vector& value_arg) { + a8_byte_array_ = value_arg; + } -void AllTypes::set_a_float_array(const std::vector& value_arg) { - a_float_array_ = value_arg; -} + const std::vector& AllTypes::a_float_array() const { + return a_float_array_; + } -const AnEnum& AllTypes::an_enum() const { return an_enum_; } + void AllTypes::set_a_float_array(const std::vector& value_arg) { + a_float_array_ = value_arg; + } -void AllTypes::set_an_enum(const AnEnum& value_arg) { an_enum_ = value_arg; } + const AnEnum& AllTypes::an_enum() const { return an_enum_; } -const AnotherEnum& AllTypes::another_enum() const { return another_enum_; } + void AllTypes::set_an_enum(const AnEnum& value_arg) { an_enum_ = value_arg; } -void AllTypes::set_another_enum(const AnotherEnum& value_arg) { - another_enum_ = value_arg; -} + const AnotherEnum& AllTypes::another_enum() const { return another_enum_; } -const std::string& AllTypes::a_string() const { return a_string_; } + void AllTypes::set_another_enum(const AnotherEnum& value_arg) { + another_enum_ = value_arg; + } -void AllTypes::set_a_string(std::string_view value_arg) { - a_string_ = value_arg; -} + const std::string& AllTypes::a_string() const { return a_string_; } -const EncodableValue& AllTypes::an_object() const { return an_object_; } + void AllTypes::set_a_string(std::string_view value_arg) { + a_string_ = value_arg; + } -void AllTypes::set_an_object(const EncodableValue& value_arg) { - an_object_ = value_arg; -} + const EncodableValue& AllTypes::an_object() const { return an_object_; } -const EncodableList& AllTypes::list() const { return list_; } + void AllTypes::set_an_object(const EncodableValue& value_arg) { + an_object_ = value_arg; + } -void AllTypes::set_list(const EncodableList& value_arg) { list_ = value_arg; } + const EncodableList& AllTypes::list() const { return list_; } -const EncodableList& AllTypes::string_list() const { return string_list_; } + void AllTypes::set_list(const EncodableList& value_arg) { list_ = value_arg; } -void AllTypes::set_string_list(const EncodableList& value_arg) { - string_list_ = value_arg; -} + const EncodableList& AllTypes::string_list() const { return string_list_; } -const EncodableList& AllTypes::int_list() const { return int_list_; } + void AllTypes::set_string_list(const EncodableList& value_arg) { + string_list_ = value_arg; + } -void AllTypes::set_int_list(const EncodableList& value_arg) { - int_list_ = value_arg; -} + const EncodableList& AllTypes::int_list() const { return int_list_; } -const EncodableList& AllTypes::double_list() const { return double_list_; } + void AllTypes::set_int_list(const EncodableList& value_arg) { + int_list_ = value_arg; + } -void AllTypes::set_double_list(const EncodableList& value_arg) { - double_list_ = value_arg; -} + const EncodableList& AllTypes::double_list() const { return double_list_; } -const EncodableList& AllTypes::bool_list() const { return bool_list_; } + void AllTypes::set_double_list(const EncodableList& value_arg) { + double_list_ = value_arg; + } -void AllTypes::set_bool_list(const EncodableList& value_arg) { - bool_list_ = value_arg; -} + const EncodableList& AllTypes::bool_list() const { return bool_list_; } -const EncodableList& AllTypes::enum_list() const { return enum_list_; } + void AllTypes::set_bool_list(const EncodableList& value_arg) { + bool_list_ = value_arg; + } -void AllTypes::set_enum_list(const EncodableList& value_arg) { - enum_list_ = value_arg; -} + const EncodableList& AllTypes::enum_list() const { return enum_list_; } -const EncodableList& AllTypes::object_list() const { return object_list_; } + void AllTypes::set_enum_list(const EncodableList& value_arg) { + enum_list_ = value_arg; + } -void AllTypes::set_object_list(const EncodableList& value_arg) { - object_list_ = value_arg; -} + const EncodableList& AllTypes::object_list() const { return object_list_; } -const EncodableList& AllTypes::list_list() const { return list_list_; } + void AllTypes::set_object_list(const EncodableList& value_arg) { + object_list_ = value_arg; + } -void AllTypes::set_list_list(const EncodableList& value_arg) { - list_list_ = value_arg; -} + const EncodableList& AllTypes::list_list() const { return list_list_; } -const EncodableList& AllTypes::map_list() const { return map_list_; } + void AllTypes::set_list_list(const EncodableList& value_arg) { + list_list_ = value_arg; + } -void AllTypes::set_map_list(const EncodableList& value_arg) { - map_list_ = value_arg; -} + const EncodableList& AllTypes::map_list() const { return map_list_; } -const EncodableMap& AllTypes::map() const { return map_; } + void AllTypes::set_map_list(const EncodableList& value_arg) { + map_list_ = value_arg; + } -void AllTypes::set_map(const EncodableMap& value_arg) { map_ = value_arg; } + const EncodableMap& AllTypes::map() const { return map_; } -const EncodableMap& AllTypes::string_map() const { return string_map_; } + void AllTypes::set_map(const EncodableMap& value_arg) { map_ = value_arg; } -void AllTypes::set_string_map(const EncodableMap& value_arg) { - string_map_ = value_arg; -} + const EncodableMap& AllTypes::string_map() const { return string_map_; } -const EncodableMap& AllTypes::int_map() const { return int_map_; } + void AllTypes::set_string_map(const EncodableMap& value_arg) { + string_map_ = value_arg; + } -void AllTypes::set_int_map(const EncodableMap& value_arg) { - int_map_ = value_arg; -} + const EncodableMap& AllTypes::int_map() const { return int_map_; } -const EncodableMap& AllTypes::enum_map() const { return enum_map_; } + void AllTypes::set_int_map(const EncodableMap& value_arg) { + int_map_ = value_arg; + } -void AllTypes::set_enum_map(const EncodableMap& value_arg) { - enum_map_ = value_arg; -} + const EncodableMap& AllTypes::enum_map() const { return enum_map_; } -const EncodableMap& AllTypes::object_map() const { return object_map_; } + void AllTypes::set_enum_map(const EncodableMap& value_arg) { + enum_map_ = value_arg; + } -void AllTypes::set_object_map(const EncodableMap& value_arg) { - object_map_ = value_arg; -} + const EncodableMap& AllTypes::object_map() const { return object_map_; } -const EncodableMap& AllTypes::list_map() const { return list_map_; } + void AllTypes::set_object_map(const EncodableMap& value_arg) { + object_map_ = value_arg; + } -void AllTypes::set_list_map(const EncodableMap& value_arg) { - list_map_ = value_arg; -} + const EncodableMap& AllTypes::list_map() const { return list_map_; } -const EncodableMap& AllTypes::map_map() const { return map_map_; } + void AllTypes::set_list_map(const EncodableMap& value_arg) { + list_map_ = value_arg; + } -void AllTypes::set_map_map(const EncodableMap& value_arg) { - map_map_ = value_arg; -} + const EncodableMap& AllTypes::map_map() const { return map_map_; } -EncodableList AllTypes::ToEncodableList() const { - EncodableList list; - list.reserve(28); - list.push_back(EncodableValue(a_bool_)); - list.push_back(EncodableValue(an_int_)); - list.push_back(EncodableValue(an_int64_)); - list.push_back(EncodableValue(a_double_)); - list.push_back(EncodableValue(a_byte_array_)); - list.push_back(EncodableValue(a4_byte_array_)); - list.push_back(EncodableValue(a8_byte_array_)); - list.push_back(EncodableValue(a_float_array_)); - list.push_back(CustomEncodableValue(an_enum_)); - list.push_back(CustomEncodableValue(another_enum_)); - list.push_back(EncodableValue(a_string_)); - list.push_back(an_object_); - list.push_back(EncodableValue(list_)); - list.push_back(EncodableValue(string_list_)); - list.push_back(EncodableValue(int_list_)); - list.push_back(EncodableValue(double_list_)); - list.push_back(EncodableValue(bool_list_)); - list.push_back(EncodableValue(enum_list_)); - list.push_back(EncodableValue(object_list_)); - list.push_back(EncodableValue(list_list_)); - list.push_back(EncodableValue(map_list_)); - list.push_back(EncodableValue(map_)); - list.push_back(EncodableValue(string_map_)); - list.push_back(EncodableValue(int_map_)); - list.push_back(EncodableValue(enum_map_)); - list.push_back(EncodableValue(object_map_)); - list.push_back(EncodableValue(list_map_)); - list.push_back(EncodableValue(map_map_)); - return list; -} + void AllTypes::set_map_map(const EncodableMap& value_arg) { + map_map_ = value_arg; + } -AllTypes AllTypes::FromEncodableList(const EncodableList& list) { - AllTypes decoded( - std::get(list[0]), std::get(list[1]), - std::get(list[2]), std::get(list[3]), - std::get>(list[4]), - std::get>(list[5]), - std::get>(list[6]), - std::get>(list[7]), - std::any_cast(std::get(list[8])), - std::any_cast( - std::get(list[9])), - std::get(list[10]), list[11], - std::get(list[12]), std::get(list[13]), - std::get(list[14]), std::get(list[15]), - std::get(list[16]), std::get(list[17]), - std::get(list[18]), std::get(list[19]), - std::get(list[20]), std::get(list[21]), - std::get(list[22]), std::get(list[23]), - std::get(list[24]), std::get(list[25]), - std::get(list[26]), std::get(list[27])); - return decoded; -} + EncodableList AllTypes::ToEncodableList() const { + EncodableList list; + list.reserve(28); + list.push_back(EncodableValue(a_bool_)); + list.push_back(EncodableValue(an_int_)); + list.push_back(EncodableValue(an_int64_)); + list.push_back(EncodableValue(a_double_)); + list.push_back(EncodableValue(a_byte_array_)); + list.push_back(EncodableValue(a4_byte_array_)); + list.push_back(EncodableValue(a8_byte_array_)); + list.push_back(EncodableValue(a_float_array_)); + list.push_back(CustomEncodableValue(an_enum_)); + list.push_back(CustomEncodableValue(another_enum_)); + list.push_back(EncodableValue(a_string_)); + list.push_back(an_object_); + list.push_back(EncodableValue(list_)); + list.push_back(EncodableValue(string_list_)); + list.push_back(EncodableValue(int_list_)); + list.push_back(EncodableValue(double_list_)); + list.push_back(EncodableValue(bool_list_)); + list.push_back(EncodableValue(enum_list_)); + list.push_back(EncodableValue(object_list_)); + list.push_back(EncodableValue(list_list_)); + list.push_back(EncodableValue(map_list_)); + list.push_back(EncodableValue(map_)); + list.push_back(EncodableValue(string_map_)); + list.push_back(EncodableValue(int_map_)); + list.push_back(EncodableValue(enum_map_)); + list.push_back(EncodableValue(object_map_)); + list.push_back(EncodableValue(list_map_)); + list.push_back(EncodableValue(map_map_)); + return list; + } -bool AllTypes::operator==(const AllTypes& other) const { - return PigeonInternalDeepEquals(a_bool_, other.a_bool_) && - PigeonInternalDeepEquals(an_int_, other.an_int_) && - PigeonInternalDeepEquals(an_int64_, other.an_int64_) && - PigeonInternalDeepEquals(a_double_, other.a_double_) && - PigeonInternalDeepEquals(a_byte_array_, other.a_byte_array_) && - PigeonInternalDeepEquals(a4_byte_array_, other.a4_byte_array_) && - PigeonInternalDeepEquals(a8_byte_array_, other.a8_byte_array_) && - PigeonInternalDeepEquals(a_float_array_, other.a_float_array_) && - PigeonInternalDeepEquals(an_enum_, other.an_enum_) && - PigeonInternalDeepEquals(another_enum_, other.another_enum_) && - PigeonInternalDeepEquals(a_string_, other.a_string_) && - PigeonInternalDeepEquals(an_object_, other.an_object_) && - PigeonInternalDeepEquals(list_, other.list_) && - PigeonInternalDeepEquals(string_list_, other.string_list_) && - PigeonInternalDeepEquals(int_list_, other.int_list_) && - PigeonInternalDeepEquals(double_list_, other.double_list_) && - PigeonInternalDeepEquals(bool_list_, other.bool_list_) && - PigeonInternalDeepEquals(enum_list_, other.enum_list_) && - PigeonInternalDeepEquals(object_list_, other.object_list_) && - PigeonInternalDeepEquals(list_list_, other.list_list_) && - PigeonInternalDeepEquals(map_list_, other.map_list_) && - PigeonInternalDeepEquals(map_, other.map_) && - PigeonInternalDeepEquals(string_map_, other.string_map_) && - PigeonInternalDeepEquals(int_map_, other.int_map_) && - PigeonInternalDeepEquals(enum_map_, other.enum_map_) && - PigeonInternalDeepEquals(object_map_, other.object_map_) && - PigeonInternalDeepEquals(list_map_, other.list_map_) && - PigeonInternalDeepEquals(map_map_, other.map_map_); -} + AllTypes AllTypes::FromEncodableList(const EncodableList& list) { + AllTypes decoded( + std::get(list[0]), std::get(list[1]), + std::get(list[2]), std::get(list[3]), + std::get>(list[4]), + std::get>(list[5]), + std::get>(list[6]), + std::get>(list[7]), + std::any_cast(std::get(list[8])), + std::any_cast( + std::get(list[9])), + std::get(list[10]), list[11], + std::get(list[12]), std::get(list[13]), + std::get(list[14]), std::get(list[15]), + std::get(list[16]), std::get(list[17]), + std::get(list[18]), std::get(list[19]), + std::get(list[20]), std::get(list[21]), + std::get(list[22]), std::get(list[23]), + std::get(list[24]), std::get(list[25]), + std::get(list[26]), std::get(list[27])); + return decoded; + } -bool AllTypes::operator!=(const AllTypes& other) const { - return !(*this == other); -} + bool AllTypes::operator==(const AllTypes& other) const { + return PigeonInternalDeepEquals(a_bool_, other.a_bool_) && + PigeonInternalDeepEquals(an_int_, other.an_int_) && + PigeonInternalDeepEquals(an_int64_, other.an_int64_) && + PigeonInternalDeepEquals(a_double_, other.a_double_) && + PigeonInternalDeepEquals(a_byte_array_, other.a_byte_array_) && + PigeonInternalDeepEquals(a4_byte_array_, other.a4_byte_array_) && + PigeonInternalDeepEquals(a8_byte_array_, other.a8_byte_array_) && + PigeonInternalDeepEquals(a_float_array_, other.a_float_array_) && + PigeonInternalDeepEquals(an_enum_, other.an_enum_) && + PigeonInternalDeepEquals(another_enum_, other.another_enum_) && + PigeonInternalDeepEquals(a_string_, other.a_string_) && + PigeonInternalDeepEquals(an_object_, other.an_object_) && + PigeonInternalDeepEquals(list_, other.list_) && + PigeonInternalDeepEquals(string_list_, other.string_list_) && + PigeonInternalDeepEquals(int_list_, other.int_list_) && + PigeonInternalDeepEquals(double_list_, other.double_list_) && + PigeonInternalDeepEquals(bool_list_, other.bool_list_) && + PigeonInternalDeepEquals(enum_list_, other.enum_list_) && + PigeonInternalDeepEquals(object_list_, other.object_list_) && + PigeonInternalDeepEquals(list_list_, other.list_list_) && + PigeonInternalDeepEquals(map_list_, other.map_list_) && + PigeonInternalDeepEquals(map_, other.map_) && + PigeonInternalDeepEquals(string_map_, other.string_map_) && + PigeonInternalDeepEquals(int_map_, other.int_map_) && + PigeonInternalDeepEquals(enum_map_, other.enum_map_) && + PigeonInternalDeepEquals(object_map_, other.object_map_) && + PigeonInternalDeepEquals(list_map_, other.list_map_) && + PigeonInternalDeepEquals(map_map_, other.map_map_); + } -size_t AllTypes::Hash() const { - size_t result = 1; - result = result * 31 + PigeonInternalDeepHash(a_bool_); - result = result * 31 + PigeonInternalDeepHash(an_int_); - result = result * 31 + PigeonInternalDeepHash(an_int64_); - result = result * 31 + PigeonInternalDeepHash(a_double_); - result = result * 31 + PigeonInternalDeepHash(a_byte_array_); - result = result * 31 + PigeonInternalDeepHash(a4_byte_array_); - result = result * 31 + PigeonInternalDeepHash(a8_byte_array_); - result = result * 31 + PigeonInternalDeepHash(a_float_array_); - result = result * 31 + PigeonInternalDeepHash(an_enum_); - result = result * 31 + PigeonInternalDeepHash(another_enum_); - result = result * 31 + PigeonInternalDeepHash(a_string_); - result = result * 31 + PigeonInternalDeepHash(an_object_); - result = result * 31 + PigeonInternalDeepHash(list_); - result = result * 31 + PigeonInternalDeepHash(string_list_); - result = result * 31 + PigeonInternalDeepHash(int_list_); - result = result * 31 + PigeonInternalDeepHash(double_list_); - result = result * 31 + PigeonInternalDeepHash(bool_list_); - result = result * 31 + PigeonInternalDeepHash(enum_list_); - result = result * 31 + PigeonInternalDeepHash(object_list_); - result = result * 31 + PigeonInternalDeepHash(list_list_); - result = result * 31 + PigeonInternalDeepHash(map_list_); - result = result * 31 + PigeonInternalDeepHash(map_); - result = result * 31 + PigeonInternalDeepHash(string_map_); - result = result * 31 + PigeonInternalDeepHash(int_map_); - result = result * 31 + PigeonInternalDeepHash(enum_map_); - result = result * 31 + PigeonInternalDeepHash(object_map_); - result = result * 31 + PigeonInternalDeepHash(list_map_); - result = result * 31 + PigeonInternalDeepHash(map_map_); - return result; -} + bool AllTypes::operator!=(const AllTypes& other) const { + return !(*this == other); + } + + size_t AllTypes::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(a_bool_); + result = result * 31 + PigeonInternalDeepHash(an_int_); + result = result * 31 + PigeonInternalDeepHash(an_int64_); + result = result * 31 + PigeonInternalDeepHash(a_double_); + result = result * 31 + PigeonInternalDeepHash(a_byte_array_); + result = result * 31 + PigeonInternalDeepHash(a4_byte_array_); + result = result * 31 + PigeonInternalDeepHash(a8_byte_array_); + result = result * 31 + PigeonInternalDeepHash(a_float_array_); + result = result * 31 + PigeonInternalDeepHash(an_enum_); + result = result * 31 + PigeonInternalDeepHash(another_enum_); + result = result * 31 + PigeonInternalDeepHash(a_string_); + result = result * 31 + PigeonInternalDeepHash(an_object_); + result = result * 31 + PigeonInternalDeepHash(list_); + result = result * 31 + PigeonInternalDeepHash(string_list_); + result = result * 31 + PigeonInternalDeepHash(int_list_); + result = result * 31 + PigeonInternalDeepHash(double_list_); + result = result * 31 + PigeonInternalDeepHash(bool_list_); + result = result * 31 + PigeonInternalDeepHash(enum_list_); + result = result * 31 + PigeonInternalDeepHash(object_list_); + result = result * 31 + PigeonInternalDeepHash(list_list_); + result = result * 31 + PigeonInternalDeepHash(map_list_); + result = result * 31 + PigeonInternalDeepHash(map_); + result = result * 31 + PigeonInternalDeepHash(string_map_); + result = result * 31 + PigeonInternalDeepHash(int_map_); + result = result * 31 + PigeonInternalDeepHash(enum_map_); + result = result * 31 + PigeonInternalDeepHash(object_map_); + result = result * 31 + PigeonInternalDeepHash(list_map_); + result = result * 31 + PigeonInternalDeepHash(map_map_); + return result; + } + + std::string AllTypes::ToString() const { + std::stringstream ss; + ss << "AllTypes("; + ss << "aBool: "; + ss << a_bool_; + ss << ", anInt: "; + ss << an_int_; + ss << ", anInt64: "; + ss << an_int64_; + ss << ", aDouble: "; + ss << a_double_; + ss << ", aByteArray: "; + ss << a_byte_array_; + ss << ", a4ByteArray: "; + ss << a4_byte_array_; + ss << ", a8ByteArray: "; + ss << a8_byte_array_; + ss << ", aFloatArray: "; + ss << a_float_array_; + ss << ", anEnum: "; + ss << an_enum_; + ss << ", anotherEnum: "; + ss << another_enum_; + ss << ", aString: "; + ss << a_string_; + ss << ", anObject: "; + ss << an_object_; + ss << ", list: "; + ss << list_; + ss << ", stringList: "; + ss << string_list_; + ss << ", intList: "; + ss << int_list_; + ss << ", doubleList: "; + ss << double_list_; + ss << ", boolList: "; + ss << bool_list_; + ss << ", enumList: "; + ss << enum_list_; + ss << ", objectList: "; + ss << object_list_; + ss << ", listList: "; + ss << list_list_; + ss << ", mapList: "; + ss << map_list_; + ss << ", map: "; + ss << map_; + ss << ", stringMap: "; + ss << string_map_; + ss << ", intMap: "; + ss << int_map_; + ss << ", enumMap: "; + ss << enum_map_; + ss << ", objectMap: "; + ss << object_map_; + ss << ", listMap: "; + ss << list_map_; + ss << ", mapMap: "; + ss << map_map_; + ss << ")"; + return ss.str(); + } -size_t PigeonInternalDeepHash(const AllTypes& v) { return v.Hash(); } - -// AllNullableTypes - -AllNullableTypes::AllNullableTypes() {} - -AllNullableTypes::AllNullableTypes( - const bool* a_nullable_bool, const int64_t* a_nullable_int, - const int64_t* a_nullable_int64, const double* a_nullable_double, - const std::vector* a_nullable_byte_array, - const std::vector* a_nullable4_byte_array, - const std::vector* a_nullable8_byte_array, - const std::vector* a_nullable_float_array, - const AnEnum* a_nullable_enum, const AnotherEnum* another_nullable_enum, - const std::string* a_nullable_string, - const EncodableValue* a_nullable_object, - const AllNullableTypes* all_nullable_types, const EncodableList* list, - const EncodableList* string_list, const EncodableList* int_list, - const EncodableList* double_list, const EncodableList* bool_list, - const EncodableList* enum_list, const EncodableList* object_list, - const EncodableList* list_list, const EncodableList* map_list, - const EncodableList* recursive_class_list, const EncodableMap* map, - const EncodableMap* string_map, const EncodableMap* int_map, - const EncodableMap* enum_map, const EncodableMap* object_map, - const EncodableMap* list_map, const EncodableMap* map_map, - const EncodableMap* recursive_class_map) - : a_nullable_bool_(a_nullable_bool ? std::optional(*a_nullable_bool) + size_t PigeonInternalDeepHash(const AllTypes& v) { return v.Hash(); } + + // AllNullableTypes + + AllNullableTypes::AllNullableTypes() {} + + AllNullableTypes::AllNullableTypes( + const bool* a_nullable_bool, const int64_t* a_nullable_int, + const int64_t* a_nullable_int64, const double* a_nullable_double, + const std::vector* a_nullable_byte_array, + const std::vector* a_nullable4_byte_array, + const std::vector* a_nullable8_byte_array, + const std::vector* a_nullable_float_array, + const AnEnum* a_nullable_enum, const AnotherEnum* another_nullable_enum, + const std::string* a_nullable_string, + const EncodableValue* a_nullable_object, + const AllNullableTypes* all_nullable_types, const EncodableList* list, + const EncodableList* string_list, const EncodableList* int_list, + const EncodableList* double_list, const EncodableList* bool_list, + const EncodableList* enum_list, const EncodableList* object_list, + const EncodableList* list_list, const EncodableList* map_list, + const EncodableList* recursive_class_list, const EncodableMap* map, + const EncodableMap* string_map, const EncodableMap* int_map, + const EncodableMap* enum_map, const EncodableMap* object_map, + const EncodableMap* list_map, const EncodableMap* map_map, + const EncodableMap* recursive_class_map) + : a_nullable_bool_(a_nullable_bool ? std::optional(*a_nullable_bool) + : std::nullopt), + a_nullable_int_(a_nullable_int ? std::optional(*a_nullable_int) : std::nullopt), - a_nullable_int_(a_nullable_int ? std::optional(*a_nullable_int) - : std::nullopt), - a_nullable_int64_(a_nullable_int64 - ? std::optional(*a_nullable_int64) - : std::nullopt), - a_nullable_double_(a_nullable_double - ? std::optional(*a_nullable_double) + a_nullable_int64_(a_nullable_int64 + ? std::optional(*a_nullable_int64) + : std::nullopt), + a_nullable_double_(a_nullable_double + ? std::optional(*a_nullable_double) + : std::nullopt), + a_nullable_byte_array_( + a_nullable_byte_array + ? std::optional>(*a_nullable_byte_array) + : std::nullopt), + a_nullable4_byte_array_( + a_nullable4_byte_array + ? std::optional>(*a_nullable4_byte_array) + : std::nullopt), + a_nullable8_byte_array_( + a_nullable8_byte_array + ? std::optional>(*a_nullable8_byte_array) + : std::nullopt), + a_nullable_float_array_( + a_nullable_float_array + ? std::optional>(*a_nullable_float_array) + : std::nullopt), + a_nullable_enum_(a_nullable_enum + ? std::optional(*a_nullable_enum) : std::nullopt), - a_nullable_byte_array_( - a_nullable_byte_array - ? std::optional>(*a_nullable_byte_array) - : std::nullopt), - a_nullable4_byte_array_( - a_nullable4_byte_array - ? std::optional>(*a_nullable4_byte_array) - : std::nullopt), - a_nullable8_byte_array_( - a_nullable8_byte_array - ? std::optional>(*a_nullable8_byte_array) - : std::nullopt), - a_nullable_float_array_( - a_nullable_float_array - ? std::optional>(*a_nullable_float_array) - : std::nullopt), - a_nullable_enum_(a_nullable_enum ? std::optional(*a_nullable_enum) - : std::nullopt), - another_nullable_enum_(another_nullable_enum ? std::optional( - *another_nullable_enum) - : std::nullopt), - a_nullable_string_(a_nullable_string - ? std::optional(*a_nullable_string) + another_nullable_enum_( + another_nullable_enum + ? std::optional(*another_nullable_enum) + : std::nullopt), + a_nullable_string_(a_nullable_string + ? std::optional(*a_nullable_string) + : std::nullopt), + a_nullable_object_(a_nullable_object ? std::optional( + *a_nullable_object) + : std::nullopt), + all_nullable_types_( + all_nullable_types + ? std::make_unique(*all_nullable_types) + : nullptr), + list_(list ? std::optional(*list) : std::nullopt), + string_list_(string_list ? std::optional(*string_list) + : std::nullopt), + int_list_(int_list ? std::optional(*int_list) + : std::nullopt), + double_list_(double_list ? std::optional(*double_list) + : std::nullopt), + bool_list_(bool_list ? std::optional(*bool_list) + : std::nullopt), + enum_list_(enum_list ? std::optional(*enum_list) : std::nullopt), - a_nullable_object_(a_nullable_object - ? std::optional(*a_nullable_object) + object_list_(object_list ? std::optional(*object_list) + : std::nullopt), + list_list_(list_list ? std::optional(*list_list) : std::nullopt), - all_nullable_types_( - all_nullable_types - ? std::make_unique(*all_nullable_types) - : nullptr), - list_(list ? std::optional(*list) : std::nullopt), - string_list_(string_list ? std::optional(*string_list) + map_list_(map_list ? std::optional(*map_list) + : std::nullopt), + recursive_class_list_( + recursive_class_list + ? std::optional(*recursive_class_list) + : std::nullopt), + map_(map ? std::optional(*map) : std::nullopt), + string_map_(string_map ? std::optional(*string_map) : std::nullopt), - int_list_(int_list ? std::optional(*int_list) + int_map_(int_map ? std::optional(*int_map) : std::nullopt), - double_list_(double_list ? std::optional(*double_list) - : std::nullopt), - bool_list_(bool_list ? std::optional(*bool_list) - : std::nullopt), - enum_list_(enum_list ? std::optional(*enum_list) + enum_map_(enum_map ? std::optional(*enum_map) : std::nullopt), - object_list_(object_list ? std::optional(*object_list) + object_map_(object_map ? std::optional(*object_map) : std::nullopt), - list_list_(list_list ? std::optional(*list_list) + list_map_(list_map ? std::optional(*list_map) : std::nullopt), - map_list_(map_list ? std::optional(*map_list) + map_map_(map_map ? std::optional(*map_map) : std::nullopt), - recursive_class_list_(recursive_class_list ? std::optional( - *recursive_class_list) - : std::nullopt), - map_(map ? std::optional(*map) : std::nullopt), - string_map_(string_map ? std::optional(*string_map) - : std::nullopt), - int_map_(int_map ? std::optional(*int_map) : std::nullopt), - enum_map_(enum_map ? std::optional(*enum_map) - : std::nullopt), - object_map_(object_map ? std::optional(*object_map) + recursive_class_map_(recursive_class_map ? std::optional( + *recursive_class_map) + : std::nullopt) {} + + AllNullableTypes::AllNullableTypes(const AllNullableTypes& other) + : a_nullable_bool_(other.a_nullable_bool_ + ? std::optional(*other.a_nullable_bool_) : std::nullopt), - list_map_(list_map ? std::optional(*list_map) - : std::nullopt), - map_map_(map_map ? std::optional(*map_map) : std::nullopt), - recursive_class_map_(recursive_class_map ? std::optional( - *recursive_class_map) - : std::nullopt) {} - -AllNullableTypes::AllNullableTypes(const AllNullableTypes& other) - : a_nullable_bool_(other.a_nullable_bool_ - ? std::optional(*other.a_nullable_bool_) - : std::nullopt), - a_nullable_int_(other.a_nullable_int_ - ? std::optional(*other.a_nullable_int_) - : std::nullopt), - a_nullable_int64_(other.a_nullable_int64_ - ? std::optional(*other.a_nullable_int64_) + a_nullable_int_(other.a_nullable_int_ + ? std::optional(*other.a_nullable_int_) : std::nullopt), - a_nullable_double_(other.a_nullable_double_ - ? std::optional(*other.a_nullable_double_) + a_nullable_int64_(other.a_nullable_int64_ + ? std::optional(*other.a_nullable_int64_) + : std::nullopt), + a_nullable_double_( + other.a_nullable_double_ + ? std::optional(*other.a_nullable_double_) + : std::nullopt), + a_nullable_byte_array_(other.a_nullable_byte_array_ + ? std::optional>( + *other.a_nullable_byte_array_) + : std::nullopt), + a_nullable4_byte_array_(other.a_nullable4_byte_array_ + ? std::optional>( + *other.a_nullable4_byte_array_) + : std::nullopt), + a_nullable8_byte_array_(other.a_nullable8_byte_array_ + ? std::optional>( + *other.a_nullable8_byte_array_) + : std::nullopt), + a_nullable_float_array_(other.a_nullable_float_array_ + ? std::optional>( + *other.a_nullable_float_array_) + : std::nullopt), + a_nullable_enum_(other.a_nullable_enum_ + ? std::optional(*other.a_nullable_enum_) : std::nullopt), - a_nullable_byte_array_(other.a_nullable_byte_array_ - ? std::optional>( - *other.a_nullable_byte_array_) - : std::nullopt), - a_nullable4_byte_array_(other.a_nullable4_byte_array_ - ? std::optional>( - *other.a_nullable4_byte_array_) - : std::nullopt), - a_nullable8_byte_array_(other.a_nullable8_byte_array_ - ? std::optional>( - *other.a_nullable8_byte_array_) - : std::nullopt), - a_nullable_float_array_(other.a_nullable_float_array_ - ? std::optional>( - *other.a_nullable_float_array_) - : std::nullopt), - a_nullable_enum_(other.a_nullable_enum_ - ? std::optional(*other.a_nullable_enum_) - : std::nullopt), - another_nullable_enum_( - other.another_nullable_enum_ - ? std::optional(*other.another_nullable_enum_) - : std::nullopt), - a_nullable_string_( - other.a_nullable_string_ - ? std::optional(*other.a_nullable_string_) - : std::nullopt), - a_nullable_object_( - other.a_nullable_object_ - ? std::optional(*other.a_nullable_object_) - : std::nullopt), - all_nullable_types_( - other.all_nullable_types_ - ? std::make_unique(*other.all_nullable_types_) - : nullptr), - list_(other.list_ ? std::optional(*other.list_) - : std::nullopt), - string_list_(other.string_list_ - ? std::optional(*other.string_list_) + another_nullable_enum_( + other.another_nullable_enum_ + ? std::optional(*other.another_nullable_enum_) + : std::nullopt), + a_nullable_string_( + other.a_nullable_string_ + ? std::optional(*other.a_nullable_string_) + : std::nullopt), + a_nullable_object_( + other.a_nullable_object_ + ? std::optional(*other.a_nullable_object_) + : std::nullopt), + all_nullable_types_( + other.all_nullable_types_ + ? std::make_unique(*other.all_nullable_types_) + : nullptr), + list_(other.list_ ? std::optional(*other.list_) + : std::nullopt), + string_list_(other.string_list_ + ? std::optional(*other.string_list_) + : std::nullopt), + int_list_(other.int_list_ + ? std::optional(*other.int_list_) + : std::nullopt), + double_list_(other.double_list_ + ? std::optional(*other.double_list_) + : std::nullopt), + bool_list_(other.bool_list_ + ? std::optional(*other.bool_list_) : std::nullopt), - int_list_(other.int_list_ ? std::optional(*other.int_list_) - : std::nullopt), - double_list_(other.double_list_ - ? std::optional(*other.double_list_) + enum_list_(other.enum_list_ + ? std::optional(*other.enum_list_) : std::nullopt), - bool_list_(other.bool_list_ - ? std::optional(*other.bool_list_) - : std::nullopt), - enum_list_(other.enum_list_ - ? std::optional(*other.enum_list_) - : std::nullopt), - object_list_(other.object_list_ - ? std::optional(*other.object_list_) + object_list_(other.object_list_ + ? std::optional(*other.object_list_) + : std::nullopt), + list_list_(other.list_list_ + ? std::optional(*other.list_list_) : std::nullopt), - list_list_(other.list_list_ - ? std::optional(*other.list_list_) - : std::nullopt), - map_list_(other.map_list_ ? std::optional(*other.map_list_) - : std::nullopt), - recursive_class_list_( - other.recursive_class_list_ - ? std::optional(*other.recursive_class_list_) - : std::nullopt), - map_(other.map_ ? std::optional(*other.map_) - : std::nullopt), - string_map_(other.string_map_ - ? std::optional(*other.string_map_) + map_list_(other.map_list_ + ? std::optional(*other.map_list_) : std::nullopt), - int_map_(other.int_map_ ? std::optional(*other.int_map_) - : std::nullopt), - enum_map_(other.enum_map_ ? std::optional(*other.enum_map_) + recursive_class_list_( + other.recursive_class_list_ + ? std::optional(*other.recursive_class_list_) + : std::nullopt), + map_(other.map_ ? std::optional(*other.map_) + : std::nullopt), + string_map_(other.string_map_ + ? std::optional(*other.string_map_) + : std::nullopt), + int_map_(other.int_map_ ? std::optional(*other.int_map_) : std::nullopt), - object_map_(other.object_map_ - ? std::optional(*other.object_map_) + enum_map_(other.enum_map_ + ? std::optional(*other.enum_map_) + : std::nullopt), + object_map_(other.object_map_ + ? std::optional(*other.object_map_) + : std::nullopt), + list_map_(other.list_map_ + ? std::optional(*other.list_map_) : std::nullopt), - list_map_(other.list_map_ ? std::optional(*other.list_map_) + map_map_(other.map_map_ ? std::optional(*other.map_map_) : std::nullopt), - map_map_(other.map_map_ ? std::optional(*other.map_map_) - : std::nullopt), - recursive_class_map_( - other.recursive_class_map_ - ? std::optional(*other.recursive_class_map_) - : std::nullopt) {} - -AllNullableTypes& AllNullableTypes::operator=(const AllNullableTypes& other) { - a_nullable_bool_ = other.a_nullable_bool_; - a_nullable_int_ = other.a_nullable_int_; - a_nullable_int64_ = other.a_nullable_int64_; - a_nullable_double_ = other.a_nullable_double_; - a_nullable_byte_array_ = other.a_nullable_byte_array_; - a_nullable4_byte_array_ = other.a_nullable4_byte_array_; - a_nullable8_byte_array_ = other.a_nullable8_byte_array_; - a_nullable_float_array_ = other.a_nullable_float_array_; - a_nullable_enum_ = other.a_nullable_enum_; - another_nullable_enum_ = other.another_nullable_enum_; - a_nullable_string_ = other.a_nullable_string_; - a_nullable_object_ = other.a_nullable_object_; - all_nullable_types_ = - other.all_nullable_types_ - ? std::make_unique(*other.all_nullable_types_) - : nullptr; - list_ = other.list_; - string_list_ = other.string_list_; - int_list_ = other.int_list_; - double_list_ = other.double_list_; - bool_list_ = other.bool_list_; - enum_list_ = other.enum_list_; - object_list_ = other.object_list_; - list_list_ = other.list_list_; - map_list_ = other.map_list_; - recursive_class_list_ = other.recursive_class_list_; - map_ = other.map_; - string_map_ = other.string_map_; - int_map_ = other.int_map_; - enum_map_ = other.enum_map_; - object_map_ = other.object_map_; - list_map_ = other.list_map_; - map_map_ = other.map_map_; - recursive_class_map_ = other.recursive_class_map_; - return *this; -} + recursive_class_map_( + other.recursive_class_map_ + ? std::optional(*other.recursive_class_map_) + : std::nullopt) {} + + AllNullableTypes& AllNullableTypes::operator=(const AllNullableTypes& other) { + a_nullable_bool_ = other.a_nullable_bool_; + a_nullable_int_ = other.a_nullable_int_; + a_nullable_int64_ = other.a_nullable_int64_; + a_nullable_double_ = other.a_nullable_double_; + a_nullable_byte_array_ = other.a_nullable_byte_array_; + a_nullable4_byte_array_ = other.a_nullable4_byte_array_; + a_nullable8_byte_array_ = other.a_nullable8_byte_array_; + a_nullable_float_array_ = other.a_nullable_float_array_; + a_nullable_enum_ = other.a_nullable_enum_; + another_nullable_enum_ = other.another_nullable_enum_; + a_nullable_string_ = other.a_nullable_string_; + a_nullable_object_ = other.a_nullable_object_; + all_nullable_types_ = + other.all_nullable_types_ + ? std::make_unique(*other.all_nullable_types_) + : nullptr; + list_ = other.list_; + string_list_ = other.string_list_; + int_list_ = other.int_list_; + double_list_ = other.double_list_; + bool_list_ = other.bool_list_; + enum_list_ = other.enum_list_; + object_list_ = other.object_list_; + list_list_ = other.list_list_; + map_list_ = other.map_list_; + recursive_class_list_ = other.recursive_class_list_; + map_ = other.map_; + string_map_ = other.string_map_; + int_map_ = other.int_map_; + enum_map_ = other.enum_map_; + object_map_ = other.object_map_; + list_map_ = other.list_map_; + map_map_ = other.map_map_; + recursive_class_map_ = other.recursive_class_map_; + return *this; + } -const bool* AllNullableTypes::a_nullable_bool() const { - return a_nullable_bool_ ? &(*a_nullable_bool_) : nullptr; -} + const bool* AllNullableTypes::a_nullable_bool() const { + return a_nullable_bool_ ? &(*a_nullable_bool_) : nullptr; + } -void AllNullableTypes::set_a_nullable_bool(const bool* value_arg) { - a_nullable_bool_ = value_arg ? std::optional(*value_arg) : std::nullopt; -} + void AllNullableTypes::set_a_nullable_bool(const bool* value_arg) { + a_nullable_bool_ = + value_arg ? std::optional(*value_arg) : std::nullopt; + } -void AllNullableTypes::set_a_nullable_bool(bool value_arg) { - a_nullable_bool_ = value_arg; -} + void AllNullableTypes::set_a_nullable_bool(bool value_arg) { + a_nullable_bool_ = value_arg; + } -const int64_t* AllNullableTypes::a_nullable_int() const { - return a_nullable_int_ ? &(*a_nullable_int_) : nullptr; -} + const int64_t* AllNullableTypes::a_nullable_int() const { + return a_nullable_int_ ? &(*a_nullable_int_) : nullptr; + } -void AllNullableTypes::set_a_nullable_int(const int64_t* value_arg) { - a_nullable_int_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} + void AllNullableTypes::set_a_nullable_int(const int64_t* value_arg) { + a_nullable_int_ = + value_arg ? std::optional(*value_arg) : std::nullopt; + } -void AllNullableTypes::set_a_nullable_int(int64_t value_arg) { - a_nullable_int_ = value_arg; -} + void AllNullableTypes::set_a_nullable_int(int64_t value_arg) { + a_nullable_int_ = value_arg; + } -const int64_t* AllNullableTypes::a_nullable_int64() const { - return a_nullable_int64_ ? &(*a_nullable_int64_) : nullptr; -} + const int64_t* AllNullableTypes::a_nullable_int64() const { + return a_nullable_int64_ ? &(*a_nullable_int64_) : nullptr; + } -void AllNullableTypes::set_a_nullable_int64(const int64_t* value_arg) { - a_nullable_int64_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} + void AllNullableTypes::set_a_nullable_int64(const int64_t* value_arg) { + a_nullable_int64_ = + value_arg ? std::optional(*value_arg) : std::nullopt; + } -void AllNullableTypes::set_a_nullable_int64(int64_t value_arg) { - a_nullable_int64_ = value_arg; -} + void AllNullableTypes::set_a_nullable_int64(int64_t value_arg) { + a_nullable_int64_ = value_arg; + } -const double* AllNullableTypes::a_nullable_double() const { - return a_nullable_double_ ? &(*a_nullable_double_) : nullptr; -} + const double* AllNullableTypes::a_nullable_double() const { + return a_nullable_double_ ? &(*a_nullable_double_) : nullptr; + } -void AllNullableTypes::set_a_nullable_double(const double* value_arg) { - a_nullable_double_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} + void AllNullableTypes::set_a_nullable_double(const double* value_arg) { + a_nullable_double_ = + value_arg ? std::optional(*value_arg) : std::nullopt; + } -void AllNullableTypes::set_a_nullable_double(double value_arg) { - a_nullable_double_ = value_arg; -} + void AllNullableTypes::set_a_nullable_double(double value_arg) { + a_nullable_double_ = value_arg; + } -const std::vector* AllNullableTypes::a_nullable_byte_array() const { - return a_nullable_byte_array_ ? &(*a_nullable_byte_array_) : nullptr; -} + const std::vector* AllNullableTypes::a_nullable_byte_array() const { + return a_nullable_byte_array_ ? &(*a_nullable_byte_array_) : nullptr; + } -void AllNullableTypes::set_a_nullable_byte_array( - const std::vector* value_arg) { - a_nullable_byte_array_ = value_arg - ? std::optional>(*value_arg) - : std::nullopt; -} + void AllNullableTypes::set_a_nullable_byte_array( + const std::vector* value_arg) { + a_nullable_byte_array_ = + value_arg ? std::optional>(*value_arg) + : std::nullopt; + } -void AllNullableTypes::set_a_nullable_byte_array( - const std::vector& value_arg) { - a_nullable_byte_array_ = value_arg; -} + void AllNullableTypes::set_a_nullable_byte_array( + const std::vector& value_arg) { + a_nullable_byte_array_ = value_arg; + } -const std::vector* AllNullableTypes::a_nullable4_byte_array() const { - return a_nullable4_byte_array_ ? &(*a_nullable4_byte_array_) : nullptr; -} + const std::vector* AllNullableTypes::a_nullable4_byte_array() const { + return a_nullable4_byte_array_ ? &(*a_nullable4_byte_array_) : nullptr; + } -void AllNullableTypes::set_a_nullable4_byte_array( - const std::vector* value_arg) { - a_nullable4_byte_array_ = - value_arg ? std::optional>(*value_arg) - : std::nullopt; -} + void AllNullableTypes::set_a_nullable4_byte_array( + const std::vector* value_arg) { + a_nullable4_byte_array_ = + value_arg ? std::optional>(*value_arg) + : std::nullopt; + } -void AllNullableTypes::set_a_nullable4_byte_array( - const std::vector& value_arg) { - a_nullable4_byte_array_ = value_arg; -} + void AllNullableTypes::set_a_nullable4_byte_array( + const std::vector& value_arg) { + a_nullable4_byte_array_ = value_arg; + } -const std::vector* AllNullableTypes::a_nullable8_byte_array() const { - return a_nullable8_byte_array_ ? &(*a_nullable8_byte_array_) : nullptr; -} + const std::vector* AllNullableTypes::a_nullable8_byte_array() const { + return a_nullable8_byte_array_ ? &(*a_nullable8_byte_array_) : nullptr; + } -void AllNullableTypes::set_a_nullable8_byte_array( - const std::vector* value_arg) { - a_nullable8_byte_array_ = - value_arg ? std::optional>(*value_arg) - : std::nullopt; -} + void AllNullableTypes::set_a_nullable8_byte_array( + const std::vector* value_arg) { + a_nullable8_byte_array_ = + value_arg ? std::optional>(*value_arg) + : std::nullopt; + } -void AllNullableTypes::set_a_nullable8_byte_array( - const std::vector& value_arg) { - a_nullable8_byte_array_ = value_arg; -} + void AllNullableTypes::set_a_nullable8_byte_array( + const std::vector& value_arg) { + a_nullable8_byte_array_ = value_arg; + } -const std::vector* AllNullableTypes::a_nullable_float_array() const { - return a_nullable_float_array_ ? &(*a_nullable_float_array_) : nullptr; -} + const std::vector* AllNullableTypes::a_nullable_float_array() const { + return a_nullable_float_array_ ? &(*a_nullable_float_array_) : nullptr; + } -void AllNullableTypes::set_a_nullable_float_array( - const std::vector* value_arg) { - a_nullable_float_array_ = - value_arg ? std::optional>(*value_arg) : std::nullopt; -} + void AllNullableTypes::set_a_nullable_float_array( + const std::vector* value_arg) { + a_nullable_float_array_ = + value_arg ? std::optional>(*value_arg) + : std::nullopt; + } -void AllNullableTypes::set_a_nullable_float_array( - const std::vector& value_arg) { - a_nullable_float_array_ = value_arg; -} + void AllNullableTypes::set_a_nullable_float_array( + const std::vector& value_arg) { + a_nullable_float_array_ = value_arg; + } -const AnEnum* AllNullableTypes::a_nullable_enum() const { - return a_nullable_enum_ ? &(*a_nullable_enum_) : nullptr; -} + const AnEnum* AllNullableTypes::a_nullable_enum() const { + return a_nullable_enum_ ? &(*a_nullable_enum_) : nullptr; + } -void AllNullableTypes::set_a_nullable_enum(const AnEnum* value_arg) { - a_nullable_enum_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} + void AllNullableTypes::set_a_nullable_enum(const AnEnum* value_arg) { + a_nullable_enum_ = + value_arg ? std::optional(*value_arg) : std::nullopt; + } -void AllNullableTypes::set_a_nullable_enum(const AnEnum& value_arg) { - a_nullable_enum_ = value_arg; -} + void AllNullableTypes::set_a_nullable_enum(const AnEnum& value_arg) { + a_nullable_enum_ = value_arg; + } -const AnotherEnum* AllNullableTypes::another_nullable_enum() const { - return another_nullable_enum_ ? &(*another_nullable_enum_) : nullptr; -} + const AnotherEnum* AllNullableTypes::another_nullable_enum() const { + return another_nullable_enum_ ? &(*another_nullable_enum_) : nullptr; + } -void AllNullableTypes::set_another_nullable_enum(const AnotherEnum* value_arg) { - another_nullable_enum_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} + void AllNullableTypes::set_another_nullable_enum( + const AnotherEnum* value_arg) { + another_nullable_enum_ = + value_arg ? std::optional(*value_arg) : std::nullopt; + } -void AllNullableTypes::set_another_nullable_enum(const AnotherEnum& value_arg) { - another_nullable_enum_ = value_arg; -} + void AllNullableTypes::set_another_nullable_enum( + const AnotherEnum& value_arg) { + another_nullable_enum_ = value_arg; + } -const std::string* AllNullableTypes::a_nullable_string() const { - return a_nullable_string_ ? &(*a_nullable_string_) : nullptr; -} + const std::string* AllNullableTypes::a_nullable_string() const { + return a_nullable_string_ ? &(*a_nullable_string_) : nullptr; + } -void AllNullableTypes::set_a_nullable_string( - const std::string_view* value_arg) { - a_nullable_string_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} + void AllNullableTypes::set_a_nullable_string( + const std::string_view* value_arg) { + a_nullable_string_ = + value_arg ? std::optional(*value_arg) : std::nullopt; + } -void AllNullableTypes::set_a_nullable_string(std::string_view value_arg) { - a_nullable_string_ = value_arg; -} + void AllNullableTypes::set_a_nullable_string(std::string_view value_arg) { + a_nullable_string_ = value_arg; + } -const EncodableValue* AllNullableTypes::a_nullable_object() const { - return a_nullable_object_ ? &(*a_nullable_object_) : nullptr; -} + const EncodableValue* AllNullableTypes::a_nullable_object() const { + return a_nullable_object_ ? &(*a_nullable_object_) : nullptr; + } -void AllNullableTypes::set_a_nullable_object(const EncodableValue* value_arg) { - a_nullable_object_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} + void AllNullableTypes::set_a_nullable_object( + const EncodableValue* value_arg) { + a_nullable_object_ = + value_arg ? std::optional(*value_arg) : std::nullopt; + } -void AllNullableTypes::set_a_nullable_object(const EncodableValue& value_arg) { - a_nullable_object_ = value_arg; -} + void AllNullableTypes::set_a_nullable_object( + const EncodableValue& value_arg) { + a_nullable_object_ = value_arg; + } -const AllNullableTypes* AllNullableTypes::all_nullable_types() const { - return all_nullable_types_.get(); -} + const AllNullableTypes* AllNullableTypes::all_nullable_types() const { + return all_nullable_types_.get(); + } -void AllNullableTypes::set_all_nullable_types( - const AllNullableTypes* value_arg) { - all_nullable_types_ = - value_arg ? std::make_unique(*value_arg) : nullptr; -} + void AllNullableTypes::set_all_nullable_types( + const AllNullableTypes* value_arg) { + all_nullable_types_ = + value_arg ? std::make_unique(*value_arg) : nullptr; + } -void AllNullableTypes::set_all_nullable_types( - const AllNullableTypes& value_arg) { - all_nullable_types_ = std::make_unique(value_arg); -} + void AllNullableTypes::set_all_nullable_types( + const AllNullableTypes& value_arg) { + all_nullable_types_ = std::make_unique(value_arg); + } -const EncodableList* AllNullableTypes::list() const { - return list_ ? &(*list_) : nullptr; -} + const EncodableList* AllNullableTypes::list() const { + return list_ ? &(*list_) : nullptr; + } -void AllNullableTypes::set_list(const EncodableList* value_arg) { - list_ = value_arg ? std::optional(*value_arg) : std::nullopt; -} + void AllNullableTypes::set_list(const EncodableList* value_arg) { + list_ = value_arg ? std::optional(*value_arg) : std::nullopt; + } -void AllNullableTypes::set_list(const EncodableList& value_arg) { - list_ = value_arg; -} + void AllNullableTypes::set_list(const EncodableList& value_arg) { + list_ = value_arg; + } -const EncodableList* AllNullableTypes::string_list() const { - return string_list_ ? &(*string_list_) : nullptr; -} + const EncodableList* AllNullableTypes::string_list() const { + return string_list_ ? &(*string_list_) : nullptr; + } -void AllNullableTypes::set_string_list(const EncodableList* value_arg) { - string_list_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} + void AllNullableTypes::set_string_list(const EncodableList* value_arg) { + string_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; + } -void AllNullableTypes::set_string_list(const EncodableList& value_arg) { - string_list_ = value_arg; -} + void AllNullableTypes::set_string_list(const EncodableList& value_arg) { + string_list_ = value_arg; + } -const EncodableList* AllNullableTypes::int_list() const { - return int_list_ ? &(*int_list_) : nullptr; -} + const EncodableList* AllNullableTypes::int_list() const { + return int_list_ ? &(*int_list_) : nullptr; + } -void AllNullableTypes::set_int_list(const EncodableList* value_arg) { - int_list_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} + void AllNullableTypes::set_int_list(const EncodableList* value_arg) { + int_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; + } -void AllNullableTypes::set_int_list(const EncodableList& value_arg) { - int_list_ = value_arg; -} + void AllNullableTypes::set_int_list(const EncodableList& value_arg) { + int_list_ = value_arg; + } -const EncodableList* AllNullableTypes::double_list() const { - return double_list_ ? &(*double_list_) : nullptr; -} + const EncodableList* AllNullableTypes::double_list() const { + return double_list_ ? &(*double_list_) : nullptr; + } -void AllNullableTypes::set_double_list(const EncodableList* value_arg) { - double_list_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} + void AllNullableTypes::set_double_list(const EncodableList* value_arg) { + double_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; + } -void AllNullableTypes::set_double_list(const EncodableList& value_arg) { - double_list_ = value_arg; -} + void AllNullableTypes::set_double_list(const EncodableList& value_arg) { + double_list_ = value_arg; + } -const EncodableList* AllNullableTypes::bool_list() const { - return bool_list_ ? &(*bool_list_) : nullptr; -} + const EncodableList* AllNullableTypes::bool_list() const { + return bool_list_ ? &(*bool_list_) : nullptr; + } -void AllNullableTypes::set_bool_list(const EncodableList* value_arg) { - bool_list_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} + void AllNullableTypes::set_bool_list(const EncodableList* value_arg) { + bool_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; + } -void AllNullableTypes::set_bool_list(const EncodableList& value_arg) { - bool_list_ = value_arg; -} + void AllNullableTypes::set_bool_list(const EncodableList& value_arg) { + bool_list_ = value_arg; + } -const EncodableList* AllNullableTypes::enum_list() const { - return enum_list_ ? &(*enum_list_) : nullptr; -} + const EncodableList* AllNullableTypes::enum_list() const { + return enum_list_ ? &(*enum_list_) : nullptr; + } -void AllNullableTypes::set_enum_list(const EncodableList* value_arg) { - enum_list_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} + void AllNullableTypes::set_enum_list(const EncodableList* value_arg) { + enum_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; + } -void AllNullableTypes::set_enum_list(const EncodableList& value_arg) { - enum_list_ = value_arg; -} + void AllNullableTypes::set_enum_list(const EncodableList& value_arg) { + enum_list_ = value_arg; + } -const EncodableList* AllNullableTypes::object_list() const { - return object_list_ ? &(*object_list_) : nullptr; -} + const EncodableList* AllNullableTypes::object_list() const { + return object_list_ ? &(*object_list_) : nullptr; + } -void AllNullableTypes::set_object_list(const EncodableList* value_arg) { - object_list_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} + void AllNullableTypes::set_object_list(const EncodableList* value_arg) { + object_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; + } -void AllNullableTypes::set_object_list(const EncodableList& value_arg) { - object_list_ = value_arg; -} + void AllNullableTypes::set_object_list(const EncodableList& value_arg) { + object_list_ = value_arg; + } -const EncodableList* AllNullableTypes::list_list() const { - return list_list_ ? &(*list_list_) : nullptr; -} + const EncodableList* AllNullableTypes::list_list() const { + return list_list_ ? &(*list_list_) : nullptr; + } -void AllNullableTypes::set_list_list(const EncodableList* value_arg) { - list_list_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} + void AllNullableTypes::set_list_list(const EncodableList* value_arg) { + list_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; + } -void AllNullableTypes::set_list_list(const EncodableList& value_arg) { - list_list_ = value_arg; -} + void AllNullableTypes::set_list_list(const EncodableList& value_arg) { + list_list_ = value_arg; + } -const EncodableList* AllNullableTypes::map_list() const { - return map_list_ ? &(*map_list_) : nullptr; -} + const EncodableList* AllNullableTypes::map_list() const { + return map_list_ ? &(*map_list_) : nullptr; + } -void AllNullableTypes::set_map_list(const EncodableList* value_arg) { - map_list_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} + void AllNullableTypes::set_map_list(const EncodableList* value_arg) { + map_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; + } -void AllNullableTypes::set_map_list(const EncodableList& value_arg) { - map_list_ = value_arg; -} + void AllNullableTypes::set_map_list(const EncodableList& value_arg) { + map_list_ = value_arg; + } -const EncodableList* AllNullableTypes::recursive_class_list() const { - return recursive_class_list_ ? &(*recursive_class_list_) : nullptr; -} + const EncodableList* AllNullableTypes::recursive_class_list() const { + return recursive_class_list_ ? &(*recursive_class_list_) : nullptr; + } -void AllNullableTypes::set_recursive_class_list( - const EncodableList* value_arg) { - recursive_class_list_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} + void AllNullableTypes::set_recursive_class_list( + const EncodableList* value_arg) { + recursive_class_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; + } -void AllNullableTypes::set_recursive_class_list( - const EncodableList& value_arg) { - recursive_class_list_ = value_arg; -} + void AllNullableTypes::set_recursive_class_list( + const EncodableList& value_arg) { + recursive_class_list_ = value_arg; + } -const EncodableMap* AllNullableTypes::map() const { - return map_ ? &(*map_) : nullptr; -} + const EncodableMap* AllNullableTypes::map() const { + return map_ ? &(*map_) : nullptr; + } -void AllNullableTypes::set_map(const EncodableMap* value_arg) { - map_ = value_arg ? std::optional(*value_arg) : std::nullopt; -} + void AllNullableTypes::set_map(const EncodableMap* value_arg) { + map_ = value_arg ? std::optional(*value_arg) : std::nullopt; + } -void AllNullableTypes::set_map(const EncodableMap& value_arg) { - map_ = value_arg; -} + void AllNullableTypes::set_map(const EncodableMap& value_arg) { + map_ = value_arg; + } -const EncodableMap* AllNullableTypes::string_map() const { - return string_map_ ? &(*string_map_) : nullptr; -} - -void AllNullableTypes::set_string_map(const EncodableMap* value_arg) { - string_map_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} - -void AllNullableTypes::set_string_map(const EncodableMap& value_arg) { - string_map_ = value_arg; -} - -const EncodableMap* AllNullableTypes::int_map() const { - return int_map_ ? &(*int_map_) : nullptr; -} - -void AllNullableTypes::set_int_map(const EncodableMap* value_arg) { - int_map_ = value_arg ? std::optional(*value_arg) : std::nullopt; -} - -void AllNullableTypes::set_int_map(const EncodableMap& value_arg) { - int_map_ = value_arg; -} - -const EncodableMap* AllNullableTypes::enum_map() const { - return enum_map_ ? &(*enum_map_) : nullptr; -} - -void AllNullableTypes::set_enum_map(const EncodableMap* value_arg) { - enum_map_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} - -void AllNullableTypes::set_enum_map(const EncodableMap& value_arg) { - enum_map_ = value_arg; -} - -const EncodableMap* AllNullableTypes::object_map() const { - return object_map_ ? &(*object_map_) : nullptr; -} - -void AllNullableTypes::set_object_map(const EncodableMap* value_arg) { - object_map_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} - -void AllNullableTypes::set_object_map(const EncodableMap& value_arg) { - object_map_ = value_arg; -} - -const EncodableMap* AllNullableTypes::list_map() const { - return list_map_ ? &(*list_map_) : nullptr; -} - -void AllNullableTypes::set_list_map(const EncodableMap* value_arg) { - list_map_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} - -void AllNullableTypes::set_list_map(const EncodableMap& value_arg) { - list_map_ = value_arg; -} - -const EncodableMap* AllNullableTypes::map_map() const { - return map_map_ ? &(*map_map_) : nullptr; -} - -void AllNullableTypes::set_map_map(const EncodableMap* value_arg) { - map_map_ = value_arg ? std::optional(*value_arg) : std::nullopt; -} - -void AllNullableTypes::set_map_map(const EncodableMap& value_arg) { - map_map_ = value_arg; -} - -const EncodableMap* AllNullableTypes::recursive_class_map() const { - return recursive_class_map_ ? &(*recursive_class_map_) : nullptr; -} - -void AllNullableTypes::set_recursive_class_map(const EncodableMap* value_arg) { - recursive_class_map_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} - -void AllNullableTypes::set_recursive_class_map(const EncodableMap& value_arg) { - recursive_class_map_ = value_arg; -} - -EncodableList AllNullableTypes::ToEncodableList() const { - EncodableList list; - list.reserve(31); - list.push_back(a_nullable_bool_ ? EncodableValue(*a_nullable_bool_) - : EncodableValue()); - list.push_back(a_nullable_int_ ? EncodableValue(*a_nullable_int_) - : EncodableValue()); - list.push_back(a_nullable_int64_ ? EncodableValue(*a_nullable_int64_) - : EncodableValue()); - list.push_back(a_nullable_double_ ? EncodableValue(*a_nullable_double_) - : EncodableValue()); - list.push_back(a_nullable_byte_array_ - ? EncodableValue(*a_nullable_byte_array_) - : EncodableValue()); - list.push_back(a_nullable4_byte_array_ - ? EncodableValue(*a_nullable4_byte_array_) - : EncodableValue()); - list.push_back(a_nullable8_byte_array_ - ? EncodableValue(*a_nullable8_byte_array_) - : EncodableValue()); - list.push_back(a_nullable_float_array_ - ? EncodableValue(*a_nullable_float_array_) - : EncodableValue()); - list.push_back(a_nullable_enum_ ? CustomEncodableValue(*a_nullable_enum_) - : EncodableValue()); - list.push_back(another_nullable_enum_ - ? CustomEncodableValue(*another_nullable_enum_) - : EncodableValue()); - list.push_back(a_nullable_string_ ? EncodableValue(*a_nullable_string_) - : EncodableValue()); - list.push_back(a_nullable_object_ ? *a_nullable_object_ : EncodableValue()); - list.push_back(all_nullable_types_ - ? CustomEncodableValue(*all_nullable_types_) - : EncodableValue()); - list.push_back(list_ ? EncodableValue(*list_) : EncodableValue()); - list.push_back(string_list_ ? EncodableValue(*string_list_) - : EncodableValue()); - list.push_back(int_list_ ? EncodableValue(*int_list_) : EncodableValue()); - list.push_back(double_list_ ? EncodableValue(*double_list_) - : EncodableValue()); - list.push_back(bool_list_ ? EncodableValue(*bool_list_) : EncodableValue()); - list.push_back(enum_list_ ? EncodableValue(*enum_list_) : EncodableValue()); - list.push_back(object_list_ ? EncodableValue(*object_list_) - : EncodableValue()); - list.push_back(list_list_ ? EncodableValue(*list_list_) : EncodableValue()); - list.push_back(map_list_ ? EncodableValue(*map_list_) : EncodableValue()); - list.push_back(recursive_class_list_ ? EncodableValue(*recursive_class_list_) - : EncodableValue()); - list.push_back(map_ ? EncodableValue(*map_) : EncodableValue()); - list.push_back(string_map_ ? EncodableValue(*string_map_) : EncodableValue()); - list.push_back(int_map_ ? EncodableValue(*int_map_) : EncodableValue()); - list.push_back(enum_map_ ? EncodableValue(*enum_map_) : EncodableValue()); - list.push_back(object_map_ ? EncodableValue(*object_map_) : EncodableValue()); - list.push_back(list_map_ ? EncodableValue(*list_map_) : EncodableValue()); - list.push_back(map_map_ ? EncodableValue(*map_map_) : EncodableValue()); - list.push_back(recursive_class_map_ ? EncodableValue(*recursive_class_map_) - : EncodableValue()); - return list; -} - -AllNullableTypes AllNullableTypes::FromEncodableList( - const EncodableList& list) { - AllNullableTypes decoded; - auto& encodable_a_nullable_bool = list[0]; - if (!encodable_a_nullable_bool.IsNull()) { - decoded.set_a_nullable_bool(std::get(encodable_a_nullable_bool)); - } - auto& encodable_a_nullable_int = list[1]; - if (!encodable_a_nullable_int.IsNull()) { - decoded.set_a_nullable_int(std::get(encodable_a_nullable_int)); - } - auto& encodable_a_nullable_int64 = list[2]; - if (!encodable_a_nullable_int64.IsNull()) { - decoded.set_a_nullable_int64(std::get(encodable_a_nullable_int64)); - } - auto& encodable_a_nullable_double = list[3]; - if (!encodable_a_nullable_double.IsNull()) { - decoded.set_a_nullable_double( - std::get(encodable_a_nullable_double)); - } - auto& encodable_a_nullable_byte_array = list[4]; - if (!encodable_a_nullable_byte_array.IsNull()) { - decoded.set_a_nullable_byte_array( - std::get>(encodable_a_nullable_byte_array)); - } - auto& encodable_a_nullable4_byte_array = list[5]; - if (!encodable_a_nullable4_byte_array.IsNull()) { - decoded.set_a_nullable4_byte_array( - std::get>(encodable_a_nullable4_byte_array)); - } - auto& encodable_a_nullable8_byte_array = list[6]; - if (!encodable_a_nullable8_byte_array.IsNull()) { - decoded.set_a_nullable8_byte_array( - std::get>(encodable_a_nullable8_byte_array)); - } - auto& encodable_a_nullable_float_array = list[7]; - if (!encodable_a_nullable_float_array.IsNull()) { - decoded.set_a_nullable_float_array( - std::get>(encodable_a_nullable_float_array)); - } - auto& encodable_a_nullable_enum = list[8]; - if (!encodable_a_nullable_enum.IsNull()) { - decoded.set_a_nullable_enum(std::any_cast( - std::get(encodable_a_nullable_enum))); - } - auto& encodable_another_nullable_enum = list[9]; - if (!encodable_another_nullable_enum.IsNull()) { - decoded.set_another_nullable_enum(std::any_cast( - std::get(encodable_another_nullable_enum))); - } - auto& encodable_a_nullable_string = list[10]; - if (!encodable_a_nullable_string.IsNull()) { - decoded.set_a_nullable_string( - std::get(encodable_a_nullable_string)); - } - auto& encodable_a_nullable_object = list[11]; - if (!encodable_a_nullable_object.IsNull()) { - decoded.set_a_nullable_object(encodable_a_nullable_object); - } - auto& encodable_all_nullable_types = list[12]; - if (!encodable_all_nullable_types.IsNull()) { - decoded.set_all_nullable_types(std::any_cast( - std::get(encodable_all_nullable_types))); - } - auto& encodable_list = list[13]; - if (!encodable_list.IsNull()) { - decoded.set_list(std::get(encodable_list)); - } - auto& encodable_string_list = list[14]; - if (!encodable_string_list.IsNull()) { - decoded.set_string_list(std::get(encodable_string_list)); - } - auto& encodable_int_list = list[15]; - if (!encodable_int_list.IsNull()) { - decoded.set_int_list(std::get(encodable_int_list)); - } - auto& encodable_double_list = list[16]; - if (!encodable_double_list.IsNull()) { - decoded.set_double_list(std::get(encodable_double_list)); - } - auto& encodable_bool_list = list[17]; - if (!encodable_bool_list.IsNull()) { - decoded.set_bool_list(std::get(encodable_bool_list)); - } - auto& encodable_enum_list = list[18]; - if (!encodable_enum_list.IsNull()) { - decoded.set_enum_list(std::get(encodable_enum_list)); - } - auto& encodable_object_list = list[19]; - if (!encodable_object_list.IsNull()) { - decoded.set_object_list(std::get(encodable_object_list)); - } - auto& encodable_list_list = list[20]; - if (!encodable_list_list.IsNull()) { - decoded.set_list_list(std::get(encodable_list_list)); - } - auto& encodable_map_list = list[21]; - if (!encodable_map_list.IsNull()) { - decoded.set_map_list(std::get(encodable_map_list)); - } - auto& encodable_recursive_class_list = list[22]; - if (!encodable_recursive_class_list.IsNull()) { - decoded.set_recursive_class_list( - std::get(encodable_recursive_class_list)); - } - auto& encodable_map = list[23]; - if (!encodable_map.IsNull()) { - decoded.set_map(std::get(encodable_map)); - } - auto& encodable_string_map = list[24]; - if (!encodable_string_map.IsNull()) { - decoded.set_string_map(std::get(encodable_string_map)); - } - auto& encodable_int_map = list[25]; - if (!encodable_int_map.IsNull()) { - decoded.set_int_map(std::get(encodable_int_map)); - } - auto& encodable_enum_map = list[26]; - if (!encodable_enum_map.IsNull()) { - decoded.set_enum_map(std::get(encodable_enum_map)); - } - auto& encodable_object_map = list[27]; - if (!encodable_object_map.IsNull()) { - decoded.set_object_map(std::get(encodable_object_map)); - } - auto& encodable_list_map = list[28]; - if (!encodable_list_map.IsNull()) { - decoded.set_list_map(std::get(encodable_list_map)); - } - auto& encodable_map_map = list[29]; - if (!encodable_map_map.IsNull()) { - decoded.set_map_map(std::get(encodable_map_map)); - } - auto& encodable_recursive_class_map = list[30]; - if (!encodable_recursive_class_map.IsNull()) { - decoded.set_recursive_class_map( - std::get(encodable_recursive_class_map)); - } - return decoded; -} - -bool AllNullableTypes::operator==(const AllNullableTypes& other) const { - return PigeonInternalDeepEquals(a_nullable_bool_, other.a_nullable_bool_) && - PigeonInternalDeepEquals(a_nullable_int_, other.a_nullable_int_) && - PigeonInternalDeepEquals(a_nullable_int64_, other.a_nullable_int64_) && - PigeonInternalDeepEquals(a_nullable_double_, - other.a_nullable_double_) && - PigeonInternalDeepEquals(a_nullable_byte_array_, - other.a_nullable_byte_array_) && - PigeonInternalDeepEquals(a_nullable4_byte_array_, - other.a_nullable4_byte_array_) && - PigeonInternalDeepEquals(a_nullable8_byte_array_, - other.a_nullable8_byte_array_) && - PigeonInternalDeepEquals(a_nullable_float_array_, - other.a_nullable_float_array_) && - PigeonInternalDeepEquals(a_nullable_enum_, other.a_nullable_enum_) && - PigeonInternalDeepEquals(another_nullable_enum_, - other.another_nullable_enum_) && - PigeonInternalDeepEquals(a_nullable_string_, - other.a_nullable_string_) && - PigeonInternalDeepEquals(a_nullable_object_, - other.a_nullable_object_) && - PigeonInternalDeepEquals(all_nullable_types_, - other.all_nullable_types_) && - PigeonInternalDeepEquals(list_, other.list_) && - PigeonInternalDeepEquals(string_list_, other.string_list_) && - PigeonInternalDeepEquals(int_list_, other.int_list_) && - PigeonInternalDeepEquals(double_list_, other.double_list_) && - PigeonInternalDeepEquals(bool_list_, other.bool_list_) && - PigeonInternalDeepEquals(enum_list_, other.enum_list_) && - PigeonInternalDeepEquals(object_list_, other.object_list_) && - PigeonInternalDeepEquals(list_list_, other.list_list_) && - PigeonInternalDeepEquals(map_list_, other.map_list_) && - PigeonInternalDeepEquals(recursive_class_list_, - other.recursive_class_list_) && - PigeonInternalDeepEquals(map_, other.map_) && - PigeonInternalDeepEquals(string_map_, other.string_map_) && - PigeonInternalDeepEquals(int_map_, other.int_map_) && - PigeonInternalDeepEquals(enum_map_, other.enum_map_) && - PigeonInternalDeepEquals(object_map_, other.object_map_) && - PigeonInternalDeepEquals(list_map_, other.list_map_) && - PigeonInternalDeepEquals(map_map_, other.map_map_) && - PigeonInternalDeepEquals(recursive_class_map_, - other.recursive_class_map_); -} - -bool AllNullableTypes::operator!=(const AllNullableTypes& other) const { - return !(*this == other); -} - -size_t AllNullableTypes::Hash() const { - size_t result = 1; - result = result * 31 + PigeonInternalDeepHash(a_nullable_bool_); - result = result * 31 + PigeonInternalDeepHash(a_nullable_int_); - result = result * 31 + PigeonInternalDeepHash(a_nullable_int64_); - result = result * 31 + PigeonInternalDeepHash(a_nullable_double_); - result = result * 31 + PigeonInternalDeepHash(a_nullable_byte_array_); - result = result * 31 + PigeonInternalDeepHash(a_nullable4_byte_array_); - result = result * 31 + PigeonInternalDeepHash(a_nullable8_byte_array_); - result = result * 31 + PigeonInternalDeepHash(a_nullable_float_array_); - result = result * 31 + PigeonInternalDeepHash(a_nullable_enum_); - result = result * 31 + PigeonInternalDeepHash(another_nullable_enum_); - result = result * 31 + PigeonInternalDeepHash(a_nullable_string_); - result = result * 31 + PigeonInternalDeepHash(a_nullable_object_); - result = result * 31 + PigeonInternalDeepHash(all_nullable_types_); - result = result * 31 + PigeonInternalDeepHash(list_); - result = result * 31 + PigeonInternalDeepHash(string_list_); - result = result * 31 + PigeonInternalDeepHash(int_list_); - result = result * 31 + PigeonInternalDeepHash(double_list_); - result = result * 31 + PigeonInternalDeepHash(bool_list_); - result = result * 31 + PigeonInternalDeepHash(enum_list_); - result = result * 31 + PigeonInternalDeepHash(object_list_); - result = result * 31 + PigeonInternalDeepHash(list_list_); - result = result * 31 + PigeonInternalDeepHash(map_list_); - result = result * 31 + PigeonInternalDeepHash(recursive_class_list_); - result = result * 31 + PigeonInternalDeepHash(map_); - result = result * 31 + PigeonInternalDeepHash(string_map_); - result = result * 31 + PigeonInternalDeepHash(int_map_); - result = result * 31 + PigeonInternalDeepHash(enum_map_); - result = result * 31 + PigeonInternalDeepHash(object_map_); - result = result * 31 + PigeonInternalDeepHash(list_map_); - result = result * 31 + PigeonInternalDeepHash(map_map_); - result = result * 31 + PigeonInternalDeepHash(recursive_class_map_); - return result; -} - -size_t PigeonInternalDeepHash(const AllNullableTypes& v) { return v.Hash(); } - -// AllNullableTypesWithoutRecursion - -AllNullableTypesWithoutRecursion::AllNullableTypesWithoutRecursion() {} - -AllNullableTypesWithoutRecursion::AllNullableTypesWithoutRecursion( - const bool* a_nullable_bool, const int64_t* a_nullable_int, - const int64_t* a_nullable_int64, const double* a_nullable_double, - const std::vector* a_nullable_byte_array, - const std::vector* a_nullable4_byte_array, - const std::vector* a_nullable8_byte_array, - const std::vector* a_nullable_float_array, - const AnEnum* a_nullable_enum, const AnotherEnum* another_nullable_enum, - const std::string* a_nullable_string, - const EncodableValue* a_nullable_object, const EncodableList* list, - const EncodableList* string_list, const EncodableList* int_list, - const EncodableList* double_list, const EncodableList* bool_list, - const EncodableList* enum_list, const EncodableList* object_list, - const EncodableList* list_list, const EncodableList* map_list, - const EncodableMap* map, const EncodableMap* string_map, - const EncodableMap* int_map, const EncodableMap* enum_map, - const EncodableMap* object_map, const EncodableMap* list_map, - const EncodableMap* map_map) - : a_nullable_bool_(a_nullable_bool ? std::optional(*a_nullable_bool) - : std::nullopt), - a_nullable_int_(a_nullable_int ? std::optional(*a_nullable_int) - : std::nullopt), - a_nullable_int64_(a_nullable_int64 - ? std::optional(*a_nullable_int64) - : std::nullopt), - a_nullable_double_(a_nullable_double - ? std::optional(*a_nullable_double) - : std::nullopt), - a_nullable_byte_array_( - a_nullable_byte_array - ? std::optional>(*a_nullable_byte_array) - : std::nullopt), - a_nullable4_byte_array_( - a_nullable4_byte_array - ? std::optional>(*a_nullable4_byte_array) - : std::nullopt), - a_nullable8_byte_array_( - a_nullable8_byte_array - ? std::optional>(*a_nullable8_byte_array) - : std::nullopt), - a_nullable_float_array_( - a_nullable_float_array - ? std::optional>(*a_nullable_float_array) - : std::nullopt), - a_nullable_enum_(a_nullable_enum ? std::optional(*a_nullable_enum) - : std::nullopt), - another_nullable_enum_(another_nullable_enum ? std::optional( - *another_nullable_enum) - : std::nullopt), - a_nullable_string_(a_nullable_string - ? std::optional(*a_nullable_string) - : std::nullopt), - a_nullable_object_(a_nullable_object - ? std::optional(*a_nullable_object) - : std::nullopt), - list_(list ? std::optional(*list) : std::nullopt), - string_list_(string_list ? std::optional(*string_list) - : std::nullopt), - int_list_(int_list ? std::optional(*int_list) - : std::nullopt), - double_list_(double_list ? std::optional(*double_list) - : std::nullopt), - bool_list_(bool_list ? std::optional(*bool_list) - : std::nullopt), - enum_list_(enum_list ? std::optional(*enum_list) - : std::nullopt), - object_list_(object_list ? std::optional(*object_list) - : std::nullopt), - list_list_(list_list ? std::optional(*list_list) - : std::nullopt), - map_list_(map_list ? std::optional(*map_list) - : std::nullopt), - map_(map ? std::optional(*map) : std::nullopt), - string_map_(string_map ? std::optional(*string_map) - : std::nullopt), - int_map_(int_map ? std::optional(*int_map) : std::nullopt), - enum_map_(enum_map ? std::optional(*enum_map) - : std::nullopt), - object_map_(object_map ? std::optional(*object_map) - : std::nullopt), - list_map_(list_map ? std::optional(*list_map) - : std::nullopt), - map_map_(map_map ? std::optional(*map_map) : std::nullopt) { -} - -const bool* AllNullableTypesWithoutRecursion::a_nullable_bool() const { - return a_nullable_bool_ ? &(*a_nullable_bool_) : nullptr; -} - -void AllNullableTypesWithoutRecursion::set_a_nullable_bool( - const bool* value_arg) { - a_nullable_bool_ = value_arg ? std::optional(*value_arg) : std::nullopt; -} - -void AllNullableTypesWithoutRecursion::set_a_nullable_bool(bool value_arg) { - a_nullable_bool_ = value_arg; -} - -const int64_t* AllNullableTypesWithoutRecursion::a_nullable_int() const { - return a_nullable_int_ ? &(*a_nullable_int_) : nullptr; -} - -void AllNullableTypesWithoutRecursion::set_a_nullable_int( - const int64_t* value_arg) { - a_nullable_int_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} - -void AllNullableTypesWithoutRecursion::set_a_nullable_int(int64_t value_arg) { - a_nullable_int_ = value_arg; -} - -const int64_t* AllNullableTypesWithoutRecursion::a_nullable_int64() const { - return a_nullable_int64_ ? &(*a_nullable_int64_) : nullptr; -} - -void AllNullableTypesWithoutRecursion::set_a_nullable_int64( - const int64_t* value_arg) { - a_nullable_int64_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} - -void AllNullableTypesWithoutRecursion::set_a_nullable_int64(int64_t value_arg) { - a_nullable_int64_ = value_arg; -} - -const double* AllNullableTypesWithoutRecursion::a_nullable_double() const { - return a_nullable_double_ ? &(*a_nullable_double_) : nullptr; -} - -void AllNullableTypesWithoutRecursion::set_a_nullable_double( - const double* value_arg) { - a_nullable_double_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} - -void AllNullableTypesWithoutRecursion::set_a_nullable_double(double value_arg) { - a_nullable_double_ = value_arg; -} - -const std::vector* -AllNullableTypesWithoutRecursion::a_nullable_byte_array() const { - return a_nullable_byte_array_ ? &(*a_nullable_byte_array_) : nullptr; -} - -void AllNullableTypesWithoutRecursion::set_a_nullable_byte_array( - const std::vector* value_arg) { - a_nullable_byte_array_ = value_arg - ? std::optional>(*value_arg) - : std::nullopt; -} - -void AllNullableTypesWithoutRecursion::set_a_nullable_byte_array( - const std::vector& value_arg) { - a_nullable_byte_array_ = value_arg; -} - -const std::vector* -AllNullableTypesWithoutRecursion::a_nullable4_byte_array() const { - return a_nullable4_byte_array_ ? &(*a_nullable4_byte_array_) : nullptr; -} - -void AllNullableTypesWithoutRecursion::set_a_nullable4_byte_array( - const std::vector* value_arg) { - a_nullable4_byte_array_ = - value_arg ? std::optional>(*value_arg) - : std::nullopt; -} - -void AllNullableTypesWithoutRecursion::set_a_nullable4_byte_array( - const std::vector& value_arg) { - a_nullable4_byte_array_ = value_arg; -} - -const std::vector* -AllNullableTypesWithoutRecursion::a_nullable8_byte_array() const { - return a_nullable8_byte_array_ ? &(*a_nullable8_byte_array_) : nullptr; -} - -void AllNullableTypesWithoutRecursion::set_a_nullable8_byte_array( - const std::vector* value_arg) { - a_nullable8_byte_array_ = - value_arg ? std::optional>(*value_arg) - : std::nullopt; -} - -void AllNullableTypesWithoutRecursion::set_a_nullable8_byte_array( - const std::vector& value_arg) { - a_nullable8_byte_array_ = value_arg; -} - -const std::vector* -AllNullableTypesWithoutRecursion::a_nullable_float_array() const { - return a_nullable_float_array_ ? &(*a_nullable_float_array_) : nullptr; -} - -void AllNullableTypesWithoutRecursion::set_a_nullable_float_array( - const std::vector* value_arg) { - a_nullable_float_array_ = - value_arg ? std::optional>(*value_arg) : std::nullopt; -} - -void AllNullableTypesWithoutRecursion::set_a_nullable_float_array( - const std::vector& value_arg) { - a_nullable_float_array_ = value_arg; -} - -const AnEnum* AllNullableTypesWithoutRecursion::a_nullable_enum() const { - return a_nullable_enum_ ? &(*a_nullable_enum_) : nullptr; -} - -void AllNullableTypesWithoutRecursion::set_a_nullable_enum( - const AnEnum* value_arg) { - a_nullable_enum_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} - -void AllNullableTypesWithoutRecursion::set_a_nullable_enum( - const AnEnum& value_arg) { - a_nullable_enum_ = value_arg; -} - -const AnotherEnum* AllNullableTypesWithoutRecursion::another_nullable_enum() - const { - return another_nullable_enum_ ? &(*another_nullable_enum_) : nullptr; -} - -void AllNullableTypesWithoutRecursion::set_another_nullable_enum( - const AnotherEnum* value_arg) { - another_nullable_enum_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} - -void AllNullableTypesWithoutRecursion::set_another_nullable_enum( - const AnotherEnum& value_arg) { - another_nullable_enum_ = value_arg; -} - -const std::string* AllNullableTypesWithoutRecursion::a_nullable_string() const { - return a_nullable_string_ ? &(*a_nullable_string_) : nullptr; -} - -void AllNullableTypesWithoutRecursion::set_a_nullable_string( - const std::string_view* value_arg) { - a_nullable_string_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} - -void AllNullableTypesWithoutRecursion::set_a_nullable_string( - std::string_view value_arg) { - a_nullable_string_ = value_arg; -} - -const EncodableValue* AllNullableTypesWithoutRecursion::a_nullable_object() - const { - return a_nullable_object_ ? &(*a_nullable_object_) : nullptr; -} - -void AllNullableTypesWithoutRecursion::set_a_nullable_object( - const EncodableValue* value_arg) { - a_nullable_object_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} - -void AllNullableTypesWithoutRecursion::set_a_nullable_object( - const EncodableValue& value_arg) { - a_nullable_object_ = value_arg; -} - -const EncodableList* AllNullableTypesWithoutRecursion::list() const { - return list_ ? &(*list_) : nullptr; -} - -void AllNullableTypesWithoutRecursion::set_list( - const EncodableList* value_arg) { - list_ = value_arg ? std::optional(*value_arg) : std::nullopt; -} - -void AllNullableTypesWithoutRecursion::set_list( - const EncodableList& value_arg) { - list_ = value_arg; -} - -const EncodableList* AllNullableTypesWithoutRecursion::string_list() const { - return string_list_ ? &(*string_list_) : nullptr; -} - -void AllNullableTypesWithoutRecursion::set_string_list( - const EncodableList* value_arg) { - string_list_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} - -void AllNullableTypesWithoutRecursion::set_string_list( - const EncodableList& value_arg) { - string_list_ = value_arg; -} - -const EncodableList* AllNullableTypesWithoutRecursion::int_list() const { - return int_list_ ? &(*int_list_) : nullptr; -} - -void AllNullableTypesWithoutRecursion::set_int_list( - const EncodableList* value_arg) { - int_list_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} - -void AllNullableTypesWithoutRecursion::set_int_list( - const EncodableList& value_arg) { - int_list_ = value_arg; -} - -const EncodableList* AllNullableTypesWithoutRecursion::double_list() const { - return double_list_ ? &(*double_list_) : nullptr; -} - -void AllNullableTypesWithoutRecursion::set_double_list( - const EncodableList* value_arg) { - double_list_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} - -void AllNullableTypesWithoutRecursion::set_double_list( - const EncodableList& value_arg) { - double_list_ = value_arg; -} - -const EncodableList* AllNullableTypesWithoutRecursion::bool_list() const { - return bool_list_ ? &(*bool_list_) : nullptr; -} - -void AllNullableTypesWithoutRecursion::set_bool_list( - const EncodableList* value_arg) { - bool_list_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} - -void AllNullableTypesWithoutRecursion::set_bool_list( - const EncodableList& value_arg) { - bool_list_ = value_arg; -} - -const EncodableList* AllNullableTypesWithoutRecursion::enum_list() const { - return enum_list_ ? &(*enum_list_) : nullptr; -} - -void AllNullableTypesWithoutRecursion::set_enum_list( - const EncodableList* value_arg) { - enum_list_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} - -void AllNullableTypesWithoutRecursion::set_enum_list( - const EncodableList& value_arg) { - enum_list_ = value_arg; -} - -const EncodableList* AllNullableTypesWithoutRecursion::object_list() const { - return object_list_ ? &(*object_list_) : nullptr; -} - -void AllNullableTypesWithoutRecursion::set_object_list( - const EncodableList* value_arg) { - object_list_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} - -void AllNullableTypesWithoutRecursion::set_object_list( - const EncodableList& value_arg) { - object_list_ = value_arg; -} - -const EncodableList* AllNullableTypesWithoutRecursion::list_list() const { - return list_list_ ? &(*list_list_) : nullptr; -} - -void AllNullableTypesWithoutRecursion::set_list_list( - const EncodableList* value_arg) { - list_list_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} - -void AllNullableTypesWithoutRecursion::set_list_list( - const EncodableList& value_arg) { - list_list_ = value_arg; -} - -const EncodableList* AllNullableTypesWithoutRecursion::map_list() const { - return map_list_ ? &(*map_list_) : nullptr; -} - -void AllNullableTypesWithoutRecursion::set_map_list( - const EncodableList* value_arg) { - map_list_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} - -void AllNullableTypesWithoutRecursion::set_map_list( - const EncodableList& value_arg) { - map_list_ = value_arg; -} - -const EncodableMap* AllNullableTypesWithoutRecursion::map() const { - return map_ ? &(*map_) : nullptr; -} - -void AllNullableTypesWithoutRecursion::set_map(const EncodableMap* value_arg) { - map_ = value_arg ? std::optional(*value_arg) : std::nullopt; -} - -void AllNullableTypesWithoutRecursion::set_map(const EncodableMap& value_arg) { - map_ = value_arg; -} - -const EncodableMap* AllNullableTypesWithoutRecursion::string_map() const { - return string_map_ ? &(*string_map_) : nullptr; -} - -void AllNullableTypesWithoutRecursion::set_string_map( - const EncodableMap* value_arg) { - string_map_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} - -void AllNullableTypesWithoutRecursion::set_string_map( - const EncodableMap& value_arg) { - string_map_ = value_arg; -} - -const EncodableMap* AllNullableTypesWithoutRecursion::int_map() const { - return int_map_ ? &(*int_map_) : nullptr; -} - -void AllNullableTypesWithoutRecursion::set_int_map( - const EncodableMap* value_arg) { - int_map_ = value_arg ? std::optional(*value_arg) : std::nullopt; -} - -void AllNullableTypesWithoutRecursion::set_int_map( - const EncodableMap& value_arg) { - int_map_ = value_arg; -} - -const EncodableMap* AllNullableTypesWithoutRecursion::enum_map() const { - return enum_map_ ? &(*enum_map_) : nullptr; -} - -void AllNullableTypesWithoutRecursion::set_enum_map( - const EncodableMap* value_arg) { - enum_map_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} - -void AllNullableTypesWithoutRecursion::set_enum_map( - const EncodableMap& value_arg) { - enum_map_ = value_arg; -} - -const EncodableMap* AllNullableTypesWithoutRecursion::object_map() const { - return object_map_ ? &(*object_map_) : nullptr; -} - -void AllNullableTypesWithoutRecursion::set_object_map( - const EncodableMap* value_arg) { - object_map_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} - -void AllNullableTypesWithoutRecursion::set_object_map( - const EncodableMap& value_arg) { - object_map_ = value_arg; -} - -const EncodableMap* AllNullableTypesWithoutRecursion::list_map() const { - return list_map_ ? &(*list_map_) : nullptr; -} - -void AllNullableTypesWithoutRecursion::set_list_map( - const EncodableMap* value_arg) { - list_map_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} - -void AllNullableTypesWithoutRecursion::set_list_map( - const EncodableMap& value_arg) { - list_map_ = value_arg; -} - -const EncodableMap* AllNullableTypesWithoutRecursion::map_map() const { - return map_map_ ? &(*map_map_) : nullptr; -} - -void AllNullableTypesWithoutRecursion::set_map_map( - const EncodableMap* value_arg) { - map_map_ = value_arg ? std::optional(*value_arg) : std::nullopt; -} - -void AllNullableTypesWithoutRecursion::set_map_map( - const EncodableMap& value_arg) { - map_map_ = value_arg; -} - -EncodableList AllNullableTypesWithoutRecursion::ToEncodableList() const { - EncodableList list; - list.reserve(28); - list.push_back(a_nullable_bool_ ? EncodableValue(*a_nullable_bool_) - : EncodableValue()); - list.push_back(a_nullable_int_ ? EncodableValue(*a_nullable_int_) - : EncodableValue()); - list.push_back(a_nullable_int64_ ? EncodableValue(*a_nullable_int64_) - : EncodableValue()); - list.push_back(a_nullable_double_ ? EncodableValue(*a_nullable_double_) - : EncodableValue()); - list.push_back(a_nullable_byte_array_ - ? EncodableValue(*a_nullable_byte_array_) - : EncodableValue()); - list.push_back(a_nullable4_byte_array_ - ? EncodableValue(*a_nullable4_byte_array_) - : EncodableValue()); - list.push_back(a_nullable8_byte_array_ - ? EncodableValue(*a_nullable8_byte_array_) - : EncodableValue()); - list.push_back(a_nullable_float_array_ - ? EncodableValue(*a_nullable_float_array_) - : EncodableValue()); - list.push_back(a_nullable_enum_ ? CustomEncodableValue(*a_nullable_enum_) - : EncodableValue()); - list.push_back(another_nullable_enum_ - ? CustomEncodableValue(*another_nullable_enum_) - : EncodableValue()); - list.push_back(a_nullable_string_ ? EncodableValue(*a_nullable_string_) - : EncodableValue()); - list.push_back(a_nullable_object_ ? *a_nullable_object_ : EncodableValue()); - list.push_back(list_ ? EncodableValue(*list_) : EncodableValue()); - list.push_back(string_list_ ? EncodableValue(*string_list_) - : EncodableValue()); - list.push_back(int_list_ ? EncodableValue(*int_list_) : EncodableValue()); - list.push_back(double_list_ ? EncodableValue(*double_list_) - : EncodableValue()); - list.push_back(bool_list_ ? EncodableValue(*bool_list_) : EncodableValue()); - list.push_back(enum_list_ ? EncodableValue(*enum_list_) : EncodableValue()); - list.push_back(object_list_ ? EncodableValue(*object_list_) - : EncodableValue()); - list.push_back(list_list_ ? EncodableValue(*list_list_) : EncodableValue()); - list.push_back(map_list_ ? EncodableValue(*map_list_) : EncodableValue()); - list.push_back(map_ ? EncodableValue(*map_) : EncodableValue()); - list.push_back(string_map_ ? EncodableValue(*string_map_) : EncodableValue()); - list.push_back(int_map_ ? EncodableValue(*int_map_) : EncodableValue()); - list.push_back(enum_map_ ? EncodableValue(*enum_map_) : EncodableValue()); - list.push_back(object_map_ ? EncodableValue(*object_map_) : EncodableValue()); - list.push_back(list_map_ ? EncodableValue(*list_map_) : EncodableValue()); - list.push_back(map_map_ ? EncodableValue(*map_map_) : EncodableValue()); - return list; -} - -AllNullableTypesWithoutRecursion -AllNullableTypesWithoutRecursion::FromEncodableList(const EncodableList& list) { - AllNullableTypesWithoutRecursion decoded; - auto& encodable_a_nullable_bool = list[0]; - if (!encodable_a_nullable_bool.IsNull()) { - decoded.set_a_nullable_bool(std::get(encodable_a_nullable_bool)); - } - auto& encodable_a_nullable_int = list[1]; - if (!encodable_a_nullable_int.IsNull()) { - decoded.set_a_nullable_int(std::get(encodable_a_nullable_int)); - } - auto& encodable_a_nullable_int64 = list[2]; - if (!encodable_a_nullable_int64.IsNull()) { - decoded.set_a_nullable_int64(std::get(encodable_a_nullable_int64)); - } - auto& encodable_a_nullable_double = list[3]; - if (!encodable_a_nullable_double.IsNull()) { - decoded.set_a_nullable_double( - std::get(encodable_a_nullable_double)); - } - auto& encodable_a_nullable_byte_array = list[4]; - if (!encodable_a_nullable_byte_array.IsNull()) { - decoded.set_a_nullable_byte_array( - std::get>(encodable_a_nullable_byte_array)); - } - auto& encodable_a_nullable4_byte_array = list[5]; - if (!encodable_a_nullable4_byte_array.IsNull()) { - decoded.set_a_nullable4_byte_array( - std::get>(encodable_a_nullable4_byte_array)); - } - auto& encodable_a_nullable8_byte_array = list[6]; - if (!encodable_a_nullable8_byte_array.IsNull()) { - decoded.set_a_nullable8_byte_array( - std::get>(encodable_a_nullable8_byte_array)); - } - auto& encodable_a_nullable_float_array = list[7]; - if (!encodable_a_nullable_float_array.IsNull()) { - decoded.set_a_nullable_float_array( - std::get>(encodable_a_nullable_float_array)); - } - auto& encodable_a_nullable_enum = list[8]; - if (!encodable_a_nullable_enum.IsNull()) { - decoded.set_a_nullable_enum(std::any_cast( - std::get(encodable_a_nullable_enum))); - } - auto& encodable_another_nullable_enum = list[9]; - if (!encodable_another_nullable_enum.IsNull()) { - decoded.set_another_nullable_enum(std::any_cast( - std::get(encodable_another_nullable_enum))); - } - auto& encodable_a_nullable_string = list[10]; - if (!encodable_a_nullable_string.IsNull()) { - decoded.set_a_nullable_string( - std::get(encodable_a_nullable_string)); - } - auto& encodable_a_nullable_object = list[11]; - if (!encodable_a_nullable_object.IsNull()) { - decoded.set_a_nullable_object(encodable_a_nullable_object); - } - auto& encodable_list = list[12]; - if (!encodable_list.IsNull()) { - decoded.set_list(std::get(encodable_list)); - } - auto& encodable_string_list = list[13]; - if (!encodable_string_list.IsNull()) { - decoded.set_string_list(std::get(encodable_string_list)); - } - auto& encodable_int_list = list[14]; - if (!encodable_int_list.IsNull()) { - decoded.set_int_list(std::get(encodable_int_list)); - } - auto& encodable_double_list = list[15]; - if (!encodable_double_list.IsNull()) { - decoded.set_double_list(std::get(encodable_double_list)); - } - auto& encodable_bool_list = list[16]; - if (!encodable_bool_list.IsNull()) { - decoded.set_bool_list(std::get(encodable_bool_list)); - } - auto& encodable_enum_list = list[17]; - if (!encodable_enum_list.IsNull()) { - decoded.set_enum_list(std::get(encodable_enum_list)); - } - auto& encodable_object_list = list[18]; - if (!encodable_object_list.IsNull()) { - decoded.set_object_list(std::get(encodable_object_list)); - } - auto& encodable_list_list = list[19]; - if (!encodable_list_list.IsNull()) { - decoded.set_list_list(std::get(encodable_list_list)); - } - auto& encodable_map_list = list[20]; - if (!encodable_map_list.IsNull()) { - decoded.set_map_list(std::get(encodable_map_list)); - } - auto& encodable_map = list[21]; - if (!encodable_map.IsNull()) { - decoded.set_map(std::get(encodable_map)); - } - auto& encodable_string_map = list[22]; - if (!encodable_string_map.IsNull()) { - decoded.set_string_map(std::get(encodable_string_map)); - } - auto& encodable_int_map = list[23]; - if (!encodable_int_map.IsNull()) { - decoded.set_int_map(std::get(encodable_int_map)); - } - auto& encodable_enum_map = list[24]; - if (!encodable_enum_map.IsNull()) { - decoded.set_enum_map(std::get(encodable_enum_map)); - } - auto& encodable_object_map = list[25]; - if (!encodable_object_map.IsNull()) { - decoded.set_object_map(std::get(encodable_object_map)); - } - auto& encodable_list_map = list[26]; - if (!encodable_list_map.IsNull()) { - decoded.set_list_map(std::get(encodable_list_map)); - } - auto& encodable_map_map = list[27]; - if (!encodable_map_map.IsNull()) { - decoded.set_map_map(std::get(encodable_map_map)); - } - return decoded; -} - -bool AllNullableTypesWithoutRecursion::operator==( - const AllNullableTypesWithoutRecursion& other) const { - return PigeonInternalDeepEquals(a_nullable_bool_, other.a_nullable_bool_) && - PigeonInternalDeepEquals(a_nullable_int_, other.a_nullable_int_) && - PigeonInternalDeepEquals(a_nullable_int64_, other.a_nullable_int64_) && - PigeonInternalDeepEquals(a_nullable_double_, - other.a_nullable_double_) && - PigeonInternalDeepEquals(a_nullable_byte_array_, - other.a_nullable_byte_array_) && - PigeonInternalDeepEquals(a_nullable4_byte_array_, - other.a_nullable4_byte_array_) && - PigeonInternalDeepEquals(a_nullable8_byte_array_, - other.a_nullable8_byte_array_) && - PigeonInternalDeepEquals(a_nullable_float_array_, - other.a_nullable_float_array_) && - PigeonInternalDeepEquals(a_nullable_enum_, other.a_nullable_enum_) && - PigeonInternalDeepEquals(another_nullable_enum_, - other.another_nullable_enum_) && - PigeonInternalDeepEquals(a_nullable_string_, - other.a_nullable_string_) && - PigeonInternalDeepEquals(a_nullable_object_, - other.a_nullable_object_) && - PigeonInternalDeepEquals(list_, other.list_) && - PigeonInternalDeepEquals(string_list_, other.string_list_) && - PigeonInternalDeepEquals(int_list_, other.int_list_) && - PigeonInternalDeepEquals(double_list_, other.double_list_) && - PigeonInternalDeepEquals(bool_list_, other.bool_list_) && - PigeonInternalDeepEquals(enum_list_, other.enum_list_) && - PigeonInternalDeepEquals(object_list_, other.object_list_) && - PigeonInternalDeepEquals(list_list_, other.list_list_) && - PigeonInternalDeepEquals(map_list_, other.map_list_) && - PigeonInternalDeepEquals(map_, other.map_) && - PigeonInternalDeepEquals(string_map_, other.string_map_) && - PigeonInternalDeepEquals(int_map_, other.int_map_) && - PigeonInternalDeepEquals(enum_map_, other.enum_map_) && - PigeonInternalDeepEquals(object_map_, other.object_map_) && - PigeonInternalDeepEquals(list_map_, other.list_map_) && - PigeonInternalDeepEquals(map_map_, other.map_map_); -} - -bool AllNullableTypesWithoutRecursion::operator!=( - const AllNullableTypesWithoutRecursion& other) const { - return !(*this == other); -} - -size_t AllNullableTypesWithoutRecursion::Hash() const { - size_t result = 1; - result = result * 31 + PigeonInternalDeepHash(a_nullable_bool_); - result = result * 31 + PigeonInternalDeepHash(a_nullable_int_); - result = result * 31 + PigeonInternalDeepHash(a_nullable_int64_); - result = result * 31 + PigeonInternalDeepHash(a_nullable_double_); - result = result * 31 + PigeonInternalDeepHash(a_nullable_byte_array_); - result = result * 31 + PigeonInternalDeepHash(a_nullable4_byte_array_); - result = result * 31 + PigeonInternalDeepHash(a_nullable8_byte_array_); - result = result * 31 + PigeonInternalDeepHash(a_nullable_float_array_); - result = result * 31 + PigeonInternalDeepHash(a_nullable_enum_); - result = result * 31 + PigeonInternalDeepHash(another_nullable_enum_); - result = result * 31 + PigeonInternalDeepHash(a_nullable_string_); - result = result * 31 + PigeonInternalDeepHash(a_nullable_object_); - result = result * 31 + PigeonInternalDeepHash(list_); - result = result * 31 + PigeonInternalDeepHash(string_list_); - result = result * 31 + PigeonInternalDeepHash(int_list_); - result = result * 31 + PigeonInternalDeepHash(double_list_); - result = result * 31 + PigeonInternalDeepHash(bool_list_); - result = result * 31 + PigeonInternalDeepHash(enum_list_); - result = result * 31 + PigeonInternalDeepHash(object_list_); - result = result * 31 + PigeonInternalDeepHash(list_list_); - result = result * 31 + PigeonInternalDeepHash(map_list_); - result = result * 31 + PigeonInternalDeepHash(map_); - result = result * 31 + PigeonInternalDeepHash(string_map_); - result = result * 31 + PigeonInternalDeepHash(int_map_); - result = result * 31 + PigeonInternalDeepHash(enum_map_); - result = result * 31 + PigeonInternalDeepHash(object_map_); - result = result * 31 + PigeonInternalDeepHash(list_map_); - result = result * 31 + PigeonInternalDeepHash(map_map_); - return result; -} - -size_t PigeonInternalDeepHash(const AllNullableTypesWithoutRecursion& v) { - return v.Hash(); -} - -// AllClassesWrapper - -AllClassesWrapper::AllClassesWrapper(const AllNullableTypes& all_nullable_types, - const EncodableList& class_list, - const EncodableMap& class_map) - : all_nullable_types_( - std::make_unique(all_nullable_types)), - class_list_(class_list), - class_map_(class_map) {} - -AllClassesWrapper::AllClassesWrapper(const AllNullableTypes& all_nullable_types, - const AllNullableTypesWithoutRecursion* - all_nullable_types_without_recursion, - const AllTypes* all_types, - const EncodableList& class_list, - const EncodableList* nullable_class_list, - const EncodableMap& class_map, - const EncodableMap* nullable_class_map) - : all_nullable_types_( - std::make_unique(all_nullable_types)), - all_nullable_types_without_recursion_( - all_nullable_types_without_recursion - ? std::make_unique( - *all_nullable_types_without_recursion) - : nullptr), - all_types_(all_types ? std::make_unique(*all_types) : nullptr), - class_list_(class_list), - nullable_class_list_(nullable_class_list ? std::optional( - *nullable_class_list) - : std::nullopt), - class_map_(class_map), - nullable_class_map_(nullable_class_map - ? std::optional(*nullable_class_map) - : std::nullopt) {} - -AllClassesWrapper::AllClassesWrapper(const AllClassesWrapper& other) - : all_nullable_types_( - std::make_unique(*other.all_nullable_types_)), - all_nullable_types_without_recursion_( - other.all_nullable_types_without_recursion_ - ? std::make_unique( - *other.all_nullable_types_without_recursion_) - : nullptr), - all_types_(other.all_types_ - ? std::make_unique(*other.all_types_) - : nullptr), - class_list_(other.class_list_), - nullable_class_list_( - other.nullable_class_list_ - ? std::optional(*other.nullable_class_list_) - : std::nullopt), - class_map_(other.class_map_), - nullable_class_map_( - other.nullable_class_map_ - ? std::optional(*other.nullable_class_map_) - : std::nullopt) {} - -AllClassesWrapper& AllClassesWrapper::operator=( - const AllClassesWrapper& other) { - all_nullable_types_ = - std::make_unique(*other.all_nullable_types_); - all_nullable_types_without_recursion_ = - other.all_nullable_types_without_recursion_ - ? std::make_unique( - *other.all_nullable_types_without_recursion_) - : nullptr; - all_types_ = other.all_types_ ? std::make_unique(*other.all_types_) - : nullptr; - class_list_ = other.class_list_; - nullable_class_list_ = other.nullable_class_list_; - class_map_ = other.class_map_; - nullable_class_map_ = other.nullable_class_map_; - return *this; -} - -const AllNullableTypes& AllClassesWrapper::all_nullable_types() const { - return *all_nullable_types_; -} - -void AllClassesWrapper::set_all_nullable_types( - const AllNullableTypes& value_arg) { - all_nullable_types_ = std::make_unique(value_arg); -} - -const AllNullableTypesWithoutRecursion* -AllClassesWrapper::all_nullable_types_without_recursion() const { - return all_nullable_types_without_recursion_.get(); -} - -void AllClassesWrapper::set_all_nullable_types_without_recursion( - const AllNullableTypesWithoutRecursion* value_arg) { - all_nullable_types_without_recursion_ = - value_arg ? std::make_unique(*value_arg) - : nullptr; -} - -void AllClassesWrapper::set_all_nullable_types_without_recursion( - const AllNullableTypesWithoutRecursion& value_arg) { - all_nullable_types_without_recursion_ = - std::make_unique(value_arg); -} - -const AllTypes* AllClassesWrapper::all_types() const { - return all_types_.get(); -} - -void AllClassesWrapper::set_all_types(const AllTypes* value_arg) { - all_types_ = value_arg ? std::make_unique(*value_arg) : nullptr; -} - -void AllClassesWrapper::set_all_types(const AllTypes& value_arg) { - all_types_ = std::make_unique(value_arg); -} - -const EncodableList& AllClassesWrapper::class_list() const { - return class_list_; -} - -void AllClassesWrapper::set_class_list(const EncodableList& value_arg) { - class_list_ = value_arg; -} - -const EncodableList* AllClassesWrapper::nullable_class_list() const { - return nullable_class_list_ ? &(*nullable_class_list_) : nullptr; -} - -void AllClassesWrapper::set_nullable_class_list( - const EncodableList* value_arg) { - nullable_class_list_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} - -void AllClassesWrapper::set_nullable_class_list( - const EncodableList& value_arg) { - nullable_class_list_ = value_arg; -} - -const EncodableMap& AllClassesWrapper::class_map() const { return class_map_; } - -void AllClassesWrapper::set_class_map(const EncodableMap& value_arg) { - class_map_ = value_arg; -} - -const EncodableMap* AllClassesWrapper::nullable_class_map() const { - return nullable_class_map_ ? &(*nullable_class_map_) : nullptr; -} - -void AllClassesWrapper::set_nullable_class_map(const EncodableMap* value_arg) { - nullable_class_map_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} - -void AllClassesWrapper::set_nullable_class_map(const EncodableMap& value_arg) { - nullable_class_map_ = value_arg; -} - -EncodableList AllClassesWrapper::ToEncodableList() const { - EncodableList list; - list.reserve(7); - list.push_back(CustomEncodableValue(*all_nullable_types_)); - list.push_back( - all_nullable_types_without_recursion_ - ? CustomEncodableValue(*all_nullable_types_without_recursion_) - : EncodableValue()); - list.push_back(all_types_ ? CustomEncodableValue(*all_types_) - : EncodableValue()); - list.push_back(EncodableValue(class_list_)); - list.push_back(nullable_class_list_ ? EncodableValue(*nullable_class_list_) - : EncodableValue()); - list.push_back(EncodableValue(class_map_)); - list.push_back(nullable_class_map_ ? EncodableValue(*nullable_class_map_) - : EncodableValue()); - return list; -} - -AllClassesWrapper AllClassesWrapper::FromEncodableList( - const EncodableList& list) { - AllClassesWrapper decoded(std::any_cast( - std::get(list[0])), - std::get(list[3]), - std::get(list[5])); - auto& encodable_all_nullable_types_without_recursion = list[1]; - if (!encodable_all_nullable_types_without_recursion.IsNull()) { - decoded.set_all_nullable_types_without_recursion( - std::any_cast( - std::get( - encodable_all_nullable_types_without_recursion))); - } - auto& encodable_all_types = list[2]; - if (!encodable_all_types.IsNull()) { - decoded.set_all_types(std::any_cast( - std::get(encodable_all_types))); - } - auto& encodable_nullable_class_list = list[4]; - if (!encodable_nullable_class_list.IsNull()) { - decoded.set_nullable_class_list( - std::get(encodable_nullable_class_list)); - } - auto& encodable_nullable_class_map = list[6]; - if (!encodable_nullable_class_map.IsNull()) { - decoded.set_nullable_class_map( - std::get(encodable_nullable_class_map)); - } - return decoded; -} - -bool AllClassesWrapper::operator==(const AllClassesWrapper& other) const { - return PigeonInternalDeepEquals(all_nullable_types_, - other.all_nullable_types_) && - PigeonInternalDeepEquals( - all_nullable_types_without_recursion_, - other.all_nullable_types_without_recursion_) && - PigeonInternalDeepEquals(all_types_, other.all_types_) && - PigeonInternalDeepEquals(class_list_, other.class_list_) && - PigeonInternalDeepEquals(nullable_class_list_, - other.nullable_class_list_) && - PigeonInternalDeepEquals(class_map_, other.class_map_) && - PigeonInternalDeepEquals(nullable_class_map_, - other.nullable_class_map_); -} - -bool AllClassesWrapper::operator!=(const AllClassesWrapper& other) const { - return !(*this == other); -} - -size_t AllClassesWrapper::Hash() const { - size_t result = 1; - result = result * 31 + PigeonInternalDeepHash(all_nullable_types_); - result = result * 31 + - PigeonInternalDeepHash(all_nullable_types_without_recursion_); - result = result * 31 + PigeonInternalDeepHash(all_types_); - result = result * 31 + PigeonInternalDeepHash(class_list_); - result = result * 31 + PigeonInternalDeepHash(nullable_class_list_); - result = result * 31 + PigeonInternalDeepHash(class_map_); - result = result * 31 + PigeonInternalDeepHash(nullable_class_map_); - return result; -} - -size_t PigeonInternalDeepHash(const AllClassesWrapper& v) { return v.Hash(); } - -// TestMessage - -TestMessage::TestMessage() {} - -TestMessage::TestMessage(const EncodableList* test_list) - : test_list_(test_list ? std::optional(*test_list) - : std::nullopt) {} - -const EncodableList* TestMessage::test_list() const { - return test_list_ ? &(*test_list_) : nullptr; -} - -void TestMessage::set_test_list(const EncodableList* value_arg) { - test_list_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} - -void TestMessage::set_test_list(const EncodableList& value_arg) { - test_list_ = value_arg; -} - -EncodableList TestMessage::ToEncodableList() const { - EncodableList list; - list.reserve(1); - list.push_back(test_list_ ? EncodableValue(*test_list_) : EncodableValue()); - return list; -} - -TestMessage TestMessage::FromEncodableList(const EncodableList& list) { - TestMessage decoded; - auto& encodable_test_list = list[0]; - if (!encodable_test_list.IsNull()) { - decoded.set_test_list(std::get(encodable_test_list)); - } - return decoded; -} - -bool TestMessage::operator==(const TestMessage& other) const { - return PigeonInternalDeepEquals(test_list_, other.test_list_); -} - -bool TestMessage::operator!=(const TestMessage& other) const { - return !(*this == other); -} - -size_t TestMessage::Hash() const { - size_t result = 1; - result = result * 31 + PigeonInternalDeepHash(test_list_); - return result; -} - -size_t PigeonInternalDeepHash(const TestMessage& v) { return v.Hash(); } - -PigeonInternalCodecSerializer::PigeonInternalCodecSerializer() {} - -EncodableValue PigeonInternalCodecSerializer::ReadValueOfType( - uint8_t type, ::flutter::ByteStreamReader* stream) const { - switch (type) { - 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: { - return CustomEncodableValue(UnusedClass::FromEncodableList( - std::get(ReadValue(stream)))); - } - case 132: { - return CustomEncodableValue(AllTypes::FromEncodableList( - std::get(ReadValue(stream)))); - } - case 133: { - return CustomEncodableValue(AllNullableTypes::FromEncodableList( - std::get(ReadValue(stream)))); - } - case 134: { - return CustomEncodableValue( - AllNullableTypesWithoutRecursion::FromEncodableList( - std::get(ReadValue(stream)))); - } - case 135: { - return CustomEncodableValue(AllClassesWrapper::FromEncodableList( - std::get(ReadValue(stream)))); - } - case 136: { - return CustomEncodableValue(TestMessage::FromEncodableList( - std::get(ReadValue(stream)))); - } - default: - return ::flutter::StandardCodecSerializer::ReadValueOfType(type, stream); - } -} - -void PigeonInternalCodecSerializer::WriteValue( - const EncodableValue& value, ::flutter::ByteStreamWriter* stream) const { - if (const CustomEncodableValue* custom_value = - std::get_if(&value)) { - if (custom_value->type() == typeid(AnEnum)) { - stream->WriteByte(129); - WriteValue(EncodableValue( - static_cast(std::any_cast(*custom_value))), - stream); - return; - } - if (custom_value->type() == typeid(AnotherEnum)) { - stream->WriteByte(130); - WriteValue(EncodableValue(static_cast( - std::any_cast(*custom_value))), - stream); - return; - } - if (custom_value->type() == typeid(UnusedClass)) { - stream->WriteByte(131); - WriteValue( - EncodableValue( - std::any_cast(*custom_value).ToEncodableList()), - stream); - return; - } - if (custom_value->type() == typeid(AllTypes)) { - stream->WriteByte(132); - WriteValue(EncodableValue( - std::any_cast(*custom_value).ToEncodableList()), - stream); - return; - } - if (custom_value->type() == typeid(AllNullableTypes)) { - stream->WriteByte(133); - WriteValue( - EncodableValue( - std::any_cast(*custom_value).ToEncodableList()), - stream); - return; - } - if (custom_value->type() == typeid(AllNullableTypesWithoutRecursion)) { - stream->WriteByte(134); - WriteValue(EncodableValue(std::any_cast( - *custom_value) - .ToEncodableList()), - stream); - return; - } - if (custom_value->type() == typeid(AllClassesWrapper)) { - stream->WriteByte(135); - WriteValue(EncodableValue(std::any_cast(*custom_value) - .ToEncodableList()), - stream); - return; - } - if (custom_value->type() == typeid(TestMessage)) { - stream->WriteByte(136); - WriteValue( - EncodableValue( - std::any_cast(*custom_value).ToEncodableList()), - stream); - return; - } - } - ::flutter::StandardCodecSerializer::WriteValue(value, stream); -} - -/// The codec used by HostIntegrationCoreApi. -const ::flutter::StandardMessageCodec& HostIntegrationCoreApi::GetCodec() { - return ::flutter::StandardMessageCodec::GetInstance( - &PigeonInternalCodecSerializer::GetInstance()); -} - -// Sets up an instance of `HostIntegrationCoreApi` to handle messages through -// the `binary_messenger`. -void HostIntegrationCoreApi::SetUp(::flutter::BinaryMessenger* binary_messenger, - HostIntegrationCoreApi* api) { - HostIntegrationCoreApi::SetUp(binary_messenger, api, ""); -} - -void HostIntegrationCoreApi::SetUp(::flutter::BinaryMessenger* binary_messenger, - HostIntegrationCoreApi* api, - const std::string& message_channel_suffix) { - const std::string prepended_suffix = - message_channel_suffix.length() > 0 - ? std::string(".") + message_channel_suffix - : ""; - { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.noop" + - prepended_suffix, - &GetCodec()); - if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const ::flutter::MessageReply& reply) { - try { - std::optional output = api->Noop(); - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.echoAllTypes" + - 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_everything_arg = args.at(0); - if (encodable_everything_arg.IsNull()) { - reply(WrapError("everything_arg unexpectedly null.")); - return; - } - const auto& everything_arg = std::any_cast( - std::get(encodable_everything_arg)); - ErrorOr output = api->EchoAllTypes(everything_arg); - 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); - } - } - { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.throwError" + - prepended_suffix, - &GetCodec()); - if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const ::flutter::MessageReply& reply) { - try { - ErrorOr> output = api->ThrowError(); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.throwErrorFromVoid" + - prepended_suffix, - &GetCodec()); - if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const ::flutter::MessageReply& reply) { - try { - std::optional output = api->ThrowErrorFromVoid(); - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.throwFlutterError" + - prepended_suffix, - &GetCodec()); - if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const ::flutter::MessageReply& reply) { - try { - ErrorOr> output = - api->ThrowFlutterError(); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.echoInt" + - 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_an_int_arg = args.at(0); - if (encodable_an_int_arg.IsNull()) { - reply(WrapError("an_int_arg unexpectedly null.")); - return; - } - const int64_t an_int_arg = encodable_an_int_arg.LongValue(); - ErrorOr output = api->EchoInt(an_int_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.echoDouble" + - 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_a_double_arg = args.at(0); - if (encodable_a_double_arg.IsNull()) { - reply(WrapError("a_double_arg unexpectedly null.")); - return; - } - const auto& a_double_arg = - std::get(encodable_a_double_arg); - ErrorOr output = api->EchoDouble(a_double_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.echoBool" + - 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_a_bool_arg = args.at(0); - if (encodable_a_bool_arg.IsNull()) { - reply(WrapError("a_bool_arg unexpectedly null.")); - return; - } - const auto& a_bool_arg = std::get(encodable_a_bool_arg); - ErrorOr output = api->EchoBool(a_bool_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.echoString" + - 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_a_string_arg = args.at(0); - if (encodable_a_string_arg.IsNull()) { - reply(WrapError("a_string_arg unexpectedly null.")); - return; - } - const auto& a_string_arg = - std::get(encodable_a_string_arg); - ErrorOr output = api->EchoString(a_string_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.echoUint8List" + - 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_a_uint8_list_arg = args.at(0); - if (encodable_a_uint8_list_arg.IsNull()) { - reply(WrapError("a_uint8_list_arg unexpectedly null.")); - return; - } - const auto& a_uint8_list_arg = - std::get>(encodable_a_uint8_list_arg); - ErrorOr> output = - api->EchoUint8List(a_uint8_list_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.echoObject" + - 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_an_object_arg = args.at(0); - if (encodable_an_object_arg.IsNull()) { - reply(WrapError("an_object_arg unexpectedly null.")); - return; - } - const auto& an_object_arg = encodable_an_object_arg; - ErrorOr output = api->EchoObject(an_object_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.echoList" + - 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_list_arg = args.at(0); - if (encodable_list_arg.IsNull()) { - reply(WrapError("list_arg unexpectedly null.")); - return; - } - const auto& list_arg = - std::get(encodable_list_arg); - ErrorOr output = api->EchoList(list_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.echoEnumList" + - 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_enum_list_arg = args.at(0); - if (encodable_enum_list_arg.IsNull()) { - reply(WrapError("enum_list_arg unexpectedly null.")); - return; - } - const auto& enum_list_arg = - std::get(encodable_enum_list_arg); - ErrorOr output = api->EchoEnumList(enum_list_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.echoClassList" + - 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_class_list_arg = args.at(0); - if (encodable_class_list_arg.IsNull()) { - reply(WrapError("class_list_arg unexpectedly null.")); - return; - } - const auto& class_list_arg = - std::get(encodable_class_list_arg); - ErrorOr output = - api->EchoClassList(class_list_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.echoNonNullEnumList" + - 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_enum_list_arg = args.at(0); - if (encodable_enum_list_arg.IsNull()) { - reply(WrapError("enum_list_arg unexpectedly null.")); - return; - } - const auto& enum_list_arg = - std::get(encodable_enum_list_arg); - ErrorOr output = - api->EchoNonNullEnumList(enum_list_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNonNullClassList" + - 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_class_list_arg = args.at(0); - if (encodable_class_list_arg.IsNull()) { - reply(WrapError("class_list_arg unexpectedly null.")); - return; - } - const auto& class_list_arg = - std::get(encodable_class_list_arg); - ErrorOr output = - api->EchoNonNullClassList(class_list_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.echoMap" + - 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_map_arg = args.at(0); - if (encodable_map_arg.IsNull()) { - reply(WrapError("map_arg unexpectedly null.")); - return; - } - const auto& map_arg = std::get(encodable_map_arg); - ErrorOr output = api->EchoMap(map_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.echoStringMap" + - 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_string_map_arg = args.at(0); - if (encodable_string_map_arg.IsNull()) { - reply(WrapError("string_map_arg unexpectedly null.")); - return; - } - const auto& string_map_arg = - std::get(encodable_string_map_arg); - ErrorOr output = api->EchoStringMap(string_map_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.echoIntMap" + - 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_int_map_arg = args.at(0); - if (encodable_int_map_arg.IsNull()) { - reply(WrapError("int_map_arg unexpectedly null.")); - return; - } - const auto& int_map_arg = - std::get(encodable_int_map_arg); - ErrorOr output = api->EchoIntMap(int_map_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.echoEnumMap" + - 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_enum_map_arg = args.at(0); - if (encodable_enum_map_arg.IsNull()) { - reply(WrapError("enum_map_arg unexpectedly null.")); - return; - } - const auto& enum_map_arg = - std::get(encodable_enum_map_arg); - ErrorOr output = api->EchoEnumMap(enum_map_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.echoClassMap" + - 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_class_map_arg = args.at(0); - if (encodable_class_map_arg.IsNull()) { - reply(WrapError("class_map_arg unexpectedly null.")); - return; - } - const auto& class_map_arg = - std::get(encodable_class_map_arg); - ErrorOr output = api->EchoClassMap(class_map_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNonNullStringMap" + - 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_string_map_arg = args.at(0); - if (encodable_string_map_arg.IsNull()) { - reply(WrapError("string_map_arg unexpectedly null.")); - return; - } - const auto& string_map_arg = - std::get(encodable_string_map_arg); - ErrorOr output = - api->EchoNonNullStringMap(string_map_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.echoNonNullIntMap" + - 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_int_map_arg = args.at(0); - if (encodable_int_map_arg.IsNull()) { - reply(WrapError("int_map_arg unexpectedly null.")); - return; - } - const auto& int_map_arg = - std::get(encodable_int_map_arg); - ErrorOr output = - api->EchoNonNullIntMap(int_map_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.echoNonNullEnumMap" + - 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_enum_map_arg = args.at(0); - if (encodable_enum_map_arg.IsNull()) { - reply(WrapError("enum_map_arg unexpectedly null.")); - return; - } - const auto& enum_map_arg = - std::get(encodable_enum_map_arg); - ErrorOr output = - api->EchoNonNullEnumMap(enum_map_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.echoNonNullClassMap" + - 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_class_map_arg = args.at(0); - if (encodable_class_map_arg.IsNull()) { - reply(WrapError("class_map_arg unexpectedly null.")); - return; - } - const auto& class_map_arg = - std::get(encodable_class_map_arg); - ErrorOr output = - api->EchoNonNullClassMap(class_map_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.echoClassWrapper" + - 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_wrapper_arg = args.at(0); - if (encodable_wrapper_arg.IsNull()) { - reply(WrapError("wrapper_arg unexpectedly null.")); - return; - } - const auto& wrapper_arg = std::any_cast( - std::get(encodable_wrapper_arg)); - ErrorOr output = - api->EchoClassWrapper(wrapper_arg); - 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); - } - } - { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoEnum" + - 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_an_enum_arg = args.at(0); - if (encodable_an_enum_arg.IsNull()) { - reply(WrapError("an_enum_arg unexpectedly null.")); - return; - } - const auto& an_enum_arg = std::any_cast( - std::get(encodable_an_enum_arg)); - ErrorOr output = api->EchoEnum(an_enum_arg); - 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); - } - } - { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoAnotherEnum" + - 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_another_enum_arg = args.at(0); - if (encodable_another_enum_arg.IsNull()) { - reply(WrapError("another_enum_arg unexpectedly null.")); - return; - } - const auto& another_enum_arg = std::any_cast( - std::get(encodable_another_enum_arg)); - ErrorOr output = - api->EchoAnotherEnum(another_enum_arg); - 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); - } - } - { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNamedDefaultString" + - 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_a_string_arg = args.at(0); - if (encodable_a_string_arg.IsNull()) { - reply(WrapError("a_string_arg unexpectedly null.")); - return; - } - const auto& a_string_arg = - std::get(encodable_a_string_arg); - ErrorOr output = - api->EchoNamedDefaultString(a_string_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoOptionalDefaultDouble" + - 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_a_double_arg = args.at(0); - if (encodable_a_double_arg.IsNull()) { - reply(WrapError("a_double_arg unexpectedly null.")); - return; - } - const auto& a_double_arg = - std::get(encodable_a_double_arg); - ErrorOr output = - api->EchoOptionalDefaultDouble(a_double_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.echoRequiredInt" + - 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_an_int_arg = args.at(0); - if (encodable_an_int_arg.IsNull()) { - reply(WrapError("an_int_arg unexpectedly null.")); - return; - } - const int64_t an_int_arg = encodable_an_int_arg.LongValue(); - ErrorOr output = api->EchoRequiredInt(an_int_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "areAllNullableTypesEqual" + - 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_a_arg = args.at(0); - if (encodable_a_arg.IsNull()) { - reply(WrapError("a_arg unexpectedly null.")); - return; - } - const auto& a_arg = std::any_cast( - std::get(encodable_a_arg)); - const auto& encodable_b_arg = args.at(1); - if (encodable_b_arg.IsNull()) { - reply(WrapError("b_arg unexpectedly null.")); - return; - } - const auto& b_arg = std::any_cast( - std::get(encodable_b_arg)); - ErrorOr output = - api->AreAllNullableTypesEqual(a_arg, b_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "getAllNullableTypesHash" + - 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_value_arg = args.at(0); - if (encodable_value_arg.IsNull()) { - reply(WrapError("value_arg unexpectedly null.")); - return; - } - const auto& value_arg = std::any_cast( - std::get(encodable_value_arg)); - ErrorOr output = api->GetAllNullableTypesHash(value_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "getAllNullableTypesWithoutRecursionHash" + - 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_value_arg = args.at(0); - if (encodable_value_arg.IsNull()) { - reply(WrapError("value_arg unexpectedly null.")); - return; - } - const auto& value_arg = - std::any_cast( - std::get(encodable_value_arg)); - ErrorOr output = - api->GetAllNullableTypesWithoutRecursionHash(value_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAllNullableTypes" + - 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_everything_arg = args.at(0); - const auto* everything_arg = - encodable_everything_arg.IsNull() - ? nullptr - : &(std::any_cast( - std::get( - encodable_everything_arg))); - ErrorOr> output = - api->EchoAllNullableTypes(everything_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - CustomEncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAllNullableTypesWithoutRecursion" + - prepended_suffix, - &GetCodec()); - if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, - const ::flutter::MessageReply< - EncodableValue>& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_everything_arg = args.at(0); - const auto* everything_arg = - encodable_everything_arg.IsNull() - ? nullptr - : &(std::any_cast( - std::get( - encodable_everything_arg))); - ErrorOr> output = - api->EchoAllNullableTypesWithoutRecursion(everything_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - CustomEncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "extractNestedNullableString" + - 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_wrapper_arg = args.at(0); - if (encodable_wrapper_arg.IsNull()) { - reply(WrapError("wrapper_arg unexpectedly null.")); - return; - } - const auto& wrapper_arg = std::any_cast( - std::get(encodable_wrapper_arg)); - ErrorOr> output = - api->ExtractNestedNullableString(wrapper_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "createNestedNullableString" + - 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_nullable_string_arg = args.at(0); - const auto* nullable_string_arg = - std::get_if(&encodable_nullable_string_arg); - ErrorOr output = - api->CreateNestedNullableString(nullable_string_arg); - 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); - } - } - { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "sendMultipleNullableTypes" + - 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_a_nullable_bool_arg = args.at(0); - const auto* a_nullable_bool_arg = - std::get_if(&encodable_a_nullable_bool_arg); - const auto& encodable_a_nullable_int_arg = args.at(1); - const auto* a_nullable_int_arg = - std::get_if(&encodable_a_nullable_int_arg); - const auto& encodable_a_nullable_string_arg = args.at(2); - const auto* a_nullable_string_arg = - std::get_if(&encodable_a_nullable_string_arg); - ErrorOr output = api->SendMultipleNullableTypes( - a_nullable_bool_arg, a_nullable_int_arg, - a_nullable_string_arg); - 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); - } - } - { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "sendMultipleNullableTypesWithoutRecursion" + - 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_a_nullable_bool_arg = args.at(0); - const auto* a_nullable_bool_arg = - std::get_if(&encodable_a_nullable_bool_arg); - const auto& encodable_a_nullable_int_arg = args.at(1); - const auto* a_nullable_int_arg = - std::get_if(&encodable_a_nullable_int_arg); - const auto& encodable_a_nullable_string_arg = args.at(2); - const auto* a_nullable_string_arg = - std::get_if(&encodable_a_nullable_string_arg); - ErrorOr output = - api->SendMultipleNullableTypesWithoutRecursion( - a_nullable_bool_arg, a_nullable_int_arg, - a_nullable_string_arg); - 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); - } - } - { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoNullableInt" + - 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_a_nullable_int_arg = args.at(0); - const auto* a_nullable_int_arg = - std::get_if(&encodable_a_nullable_int_arg); - ErrorOr> output = - api->EchoNullableInt(a_nullable_int_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.echoNullableDouble" + - 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_a_nullable_double_arg = args.at(0); - const auto* a_nullable_double_arg = - std::get_if(&encodable_a_nullable_double_arg); - ErrorOr> output = - api->EchoNullableDouble(a_nullable_double_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.echoNullableBool" + - 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_a_nullable_bool_arg = args.at(0); - const auto* a_nullable_bool_arg = - std::get_if(&encodable_a_nullable_bool_arg); - ErrorOr> output = - api->EchoNullableBool(a_nullable_bool_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.echoNullableString" + - 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_a_nullable_string_arg = args.at(0); - const auto* a_nullable_string_arg = - std::get_if(&encodable_a_nullable_string_arg); - ErrorOr> output = - api->EchoNullableString(a_nullable_string_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNullableUint8List" + - 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_a_nullable_uint8_list_arg = args.at(0); - const auto* a_nullable_uint8_list_arg = - std::get_if>( - &encodable_a_nullable_uint8_list_arg); - ErrorOr>> output = - api->EchoNullableUint8List(a_nullable_uint8_list_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.echoNullableObject" + - 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_a_nullable_object_arg = args.at(0); - const auto* a_nullable_object_arg = - &encodable_a_nullable_object_arg; - ErrorOr> output = - api->EchoNullableObject(a_nullable_object_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.echoNullableList" + - 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_a_nullable_list_arg = args.at(0); - const auto* a_nullable_list_arg = - std::get_if(&encodable_a_nullable_list_arg); - ErrorOr> output = - api->EchoNullableList(a_nullable_list_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNullableEnumList" + - 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_enum_list_arg = args.at(0); - const auto* enum_list_arg = - std::get_if(&encodable_enum_list_arg); - ErrorOr> output = - api->EchoNullableEnumList(enum_list_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNullableClassList" + - 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_class_list_arg = args.at(0); - const auto* class_list_arg = - std::get_if(&encodable_class_list_arg); - ErrorOr> output = - api->EchoNullableClassList(class_list_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNullableNonNullEnumList" + - 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_enum_list_arg = args.at(0); - const auto* enum_list_arg = - std::get_if(&encodable_enum_list_arg); - ErrorOr> output = - api->EchoNullableNonNullEnumList(enum_list_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNullableNonNullClassList" + - 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_class_list_arg = args.at(0); - const auto* class_list_arg = - std::get_if(&encodable_class_list_arg); - ErrorOr> output = - api->EchoNullableNonNullClassList(class_list_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.echoNullableMap" + - 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_map_arg = args.at(0); - const auto* map_arg = - std::get_if(&encodable_map_arg); - ErrorOr> output = - api->EchoNullableMap(map_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNullableStringMap" + - 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_string_map_arg = args.at(0); - const auto* string_map_arg = - std::get_if(&encodable_string_map_arg); - ErrorOr> output = - api->EchoNullableStringMap(string_map_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.echoNullableIntMap" + - 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_int_map_arg = args.at(0); - const auto* int_map_arg = - std::get_if(&encodable_int_map_arg); - ErrorOr> output = - api->EchoNullableIntMap(int_map_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.echoNullableEnumMap" + - 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_enum_map_arg = args.at(0); - const auto* enum_map_arg = - std::get_if(&encodable_enum_map_arg); - ErrorOr> output = - api->EchoNullableEnumMap(enum_map_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNullableClassMap" + - 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_class_map_arg = args.at(0); - const auto* class_map_arg = - std::get_if(&encodable_class_map_arg); - ErrorOr> output = - api->EchoNullableClassMap(class_map_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNullableNonNullStringMap" + - 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_string_map_arg = args.at(0); - const auto* string_map_arg = - std::get_if(&encodable_string_map_arg); - ErrorOr> output = - api->EchoNullableNonNullStringMap(string_map_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNullableNonNullIntMap" + - 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_int_map_arg = args.at(0); - const auto* int_map_arg = - std::get_if(&encodable_int_map_arg); - ErrorOr> output = - api->EchoNullableNonNullIntMap(int_map_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNullableNonNullEnumMap" + - 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_enum_map_arg = args.at(0); - const auto* enum_map_arg = - std::get_if(&encodable_enum_map_arg); - ErrorOr> output = - api->EchoNullableNonNullEnumMap(enum_map_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNullableNonNullClassMap" + - 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_class_map_arg = args.at(0); - const auto* class_map_arg = - std::get_if(&encodable_class_map_arg); - ErrorOr> output = - api->EchoNullableNonNullClassMap(class_map_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.echoNullableEnum" + - 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_an_enum_arg = args.at(0); - AnEnum an_enum_arg_value; - const AnEnum* an_enum_arg = nullptr; - if (!encodable_an_enum_arg.IsNull()) { - an_enum_arg_value = std::any_cast( - std::get(encodable_an_enum_arg)); - an_enum_arg = &an_enum_arg_value; - } - ErrorOr> output = api->EchoNullableEnum( - an_enum_arg ? &(*an_enum_arg) : nullptr); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - CustomEncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAnotherNullableEnum" + - 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_another_enum_arg = args.at(0); - AnotherEnum another_enum_arg_value; - const AnotherEnum* another_enum_arg = nullptr; - if (!encodable_another_enum_arg.IsNull()) { - another_enum_arg_value = std::any_cast( - std::get(encodable_another_enum_arg)); - another_enum_arg = &another_enum_arg_value; - } - ErrorOr> output = - api->EchoAnotherNullableEnum( - another_enum_arg ? &(*another_enum_arg) : nullptr); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - CustomEncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoOptionalNullableInt" + - 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_a_nullable_int_arg = args.at(0); - const auto* a_nullable_int_arg = - std::get_if(&encodable_a_nullable_int_arg); - ErrorOr> output = - api->EchoOptionalNullableInt(a_nullable_int_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNamedNullableString" + - 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_a_nullable_string_arg = args.at(0); - const auto* a_nullable_string_arg = - std::get_if(&encodable_a_nullable_string_arg); - ErrorOr> output = - api->EchoNamedNullableString(a_nullable_string_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.noopAsync" + - prepended_suffix, - &GetCodec()); - if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const ::flutter::MessageReply& reply) { - try { - api->NoopAsync([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.pigeon_integration_tests." - "HostIntegrationCoreApi.echoAsyncInt" + - 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_an_int_arg = args.at(0); - if (encodable_an_int_arg.IsNull()) { - reply(WrapError("an_int_arg unexpectedly null.")); - return; - } - const int64_t an_int_arg = encodable_an_int_arg.LongValue(); - api->EchoAsyncInt(an_int_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.echoAsyncDouble" + - 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_a_double_arg = args.at(0); - if (encodable_a_double_arg.IsNull()) { - reply(WrapError("a_double_arg unexpectedly null.")); - return; - } - const auto& a_double_arg = - std::get(encodable_a_double_arg); - api->EchoAsyncDouble( - a_double_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.echoAsyncBool" + - 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_a_bool_arg = args.at(0); - if (encodable_a_bool_arg.IsNull()) { - reply(WrapError("a_bool_arg unexpectedly null.")); - return; - } - const auto& a_bool_arg = std::get(encodable_a_bool_arg); - api->EchoAsyncBool(a_bool_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.echoAsyncString" + - 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_a_string_arg = args.at(0); - if (encodable_a_string_arg.IsNull()) { - reply(WrapError("a_string_arg unexpectedly null.")); - return; - } - const auto& a_string_arg = - std::get(encodable_a_string_arg); - api->EchoAsyncString( - a_string_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.echoAsyncUint8List" + - 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_a_uint8_list_arg = args.at(0); - if (encodable_a_uint8_list_arg.IsNull()) { - reply(WrapError("a_uint8_list_arg unexpectedly null.")); - return; - } - const auto& a_uint8_list_arg = - std::get>(encodable_a_uint8_list_arg); - api->EchoAsyncUint8List( - a_uint8_list_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.echoAsyncObject" + - 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_an_object_arg = args.at(0); - if (encodable_an_object_arg.IsNull()) { - reply(WrapError("an_object_arg unexpectedly null.")); - return; - } - const auto& an_object_arg = encodable_an_object_arg; - api->EchoAsyncObject( - an_object_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.echoAsyncList" + - 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_list_arg = args.at(0); - if (encodable_list_arg.IsNull()) { - reply(WrapError("list_arg unexpectedly null.")); - return; - } - const auto& list_arg = - std::get(encodable_list_arg); - api->EchoAsyncList( - list_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.echoAsyncEnumList" + - 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_enum_list_arg = args.at(0); - if (encodable_enum_list_arg.IsNull()) { - reply(WrapError("enum_list_arg unexpectedly null.")); - return; - } - const auto& enum_list_arg = - std::get(encodable_enum_list_arg); - api->EchoAsyncEnumList( - enum_list_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.echoAsyncClassList" + - 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_class_list_arg = args.at(0); - if (encodable_class_list_arg.IsNull()) { - reply(WrapError("class_list_arg unexpectedly null.")); - return; - } - const auto& class_list_arg = - std::get(encodable_class_list_arg); - api->EchoAsyncClassList( - class_list_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.echoAsyncMap" + - 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_map_arg = args.at(0); - if (encodable_map_arg.IsNull()) { - reply(WrapError("map_arg unexpectedly null.")); - return; - } - const auto& map_arg = std::get(encodable_map_arg); - api->EchoAsyncMap( - map_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.echoAsyncStringMap" + - 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_string_map_arg = args.at(0); - if (encodable_string_map_arg.IsNull()) { - reply(WrapError("string_map_arg unexpectedly null.")); - return; - } - const auto& string_map_arg = - std::get(encodable_string_map_arg); - api->EchoAsyncStringMap( - string_map_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.echoAsyncIntMap" + - 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_int_map_arg = args.at(0); - if (encodable_int_map_arg.IsNull()) { - reply(WrapError("int_map_arg unexpectedly null.")); - return; - } - const auto& int_map_arg = - std::get(encodable_int_map_arg); - api->EchoAsyncIntMap( - int_map_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.echoAsyncEnumMap" + - 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_enum_map_arg = args.at(0); - if (encodable_enum_map_arg.IsNull()) { - reply(WrapError("enum_map_arg unexpectedly null.")); - return; - } - const auto& enum_map_arg = - std::get(encodable_enum_map_arg); - api->EchoAsyncEnumMap( - enum_map_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.echoAsyncClassMap" + - 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_class_map_arg = args.at(0); - if (encodable_class_map_arg.IsNull()) { - reply(WrapError("class_map_arg unexpectedly null.")); - return; - } - const auto& class_map_arg = - std::get(encodable_class_map_arg); - api->EchoAsyncClassMap( - class_map_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.echoAsyncEnum" + - 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_an_enum_arg = args.at(0); - if (encodable_an_enum_arg.IsNull()) { - reply(WrapError("an_enum_arg unexpectedly null.")); - return; - } - const auto& an_enum_arg = std::any_cast( - std::get(encodable_an_enum_arg)); - api->EchoAsyncEnum( - an_enum_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); - } - } - { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAnotherAsyncEnum" + - 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_another_enum_arg = args.at(0); - if (encodable_another_enum_arg.IsNull()) { - reply(WrapError("another_enum_arg unexpectedly null.")); - return; - } - const auto& another_enum_arg = std::any_cast( - std::get(encodable_another_enum_arg)); - api->EchoAnotherAsyncEnum( - another_enum_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); - } - } - { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.throwAsyncError" + - prepended_suffix, - &GetCodec()); - if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const ::flutter::MessageReply& reply) { - try { - api->ThrowAsyncError( - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "throwAsyncErrorFromVoid" + - prepended_suffix, - &GetCodec()); - if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const ::flutter::MessageReply& reply) { - try { - api->ThrowAsyncErrorFromVoid( - [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.pigeon_integration_tests.HostIntegrationCoreApi." - "throwAsyncFlutterError" + - prepended_suffix, - &GetCodec()); - if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const ::flutter::MessageReply& reply) { - try { - api->ThrowAsyncFlutterError( - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.echoAsyncAllTypes" + - 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_everything_arg = args.at(0); - if (encodable_everything_arg.IsNull()) { - reply(WrapError("everything_arg unexpectedly null.")); - return; - } - const auto& everything_arg = std::any_cast( - std::get(encodable_everything_arg)); - api->EchoAsyncAllTypes( - everything_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); - } - } - { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableAllNullableTypes" + - 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_everything_arg = args.at(0); - const auto* everything_arg = - encodable_everything_arg.IsNull() - ? nullptr - : &(std::any_cast( - std::get( - encodable_everything_arg))); - api->EchoAsyncNullableAllNullableTypes( - everything_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(CustomEncodableValue( - std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableAllNullableTypesWithoutRecursion" + - prepended_suffix, - &GetCodec()); - if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, - const ::flutter::MessageReply< - EncodableValue>& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_everything_arg = args.at(0); - const auto* everything_arg = - encodable_everything_arg.IsNull() - ? nullptr - : &(std::any_cast( - std::get( - encodable_everything_arg))); - api->EchoAsyncNullableAllNullableTypesWithoutRecursion( - everything_arg, - [reply](ErrorOr>&& - output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - CustomEncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableInt" + - 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_an_int_arg = args.at(0); - const auto* an_int_arg = - std::get_if(&encodable_an_int_arg); - api->EchoAsyncNullableInt( - an_int_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableDouble" + - 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_a_double_arg = args.at(0); - const auto* a_double_arg = - std::get_if(&encodable_a_double_arg); - api->EchoAsyncNullableDouble( - a_double_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableBool" + - 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_a_bool_arg = args.at(0); - const auto* a_bool_arg = std::get_if(&encodable_a_bool_arg); - api->EchoAsyncNullableBool( - a_bool_arg, [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableString" + - 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_a_string_arg = args.at(0); - const auto* a_string_arg = - std::get_if(&encodable_a_string_arg); - api->EchoAsyncNullableString( - a_string_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableUint8List" + - 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_a_uint8_list_arg = args.at(0); - const auto* a_uint8_list_arg = std::get_if>( - &encodable_a_uint8_list_arg); - api->EchoAsyncNullableUint8List( - a_uint8_list_arg, - [reply]( - ErrorOr>>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableObject" + - 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_an_object_arg = args.at(0); - const auto* an_object_arg = &encodable_an_object_arg; - api->EchoAsyncNullableObject( - an_object_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableList" + - 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_list_arg = args.at(0); - const auto* list_arg = - std::get_if(&encodable_list_arg); - api->EchoAsyncNullableList( - list_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableEnumList" + - 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_enum_list_arg = args.at(0); - const auto* enum_list_arg = - std::get_if(&encodable_enum_list_arg); - api->EchoAsyncNullableEnumList( - enum_list_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableClassList" + - 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_class_list_arg = args.at(0); - const auto* class_list_arg = - std::get_if(&encodable_class_list_arg); - api->EchoAsyncNullableClassList( - class_list_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableMap" + - 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_map_arg = args.at(0); - const auto* map_arg = - std::get_if(&encodable_map_arg); - api->EchoAsyncNullableMap( - map_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableStringMap" + - 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_string_map_arg = args.at(0); - const auto* string_map_arg = - std::get_if(&encodable_string_map_arg); - api->EchoAsyncNullableStringMap( - string_map_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableIntMap" + - 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_int_map_arg = args.at(0); - const auto* int_map_arg = - std::get_if(&encodable_int_map_arg); - api->EchoAsyncNullableIntMap( - int_map_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableEnumMap" + - 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_enum_map_arg = args.at(0); - const auto* enum_map_arg = - std::get_if(&encodable_enum_map_arg); - api->EchoAsyncNullableEnumMap( - enum_map_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableClassMap" + - 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_class_map_arg = args.at(0); - const auto* class_map_arg = - std::get_if(&encodable_class_map_arg); - api->EchoAsyncNullableClassMap( - class_map_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableEnum" + - 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_an_enum_arg = args.at(0); - AnEnum an_enum_arg_value; - const AnEnum* an_enum_arg = nullptr; - if (!encodable_an_enum_arg.IsNull()) { - an_enum_arg_value = std::any_cast( - std::get(encodable_an_enum_arg)); - an_enum_arg = &an_enum_arg_value; - } - api->EchoAsyncNullableEnum( - an_enum_arg ? &(*an_enum_arg) : nullptr, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(CustomEncodableValue( - std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAnotherAsyncNullableEnum" + - 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_another_enum_arg = args.at(0); - AnotherEnum another_enum_arg_value; - const AnotherEnum* another_enum_arg = nullptr; - if (!encodable_another_enum_arg.IsNull()) { - another_enum_arg_value = std::any_cast( - std::get(encodable_another_enum_arg)); - another_enum_arg = &another_enum_arg_value; - } - api->EchoAnotherAsyncNullableEnum( - another_enum_arg ? &(*another_enum_arg) : nullptr, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(CustomEncodableValue( - std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.defaultIsMainThread" + - prepended_suffix, - &GetCodec()); - if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const ::flutter::MessageReply& reply) { - try { - ErrorOr output = api->DefaultIsMainThread(); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "taskQueueIsBackgroundThread" + - prepended_suffix, - &GetCodec()); - if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const ::flutter::MessageReply& reply) { - try { - ErrorOr output = api->TaskQueueIsBackgroundThread(); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.callFlutterNoop" + - prepended_suffix, - &GetCodec()); - if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const ::flutter::MessageReply& reply) { - try { - api->CallFlutterNoop( - [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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterThrowError" + - prepended_suffix, - &GetCodec()); - if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const ::flutter::MessageReply& reply) { - try { - api->CallFlutterThrowError( - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterThrowErrorFromVoid" + - prepended_suffix, - &GetCodec()); - if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const ::flutter::MessageReply& reply) { - try { - api->CallFlutterThrowErrorFromVoid( - [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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoAllTypes" + - 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_everything_arg = args.at(0); - if (encodable_everything_arg.IsNull()) { - reply(WrapError("everything_arg unexpectedly null.")); - return; - } - const auto& everything_arg = std::any_cast( - std::get(encodable_everything_arg)); - api->CallFlutterEchoAllTypes( - everything_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); - } - } - { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoAllNullableTypes" + - 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_everything_arg = args.at(0); - const auto* everything_arg = - encodable_everything_arg.IsNull() - ? nullptr - : &(std::any_cast( - std::get( - encodable_everything_arg))); - api->CallFlutterEchoAllNullableTypes( - everything_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(CustomEncodableValue( - std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterSendMultipleNullableTypes" + - 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_a_nullable_bool_arg = args.at(0); - const auto* a_nullable_bool_arg = - std::get_if(&encodable_a_nullable_bool_arg); - const auto& encodable_a_nullable_int_arg = args.at(1); - const auto* a_nullable_int_arg = - std::get_if(&encodable_a_nullable_int_arg); - const auto& encodable_a_nullable_string_arg = args.at(2); - const auto* a_nullable_string_arg = - std::get_if(&encodable_a_nullable_string_arg); - api->CallFlutterSendMultipleNullableTypes( - a_nullable_bool_arg, a_nullable_int_arg, - a_nullable_string_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); - } - } - { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoAllNullableTypesWithoutRecursion" + - prepended_suffix, - &GetCodec()); - if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, - const ::flutter::MessageReply< - EncodableValue>& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_everything_arg = args.at(0); - const auto* everything_arg = - encodable_everything_arg.IsNull() - ? nullptr - : &(std::any_cast( - std::get( - encodable_everything_arg))); - api->CallFlutterEchoAllNullableTypesWithoutRecursion( - everything_arg, - [reply](ErrorOr>&& - output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - CustomEncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterSendMultipleNullableTypesWithoutRecursion" + - 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_a_nullable_bool_arg = args.at(0); - const auto* a_nullable_bool_arg = - std::get_if(&encodable_a_nullable_bool_arg); - const auto& encodable_a_nullable_int_arg = args.at(1); - const auto* a_nullable_int_arg = - std::get_if(&encodable_a_nullable_int_arg); - const auto& encodable_a_nullable_string_arg = args.at(2); - const auto* a_nullable_string_arg = - std::get_if(&encodable_a_nullable_string_arg); - api->CallFlutterSendMultipleNullableTypesWithoutRecursion( - a_nullable_bool_arg, a_nullable_int_arg, - a_nullable_string_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); - } - } - { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.callFlutterEchoBool" + - 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_a_bool_arg = args.at(0); - if (encodable_a_bool_arg.IsNull()) { - reply(WrapError("a_bool_arg unexpectedly null.")); - return; - } - const auto& a_bool_arg = std::get(encodable_a_bool_arg); - api->CallFlutterEchoBool( - a_bool_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.callFlutterEchoInt" + - 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_an_int_arg = args.at(0); - if (encodable_an_int_arg.IsNull()) { - reply(WrapError("an_int_arg unexpectedly null.")); - return; - } - const int64_t an_int_arg = encodable_an_int_arg.LongValue(); - api->CallFlutterEchoInt( - an_int_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoDouble" + - 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_a_double_arg = args.at(0); - if (encodable_a_double_arg.IsNull()) { - reply(WrapError("a_double_arg unexpectedly null.")); - return; - } - const auto& a_double_arg = - std::get(encodable_a_double_arg); - api->CallFlutterEchoDouble( - a_double_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoString" + - 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_a_string_arg = args.at(0); - if (encodable_a_string_arg.IsNull()) { - reply(WrapError("a_string_arg unexpectedly null.")); - return; - } - const auto& a_string_arg = - std::get(encodable_a_string_arg); - api->CallFlutterEchoString( - a_string_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoUint8List" + - 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_list_arg = args.at(0); - if (encodable_list_arg.IsNull()) { - reply(WrapError("list_arg unexpectedly null.")); - return; - } - const auto& list_arg = - std::get>(encodable_list_arg); - api->CallFlutterEchoUint8List( - list_arg, [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.callFlutterEchoList" + - 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_list_arg = args.at(0); - if (encodable_list_arg.IsNull()) { - reply(WrapError("list_arg unexpectedly null.")); - return; - } - const auto& list_arg = - std::get(encodable_list_arg); - api->CallFlutterEchoList( - list_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoEnumList" + - 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_enum_list_arg = args.at(0); - if (encodable_enum_list_arg.IsNull()) { - reply(WrapError("enum_list_arg unexpectedly null.")); - return; - } - const auto& enum_list_arg = - std::get(encodable_enum_list_arg); - api->CallFlutterEchoEnumList( - enum_list_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoClassList" + - 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_class_list_arg = args.at(0); - if (encodable_class_list_arg.IsNull()) { - reply(WrapError("class_list_arg unexpectedly null.")); - return; - } - const auto& class_list_arg = - std::get(encodable_class_list_arg); - api->CallFlutterEchoClassList( - class_list_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNonNullEnumList" + - 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_enum_list_arg = args.at(0); - if (encodable_enum_list_arg.IsNull()) { - reply(WrapError("enum_list_arg unexpectedly null.")); - return; - } - const auto& enum_list_arg = - std::get(encodable_enum_list_arg); - api->CallFlutterEchoNonNullEnumList( - enum_list_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNonNullClassList" + - 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_class_list_arg = args.at(0); - if (encodable_class_list_arg.IsNull()) { - reply(WrapError("class_list_arg unexpectedly null.")); - return; - } - const auto& class_list_arg = - std::get(encodable_class_list_arg); - api->CallFlutterEchoNonNullClassList( - class_list_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.callFlutterEchoMap" + - 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_map_arg = args.at(0); - if (encodable_map_arg.IsNull()) { - reply(WrapError("map_arg unexpectedly null.")); - return; - } - const auto& map_arg = std::get(encodable_map_arg); - api->CallFlutterEchoMap( - map_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoStringMap" + - 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_string_map_arg = args.at(0); - if (encodable_string_map_arg.IsNull()) { - reply(WrapError("string_map_arg unexpectedly null.")); - return; - } - const auto& string_map_arg = - std::get(encodable_string_map_arg); - api->CallFlutterEchoStringMap( - string_map_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoIntMap" + - 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_int_map_arg = args.at(0); - if (encodable_int_map_arg.IsNull()) { - reply(WrapError("int_map_arg unexpectedly null.")); - return; - } - const auto& int_map_arg = - std::get(encodable_int_map_arg); - api->CallFlutterEchoIntMap( - int_map_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoEnumMap" + - 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_enum_map_arg = args.at(0); - if (encodable_enum_map_arg.IsNull()) { - reply(WrapError("enum_map_arg unexpectedly null.")); - return; - } - const auto& enum_map_arg = - std::get(encodable_enum_map_arg); - api->CallFlutterEchoEnumMap( - enum_map_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoClassMap" + - 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_class_map_arg = args.at(0); - if (encodable_class_map_arg.IsNull()) { - reply(WrapError("class_map_arg unexpectedly null.")); - return; - } - const auto& class_map_arg = - std::get(encodable_class_map_arg); - api->CallFlutterEchoClassMap( - class_map_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNonNullStringMap" + - 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_string_map_arg = args.at(0); - if (encodable_string_map_arg.IsNull()) { - reply(WrapError("string_map_arg unexpectedly null.")); - return; - } - const auto& string_map_arg = - std::get(encodable_string_map_arg); - api->CallFlutterEchoNonNullStringMap( - string_map_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNonNullIntMap" + - 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_int_map_arg = args.at(0); - if (encodable_int_map_arg.IsNull()) { - reply(WrapError("int_map_arg unexpectedly null.")); - return; - } - const auto& int_map_arg = - std::get(encodable_int_map_arg); - api->CallFlutterEchoNonNullIntMap( - int_map_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNonNullEnumMap" + - 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_enum_map_arg = args.at(0); - if (encodable_enum_map_arg.IsNull()) { - reply(WrapError("enum_map_arg unexpectedly null.")); - return; - } - const auto& enum_map_arg = - std::get(encodable_enum_map_arg); - api->CallFlutterEchoNonNullEnumMap( - enum_map_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNonNullClassMap" + - 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_class_map_arg = args.at(0); - if (encodable_class_map_arg.IsNull()) { - reply(WrapError("class_map_arg unexpectedly null.")); - return; - } - const auto& class_map_arg = - std::get(encodable_class_map_arg); - api->CallFlutterEchoNonNullClassMap( - class_map_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - 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.pigeon_integration_tests." - "HostIntegrationCoreApi.callFlutterEchoEnum" + - 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_an_enum_arg = args.at(0); - if (encodable_an_enum_arg.IsNull()) { - reply(WrapError("an_enum_arg unexpectedly null.")); - return; - } - const auto& an_enum_arg = std::any_cast( - std::get(encodable_an_enum_arg)); - api->CallFlutterEchoEnum( - an_enum_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); - } - } - { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoAnotherEnum" + - 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_another_enum_arg = args.at(0); - if (encodable_another_enum_arg.IsNull()) { - reply(WrapError("another_enum_arg unexpectedly null.")); - return; - } - const auto& another_enum_arg = std::any_cast( - std::get(encodable_another_enum_arg)); - api->CallFlutterEchoAnotherEnum( - another_enum_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); - } - } - { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableBool" + - 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_a_bool_arg = args.at(0); - const auto* a_bool_arg = std::get_if(&encodable_a_bool_arg); - api->CallFlutterEchoNullableBool( - a_bool_arg, [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableInt" + - 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_an_int_arg = args.at(0); - const auto* an_int_arg = - std::get_if(&encodable_an_int_arg); - api->CallFlutterEchoNullableInt( - an_int_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableDouble" + - 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_a_double_arg = args.at(0); - const auto* a_double_arg = - std::get_if(&encodable_a_double_arg); - api->CallFlutterEchoNullableDouble( - a_double_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableString" + - 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_a_string_arg = args.at(0); - const auto* a_string_arg = - std::get_if(&encodable_a_string_arg); - api->CallFlutterEchoNullableString( - a_string_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableUint8List" + - 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_list_arg = args.at(0); - const auto* list_arg = - std::get_if>(&encodable_list_arg); - api->CallFlutterEchoNullableUint8List( - list_arg, - [reply]( - ErrorOr>>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableList" + - 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_list_arg = args.at(0); - const auto* list_arg = - std::get_if(&encodable_list_arg); - api->CallFlutterEchoNullableList( - list_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableEnumList" + - 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_enum_list_arg = args.at(0); - const auto* enum_list_arg = - std::get_if(&encodable_enum_list_arg); - api->CallFlutterEchoNullableEnumList( - enum_list_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableClassList" + - 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_class_list_arg = args.at(0); - const auto* class_list_arg = - std::get_if(&encodable_class_list_arg); - api->CallFlutterEchoNullableClassList( - class_list_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableNonNullEnumList" + - 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_enum_list_arg = args.at(0); - const auto* enum_list_arg = - std::get_if(&encodable_enum_list_arg); - api->CallFlutterEchoNullableNonNullEnumList( - enum_list_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableNonNullClassList" + - 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_class_list_arg = args.at(0); - const auto* class_list_arg = - std::get_if(&encodable_class_list_arg); - api->CallFlutterEchoNullableNonNullClassList( - class_list_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableMap" + - 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_map_arg = args.at(0); - const auto* map_arg = - std::get_if(&encodable_map_arg); - api->CallFlutterEchoNullableMap( - map_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableStringMap" + - 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_string_map_arg = args.at(0); - const auto* string_map_arg = - std::get_if(&encodable_string_map_arg); - api->CallFlutterEchoNullableStringMap( - string_map_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableIntMap" + - 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_int_map_arg = args.at(0); - const auto* int_map_arg = - std::get_if(&encodable_int_map_arg); - api->CallFlutterEchoNullableIntMap( - int_map_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableEnumMap" + - 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_enum_map_arg = args.at(0); - const auto* enum_map_arg = - std::get_if(&encodable_enum_map_arg); - api->CallFlutterEchoNullableEnumMap( - enum_map_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableClassMap" + - 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_class_map_arg = args.at(0); - const auto* class_map_arg = - std::get_if(&encodable_class_map_arg); - api->CallFlutterEchoNullableClassMap( - class_map_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableNonNullStringMap" + - 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_string_map_arg = args.at(0); - const auto* string_map_arg = - std::get_if(&encodable_string_map_arg); - api->CallFlutterEchoNullableNonNullStringMap( - string_map_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableNonNullIntMap" + - 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_int_map_arg = args.at(0); - const auto* int_map_arg = - std::get_if(&encodable_int_map_arg); - api->CallFlutterEchoNullableNonNullIntMap( - int_map_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableNonNullEnumMap" + - 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_enum_map_arg = args.at(0); - const auto* enum_map_arg = - std::get_if(&encodable_enum_map_arg); - api->CallFlutterEchoNullableNonNullEnumMap( - enum_map_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableNonNullClassMap" + - 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_class_map_arg = args.at(0); - const auto* class_map_arg = - std::get_if(&encodable_class_map_arg); - api->CallFlutterEchoNullableNonNullClassMap( - class_map_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableEnum" + - 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_an_enum_arg = args.at(0); - AnEnum an_enum_arg_value; - const AnEnum* an_enum_arg = nullptr; - if (!encodable_an_enum_arg.IsNull()) { - an_enum_arg_value = std::any_cast( - std::get(encodable_an_enum_arg)); - an_enum_arg = &an_enum_arg_value; - } - api->CallFlutterEchoNullableEnum( - an_enum_arg ? &(*an_enum_arg) : nullptr, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(CustomEncodableValue( - std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoAnotherNullableEnum" + - 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_another_enum_arg = args.at(0); - AnotherEnum another_enum_arg_value; - const AnotherEnum* another_enum_arg = nullptr; - if (!encodable_another_enum_arg.IsNull()) { - another_enum_arg_value = std::any_cast( - std::get(encodable_another_enum_arg)); - another_enum_arg = &another_enum_arg_value; - } - api->CallFlutterEchoAnotherNullableEnum( - another_enum_arg ? &(*another_enum_arg) : nullptr, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(CustomEncodableValue( - std::move(output_optional).value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterSmallApiEchoString" + - 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_a_string_arg = args.at(0); - if (encodable_a_string_arg.IsNull()) { - reply(WrapError("a_string_arg unexpectedly null.")); - return; - } - const auto& a_string_arg = - std::get(encodable_a_string_arg); - api->CallFlutterSmallApiEchoString( - a_string_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); - } else { - channel.SetMessageHandler(nullptr); - } - } -} - -EncodableValue HostIntegrationCoreApi::WrapError( - std::string_view error_message) { - return EncodableValue( - EncodableList{EncodableValue(std::string(error_message)), - EncodableValue("Error"), EncodableValue()}); -} - -EncodableValue HostIntegrationCoreApi::WrapError(const FlutterError& error) { - return EncodableValue(EncodableList{EncodableValue(error.code()), - EncodableValue(error.message()), - error.details()}); -} - -// Generated class from Pigeon that represents Flutter messages that can be -// called from C++. -FlutterIntegrationCoreApi::FlutterIntegrationCoreApi( - ::flutter::BinaryMessenger* binary_messenger) - : binary_messenger_(binary_messenger), message_channel_suffix_("") {} - -FlutterIntegrationCoreApi::FlutterIntegrationCoreApi( - ::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& FlutterIntegrationCoreApi::GetCodec() { - return ::flutter::StandardMessageCodec::GetInstance( - &PigeonInternalCodecSerializer::GetInstance()); -} - -void FlutterIntegrationCoreApi::Noop( - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "noop" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - on_success(); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} - -void FlutterIntegrationCoreApi::ThrowError( - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "throwError" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto* return_value = &list_return_value->at(0); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} - -void FlutterIntegrationCoreApi::ThrowErrorFromVoid( - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "throwErrorFromVoid" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - on_success(); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} - -void FlutterIntegrationCoreApi::EchoAllTypes( - const AllTypes& everything_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoAllTypes" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - CustomEncodableValue(everything_arg), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = std::any_cast( - std::get(list_return_value->at(0))); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} - -void FlutterIntegrationCoreApi::EchoAllNullableTypes( - const AllNullableTypes* everything_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoAllNullableTypes" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - everything_arg ? CustomEncodableValue(*everything_arg) : EncodableValue(), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto* return_value = - list_return_value->at(0).IsNull() - ? nullptr - : &(std::any_cast( - std::get( - list_return_value->at(0)))); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} - -void FlutterIntegrationCoreApi::SendMultipleNullableTypes( - const bool* a_nullable_bool_arg, const int64_t* a_nullable_int_arg, - const std::string* a_nullable_string_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "sendMultipleNullableTypes" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - a_nullable_bool_arg ? EncodableValue(*a_nullable_bool_arg) - : EncodableValue(), - a_nullable_int_arg ? EncodableValue(*a_nullable_int_arg) - : EncodableValue(), - a_nullable_string_arg ? EncodableValue(*a_nullable_string_arg) - : EncodableValue(), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = std::any_cast( - std::get(list_return_value->at(0))); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} - -void FlutterIntegrationCoreApi::EchoAllNullableTypesWithoutRecursion( - const AllNullableTypesWithoutRecursion* everything_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoAllNullableTypesWithoutRecursion" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - everything_arg ? CustomEncodableValue(*everything_arg) : EncodableValue(), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto* return_value = - list_return_value->at(0).IsNull() - ? nullptr - : &(std::any_cast( - std::get( - list_return_value->at(0)))); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} - -void FlutterIntegrationCoreApi::SendMultipleNullableTypesWithoutRecursion( - const bool* a_nullable_bool_arg, const int64_t* a_nullable_int_arg, - const std::string* a_nullable_string_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "sendMultipleNullableTypesWithoutRecursion" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - a_nullable_bool_arg ? EncodableValue(*a_nullable_bool_arg) - : EncodableValue(), - a_nullable_int_arg ? EncodableValue(*a_nullable_int_arg) - : EncodableValue(), - a_nullable_string_arg ? EncodableValue(*a_nullable_string_arg) - : EncodableValue(), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = - std::any_cast( - std::get(list_return_value->at(0))); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} - -void FlutterIntegrationCoreApi::EchoBool( - bool a_bool_arg, std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoBool" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(a_bool_arg), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = std::get(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} - -void FlutterIntegrationCoreApi::EchoInt( - int64_t an_int_arg, std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoInt" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(an_int_arg), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const int64_t return_value = list_return_value->at(0).LongValue(); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} - -void FlutterIntegrationCoreApi::EchoDouble( - double a_double_arg, std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoDouble" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(a_double_arg), - }); - channel.Send(encoded_api_arguments, [channel_name, - on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, - size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error(FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = std::get(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} - -void FlutterIntegrationCoreApi::EchoString( - const std::string& a_string_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoString" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(a_string_arg), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = - std::get(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} - -void FlutterIntegrationCoreApi::EchoUint8List( - const std::vector& list_arg, - std::function&)>&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoUint8List" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(list_arg), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = - std::get>(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} - -void FlutterIntegrationCoreApi::EchoList( - const EncodableList& list_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoList" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(list_arg), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = - std::get(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} - -void FlutterIntegrationCoreApi::EchoEnumList( - const EncodableList& enum_list_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoEnumList" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(enum_list_arg), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = - std::get(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} - -void FlutterIntegrationCoreApi::EchoClassList( - const EncodableList& class_list_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoClassList" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(class_list_arg), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = - std::get(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} - -void FlutterIntegrationCoreApi::EchoNonNullEnumList( - const EncodableList& enum_list_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNonNullEnumList" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(enum_list_arg), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = - std::get(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} - -void FlutterIntegrationCoreApi::EchoNonNullClassList( - const EncodableList& class_list_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNonNullClassList" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(class_list_arg), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = - std::get(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} - -void FlutterIntegrationCoreApi::EchoMap( - const EncodableMap& map_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoMap" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(map_arg), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = - std::get(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} - -void FlutterIntegrationCoreApi::EchoStringMap( - const EncodableMap& string_map_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoStringMap" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(string_map_arg), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = - std::get(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} - -void FlutterIntegrationCoreApi::EchoIntMap( - const EncodableMap& int_map_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoIntMap" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(int_map_arg), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = - std::get(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} - -void FlutterIntegrationCoreApi::EchoEnumMap( - const EncodableMap& enum_map_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoEnumMap" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(enum_map_arg), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = - std::get(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} - -void FlutterIntegrationCoreApi::EchoClassMap( - const EncodableMap& class_map_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoClassMap" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(class_map_arg), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = - std::get(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} - -void FlutterIntegrationCoreApi::EchoNonNullStringMap( - const EncodableMap& string_map_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNonNullStringMap" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(string_map_arg), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = - std::get(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} - -void FlutterIntegrationCoreApi::EchoNonNullIntMap( - const EncodableMap& int_map_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNonNullIntMap" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(int_map_arg), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = - std::get(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} - -void FlutterIntegrationCoreApi::EchoNonNullEnumMap( - const EncodableMap& enum_map_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNonNullEnumMap" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(enum_map_arg), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = - std::get(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} - -void FlutterIntegrationCoreApi::EchoNonNullClassMap( - const EncodableMap& class_map_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNonNullClassMap" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(class_map_arg), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = - std::get(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} - -void FlutterIntegrationCoreApi::EchoEnum( - const AnEnum& an_enum_arg, std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoEnum" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - CustomEncodableValue(an_enum_arg), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = std::any_cast( - std::get(list_return_value->at(0))); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} - -void FlutterIntegrationCoreApi::EchoAnotherEnum( - const AnotherEnum& another_enum_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoAnotherEnum" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - CustomEncodableValue(another_enum_arg), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = std::any_cast( - std::get(list_return_value->at(0))); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} - -void FlutterIntegrationCoreApi::EchoNullableBool( - const bool* a_bool_arg, std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableBool" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - a_bool_arg ? EncodableValue(*a_bool_arg) : EncodableValue(), - }); - channel.Send(encoded_api_arguments, [channel_name, - on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, - size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error(FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto* return_value = std::get_if(&list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} - -void FlutterIntegrationCoreApi::EchoNullableInt( - const int64_t* an_int_arg, std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableInt" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - an_int_arg ? EncodableValue(*an_int_arg) : EncodableValue(), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto* return_value = - std::get_if(&list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} - -void FlutterIntegrationCoreApi::EchoNullableDouble( - const double* a_double_arg, std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableDouble" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - a_double_arg ? EncodableValue(*a_double_arg) : EncodableValue(), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto* return_value = - std::get_if(&list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} - -void FlutterIntegrationCoreApi::EchoNullableString( - const std::string* a_string_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableString" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - a_string_arg ? EncodableValue(*a_string_arg) : EncodableValue(), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto* return_value = - std::get_if(&list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} - -void FlutterIntegrationCoreApi::EchoNullableUint8List( - const std::vector* list_arg, - std::function*)>&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableUint8List" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - list_arg ? EncodableValue(*list_arg) : EncodableValue(), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto* return_value = - std::get_if>(&list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} - -void FlutterIntegrationCoreApi::EchoNullableList( - const EncodableList* list_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableList" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - list_arg ? EncodableValue(*list_arg) : EncodableValue(), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto* return_value = - std::get_if(&list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} - -void FlutterIntegrationCoreApi::EchoNullableEnumList( - const EncodableList* enum_list_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableEnumList" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - enum_list_arg ? EncodableValue(*enum_list_arg) : EncodableValue(), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto* return_value = - std::get_if(&list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} - -void FlutterIntegrationCoreApi::EchoNullableClassList( - const EncodableList* class_list_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableClassList" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - class_list_arg ? EncodableValue(*class_list_arg) : EncodableValue(), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto* return_value = - std::get_if(&list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} - -void FlutterIntegrationCoreApi::EchoNullableNonNullEnumList( - const EncodableList* enum_list_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableNonNullEnumList" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - enum_list_arg ? EncodableValue(*enum_list_arg) : EncodableValue(), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto* return_value = - std::get_if(&list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} + const EncodableMap* AllNullableTypes::string_map() const { + return string_map_ ? &(*string_map_) : nullptr; + } -void FlutterIntegrationCoreApi::EchoNullableNonNullClassList( - const EncodableList* class_list_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableNonNullClassList" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - class_list_arg ? EncodableValue(*class_list_arg) : EncodableValue(), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto* return_value = - std::get_if(&list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} + void AllNullableTypes::set_string_map(const EncodableMap* value_arg) { + string_map_ = + value_arg ? std::optional(*value_arg) : std::nullopt; + } -void FlutterIntegrationCoreApi::EchoNullableMap( - const EncodableMap* map_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableMap" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - map_arg ? EncodableValue(*map_arg) : EncodableValue(), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto* return_value = - std::get_if(&list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} + void AllNullableTypes::set_string_map(const EncodableMap& value_arg) { + string_map_ = value_arg; + } -void FlutterIntegrationCoreApi::EchoNullableStringMap( - const EncodableMap* string_map_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableStringMap" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - string_map_arg ? EncodableValue(*string_map_arg) : EncodableValue(), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto* return_value = - std::get_if(&list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} + const EncodableMap* AllNullableTypes::int_map() const { + return int_map_ ? &(*int_map_) : nullptr; + } -void FlutterIntegrationCoreApi::EchoNullableIntMap( - const EncodableMap* int_map_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableIntMap" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - int_map_arg ? EncodableValue(*int_map_arg) : EncodableValue(), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto* return_value = - std::get_if(&list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} + void AllNullableTypes::set_int_map(const EncodableMap* value_arg) { + int_map_ = + value_arg ? std::optional(*value_arg) : std::nullopt; + } -void FlutterIntegrationCoreApi::EchoNullableEnumMap( - const EncodableMap* enum_map_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableEnumMap" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - enum_map_arg ? EncodableValue(*enum_map_arg) : EncodableValue(), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto* return_value = - std::get_if(&list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} + void AllNullableTypes::set_int_map(const EncodableMap& value_arg) { + int_map_ = value_arg; + } -void FlutterIntegrationCoreApi::EchoNullableClassMap( - const EncodableMap* class_map_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableClassMap" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - class_map_arg ? EncodableValue(*class_map_arg) : EncodableValue(), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto* return_value = - std::get_if(&list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} + const EncodableMap* AllNullableTypes::enum_map() const { + return enum_map_ ? &(*enum_map_) : nullptr; + } -void FlutterIntegrationCoreApi::EchoNullableNonNullStringMap( - const EncodableMap* string_map_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableNonNullStringMap" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - string_map_arg ? EncodableValue(*string_map_arg) : EncodableValue(), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto* return_value = - std::get_if(&list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} + void AllNullableTypes::set_enum_map(const EncodableMap* value_arg) { + enum_map_ = + value_arg ? std::optional(*value_arg) : std::nullopt; + } -void FlutterIntegrationCoreApi::EchoNullableNonNullIntMap( - const EncodableMap* int_map_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableNonNullIntMap" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - int_map_arg ? EncodableValue(*int_map_arg) : EncodableValue(), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto* return_value = - std::get_if(&list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} + void AllNullableTypes::set_enum_map(const EncodableMap& value_arg) { + enum_map_ = value_arg; + } -void FlutterIntegrationCoreApi::EchoNullableNonNullEnumMap( - const EncodableMap* enum_map_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableNonNullEnumMap" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - enum_map_arg ? EncodableValue(*enum_map_arg) : EncodableValue(), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto* return_value = - std::get_if(&list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} + const EncodableMap* AllNullableTypes::object_map() const { + return object_map_ ? &(*object_map_) : nullptr; + } -void FlutterIntegrationCoreApi::EchoNullableNonNullClassMap( - const EncodableMap* class_map_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableNonNullClassMap" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - class_map_arg ? EncodableValue(*class_map_arg) : EncodableValue(), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto* return_value = - std::get_if(&list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} + void AllNullableTypes::set_object_map(const EncodableMap* value_arg) { + object_map_ = + value_arg ? std::optional(*value_arg) : std::nullopt; + } -void FlutterIntegrationCoreApi::EchoNullableEnum( - const AnEnum* an_enum_arg, std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableEnum" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - an_enum_arg ? CustomEncodableValue(*an_enum_arg) : EncodableValue(), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - AnEnum return_value_value; - const AnEnum* return_value = nullptr; - if (!list_return_value->at(0).IsNull()) { - return_value_value = std::any_cast( - std::get(list_return_value->at(0))); - return_value = &return_value_value; - } - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} + void AllNullableTypes::set_object_map(const EncodableMap& value_arg) { + object_map_ = value_arg; + } -void FlutterIntegrationCoreApi::EchoAnotherNullableEnum( - const AnotherEnum* another_enum_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoAnotherNullableEnum" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - another_enum_arg ? CustomEncodableValue(*another_enum_arg) - : EncodableValue(), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - AnotherEnum return_value_value; - const AnotherEnum* return_value = nullptr; - if (!list_return_value->at(0).IsNull()) { - return_value_value = std::any_cast( - std::get(list_return_value->at(0))); - return_value = &return_value_value; - } - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} + const EncodableMap* AllNullableTypes::list_map() const { + return list_map_ ? &(*list_map_) : nullptr; + } -void FlutterIntegrationCoreApi::NoopAsync( - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "noopAsync" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - on_success(); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} + void AllNullableTypes::set_list_map(const EncodableMap* value_arg) { + list_map_ = + value_arg ? std::optional(*value_arg) : std::nullopt; + } -void FlutterIntegrationCoreApi::EchoAsyncString( - const std::string& a_string_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoAsyncString" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(a_string_arg), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = - std::get(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} + void AllNullableTypes::set_list_map(const EncodableMap& value_arg) { + list_map_ = value_arg; + } -/// The codec used by HostTrivialApi. -const ::flutter::StandardMessageCodec& HostTrivialApi::GetCodec() { - return ::flutter::StandardMessageCodec::GetInstance( - &PigeonInternalCodecSerializer::GetInstance()); -} + const EncodableMap* AllNullableTypes::map_map() const { + return map_map_ ? &(*map_map_) : nullptr; + } -// Sets up an instance of `HostTrivialApi` to handle messages through the -// `binary_messenger`. -void HostTrivialApi::SetUp(::flutter::BinaryMessenger* binary_messenger, - HostTrivialApi* api) { - HostTrivialApi::SetUp(binary_messenger, api, ""); -} + void AllNullableTypes::set_map_map(const EncodableMap* value_arg) { + map_map_ = + value_arg ? std::optional(*value_arg) : std::nullopt; + } -void HostTrivialApi::SetUp(::flutter::BinaryMessenger* binary_messenger, - HostTrivialApi* api, - const std::string& message_channel_suffix) { - const std::string prepended_suffix = - message_channel_suffix.length() > 0 - ? std::string(".") + message_channel_suffix - : ""; - { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostTrivialApi.noop" + - prepended_suffix, - &GetCodec()); - if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const ::flutter::MessageReply& reply) { - try { - std::optional output = api->Noop(); - 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); - } + void AllNullableTypes::set_map_map(const EncodableMap& value_arg) { + map_map_ = value_arg; } -} -EncodableValue HostTrivialApi::WrapError(std::string_view error_message) { - return EncodableValue( - EncodableList{EncodableValue(std::string(error_message)), - EncodableValue("Error"), EncodableValue()}); -} + const EncodableMap* AllNullableTypes::recursive_class_map() const { + return recursive_class_map_ ? &(*recursive_class_map_) : nullptr; + } -EncodableValue HostTrivialApi::WrapError(const FlutterError& error) { - return EncodableValue(EncodableList{EncodableValue(error.code()), - EncodableValue(error.message()), - error.details()}); -} + void AllNullableTypes::set_recursive_class_map( + const EncodableMap* value_arg) { + recursive_class_map_ = + value_arg ? std::optional(*value_arg) : std::nullopt; + } -/// The codec used by HostSmallApi. -const ::flutter::StandardMessageCodec& HostSmallApi::GetCodec() { - return ::flutter::StandardMessageCodec::GetInstance( - &PigeonInternalCodecSerializer::GetInstance()); -} + void AllNullableTypes::set_recursive_class_map( + const EncodableMap& value_arg) { + recursive_class_map_ = value_arg; + } -// Sets up an instance of `HostSmallApi` to handle messages through the -// `binary_messenger`. -void HostSmallApi::SetUp(::flutter::BinaryMessenger* binary_messenger, - HostSmallApi* api) { - HostSmallApi::SetUp(binary_messenger, api, ""); -} + EncodableList AllNullableTypes::ToEncodableList() const { + EncodableList list; + list.reserve(31); + list.push_back(a_nullable_bool_ ? EncodableValue(*a_nullable_bool_) + : EncodableValue()); + list.push_back(a_nullable_int_ ? EncodableValue(*a_nullable_int_) + : EncodableValue()); + list.push_back(a_nullable_int64_ ? EncodableValue(*a_nullable_int64_) + : EncodableValue()); + list.push_back(a_nullable_double_ ? EncodableValue(*a_nullable_double_) + : EncodableValue()); + list.push_back(a_nullable_byte_array_ + ? EncodableValue(*a_nullable_byte_array_) + : EncodableValue()); + list.push_back(a_nullable4_byte_array_ + ? EncodableValue(*a_nullable4_byte_array_) + : EncodableValue()); + list.push_back(a_nullable8_byte_array_ + ? EncodableValue(*a_nullable8_byte_array_) + : EncodableValue()); + list.push_back(a_nullable_float_array_ + ? EncodableValue(*a_nullable_float_array_) + : EncodableValue()); + list.push_back(a_nullable_enum_ ? CustomEncodableValue(*a_nullable_enum_) + : EncodableValue()); + list.push_back(another_nullable_enum_ + ? CustomEncodableValue(*another_nullable_enum_) + : EncodableValue()); + list.push_back(a_nullable_string_ ? EncodableValue(*a_nullable_string_) + : EncodableValue()); + list.push_back(a_nullable_object_ ? *a_nullable_object_ : EncodableValue()); + list.push_back(all_nullable_types_ + ? CustomEncodableValue(*all_nullable_types_) + : EncodableValue()); + list.push_back(list_ ? EncodableValue(*list_) : EncodableValue()); + list.push_back(string_list_ ? EncodableValue(*string_list_) + : EncodableValue()); + list.push_back(int_list_ ? EncodableValue(*int_list_) : EncodableValue()); + list.push_back(double_list_ ? EncodableValue(*double_list_) + : EncodableValue()); + list.push_back(bool_list_ ? EncodableValue(*bool_list_) : EncodableValue()); + list.push_back(enum_list_ ? EncodableValue(*enum_list_) : EncodableValue()); + list.push_back(object_list_ ? EncodableValue(*object_list_) + : EncodableValue()); + list.push_back(list_list_ ? EncodableValue(*list_list_) : EncodableValue()); + list.push_back(map_list_ ? EncodableValue(*map_list_) : EncodableValue()); + list.push_back(recursive_class_list_ + ? EncodableValue(*recursive_class_list_) + : EncodableValue()); + list.push_back(map_ ? EncodableValue(*map_) : EncodableValue()); + list.push_back(string_map_ ? EncodableValue(*string_map_) + : EncodableValue()); + list.push_back(int_map_ ? EncodableValue(*int_map_) : EncodableValue()); + list.push_back(enum_map_ ? EncodableValue(*enum_map_) : EncodableValue()); + list.push_back(object_map_ ? EncodableValue(*object_map_) + : EncodableValue()); + list.push_back(list_map_ ? EncodableValue(*list_map_) : EncodableValue()); + list.push_back(map_map_ ? EncodableValue(*map_map_) : EncodableValue()); + list.push_back(recursive_class_map_ ? EncodableValue(*recursive_class_map_) + : EncodableValue()); + return list; + } -void HostSmallApi::SetUp(::flutter::BinaryMessenger* binary_messenger, - HostSmallApi* api, - const std::string& message_channel_suffix) { - const std::string prepended_suffix = - message_channel_suffix.length() > 0 - ? std::string(".") + message_channel_suffix - : ""; - { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.echo" + - 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_a_string_arg = args.at(0); - if (encodable_a_string_arg.IsNull()) { - reply(WrapError("a_string_arg unexpectedly null.")); - return; - } - const auto& a_string_arg = - std::get(encodable_a_string_arg); - api->Echo(a_string_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); - } else { - channel.SetMessageHandler(nullptr); + AllNullableTypes AllNullableTypes::FromEncodableList( + const EncodableList& list) { + AllNullableTypes decoded; + auto& encodable_a_nullable_bool = list[0]; + if (!encodable_a_nullable_bool.IsNull()) { + decoded.set_a_nullable_bool(std::get(encodable_a_nullable_bool)); } - } - { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.voidVoid" + - prepended_suffix, - &GetCodec()); - if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const ::flutter::MessageReply& reply) { - try { - api->VoidVoid([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); + auto& encodable_a_nullable_int = list[1]; + if (!encodable_a_nullable_int.IsNull()) { + decoded.set_a_nullable_int(std::get(encodable_a_nullable_int)); + } + auto& encodable_a_nullable_int64 = list[2]; + if (!encodable_a_nullable_int64.IsNull()) { + decoded.set_a_nullable_int64( + std::get(encodable_a_nullable_int64)); + } + auto& encodable_a_nullable_double = list[3]; + if (!encodable_a_nullable_double.IsNull()) { + decoded.set_a_nullable_double( + std::get(encodable_a_nullable_double)); + } + auto& encodable_a_nullable_byte_array = list[4]; + if (!encodable_a_nullable_byte_array.IsNull()) { + decoded.set_a_nullable_byte_array( + std::get>(encodable_a_nullable_byte_array)); + } + auto& encodable_a_nullable4_byte_array = list[5]; + if (!encodable_a_nullable4_byte_array.IsNull()) { + decoded.set_a_nullable4_byte_array( + std::get>(encodable_a_nullable4_byte_array)); + } + auto& encodable_a_nullable8_byte_array = list[6]; + if (!encodable_a_nullable8_byte_array.IsNull()) { + decoded.set_a_nullable8_byte_array( + std::get>(encodable_a_nullable8_byte_array)); + } + auto& encodable_a_nullable_float_array = list[7]; + if (!encodable_a_nullable_float_array.IsNull()) { + decoded.set_a_nullable_float_array( + std::get>(encodable_a_nullable_float_array)); + } + auto& encodable_a_nullable_enum = list[8]; + if (!encodable_a_nullable_enum.IsNull()) { + decoded.set_a_nullable_enum(std::any_cast( + std::get(encodable_a_nullable_enum))); + } + auto& encodable_another_nullable_enum = list[9]; + if (!encodable_another_nullable_enum.IsNull()) { + decoded.set_another_nullable_enum(std::any_cast( + std::get(encodable_another_nullable_enum))); + } + auto& encodable_a_nullable_string = list[10]; + if (!encodable_a_nullable_string.IsNull()) { + decoded.set_a_nullable_string( + std::get(encodable_a_nullable_string)); + } + auto& encodable_a_nullable_object = list[11]; + if (!encodable_a_nullable_object.IsNull()) { + decoded.set_a_nullable_object(encodable_a_nullable_object); + } + auto& encodable_all_nullable_types = list[12]; + if (!encodable_all_nullable_types.IsNull()) { + decoded.set_all_nullable_types(std::any_cast( + std::get(encodable_all_nullable_types))); + } + auto& encodable_list = list[13]; + if (!encodable_list.IsNull()) { + decoded.set_list(std::get(encodable_list)); + } + auto& encodable_string_list = list[14]; + if (!encodable_string_list.IsNull()) { + decoded.set_string_list(std::get(encodable_string_list)); + } + auto& encodable_int_list = list[15]; + if (!encodable_int_list.IsNull()) { + decoded.set_int_list(std::get(encodable_int_list)); + } + auto& encodable_double_list = list[16]; + if (!encodable_double_list.IsNull()) { + decoded.set_double_list(std::get(encodable_double_list)); + } + auto& encodable_bool_list = list[17]; + if (!encodable_bool_list.IsNull()) { + decoded.set_bool_list(std::get(encodable_bool_list)); + } + auto& encodable_enum_list = list[18]; + if (!encodable_enum_list.IsNull()) { + decoded.set_enum_list(std::get(encodable_enum_list)); + } + auto& encodable_object_list = list[19]; + if (!encodable_object_list.IsNull()) { + decoded.set_object_list(std::get(encodable_object_list)); + } + auto& encodable_list_list = list[20]; + if (!encodable_list_list.IsNull()) { + decoded.set_list_list(std::get(encodable_list_list)); } + auto& encodable_map_list = list[21]; + if (!encodable_map_list.IsNull()) { + decoded.set_map_list(std::get(encodable_map_list)); + } + auto& encodable_recursive_class_list = list[22]; + if (!encodable_recursive_class_list.IsNull()) { + decoded.set_recursive_class_list( + std::get(encodable_recursive_class_list)); + } + auto& encodable_map = list[23]; + if (!encodable_map.IsNull()) { + decoded.set_map(std::get(encodable_map)); + } + auto& encodable_string_map = list[24]; + if (!encodable_string_map.IsNull()) { + decoded.set_string_map(std::get(encodable_string_map)); + } + auto& encodable_int_map = list[25]; + if (!encodable_int_map.IsNull()) { + decoded.set_int_map(std::get(encodable_int_map)); + } + auto& encodable_enum_map = list[26]; + if (!encodable_enum_map.IsNull()) { + decoded.set_enum_map(std::get(encodable_enum_map)); + } + auto& encodable_object_map = list[27]; + if (!encodable_object_map.IsNull()) { + decoded.set_object_map(std::get(encodable_object_map)); + } + auto& encodable_list_map = list[28]; + if (!encodable_list_map.IsNull()) { + decoded.set_list_map(std::get(encodable_list_map)); + } + auto& encodable_map_map = list[29]; + if (!encodable_map_map.IsNull()) { + decoded.set_map_map(std::get(encodable_map_map)); + } + auto& encodable_recursive_class_map = list[30]; + if (!encodable_recursive_class_map.IsNull()) { + decoded.set_recursive_class_map( + std::get(encodable_recursive_class_map)); + } + return decoded; } -} -EncodableValue HostSmallApi::WrapError(std::string_view error_message) { - return EncodableValue( - EncodableList{EncodableValue(std::string(error_message)), - EncodableValue("Error"), EncodableValue()}); -} + bool AllNullableTypes::operator==(const AllNullableTypes& other) const { + return PigeonInternalDeepEquals(a_nullable_bool_, other.a_nullable_bool_) && + PigeonInternalDeepEquals(a_nullable_int_, other.a_nullable_int_) && + PigeonInternalDeepEquals(a_nullable_int64_, + other.a_nullable_int64_) && + PigeonInternalDeepEquals(a_nullable_double_, + other.a_nullable_double_) && + PigeonInternalDeepEquals(a_nullable_byte_array_, + other.a_nullable_byte_array_) && + PigeonInternalDeepEquals(a_nullable4_byte_array_, + other.a_nullable4_byte_array_) && + PigeonInternalDeepEquals(a_nullable8_byte_array_, + other.a_nullable8_byte_array_) && + PigeonInternalDeepEquals(a_nullable_float_array_, + other.a_nullable_float_array_) && + PigeonInternalDeepEquals(a_nullable_enum_, other.a_nullable_enum_) && + PigeonInternalDeepEquals(another_nullable_enum_, + other.another_nullable_enum_) && + PigeonInternalDeepEquals(a_nullable_string_, + other.a_nullable_string_) && + PigeonInternalDeepEquals(a_nullable_object_, + other.a_nullable_object_) && + PigeonInternalDeepEquals(all_nullable_types_, + other.all_nullable_types_) && + PigeonInternalDeepEquals(list_, other.list_) && + PigeonInternalDeepEquals(string_list_, other.string_list_) && + PigeonInternalDeepEquals(int_list_, other.int_list_) && + PigeonInternalDeepEquals(double_list_, other.double_list_) && + PigeonInternalDeepEquals(bool_list_, other.bool_list_) && + PigeonInternalDeepEquals(enum_list_, other.enum_list_) && + PigeonInternalDeepEquals(object_list_, other.object_list_) && + PigeonInternalDeepEquals(list_list_, other.list_list_) && + PigeonInternalDeepEquals(map_list_, other.map_list_) && + PigeonInternalDeepEquals(recursive_class_list_, + other.recursive_class_list_) && + PigeonInternalDeepEquals(map_, other.map_) && + PigeonInternalDeepEquals(string_map_, other.string_map_) && + PigeonInternalDeepEquals(int_map_, other.int_map_) && + PigeonInternalDeepEquals(enum_map_, other.enum_map_) && + PigeonInternalDeepEquals(object_map_, other.object_map_) && + PigeonInternalDeepEquals(list_map_, other.list_map_) && + PigeonInternalDeepEquals(map_map_, other.map_map_) && + PigeonInternalDeepEquals(recursive_class_map_, + other.recursive_class_map_); + } -EncodableValue HostSmallApi::WrapError(const FlutterError& error) { - return EncodableValue(EncodableList{EncodableValue(error.code()), - EncodableValue(error.message()), - error.details()}); -} + bool AllNullableTypes::operator!=(const AllNullableTypes& other) const { + return !(*this == other); + } -// Generated class from Pigeon that represents Flutter messages that can be -// called from C++. -FlutterSmallApi::FlutterSmallApi(::flutter::BinaryMessenger* binary_messenger) - : binary_messenger_(binary_messenger), message_channel_suffix_("") {} - -FlutterSmallApi::FlutterSmallApi(::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& FlutterSmallApi::GetCodec() { - return ::flutter::StandardMessageCodec::GetInstance( - &PigeonInternalCodecSerializer::GetInstance()); -} + size_t AllNullableTypes::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(a_nullable_bool_); + result = result * 31 + PigeonInternalDeepHash(a_nullable_int_); + result = result * 31 + PigeonInternalDeepHash(a_nullable_int64_); + result = result * 31 + PigeonInternalDeepHash(a_nullable_double_); + result = result * 31 + PigeonInternalDeepHash(a_nullable_byte_array_); + result = result * 31 + PigeonInternalDeepHash(a_nullable4_byte_array_); + result = result * 31 + PigeonInternalDeepHash(a_nullable8_byte_array_); + result = result * 31 + PigeonInternalDeepHash(a_nullable_float_array_); + result = result * 31 + PigeonInternalDeepHash(a_nullable_enum_); + result = result * 31 + PigeonInternalDeepHash(another_nullable_enum_); + result = result * 31 + PigeonInternalDeepHash(a_nullable_string_); + result = result * 31 + PigeonInternalDeepHash(a_nullable_object_); + result = result * 31 + PigeonInternalDeepHash(all_nullable_types_); + result = result * 31 + PigeonInternalDeepHash(list_); + result = result * 31 + PigeonInternalDeepHash(string_list_); + result = result * 31 + PigeonInternalDeepHash(int_list_); + result = result * 31 + PigeonInternalDeepHash(double_list_); + result = result * 31 + PigeonInternalDeepHash(bool_list_); + result = result * 31 + PigeonInternalDeepHash(enum_list_); + result = result * 31 + PigeonInternalDeepHash(object_list_); + result = result * 31 + PigeonInternalDeepHash(list_list_); + result = result * 31 + PigeonInternalDeepHash(map_list_); + result = result * 31 + PigeonInternalDeepHash(recursive_class_list_); + result = result * 31 + PigeonInternalDeepHash(map_); + result = result * 31 + PigeonInternalDeepHash(string_map_); + result = result * 31 + PigeonInternalDeepHash(int_map_); + result = result * 31 + PigeonInternalDeepHash(enum_map_); + result = result * 31 + PigeonInternalDeepHash(object_map_); + result = result * 31 + PigeonInternalDeepHash(list_map_); + result = result * 31 + PigeonInternalDeepHash(map_map_); + result = result * 31 + PigeonInternalDeepHash(recursive_class_map_); + return result; + } -void FlutterSmallApi::EchoWrappedList( - const TestMessage& msg_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi." - "echoWrappedList" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - CustomEncodableValue(msg_arg), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = std::any_cast( - std::get(list_return_value->at(0))); - on_success(return_value); - } + std::string AllNullableTypes::ToString() const { + std::stringstream ss; + ss << "AllNullableTypes("; + ss << "aNullableBool: "; + if (a_nullable_bool_.has_value()) { + ss << *a_nullable_bool_; + } else { + ss << "null"; + ss << ", aNullableInt: "; + if (a_nullable_int_.has_value()) { + ss << *a_nullable_int_; + } else { + ss << "null"; + ss << ", aNullableInt64: "; + if (a_nullable_int64_.has_value()) { + ss << *a_nullable_int64_; } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} - -void FlutterSmallApi::EchoString( - const std::string& a_string_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoString" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(a_string_arg), - }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); + ss << "null"; + ss << ", aNullableDouble: "; + if (a_nullable_double_.has_value()) { + ss << *a_nullable_double_; } else { - const auto& return_value = - std::get(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} - -} // namespace core_tests_pigeontest + ss << "null"; + ss << ", aNullableByteArray: "; + if (a_nullable_byte_array_.has_value()) { + ss << *a_nullable_byte_array_; + } else { + ss << "null"; + ss << ", aNullable4ByteArray: "; + if (a_nullable4_byte_array_.has_value()) { + ss << *a_nullable4_byte_array_; + } else { + ss << "null"; + ss << ", aNullable8ByteArray: "; + if (a_nullable8_byte_array_.has_value()) { + ss << *a_nullable8_byte_array_; + } else { + ss << "null"; + ss << ", aNullableFloatArray: "; + if (a_nullable_float_array_.has_value()) { + ss << *a_nullable_float_array_; + } else { + ss << "null"; + ss << ", aNullableEnum: "; + if (a_nullable_enum_.has_value()) { + ss << *a_nullable_enum_; + } else { + ss << "null"; + ss << ", anotherNullableEnum: "; + if (another_nullable_enum_.has_value()) { + ss << *another_nullable_enum_; + } else { + ss << "null"; + ss << ", aNullableString: "; + if (a_nullable_string_.has_value()) { + ss << *a_nullable_string_; + } else { + ss << "null"; + ss << ", aNullableObject: "; + if (a_nullable_object_.has_value()) { + ss << *a_nullable_object_; + } else { + ss << "null"; + ss << ", allNullableTypes: "; + if (all_nullable_types_.has_value()) { + ss << all_nullable_types_->ToString(); + } else { + ss << "null"; + ss << ", list: "; + if (list_.has_value()) { + ss << *list_; + } else { + ss << "null"; + ss << ", stringList: "; + if (string_list_.has_value()) { + ss << *string_list_; + } else { + ss << "null"; + ss << ", intList: "; + if (int_list_.has_value()) { + ss << *int_list_; + } else { + ss << "null"; + ss << ", doubleList: "; + if (double_list_.has_value()) { + ss << *double_list_; + } else { + ss << "null"; + ss << ", boolList: "; + if (bool_list_.has_value()) { + ss << *bool_list_; + } else { + ss << "null"; + ss << ", enumList: "; + if (enum_list_.has_value()) { + ss << *enum_list_; + } else { + ss << "null"; + ss << ", objectList: "; + if (object_list_.has_value()) { + ss << *object_list_; + } else { + ss << "null"; + ss << ", listList: "; + if (list_list_.has_value()) { + ss << *list_list_; + } else { + ss << "null"; + ss << ", mapList: "; + if (map_list_.has_value()) { + ss << *map_list_; + } else { + ss << "null"; + ss << ", recursiveClassList: "; + if (recursive_class_list_ + .has_value()) { + ss << *recursive_class_list_; + } else { + ss << "null"; + ss << ", map: "; + if (map_.has_value()) { + ss << *map_; + } else { + ss << "null"; + ss << ", stringMap: "; + if (string_map_ + .has_value()) { + ss << *string_map_; + } else { + ss << "null"; + ss << ", intMap: "; + if (int_map_ + .has_value()) { + ss << *int_map_; + } else { + ss << "null"; + ss << ", enumMap: "; + if (enum_map_ + .has_value()) { + ss << *enum_map_; + } else { + ss << "null"; + ss << ", objectMap: "; + if (object_map_ + .has_value()) { + ss << *object_map_; + } else { + ss << "null"; + ss << ", listMap: "; + if (list_map_ + .has_value()) { + ss << *list_map_; + } else { + ss << "null"; + ss << ", " + "mapMap: "; + if (map_map_ + .has_value()) { + ss << *map_map_; + } else { + ss << "null"; + ss << ", " + "recursiv" + "eClassMa" + "p: "; + if (recursive_class_map_ + .has_value()) { + ss << *recursive_class_map_; + } else { + ss << "null"; + ss << ")"; + return ss + .str(); + } + + size_t + PigeonInternalDeepHash( + const AllNullableTypes& + v) { + return v + .Hash(); + } + + // AllNullableTypesWithoutRecursion + + AllNullableTypesWithoutRecursion:: + AllNullableTypesWithoutRecursion() { + } + + AllNullableTypesWithoutRecursion::AllNullableTypesWithoutRecursion( + const bool* + a_nullable_bool, + const int64_t* + a_nullable_int, + const int64_t* + a_nullable_int64, + const double* + a_nullable_double, + const std::vector< + uint8_t>* + a_nullable_byte_array, + const std::vector< + int32_t>* + a_nullable4_byte_array, + const std::vector< + int64_t>* + a_nullable8_byte_array, + const std::vector< + double>* + a_nullable_float_array, + const AnEnum* + a_nullable_enum, + const AnotherEnum* + another_nullable_enum, + const std:: + string* + a_nullable_string, + const EncodableValue* + a_nullable_object, + const EncodableList* + list, + const EncodableList* + string_list, + const EncodableList* + int_list, + const EncodableList* + double_list, + const EncodableList* + bool_list, + const EncodableList* + enum_list, + const EncodableList* + object_list, + const EncodableList* + list_list, + const EncodableList* + map_list, + const EncodableMap* + map, + const EncodableMap* + string_map, + const EncodableMap* + int_map, + const EncodableMap* + enum_map, + const EncodableMap* + object_map, + const EncodableMap* + list_map, + const EncodableMap* + map_map) + : a_nullable_bool_( + a_nullable_bool + ? std::optional< + bool>( + *a_nullable_bool) + : std:: + nullopt), + a_nullable_int_( + a_nullable_int + ? std::optional< + int64_t>( + *a_nullable_int) + : std:: + nullopt), + a_nullable_int64_( + a_nullable_int64 + ? std::optional< + int64_t>( + *a_nullable_int64) + : std:: + nullopt), + a_nullable_double_( + a_nullable_double + ? std::optional< + double>( + *a_nullable_double) + : std:: + nullopt), + a_nullable_byte_array_( + a_nullable_byte_array + ? std::optional< + std::vector< + uint8_t>>( + *a_nullable_byte_array) + : std:: + nullopt), + a_nullable4_byte_array_( + a_nullable4_byte_array + ? std::optional< + std::vector< + int32_t>>( + *a_nullable4_byte_array) + : std:: + nullopt), + a_nullable8_byte_array_( + a_nullable8_byte_array + ? std::optional< + std::vector< + int64_t>>( + *a_nullable8_byte_array) + : std:: + nullopt), + a_nullable_float_array_( + a_nullable_float_array + ? std::optional< + std::vector< + double>>( + *a_nullable_float_array) + : std:: + nullopt), + a_nullable_enum_( + a_nullable_enum + ? std::optional< + AnEnum>( + *a_nullable_enum) + : std:: + nullopt), + another_nullable_enum_( + another_nullable_enum + ? std::optional< + AnotherEnum>( + *another_nullable_enum) + : std:: + nullopt), + a_nullable_string_( + a_nullable_string + ? std::optional< + std:: + string>( + *a_nullable_string) + : std:: + nullopt), + a_nullable_object_( + a_nullable_object + ? std::optional< + EncodableValue>( + *a_nullable_object) + : std:: + nullopt), + list_( + list + ? std::optional< + EncodableList>( + *list) + : std:: + nullopt), + string_list_( + string_list + ? std::optional< + EncodableList>( + *string_list) + : std:: + nullopt), + int_list_( + int_list + ? std::optional< + EncodableList>( + *int_list) + : std:: + nullopt), + double_list_( + double_list + ? std::optional< + EncodableList>( + *double_list) + : std:: + nullopt), + bool_list_( + bool_list ? std::optional( + *bool_list) + : std:: + nullopt), + enum_list_( + enum_list + ? std::optional< + EncodableList>( + *enum_list) + : std:: + nullopt), + object_list_( + object_list + ? std::optional< + EncodableList>( + *object_list) + : std:: + nullopt), + list_list_( + list_list + ? std::optional< + EncodableList>( + *list_list) + : std:: + nullopt), + map_list_( + map_list + ? std::optional< + EncodableList>( + *map_list) + : std:: + nullopt), + map_( + map ? std::optional< + EncodableMap>( + *map) + : std:: + nullopt), + string_map_( + string_map + ? std::optional< + EncodableMap>( + *string_map) + : std:: + nullopt), + int_map_( + int_map + ? std::optional< + EncodableMap>( + *int_map) + : std:: + nullopt), + enum_map_( + enum_map + ? std::optional< + EncodableMap>( + *enum_map) + : std:: + nullopt), + object_map_( + object_map + ? std::optional< + EncodableMap>( + *object_map) + : std:: + nullopt), + list_map_( + list_map + ? std::optional< + EncodableMap>( + *list_map) + : std:: + nullopt), + map_map_( + map_map + ? std::optional< + EncodableMap>( + *map_map) + : std:: + nullopt) { + } + + const bool* + AllNullableTypesWithoutRecursion:: + a_nullable_bool() + const { + return a_nullable_bool_ + ? &(*a_nullable_bool_) + : nullptr; + } + + void + AllNullableTypesWithoutRecursion:: + set_a_nullable_bool( + const bool* + value_arg) { + a_nullable_bool_ = + value_arg + ? std::optional< + bool>( + *value_arg) + : std:: + nullopt; + } + + void + AllNullableTypesWithoutRecursion:: + set_a_nullable_bool( + bool + value_arg) { + a_nullable_bool_ = + value_arg; + } + + const int64_t* + AllNullableTypesWithoutRecursion:: + a_nullable_int() + const { + return a_nullable_int_ + ? &(*a_nullable_int_) + : nullptr; + } + + void + AllNullableTypesWithoutRecursion:: + set_a_nullable_int( + const int64_t* + value_arg) { + a_nullable_int_ = + value_arg + ? std::optional< + int64_t>( + *value_arg) + : std:: + nullopt; + } + + void + AllNullableTypesWithoutRecursion:: + set_a_nullable_int( + int64_t + value_arg) { + a_nullable_int_ = + value_arg; + } + + const int64_t* + AllNullableTypesWithoutRecursion:: + a_nullable_int64() + const { + return a_nullable_int64_ + ? &(*a_nullable_int64_) + : nullptr; + } + + void + AllNullableTypesWithoutRecursion:: + set_a_nullable_int64( + const int64_t* + value_arg) { + a_nullable_int64_ = + value_arg + ? std::optional< + int64_t>( + *value_arg) + : std:: + nullopt; + } + + void + AllNullableTypesWithoutRecursion:: + set_a_nullable_int64( + int64_t + value_arg) { + a_nullable_int64_ = + value_arg; + } + + const double* + AllNullableTypesWithoutRecursion:: + a_nullable_double() + const { + return a_nullable_double_ + ? &(*a_nullable_double_) + : nullptr; + } + + void + AllNullableTypesWithoutRecursion:: + set_a_nullable_double( + const double* + value_arg) { + a_nullable_double_ = + value_arg + ? std::optional< + double>( + *value_arg) + : std:: + nullopt; + } + + void + AllNullableTypesWithoutRecursion:: + set_a_nullable_double( + double + value_arg) { + a_nullable_double_ = + value_arg; + } + + const std::vector< + uint8_t>* + AllNullableTypesWithoutRecursion:: + a_nullable_byte_array() + const { + return a_nullable_byte_array_ + ? &(*a_nullable_byte_array_) + : nullptr; + } + + void + AllNullableTypesWithoutRecursion:: + set_a_nullable_byte_array( + const std::vector< + uint8_t>* + value_arg) { + a_nullable_byte_array_ = + value_arg + ? std::optional< + std::vector< + uint8_t>>( + *value_arg) + : std:: + nullopt; + } + + void + AllNullableTypesWithoutRecursion:: + set_a_nullable_byte_array( + const std::vector< + uint8_t>& + value_arg) { + a_nullable_byte_array_ = + value_arg; + } + + const std::vector< + int32_t>* + AllNullableTypesWithoutRecursion:: + a_nullable4_byte_array() + const { + return a_nullable4_byte_array_ + ? &(*a_nullable4_byte_array_) + : nullptr; + } + + void + AllNullableTypesWithoutRecursion:: + set_a_nullable4_byte_array( + const std::vector< + int32_t>* + value_arg) { + a_nullable4_byte_array_ = + value_arg + ? std::optional< + std::vector< + int32_t>>( + *value_arg) + : std:: + nullopt; + } + + void + AllNullableTypesWithoutRecursion:: + set_a_nullable4_byte_array( + const std::vector< + int32_t>& + value_arg) { + a_nullable4_byte_array_ = + value_arg; + } + + const std::vector< + int64_t>* + AllNullableTypesWithoutRecursion:: + a_nullable8_byte_array() + const { + return a_nullable8_byte_array_ + ? &(*a_nullable8_byte_array_) + : nullptr; + } + + void + AllNullableTypesWithoutRecursion:: + set_a_nullable8_byte_array( + const std::vector< + int64_t>* + value_arg) { + a_nullable8_byte_array_ = + value_arg + ? std::optional< + std::vector< + int64_t>>( + *value_arg) + : std:: + nullopt; + } + + void + AllNullableTypesWithoutRecursion:: + set_a_nullable8_byte_array( + const std::vector< + int64_t>& + value_arg) { + a_nullable8_byte_array_ = + value_arg; + } + + const std::vector< + double>* + AllNullableTypesWithoutRecursion:: + a_nullable_float_array() + const { + return a_nullable_float_array_ + ? &(*a_nullable_float_array_) + : nullptr; + } + + void + AllNullableTypesWithoutRecursion:: + set_a_nullable_float_array( + const std::vector< + double>* + value_arg) { + a_nullable_float_array_ = + value_arg + ? std::optional< + std::vector< + double>>( + *value_arg) + : std:: + nullopt; + } + + void + AllNullableTypesWithoutRecursion:: + set_a_nullable_float_array( + const std::vector< + double>& + value_arg) { + a_nullable_float_array_ = + value_arg; + } + + const AnEnum* + AllNullableTypesWithoutRecursion:: + a_nullable_enum() + const { + return a_nullable_enum_ + ? &(*a_nullable_enum_) + : nullptr; + } + + void + AllNullableTypesWithoutRecursion:: + set_a_nullable_enum( + const AnEnum* + value_arg) { + a_nullable_enum_ = + value_arg + ? std::optional< + AnEnum>( + *value_arg) + : std:: + nullopt; + } + + void + AllNullableTypesWithoutRecursion:: + set_a_nullable_enum( + const AnEnum& + value_arg) { + a_nullable_enum_ = + value_arg; + } + + const AnotherEnum* + AllNullableTypesWithoutRecursion:: + another_nullable_enum() + const { + return another_nullable_enum_ + ? &(*another_nullable_enum_) + : nullptr; + } + + void + AllNullableTypesWithoutRecursion:: + set_another_nullable_enum( + const AnotherEnum* + value_arg) { + another_nullable_enum_ = + value_arg + ? std::optional< + AnotherEnum>( + *value_arg) + : std:: + nullopt; + } + + void + AllNullableTypesWithoutRecursion:: + set_another_nullable_enum( + const AnotherEnum& + value_arg) { + another_nullable_enum_ = + value_arg; + } + + const std::string* + AllNullableTypesWithoutRecursion:: + a_nullable_string() + const { + return a_nullable_string_ + ? &(*a_nullable_string_) + : nullptr; + } + + void + AllNullableTypesWithoutRecursion:: + set_a_nullable_string( + const std:: + string_view* + value_arg) { + a_nullable_string_ = + value_arg + ? std::optional< + std:: + string>( + *value_arg) + : std:: + nullopt; + } + + void + AllNullableTypesWithoutRecursion:: + set_a_nullable_string( + std::string_view + value_arg) { + a_nullable_string_ = + value_arg; + } + + const EncodableValue* + AllNullableTypesWithoutRecursion:: + a_nullable_object() + const { + return a_nullable_object_ + ? &(*a_nullable_object_) + : nullptr; + } + + void + AllNullableTypesWithoutRecursion:: + set_a_nullable_object( + const EncodableValue* + value_arg) { + a_nullable_object_ = + value_arg + ? std::optional< + EncodableValue>( + *value_arg) + : std:: + nullopt; + } + + void + AllNullableTypesWithoutRecursion:: + set_a_nullable_object( + const EncodableValue& + value_arg) { + a_nullable_object_ = + value_arg; + } + + const EncodableList* + AllNullableTypesWithoutRecursion:: + list() + const { + return list_ + ? &(*list_) + : nullptr; + } + + void + AllNullableTypesWithoutRecursion:: + set_list( + const EncodableList* + value_arg) { + list_ = + value_arg + ? std::optional< + EncodableList>( + *value_arg) + : std:: + nullopt; + } + + void + AllNullableTypesWithoutRecursion:: + set_list( + const EncodableList& + value_arg) { + list_ = + value_arg; + } + + const EncodableList* + AllNullableTypesWithoutRecursion:: + string_list() + const { + return string_list_ + ? &(*string_list_) + : nullptr; + } + + void + AllNullableTypesWithoutRecursion:: + set_string_list( + const EncodableList* + value_arg) { + string_list_ = + value_arg + ? std::optional< + EncodableList>( + *value_arg) + : std:: + nullopt; + } + + void + AllNullableTypesWithoutRecursion:: + set_string_list( + const EncodableList& + value_arg) { + string_list_ = + value_arg; + } + + const EncodableList* + AllNullableTypesWithoutRecursion:: + int_list() + const { + return int_list_ + ? &(*int_list_) + : nullptr; + } + + void + AllNullableTypesWithoutRecursion:: + set_int_list( + const EncodableList* + value_arg) { + int_list_ = + value_arg + ? std::optional< + EncodableList>( + *value_arg) + : std:: + nullopt; + } + + void + AllNullableTypesWithoutRecursion:: + set_int_list( + const EncodableList& + value_arg) { + int_list_ = + value_arg; + } + + const EncodableList* + AllNullableTypesWithoutRecursion:: + double_list() + const { + return double_list_ + ? &(*double_list_) + : nullptr; + } + + void + AllNullableTypesWithoutRecursion:: + set_double_list( + const EncodableList* + value_arg) { + double_list_ = + value_arg + ? std::optional< + EncodableList>( + *value_arg) + : std:: + nullopt; + } + + void + AllNullableTypesWithoutRecursion:: + set_double_list( + const EncodableList& + value_arg) { + double_list_ = + value_arg; + } + + const EncodableList* + AllNullableTypesWithoutRecursion:: + bool_list() + const { + return bool_list_ + ? &(*bool_list_) + : nullptr; + } + + void + AllNullableTypesWithoutRecursion:: + set_bool_list( + const EncodableList* + value_arg) { + bool_list_ = + value_arg + ? std::optional< + EncodableList>( + *value_arg) + : std:: + nullopt; + } + + void + AllNullableTypesWithoutRecursion:: + set_bool_list( + const EncodableList& + value_arg) { + bool_list_ = + value_arg; + } + + const EncodableList* + AllNullableTypesWithoutRecursion:: + enum_list() + const { + return enum_list_ + ? &(*enum_list_) + : nullptr; + } + + void + AllNullableTypesWithoutRecursion:: + set_enum_list( + const EncodableList* + value_arg) { + enum_list_ = + value_arg + ? std::optional< + EncodableList>( + *value_arg) + : std:: + nullopt; + } + + void + AllNullableTypesWithoutRecursion:: + set_enum_list( + const EncodableList& + value_arg) { + enum_list_ = + value_arg; + } + + const EncodableList* + AllNullableTypesWithoutRecursion:: + object_list() + const { + return object_list_ + ? &(*object_list_) + : nullptr; + } + + void + AllNullableTypesWithoutRecursion:: + set_object_list( + const EncodableList* + value_arg) { + object_list_ = + value_arg + ? std::optional< + EncodableList>( + *value_arg) + : std:: + nullopt; + } + + void + AllNullableTypesWithoutRecursion:: + set_object_list( + const EncodableList& + value_arg) { + object_list_ = + value_arg; + } + + const EncodableList* + AllNullableTypesWithoutRecursion:: + list_list() + const { + return list_list_ + ? &(*list_list_) + : nullptr; + } + + void + AllNullableTypesWithoutRecursion:: + set_list_list( + const EncodableList* + value_arg) { + list_list_ = + value_arg + ? std::optional< + EncodableList>( + *value_arg) + : std:: + nullopt; + } + + void + AllNullableTypesWithoutRecursion:: + set_list_list( + const EncodableList& + value_arg) { + list_list_ = + value_arg; + } + + const EncodableList* + AllNullableTypesWithoutRecursion:: + map_list() + const { + return map_list_ + ? &(*map_list_) + : nullptr; + } + + void + AllNullableTypesWithoutRecursion:: + set_map_list( + const EncodableList* + value_arg) { + map_list_ = + value_arg + ? std::optional< + EncodableList>( + *value_arg) + : std:: + nullopt; + } + + void + AllNullableTypesWithoutRecursion:: + set_map_list( + const EncodableList& + value_arg) { + map_list_ = + value_arg; + } + + const EncodableMap* + AllNullableTypesWithoutRecursion:: + map() + const { + return map_ + ? &(*map_) + : nullptr; + } + + void + AllNullableTypesWithoutRecursion:: + set_map( + const EncodableMap* + value_arg) { + map_ = + value_arg + ? std::optional< + EncodableMap>( + *value_arg) + : std:: + nullopt; + } + + void + AllNullableTypesWithoutRecursion:: + set_map( + const EncodableMap& + value_arg) { + map_ = + value_arg; + } + + const EncodableMap* + AllNullableTypesWithoutRecursion:: + string_map() + const { + return string_map_ + ? &(*string_map_) + : nullptr; + } + + void + AllNullableTypesWithoutRecursion:: + set_string_map( + const EncodableMap* + value_arg) { + string_map_ = + value_arg + ? std::optional< + EncodableMap>( + *value_arg) + : std:: + nullopt; + } + + void + AllNullableTypesWithoutRecursion:: + set_string_map( + const EncodableMap& + value_arg) { + string_map_ = + value_arg; + } + + const EncodableMap* + AllNullableTypesWithoutRecursion:: + int_map() + const { + return int_map_ + ? &(*int_map_) + : nullptr; + } + + void + AllNullableTypesWithoutRecursion:: + set_int_map( + const EncodableMap* + value_arg) { + int_map_ = + value_arg + ? std::optional< + EncodableMap>( + *value_arg) + : std:: + nullopt; + } + + void + AllNullableTypesWithoutRecursion:: + set_int_map( + const EncodableMap& + value_arg) { + int_map_ = + value_arg; + } + + const EncodableMap* + AllNullableTypesWithoutRecursion:: + enum_map() + const { + return enum_map_ + ? &(*enum_map_) + : nullptr; + } + + void + AllNullableTypesWithoutRecursion:: + set_enum_map( + const EncodableMap* + value_arg) { + enum_map_ = + value_arg + ? std::optional< + EncodableMap>( + *value_arg) + : std:: + nullopt; + } + + void + AllNullableTypesWithoutRecursion:: + set_enum_map( + const EncodableMap& + value_arg) { + enum_map_ = + value_arg; + } + + const EncodableMap* + AllNullableTypesWithoutRecursion:: + object_map() + const { + return object_map_ + ? &(*object_map_) + : nullptr; + } + + void + AllNullableTypesWithoutRecursion:: + set_object_map( + const EncodableMap* + value_arg) { + object_map_ = + value_arg + ? std::optional< + EncodableMap>( + *value_arg) + : std:: + nullopt; + } + + void + AllNullableTypesWithoutRecursion:: + set_object_map( + const EncodableMap& + value_arg) { + object_map_ = + value_arg; + } + + const EncodableMap* + AllNullableTypesWithoutRecursion:: + list_map() + const { + return list_map_ + ? &(*list_map_) + : nullptr; + } + + void + AllNullableTypesWithoutRecursion:: + set_list_map( + const EncodableMap* + value_arg) { + list_map_ = + value_arg + ? std::optional< + EncodableMap>( + *value_arg) + : std:: + nullopt; + } + + void + AllNullableTypesWithoutRecursion:: + set_list_map( + const EncodableMap& + value_arg) { + list_map_ = + value_arg; + } + + const EncodableMap* + AllNullableTypesWithoutRecursion:: + map_map() + const { + return map_map_ + ? &(*map_map_) + : nullptr; + } + + void + AllNullableTypesWithoutRecursion:: + set_map_map( + const EncodableMap* + value_arg) { + map_map_ = + value_arg + ? std::optional< + EncodableMap>( + *value_arg) + : std:: + nullopt; + } + + void + AllNullableTypesWithoutRecursion:: + set_map_map( + const EncodableMap& + value_arg) { + map_map_ = + value_arg; + } + + EncodableList + AllNullableTypesWithoutRecursion:: + ToEncodableList() + const { + EncodableList + list; + list.reserve( + 28); + list.push_back( + a_nullable_bool_ + ? EncodableValue( + *a_nullable_bool_) + : EncodableValue()); + list.push_back( + a_nullable_int_ + ? EncodableValue( + *a_nullable_int_) + : EncodableValue()); + list.push_back( + a_nullable_int64_ + ? EncodableValue( + *a_nullable_int64_) + : EncodableValue()); + list.push_back( + a_nullable_double_ + ? EncodableValue( + *a_nullable_double_) + : EncodableValue()); + list.push_back( + a_nullable_byte_array_ + ? EncodableValue( + *a_nullable_byte_array_) + : EncodableValue()); + list.push_back( + a_nullable4_byte_array_ + ? EncodableValue( + *a_nullable4_byte_array_) + : EncodableValue()); + list.push_back( + a_nullable8_byte_array_ + ? EncodableValue( + *a_nullable8_byte_array_) + : EncodableValue()); + list.push_back( + a_nullable_float_array_ + ? EncodableValue( + *a_nullable_float_array_) + : EncodableValue()); + list.push_back( + a_nullable_enum_ + ? CustomEncodableValue( + *a_nullable_enum_) + : EncodableValue()); + list.push_back( + another_nullable_enum_ + ? CustomEncodableValue( + *another_nullable_enum_) + : EncodableValue()); + list.push_back( + a_nullable_string_ + ? EncodableValue( + *a_nullable_string_) + : EncodableValue()); + list.push_back( + a_nullable_object_ + ? *a_nullable_object_ + : EncodableValue()); + list.push_back( + list_ + ? EncodableValue( + *list_) + : EncodableValue()); + list.push_back( + string_list_ + ? EncodableValue( + *string_list_) + : EncodableValue()); + list.push_back( + int_list_ + ? EncodableValue( + *int_list_) + : EncodableValue()); + list.push_back( + double_list_ + ? EncodableValue( + *double_list_) + : EncodableValue()); + list.push_back( + bool_list_ + ? EncodableValue( + *bool_list_) + : EncodableValue()); + list.push_back( + enum_list_ + ? EncodableValue( + *enum_list_) + : EncodableValue()); + list.push_back( + object_list_ + ? EncodableValue( + *object_list_) + : EncodableValue()); + list.push_back( + list_list_ + ? EncodableValue( + *list_list_) + : EncodableValue()); + list.push_back( + map_list_ + ? EncodableValue( + *map_list_) + : EncodableValue()); + list.push_back( + map_ + ? EncodableValue( + *map_) + : EncodableValue()); + list.push_back( + string_map_ + ? EncodableValue( + *string_map_) + : EncodableValue()); + list.push_back( + int_map_ + ? EncodableValue( + *int_map_) + : EncodableValue()); + list.push_back( + enum_map_ + ? EncodableValue( + *enum_map_) + : EncodableValue()); + list.push_back( + object_map_ + ? EncodableValue( + *object_map_) + : EncodableValue()); + list.push_back( + list_map_ + ? EncodableValue( + *list_map_) + : EncodableValue()); + list.push_back( + map_map_ + ? EncodableValue( + *map_map_) + : EncodableValue()); + return list; + } + + AllNullableTypesWithoutRecursion + AllNullableTypesWithoutRecursion:: + FromEncodableList( + const EncodableList& + list) { + AllNullableTypesWithoutRecursion + decoded; + auto& + encodable_a_nullable_bool = + list[0]; + if (!encodable_a_nullable_bool + .IsNull()) { + decoded.set_a_nullable_bool( + std::get< + bool>( + encodable_a_nullable_bool)); + } + auto& + encodable_a_nullable_int = + list[1]; + if (!encodable_a_nullable_int + .IsNull()) { + decoded.set_a_nullable_int( + std::get< + int64_t>( + encodable_a_nullable_int)); + } + auto& + encodable_a_nullable_int64 = + list[2]; + if (!encodable_a_nullable_int64 + .IsNull()) { + decoded.set_a_nullable_int64( + std::get< + int64_t>( + encodable_a_nullable_int64)); + } + auto& + encodable_a_nullable_double = + list[3]; + if (!encodable_a_nullable_double + .IsNull()) { + decoded.set_a_nullable_double( + std::get< + double>( + encodable_a_nullable_double)); + } + auto& + encodable_a_nullable_byte_array = + list[4]; + if (!encodable_a_nullable_byte_array + .IsNull()) { + decoded.set_a_nullable_byte_array( + std::get< + std::vector< + uint8_t>>( + encodable_a_nullable_byte_array)); + } + auto& + encodable_a_nullable4_byte_array = + list[5]; + if (!encodable_a_nullable4_byte_array + .IsNull()) { + decoded.set_a_nullable4_byte_array( + std::get< + std::vector< + int32_t>>( + encodable_a_nullable4_byte_array)); + } + auto& + encodable_a_nullable8_byte_array = + list[6]; + if (!encodable_a_nullable8_byte_array + .IsNull()) { + decoded.set_a_nullable8_byte_array( + std::get< + std::vector< + int64_t>>( + encodable_a_nullable8_byte_array)); + } + auto& + encodable_a_nullable_float_array = + list[7]; + if (!encodable_a_nullable_float_array + .IsNull()) { + decoded.set_a_nullable_float_array( + std::get< + std::vector< + double>>( + encodable_a_nullable_float_array)); + } + auto& + encodable_a_nullable_enum = + list[8]; + if (!encodable_a_nullable_enum + .IsNull()) { + decoded.set_a_nullable_enum( + std::any_cast< + const AnEnum&>( + std::get< + CustomEncodableValue>( + encodable_a_nullable_enum))); + } + auto& + encodable_another_nullable_enum = + list[9]; + if (!encodable_another_nullable_enum + .IsNull()) { + decoded.set_another_nullable_enum( + std::any_cast< + const AnotherEnum&>( + std::get< + CustomEncodableValue>( + encodable_another_nullable_enum))); + } + auto& encodable_a_nullable_string = + list[10]; + if (!encodable_a_nullable_string + .IsNull()) { + decoded.set_a_nullable_string( + std::get< + std:: + string>( + encodable_a_nullable_string)); + } + auto& encodable_a_nullable_object = + list[11]; + if (!encodable_a_nullable_object + .IsNull()) { + decoded.set_a_nullable_object( + encodable_a_nullable_object); + } + auto& encodable_list = + list[12]; + if (!encodable_list + .IsNull()) { + decoded.set_list( + std::get< + EncodableList>( + encodable_list)); + } + auto& encodable_string_list = + list[13]; + if (!encodable_string_list + .IsNull()) { + decoded.set_string_list( + std::get< + EncodableList>( + encodable_string_list)); + } + auto& encodable_int_list = + list[14]; + if (!encodable_int_list + .IsNull()) { + decoded.set_int_list( + std::get< + EncodableList>( + encodable_int_list)); + } + auto& encodable_double_list = + list[15]; + if (!encodable_double_list + .IsNull()) { + decoded.set_double_list( + std::get< + EncodableList>( + encodable_double_list)); + } + auto& encodable_bool_list = + list[16]; + if (!encodable_bool_list + .IsNull()) { + decoded.set_bool_list( + std::get< + EncodableList>( + encodable_bool_list)); + } + auto& encodable_enum_list = + list[17]; + if (!encodable_enum_list + .IsNull()) { + decoded.set_enum_list( + std::get< + EncodableList>( + encodable_enum_list)); + } + auto& encodable_object_list = + list[18]; + if (!encodable_object_list + .IsNull()) { + decoded.set_object_list( + std::get< + EncodableList>( + encodable_object_list)); + } + auto& encodable_list_list = + list[19]; + if (!encodable_list_list + .IsNull()) { + decoded.set_list_list( + std::get< + EncodableList>( + encodable_list_list)); + } + auto& encodable_map_list = + list[20]; + if (!encodable_map_list + .IsNull()) { + decoded.set_map_list( + std::get< + EncodableList>( + encodable_map_list)); + } + auto& encodable_map = + list[21]; + if (!encodable_map + .IsNull()) { + decoded.set_map( + std::get< + EncodableMap>( + encodable_map)); + } + auto& encodable_string_map = + list[22]; + if (!encodable_string_map + .IsNull()) { + decoded.set_string_map( + std::get< + EncodableMap>( + encodable_string_map)); + } + auto& encodable_int_map = + list[23]; + if (!encodable_int_map + .IsNull()) { + decoded.set_int_map( + std::get< + EncodableMap>( + encodable_int_map)); + } + auto& encodable_enum_map = + list[24]; + if (!encodable_enum_map + .IsNull()) { + decoded.set_enum_map( + std::get< + EncodableMap>( + encodable_enum_map)); + } + auto& encodable_object_map = + list[25]; + if (!encodable_object_map + .IsNull()) { + decoded.set_object_map( + std::get< + EncodableMap>( + encodable_object_map)); + } + auto& encodable_list_map = + list[26]; + if (!encodable_list_map + .IsNull()) { + decoded.set_list_map( + std::get< + EncodableMap>( + encodable_list_map)); + } + auto& encodable_map_map = + list[27]; + if (!encodable_map_map + .IsNull()) { + decoded.set_map_map( + std::get< + EncodableMap>( + encodable_map_map)); + } + return decoded; + } + + bool + AllNullableTypesWithoutRecursion:: + operator==( + const AllNullableTypesWithoutRecursion& + other) + const { + return PigeonInternalDeepEquals( + a_nullable_bool_, + other + .a_nullable_bool_) && + PigeonInternalDeepEquals( + a_nullable_int_, + other + .a_nullable_int_) && + PigeonInternalDeepEquals( + a_nullable_int64_, + other + .a_nullable_int64_) && + PigeonInternalDeepEquals( + a_nullable_double_, + other + .a_nullable_double_) && + PigeonInternalDeepEquals( + a_nullable_byte_array_, + other + .a_nullable_byte_array_) && + PigeonInternalDeepEquals( + a_nullable4_byte_array_, + other + .a_nullable4_byte_array_) && + PigeonInternalDeepEquals( + a_nullable8_byte_array_, + other + .a_nullable8_byte_array_) && + PigeonInternalDeepEquals( + a_nullable_float_array_, + other + .a_nullable_float_array_) && + PigeonInternalDeepEquals( + a_nullable_enum_, + other + .a_nullable_enum_) && + PigeonInternalDeepEquals( + another_nullable_enum_, + other + .another_nullable_enum_) && + PigeonInternalDeepEquals( + a_nullable_string_, + other + .a_nullable_string_) && + PigeonInternalDeepEquals( + a_nullable_object_, + other + .a_nullable_object_) && + PigeonInternalDeepEquals( + list_, + other + .list_) && + PigeonInternalDeepEquals( + string_list_, + other + .string_list_) && + PigeonInternalDeepEquals( + int_list_, + other + .int_list_) && + PigeonInternalDeepEquals( + double_list_, + other + .double_list_) && + PigeonInternalDeepEquals( + bool_list_, + other + .bool_list_) && + PigeonInternalDeepEquals( + enum_list_, + other + .enum_list_) && + PigeonInternalDeepEquals( + object_list_, + other + .object_list_) && + PigeonInternalDeepEquals( + list_list_, + other + .list_list_) && + PigeonInternalDeepEquals( + map_list_, + other + .map_list_) && + PigeonInternalDeepEquals( + map_, + other + .map_) && + PigeonInternalDeepEquals( + string_map_, + other + .string_map_) && + PigeonInternalDeepEquals( + int_map_, + other + .int_map_) && + PigeonInternalDeepEquals( + enum_map_, + other + .enum_map_) && + PigeonInternalDeepEquals( + object_map_, + other + .object_map_) && + PigeonInternalDeepEquals( + list_map_, + other + .list_map_) && + PigeonInternalDeepEquals( + map_map_, + other + .map_map_); + } + + bool + AllNullableTypesWithoutRecursion:: + operator!=( + const AllNullableTypesWithoutRecursion& + other) + const { + return !( + *this == + other); + } + + size_t + AllNullableTypesWithoutRecursion:: + Hash() + const { + size_t + result = + 1; + result = + result * + 31 + + PigeonInternalDeepHash( + a_nullable_bool_); + result = + result * + 31 + + PigeonInternalDeepHash( + a_nullable_int_); + result = + result * + 31 + + PigeonInternalDeepHash( + a_nullable_int64_); + result = + result * + 31 + + PigeonInternalDeepHash( + a_nullable_double_); + result = + result * + 31 + + PigeonInternalDeepHash( + a_nullable_byte_array_); + result = + result * + 31 + + PigeonInternalDeepHash( + a_nullable4_byte_array_); + result = + result * + 31 + + PigeonInternalDeepHash( + a_nullable8_byte_array_); + result = + result * + 31 + + PigeonInternalDeepHash( + a_nullable_float_array_); + result = + result * + 31 + + PigeonInternalDeepHash( + a_nullable_enum_); + result = + result * + 31 + + PigeonInternalDeepHash( + another_nullable_enum_); + result = + result * + 31 + + PigeonInternalDeepHash( + a_nullable_string_); + result = + result * + 31 + + PigeonInternalDeepHash( + a_nullable_object_); + result = + result * + 31 + + PigeonInternalDeepHash( + list_); + result = + result * + 31 + + PigeonInternalDeepHash( + string_list_); + result = + result * + 31 + + PigeonInternalDeepHash( + int_list_); + result = + result * + 31 + + PigeonInternalDeepHash( + double_list_); + result = + result * + 31 + + PigeonInternalDeepHash( + bool_list_); + result = + result * + 31 + + PigeonInternalDeepHash( + enum_list_); + result = + result * + 31 + + PigeonInternalDeepHash( + object_list_); + result = + result * + 31 + + PigeonInternalDeepHash( + list_list_); + result = + result * + 31 + + PigeonInternalDeepHash( + map_list_); + result = + result * + 31 + + PigeonInternalDeepHash( + map_); + result = + result * + 31 + + PigeonInternalDeepHash( + string_map_); + result = + result * + 31 + + PigeonInternalDeepHash( + int_map_); + result = + result * + 31 + + PigeonInternalDeepHash( + enum_map_); + result = + result * + 31 + + PigeonInternalDeepHash( + object_map_); + result = + result * + 31 + + PigeonInternalDeepHash( + list_map_); + result = + result * + 31 + + PigeonInternalDeepHash( + map_map_); + return result; + } + + std::string + AllNullableTypesWithoutRecursion:: + ToString() + const { + std:: + stringstream + ss; + ss << "AllNul" + "lableT" + "ypesWi" + "thoutR" + "ecursi" + "on("; + ss << "aNulla" + "bleBoo" + "l: "; + if (a_nullable_bool_ + .has_value()) { + ss << *a_nullable_bool_; + } else { + ss << "nul" + "l"; + ss << ", " + "aNul" + "labl" + "eInt" + ": "; + if (a_nullable_int_ + .has_value()) { + ss << *a_nullable_int_; + } else { + ss << "nu" + "l" + "l"; + ss << ", " + "aN" + "ul" + "la" + "bl" + "eI" + "nt" + "64" + ":" + " "; + if (a_nullable_int64_ + .has_value()) { + ss << *a_nullable_int64_; + } else { + ss << "null"; + ss << ", aNullableDouble: "; + if (a_nullable_double_ + .has_value()) { + ss << *a_nullable_double_; + } else { + ss << "null"; + ss << ", aNullableByteArray: "; + if (a_nullable_byte_array_ + .has_value()) { + ss << *a_nullable_byte_array_; + } else { + ss << "null"; + ss << ", aNullable4ByteArray: "; + if (a_nullable4_byte_array_ + .has_value()) { + ss << *a_nullable4_byte_array_; + } else { + ss << "null"; + ss << ", aNullable8ByteArray: "; + if (a_nullable8_byte_array_ + .has_value()) { + ss << *a_nullable8_byte_array_; + } else { + ss << "null"; + ss << ", aNullableFloatArray: "; + if (a_nullable_float_array_ + .has_value()) { + ss << *a_nullable_float_array_; + } else { + ss << "null"; + ss << ", aNullableEnum: "; + if (a_nullable_enum_ + .has_value()) { + ss << *a_nullable_enum_; + } else { + ss << "null"; + ss << ", anotherNullableEnum: "; + if (another_nullable_enum_ + .has_value()) { + ss << *another_nullable_enum_; + } else { + ss << "null"; + ss << ", aNullableString: "; + if (a_nullable_string_ + .has_value()) { + ss << *a_nullable_string_; + } else { + ss << "null"; + ss << ", aNullableObject: "; + if (a_nullable_object_ + .has_value()) { + ss << *a_nullable_object_; + } else { + ss << "null"; + ss << ", list: "; + if (list_ + .has_value()) { + ss << *list_; + } else { + ss << "null"; + ss << ", stringList: "; + if (string_list_ + .has_value()) { + ss << *string_list_; + } else { + ss << "null"; + ss << ", intList: "; + if (int_list_ + .has_value()) { + ss << *int_list_; + } else { + ss << "null"; + ss << ", doubleList: "; + if (double_list_ + .has_value()) { + ss << *double_list_; + } else { + ss << "null"; + ss << ", boolList: "; + if (bool_list_ + .has_value()) { + ss << *bool_list_; + } else { + ss << "null"; + ss << ", enumList: "; + if (enum_list_ + .has_value()) { + ss << *enum_list_; + } else { + ss << "null"; + ss << ", objectList: "; + if (object_list_ + .has_value()) { + ss << *object_list_; + } else { + ss << "null"; + ss << ", listList: "; + if (list_list_ + .has_value()) { + ss << *list_list_; + } else { + ss << "null"; + ss << ", mapList: "; + if (map_list_ + .has_value()) { + ss << *map_list_; + } else { + ss << "null"; + ss << ", map: "; + if (map_.has_value()) { + ss << *map_; + } else { + ss << "null"; + ss << ", stringMap: "; + if (string_map_ + .has_value()) { + ss << *string_map_; + } else { + ss << "null"; + ss << ", intMap: "; + if (int_map_ + .has_value()) { + ss << *int_map_; + } else { + ss << "null"; + ss << ", enumMap: "; + if (enum_map_ + .has_value()) { + ss << *enum_map_; + } else { + ss << "null"; + ss << ", objectMap: "; + if (object_map_ + .has_value()) { + ss << *object_map_; + } else { + ss << "null"; + ss << ", listMap: "; + if (list_map_ + .has_value()) { + ss << *list_map_; + } else { + ss << "null"; + ss << ", mapMap: "; + if (map_map_ + .has_value()) { + ss << *map_map_; + } else { + ss << "null"; + ss << ")"; + return ss + .str(); + } + + size_t + PigeonInternalDeepHash( + const AllNullableTypesWithoutRecursion& + v) { + return v + .Hash(); + } + + // AllClassesWrapper + + AllClassesWrapper::AllClassesWrapper( + const AllNullableTypes& + all_nullable_types, + const EncodableList& + class_list, + const EncodableMap& + class_map) + : all_nullable_types_( + std::make_unique< + AllNullableTypes>( + all_nullable_types)), + class_list_( + class_list), + class_map_( + class_map) { + } + + AllClassesWrapper::AllClassesWrapper( + const AllNullableTypes& + all_nullable_types, + const AllNullableTypesWithoutRecursion* + all_nullable_types_without_recursion, + const AllTypes* + all_types, + const EncodableList& + class_list, + const EncodableList* + nullable_class_list, + const EncodableMap& + class_map, + const EncodableMap* + nullable_class_map) + : all_nullable_types_(std::make_unique(all_nullable_types)), all_nullable_types_without_recursion_(all_nullable_types_without_recursion ? std::make_unique(*all_nullable_types_without_recursion) : nullptr), all_types_(all_types ? std::make_unique(*all_types) : nullptr), class_list_(class_list), nullable_class_list_(nullable_class_list ? std::optional(*nullable_class_list) : std::nullopt), class_map_(class_map), nullable_class_map_(nullable_class_map ? std::optional(*nullable_class_map) : std::nullopt) { + } + + AllClassesWrapper:: + AllClassesWrapper( + const AllClassesWrapper& + other) + : all_nullable_types_( + std::make_unique< + AllNullableTypes>( + *other + .all_nullable_types_)), + all_nullable_types_without_recursion_( + other.all_nullable_types_without_recursion_ + ? std::make_unique< + AllNullableTypesWithoutRecursion>( + *other + .all_nullable_types_without_recursion_) + : nullptr), + all_types_( + other.all_types_ + ? std:: + make_unique< + AllTypes>(*other + .all_types_) + : nullptr), + class_list_( + other + .class_list_), + nullable_class_list_( + other.nullable_class_list_ + ? std::optional< + EncodableList>( + *other + .nullable_class_list_) + : std:: + nullopt), + class_map_( + other + .class_map_), + nullable_class_map_( + other.nullable_class_map_ ? std:: + optional< + EncodableMap>( + *other + .nullable_class_map_) + : std:: + nullopt) { + } + + AllClassesWrapper& + AllClassesWrapper:: + operator=( + const AllClassesWrapper& + other) { + all_nullable_types_ = + std::make_unique< + AllNullableTypes>( + *other + .all_nullable_types_); + all_nullable_types_without_recursion_ = + other.all_nullable_types_without_recursion_ + ? std::make_unique< + AllNullableTypesWithoutRecursion>( + *other + .all_nullable_types_without_recursion_) + : nullptr; + all_types_ = + other.all_types_ + ? std::make_unique< + AllTypes>( + *other + .all_types_) + : nullptr; + class_list_ = + other + .class_list_; + nullable_class_list_ = + other + .nullable_class_list_; + class_map_ = + other + .class_map_; + nullable_class_map_ = + other + .nullable_class_map_; + return *this; + } + + const AllNullableTypes& + AllClassesWrapper:: + all_nullable_types() + const { + return *all_nullable_types_; + } + + void + AllClassesWrapper:: + set_all_nullable_types( + const AllNullableTypes& + value_arg) { + all_nullable_types_ = + std::make_unique< + AllNullableTypes>( + value_arg); + } + + const AllNullableTypesWithoutRecursion* + AllClassesWrapper:: + all_nullable_types_without_recursion() + const { + return all_nullable_types_without_recursion_ + .get(); + } + + void + AllClassesWrapper:: + set_all_nullable_types_without_recursion( + const AllNullableTypesWithoutRecursion* + value_arg) { + all_nullable_types_without_recursion_ = + value_arg + ? std::make_unique< + AllNullableTypesWithoutRecursion>( + *value_arg) + : nullptr; + } + + void + AllClassesWrapper:: + set_all_nullable_types_without_recursion( + const AllNullableTypesWithoutRecursion& + value_arg) { + all_nullable_types_without_recursion_ = + std::make_unique< + AllNullableTypesWithoutRecursion>( + value_arg); + } + + const AllTypes* + AllClassesWrapper:: + all_types() + const { + return all_types_ + .get(); + } + + void + AllClassesWrapper:: + set_all_types( + const AllTypes* + value_arg) { + all_types_ = + value_arg + ? std::make_unique< + AllTypes>( + *value_arg) + : nullptr; + } + + void + AllClassesWrapper:: + set_all_types( + const AllTypes& + value_arg) { + all_types_ = + std::make_unique< + AllTypes>( + value_arg); + } + + const EncodableList& + AllClassesWrapper:: + class_list() + const { + return class_list_; + } + + void + AllClassesWrapper:: + set_class_list( + const EncodableList& + value_arg) { + class_list_ = + value_arg; + } + + const EncodableList* + AllClassesWrapper:: + nullable_class_list() + const { + return nullable_class_list_ + ? &(*nullable_class_list_) + : nullptr; + } + + void + AllClassesWrapper:: + set_nullable_class_list( + const EncodableList* + value_arg) { + nullable_class_list_ = + value_arg + ? std::optional< + EncodableList>( + *value_arg) + : std:: + nullopt; + } + + void + AllClassesWrapper:: + set_nullable_class_list( + const EncodableList& + value_arg) { + nullable_class_list_ = + value_arg; + } + + const EncodableMap& + AllClassesWrapper:: + class_map() + const { + return class_map_; + } + + void + AllClassesWrapper:: + set_class_map( + const EncodableMap& + value_arg) { + class_map_ = + value_arg; + } + + const EncodableMap* + AllClassesWrapper:: + nullable_class_map() + const { + return nullable_class_map_ + ? &(*nullable_class_map_) + : nullptr; + } + + void + AllClassesWrapper:: + set_nullable_class_map( + const EncodableMap* + value_arg) { + nullable_class_map_ = + value_arg + ? std::optional< + EncodableMap>( + *value_arg) + : std:: + nullopt; + } + + void + AllClassesWrapper:: + set_nullable_class_map( + const EncodableMap& + value_arg) { + nullable_class_map_ = + value_arg; + } + + EncodableList + AllClassesWrapper:: + ToEncodableList() + const { + EncodableList + list; + list.reserve( + 7); + list.push_back( + CustomEncodableValue( + *all_nullable_types_)); + list.push_back( + all_nullable_types_without_recursion_ + ? CustomEncodableValue( + *all_nullable_types_without_recursion_) + : EncodableValue()); + list.push_back( + all_types_ + ? CustomEncodableValue( + *all_types_) + : EncodableValue()); + list.push_back( + EncodableValue( + class_list_)); + list.push_back( + nullable_class_list_ + ? EncodableValue( + *nullable_class_list_) + : EncodableValue()); + list.push_back( + EncodableValue( + class_map_)); + list.push_back( + nullable_class_map_ + ? EncodableValue( + *nullable_class_map_) + : EncodableValue()); + return list; + } + + AllClassesWrapper + AllClassesWrapper:: + FromEncodableList( + const EncodableList& + list) { + AllClassesWrapper decoded( + std::any_cast< + const AllNullableTypes&>( + std::get< + CustomEncodableValue>( + list[0])), + std::get< + EncodableList>( + list[3]), + std::get< + EncodableMap>( + list[5])); + auto& encodable_all_nullable_types_without_recursion = + list[1]; + if (!encodable_all_nullable_types_without_recursion + .IsNull()) { + decoded + .set_all_nullable_types_without_recursion( + std::any_cast< + const AllNullableTypesWithoutRecursion&>( + std::get< + CustomEncodableValue>( + encodable_all_nullable_types_without_recursion))); + } + auto& encodable_all_types = + list[2]; + if (!encodable_all_types + .IsNull()) { + decoded + .set_all_types( + std::any_cast< + const AllTypes&>( + std::get< + CustomEncodableValue>( + encodable_all_types))); + } + auto& encodable_nullable_class_list = + list[4]; + if (!encodable_nullable_class_list + .IsNull()) { + decoded + .set_nullable_class_list( + std::get< + EncodableList>( + encodable_nullable_class_list)); + } + auto& encodable_nullable_class_map = + list[6]; + if (!encodable_nullable_class_map + .IsNull()) { + decoded + .set_nullable_class_map( + std::get< + EncodableMap>( + encodable_nullable_class_map)); + } + return decoded; + } + + bool + AllClassesWrapper:: + operator==( + const AllClassesWrapper& + other) + const { + return PigeonInternalDeepEquals( + all_nullable_types_, + other + .all_nullable_types_) && + PigeonInternalDeepEquals( + all_nullable_types_without_recursion_, + other + .all_nullable_types_without_recursion_) && + PigeonInternalDeepEquals( + all_types_, + other + .all_types_) && + PigeonInternalDeepEquals( + class_list_, + other + .class_list_) && + PigeonInternalDeepEquals( + nullable_class_list_, + other + .nullable_class_list_) && + PigeonInternalDeepEquals( + class_map_, + other + .class_map_) && + PigeonInternalDeepEquals( + nullable_class_map_, + other + .nullable_class_map_); + } + + bool + AllClassesWrapper:: + operator!=( + const AllClassesWrapper& + other) + const { + return !( + *this == + other); + } + + size_t + AllClassesWrapper:: + Hash() + const { + size_t result = + 1; + result = + result * + 31 + + PigeonInternalDeepHash( + all_nullable_types_); + result = + result * + 31 + + PigeonInternalDeepHash( + all_nullable_types_without_recursion_); + result = + result * + 31 + + PigeonInternalDeepHash( + all_types_); + result = + result * + 31 + + PigeonInternalDeepHash( + class_list_); + result = + result * + 31 + + PigeonInternalDeepHash( + nullable_class_list_); + result = + result * + 31 + + PigeonInternalDeepHash( + class_map_); + result = + result * + 31 + + PigeonInternalDeepHash( + nullable_class_map_); + return result; + } + + std::string + AllClassesWrapper:: + ToString() + const { + std::stringstream + ss; + ss << "AllClassesWrapper("; + ss << "allNullableTypes: "; + ss << all_nullable_types_ + .ToString(); + ss << ", allNullableTypesWithoutRecursion: "; + if (all_nullable_types_without_recursion_ + .has_value()) { + ss << all_nullable_types_without_recursion_ + ->ToString(); + } else { + ss << "null"; + ss << ", allTypes: "; + if (all_types_ + .has_value()) { + ss << all_types_ + ->ToString(); + } else { + ss << "null"; + ss << ", classList: "; + ss << class_list_; + ss << ", nullableClassList: "; + if (nullable_class_list_ + .has_value()) { + ss << *nullable_class_list_; + } else { + ss << "null"; + ss << ", classMap: "; + ss << class_map_; + ss << ", nullableClassMap: "; + if (nullable_class_map_ + .has_value()) { + ss << *nullable_class_map_; + } else { + ss << "null"; + ss << ")"; + return ss + .str(); + } + + size_t + PigeonInternalDeepHash( + const AllClassesWrapper& + v) { + return v + .Hash(); + } + + // TestMessage + + TestMessage:: + TestMessage() { + } + + TestMessage::TestMessage( + const EncodableList* + test_list) + : test_list_( + test_list + ? std::optional< + EncodableList>( + *test_list) + : std:: + nullopt) { + } + + const EncodableList* + TestMessage:: + test_list() + const { + return test_list_ + ? &(*test_list_) + : nullptr; + } + + void + TestMessage::set_test_list( + const EncodableList* + value_arg) { + test_list_ = + value_arg + ? std::optional< + EncodableList>( + *value_arg) + : std:: + nullopt; + } + + void + TestMessage::set_test_list( + const EncodableList& + value_arg) { + test_list_ = + value_arg; + } + + EncodableList + TestMessage:: + ToEncodableList() + const { + EncodableList + list; + list.reserve( + 1); + list.push_back( + test_list_ + ? EncodableValue( + *test_list_) + : EncodableValue()); + return list; + } + + TestMessage + TestMessage::FromEncodableList( + const EncodableList& + list) { + TestMessage + decoded; + auto& encodable_test_list = + list[0]; + if (!encodable_test_list + .IsNull()) { + decoded + .set_test_list( + std::get< + EncodableList>( + encodable_test_list)); + } + return decoded; + } + + bool + TestMessage:: + operator==( + const TestMessage& + other) + const { + return PigeonInternalDeepEquals( + test_list_, + other + .test_list_); + } + + bool + TestMessage:: + operator!=( + const TestMessage& + other) + const { + return !( + *this == + other); + } + + size_t + TestMessage:: + Hash() + const { + size_t result = + 1; + result = + result * + 31 + + PigeonInternalDeepHash( + test_list_); + return result; + } + + std::string + TestMessage:: + ToString() + const { + std::stringstream + ss; + ss << "TestMessage("; + ss << "testList: "; + if (test_list_ + .has_value()) { + ss << *test_list_; + } else { + ss << "null"; + ss << ")"; + return ss + .str(); + } + + size_t + PigeonInternalDeepHash( + const TestMessage& + v) { + return v + .Hash(); + } + + PigeonInternalCodecSerializer:: + PigeonInternalCodecSerializer() { + } + + EncodableValue + PigeonInternalCodecSerializer:: + ReadValueOfType( + uint8_t + type, + ::flutter:: + ByteStreamReader* + stream) + const { + switch ( + type) { + 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< + AnEnum>( + 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< + AnotherEnum>( + enum_arg_value)); + } + case 131: { + return CustomEncodableValue( + UnusedClass::FromEncodableList( + std::get< + EncodableList>( + ReadValue( + stream)))); + } + case 132: { + return CustomEncodableValue( + AllTypes::FromEncodableList( + std::get< + EncodableList>( + ReadValue( + stream)))); + } + case 133: { + return CustomEncodableValue( + AllNullableTypes::FromEncodableList( + std::get< + EncodableList>( + ReadValue( + stream)))); + } + case 134: { + return CustomEncodableValue( + AllNullableTypesWithoutRecursion::FromEncodableList( + std::get< + EncodableList>( + ReadValue( + stream)))); + } + case 135: { + return CustomEncodableValue( + AllClassesWrapper::FromEncodableList( + std::get< + EncodableList>( + ReadValue( + stream)))); + } + case 136: { + return CustomEncodableValue( + TestMessage::FromEncodableList( + std::get< + EncodableList>( + ReadValue( + stream)))); + } + default: + return ::flutter::StandardCodecSerializer:: + ReadValueOfType( + type, + stream); + } + } + + void + PigeonInternalCodecSerializer::WriteValue( + const EncodableValue& + value, + ::flutter:: + ByteStreamWriter* + stream) + const { + if (const CustomEncodableValue* custom_value = + std::get_if< + CustomEncodableValue>( + &value)) { + if (custom_value + ->type() == + typeid( + AnEnum)) { + stream + ->WriteByte( + 129); + WriteValue( + EncodableValue(static_cast< + int>( + std::any_cast< + AnEnum>( + *custom_value))), + stream); + return; + } + if (custom_value + ->type() == + typeid( + AnotherEnum)) { + stream + ->WriteByte( + 130); + WriteValue( + EncodableValue(static_cast< + int>( + std::any_cast< + AnotherEnum>( + *custom_value))), + stream); + return; + } + if (custom_value + ->type() == + typeid( + UnusedClass)) { + stream + ->WriteByte( + 131); + WriteValue( + EncodableValue( + std::any_cast< + UnusedClass>( + *custom_value) + .ToEncodableList()), + stream); + return; + } + if (custom_value + ->type() == + typeid( + AllTypes)) { + stream + ->WriteByte( + 132); + WriteValue( + EncodableValue( + std::any_cast< + AllTypes>( + *custom_value) + .ToEncodableList()), + stream); + return; + } + if (custom_value + ->type() == + typeid( + AllNullableTypes)) { + stream + ->WriteByte( + 133); + WriteValue( + EncodableValue( + std::any_cast< + AllNullableTypes>( + *custom_value) + .ToEncodableList()), + stream); + return; + } + if (custom_value + ->type() == + typeid( + AllNullableTypesWithoutRecursion)) { + stream + ->WriteByte( + 134); + WriteValue( + EncodableValue( + std::any_cast< + AllNullableTypesWithoutRecursion>( + *custom_value) + .ToEncodableList()), + stream); + return; + } + if (custom_value + ->type() == + typeid( + AllClassesWrapper)) { + stream + ->WriteByte( + 135); + WriteValue( + EncodableValue( + std::any_cast< + AllClassesWrapper>( + *custom_value) + .ToEncodableList()), + stream); + return; + } + if (custom_value + ->type() == + typeid( + TestMessage)) { + stream + ->WriteByte( + 136); + WriteValue( + EncodableValue( + std::any_cast< + TestMessage>( + *custom_value) + .ToEncodableList()), + stream); + return; + } + } + ::flutter::StandardCodecSerializer:: + WriteValue( + value, + stream); + } + + /// The codec used by HostIntegrationCoreApi. + const ::flutter:: + StandardMessageCodec& + HostIntegrationCoreApi:: + GetCodec() { + return ::flutter::StandardMessageCodec:: + GetInstance( + &PigeonInternalCodecSerializer:: + GetInstance()); + } + + // Sets up an instance of `HostIntegrationCoreApi` to handle messages through the `binary_messenger`. + void + HostIntegrationCoreApi::SetUp( + ::flutter:: + BinaryMessenger * + binary_messenger, + HostIntegrationCoreApi * + api) { + HostIntegrationCoreApi:: + SetUp( + binary_messenger, + api, + ""); + } + + void + HostIntegrationCoreApi::SetUp( + ::flutter:: + BinaryMessenger * + binary_messenger, + HostIntegrationCoreApi * + api, + const std:: + string& + message_channel_suffix) { + const std::string prepended_suffix = + message_channel_suffix + .length() > + 0 + ? std::string( + ".") + + message_channel_suffix + : ""; + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noop" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& message, const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + std::optional< + FlutterError> + output = + api->Noop(); + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAllTypes" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_everything_arg = + args.at( + 0); + if (encodable_everything_arg + .IsNull()) { + reply(WrapError( + "everything_arg unexpectedly null.")); + return; + } + const auto& everything_arg = + std::any_cast< + const AllTypes&>( + std::get< + CustomEncodableValue>( + encodable_everything_arg)); + ErrorOr< + AllTypes> + output = + api->EchoAllTypes( + everything_arg); + 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); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwError" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + ErrorOr< + std::optional< + EncodableValue>> + output = + api->ThrowError(); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.throwErrorFromVoid" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api](const EncodableValue& + message, + const :: + flutter::MessageReply& reply) { + try { + std::optional< + FlutterError> + output = + api->ThrowErrorFromVoid(); + 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.pigeon_integration_tests.HostIntegrationCoreApi.throwFlutterError" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + ErrorOr< + std::optional< + EncodableValue>> + output = + api->ThrowFlutterError(); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoInt" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_an_int_arg = + args.at( + 0); + if (encodable_an_int_arg + .IsNull()) { + reply(WrapError( + "an_int_arg unexpectedly null.")); + return; + } + const int64_t an_int_arg = + encodable_an_int_arg + .LongValue(); + ErrorOr< + int64_t> + output = + api->EchoInt( + an_int_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoDouble" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_a_double_arg = + args.at( + 0); + if (encodable_a_double_arg + .IsNull()) { + reply(WrapError( + "a_double_arg unexpectedly null.")); + return; + } + const auto& a_double_arg = + std::get< + double>( + encodable_a_double_arg); + ErrorOr< + double> + output = + api->EchoDouble( + a_double_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoBool" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_a_bool_arg = + args.at( + 0); + if (encodable_a_bool_arg + .IsNull()) { + reply(WrapError( + "a_bool_arg unexpectedly null.")); + return; + } + const auto& a_bool_arg = + std::get< + bool>( + encodable_a_bool_arg); + ErrorOr output = + api->EchoBool( + a_bool_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoString" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_a_string_arg = + args.at( + 0); + if (encodable_a_string_arg + .IsNull()) { + reply(WrapError( + "a_string_arg unexpectedly null.")); + return; + } + const auto& a_string_arg = + std::get< + std:: + string>( + encodable_a_string_arg); + ErrorOr< + std:: + string> + output = + api->EchoString( + a_string_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoUint8List" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_a_uint8_list_arg = + args.at( + 0); + if (encodable_a_uint8_list_arg + .IsNull()) { + reply(WrapError( + "a_uint8_list_arg unexpectedly null.")); + return; + } + const auto& a_uint8_list_arg = + std::get< + std::vector< + uint8_t>>( + encodable_a_uint8_list_arg); + ErrorOr< + std::vector< + uint8_t>> + output = + api->EchoUint8List( + a_uint8_list_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoObject" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_an_object_arg = + args.at( + 0); + if (encodable_an_object_arg + .IsNull()) { + reply(WrapError( + "an_object_arg unexpectedly null.")); + return; + } + const auto& + an_object_arg = + encodable_an_object_arg; + ErrorOr< + EncodableValue> + output = + api->EchoObject( + an_object_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoList" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_list_arg = + args.at( + 0); + if (encodable_list_arg + .IsNull()) { + reply(WrapError( + "list_arg unexpectedly null.")); + return; + } + const auto& list_arg = + std::get< + EncodableList>( + encodable_list_arg); + ErrorOr< + EncodableList> + output = + api->EchoList( + list_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoEnumList" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_enum_list_arg = + args.at( + 0); + if (encodable_enum_list_arg + .IsNull()) { + reply(WrapError( + "enum_list_arg unexpectedly null.")); + return; + } + const auto& enum_list_arg = + std::get< + EncodableList>( + encodable_enum_list_arg); + ErrorOr< + EncodableList> + output = + api->EchoEnumList( + enum_list_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoClassList" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_class_list_arg = + args.at( + 0); + if (encodable_class_list_arg + .IsNull()) { + reply(WrapError( + "class_list_arg unexpectedly null.")); + return; + } + const auto& class_list_arg = + std::get< + EncodableList>( + encodable_class_list_arg); + ErrorOr< + EncodableList> + output = + api->EchoClassList( + class_list_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullEnumList" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_enum_list_arg = + args.at( + 0); + if (encodable_enum_list_arg + .IsNull()) { + reply(WrapError( + "enum_list_arg unexpectedly null.")); + return; + } + const auto& enum_list_arg = + std::get< + EncodableList>( + encodable_enum_list_arg); + ErrorOr< + EncodableList> + output = + api->EchoNonNullEnumList( + enum_list_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullClassList" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_class_list_arg = + args.at( + 0); + if (encodable_class_list_arg + .IsNull()) { + reply(WrapError( + "class_list_arg unexpectedly null.")); + return; + } + const auto& class_list_arg = + std::get< + EncodableList>( + encodable_class_list_arg); + ErrorOr< + EncodableList> + output = + api->EchoNonNullClassList( + class_list_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoMap" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_map_arg = + args.at( + 0); + if (encodable_map_arg + .IsNull()) { + reply(WrapError( + "map_arg unexpectedly null.")); + return; + } + const auto& map_arg = + std::get< + EncodableMap>( + encodable_map_arg); + ErrorOr< + EncodableMap> + output = + api->EchoMap( + map_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoStringMap" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_string_map_arg = + args.at( + 0); + if (encodable_string_map_arg + .IsNull()) { + reply(WrapError( + "string_map_arg unexpectedly null.")); + return; + } + const auto& string_map_arg = + std::get< + EncodableMap>( + encodable_string_map_arg); + ErrorOr< + EncodableMap> + output = + api->EchoStringMap( + string_map_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoIntMap" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_int_map_arg = + args.at( + 0); + if (encodable_int_map_arg + .IsNull()) { + reply(WrapError( + "int_map_arg unexpectedly null.")); + return; + } + const auto& int_map_arg = + std::get< + EncodableMap>( + encodable_int_map_arg); + ErrorOr< + EncodableMap> + output = + api->EchoIntMap( + int_map_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoEnumMap" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_enum_map_arg = + args.at( + 0); + if (encodable_enum_map_arg + .IsNull()) { + reply(WrapError( + "enum_map_arg unexpectedly null.")); + return; + } + const auto& enum_map_arg = + std::get< + EncodableMap>( + encodable_enum_map_arg); + ErrorOr< + EncodableMap> + output = + api->EchoEnumMap( + enum_map_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoClassMap" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_class_map_arg = + args.at( + 0); + if (encodable_class_map_arg + .IsNull()) { + reply(WrapError( + "class_map_arg unexpectedly null.")); + return; + } + const auto& class_map_arg = + std::get< + EncodableMap>( + encodable_class_map_arg); + ErrorOr< + EncodableMap> + output = + api->EchoClassMap( + class_map_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullStringMap" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_string_map_arg = + args.at( + 0); + if (encodable_string_map_arg + .IsNull()) { + reply(WrapError( + "string_map_arg unexpectedly null.")); + return; + } + const auto& string_map_arg = + std::get< + EncodableMap>( + encodable_string_map_arg); + ErrorOr< + EncodableMap> + output = + api->EchoNonNullStringMap( + string_map_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullIntMap" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_int_map_arg = + args.at( + 0); + if (encodable_int_map_arg + .IsNull()) { + reply(WrapError( + "int_map_arg unexpectedly null.")); + return; + } + const auto& int_map_arg = + std::get< + EncodableMap>( + encodable_int_map_arg); + ErrorOr< + EncodableMap> + output = + api->EchoNonNullIntMap( + int_map_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullEnumMap" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_enum_map_arg = + args.at( + 0); + if (encodable_enum_map_arg + .IsNull()) { + reply(WrapError( + "enum_map_arg unexpectedly null.")); + return; + } + const auto& enum_map_arg = + std::get< + EncodableMap>( + encodable_enum_map_arg); + ErrorOr< + EncodableMap> + output = + api->EchoNonNullEnumMap( + enum_map_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullClassMap" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_class_map_arg = + args.at( + 0); + if (encodable_class_map_arg + .IsNull()) { + reply(WrapError( + "class_map_arg unexpectedly null.")); + return; + } + const auto& class_map_arg = + std::get< + EncodableMap>( + encodable_class_map_arg); + ErrorOr< + EncodableMap> + output = + api->EchoNonNullClassMap( + class_map_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoClassWrapper" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_wrapper_arg = + args.at( + 0); + if (encodable_wrapper_arg + .IsNull()) { + reply(WrapError( + "wrapper_arg unexpectedly null.")); + return; + } + const auto& wrapper_arg = + std::any_cast< + const AllClassesWrapper&>( + std::get< + CustomEncodableValue>( + encodable_wrapper_arg)); + ErrorOr< + AllClassesWrapper> + output = + api->EchoClassWrapper( + wrapper_arg); + 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); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnum" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_an_enum_arg = + args.at( + 0); + if (encodable_an_enum_arg + .IsNull()) { + reply(WrapError( + "an_enum_arg unexpectedly null.")); + return; + } + const auto& an_enum_arg = + std::any_cast< + const AnEnum&>( + std::get< + CustomEncodableValue>( + encodable_an_enum_arg)); + ErrorOr< + AnEnum> + output = + api->EchoEnum( + an_enum_arg); + 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); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAnotherEnum" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_another_enum_arg = + args.at( + 0); + if (encodable_another_enum_arg + .IsNull()) { + reply(WrapError( + "another_enum_arg unexpectedly null.")); + return; + } + const auto& another_enum_arg = + std::any_cast< + const AnotherEnum&>( + std::get< + CustomEncodableValue>( + encodable_another_enum_arg)); + ErrorOr< + AnotherEnum> + output = + api->EchoAnotherEnum( + another_enum_arg); + 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); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedDefaultString" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_a_string_arg = + args.at( + 0); + if (encodable_a_string_arg + .IsNull()) { + reply(WrapError( + "a_string_arg unexpectedly null.")); + return; + } + const auto& a_string_arg = + std::get< + std:: + string>( + encodable_a_string_arg); + ErrorOr< + std:: + string> + output = + api->EchoNamedDefaultString( + a_string_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalDefaultDouble" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_a_double_arg = + args.at( + 0); + if (encodable_a_double_arg + .IsNull()) { + reply(WrapError( + "a_double_arg unexpectedly null.")); + return; + } + const auto& a_double_arg = + std::get< + double>( + encodable_a_double_arg); + ErrorOr< + double> + output = + api->EchoOptionalDefaultDouble( + a_double_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoRequiredInt" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_an_int_arg = + args.at( + 0); + if (encodable_an_int_arg + .IsNull()) { + reply(WrapError( + "an_int_arg unexpectedly null.")); + return; + } + const int64_t an_int_arg = + encodable_an_int_arg + .LongValue(); + ErrorOr< + int64_t> + output = + api->EchoRequiredInt( + an_int_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.areAllNullableTypesEqual" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_a_arg = + args.at( + 0); + if (encodable_a_arg + .IsNull()) { + reply(WrapError( + "a_arg unexpectedly null.")); + return; + } + const auto& a_arg = std::any_cast< + const AllNullableTypes&>( + std::get< + CustomEncodableValue>( + encodable_a_arg)); + const auto& encodable_b_arg = + args.at( + 1); + if (encodable_b_arg + .IsNull()) { + reply(WrapError( + "b_arg unexpectedly null.")); + return; + } + const auto& b_arg = std::any_cast< + const AllNullableTypes&>( + std::get< + CustomEncodableValue>( + encodable_b_arg)); + ErrorOr output = + api->AreAllNullableTypesEqual( + a_arg, + b_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.getAllNullableTypesHash" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_value_arg = + args.at( + 0); + if (encodable_value_arg + .IsNull()) { + reply(WrapError( + "value_arg unexpectedly null.")); + return; + } + const auto& value_arg = + std::any_cast< + const AllNullableTypes&>( + std::get< + CustomEncodableValue>( + encodable_value_arg)); + ErrorOr< + int64_t> + output = + api->GetAllNullableTypesHash( + value_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.getAllNullableTypesWithoutRecursionHash" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_value_arg = + args.at( + 0); + if (encodable_value_arg + .IsNull()) { + reply(WrapError( + "value_arg unexpectedly null.")); + return; + } + const auto& value_arg = + std::any_cast< + const AllNullableTypesWithoutRecursion&>( + std::get< + CustomEncodableValue>( + encodable_value_arg)); + ErrorOr< + int64_t> + output = + api->GetAllNullableTypesWithoutRecursionHash( + value_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypes" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_everything_arg = + args.at( + 0); + const auto* everything_arg = + encodable_everything_arg + .IsNull() + ? nullptr + : &(std::any_cast< + const AllNullableTypes&>( + std::get< + CustomEncodableValue>( + encodable_everything_arg))); + ErrorOr< + std::optional< + AllNullableTypes>> + output = + api->EchoAllNullableTypes( + everything_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(CustomEncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_everything_arg = + args.at( + 0); + const auto* everything_arg = + encodable_everything_arg + .IsNull() + ? nullptr + : &(std::any_cast< + const AllNullableTypesWithoutRecursion&>( + std::get< + CustomEncodableValue>( + encodable_everything_arg))); + ErrorOr< + std::optional< + AllNullableTypesWithoutRecursion>> + output = + api->EchoAllNullableTypesWithoutRecursion( + everything_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(CustomEncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.extractNestedNullableString" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_wrapper_arg = + args.at( + 0); + if (encodable_wrapper_arg + .IsNull()) { + reply(WrapError( + "wrapper_arg unexpectedly null.")); + return; + } + const auto& wrapper_arg = + std::any_cast< + const AllClassesWrapper&>( + std::get< + CustomEncodableValue>( + encodable_wrapper_arg)); + ErrorOr> + output = + api->ExtractNestedNullableString( + wrapper_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.createNestedNullableString" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api](const EncodableValue& + message, + const :: + flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_nullable_string_arg = + args.at( + 0); + const auto* nullable_string_arg = + std::get_if< + std:: + string>( + &encodable_nullable_string_arg); + ErrorOr< + AllClassesWrapper> + output = + api->CreateNestedNullableString( + nullable_string_arg); + 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); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypes" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_a_nullable_bool_arg = + args.at( + 0); + const auto* a_nullable_bool_arg = + std::get_if< + bool>( + &encodable_a_nullable_bool_arg); + const auto& encodable_a_nullable_int_arg = + args.at( + 1); + const auto* a_nullable_int_arg = + std::get_if< + int64_t>( + &encodable_a_nullable_int_arg); + const auto& encodable_a_nullable_string_arg = + args.at( + 2); + const auto* a_nullable_string_arg = + std::get_if< + std:: + string>( + &encodable_a_nullable_string_arg); + ErrorOr< + AllNullableTypes> + output = api->SendMultipleNullableTypes( + a_nullable_bool_arg, + a_nullable_int_arg, + a_nullable_string_arg); + 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); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_a_nullable_bool_arg = + args.at( + 0); + const auto* a_nullable_bool_arg = + std::get_if< + bool>( + &encodable_a_nullable_bool_arg); + const auto& encodable_a_nullable_int_arg = + args.at( + 1); + const auto* a_nullable_int_arg = + std::get_if< + int64_t>( + &encodable_a_nullable_int_arg); + const auto& encodable_a_nullable_string_arg = + args.at( + 2); + const auto* a_nullable_string_arg = + std::get_if< + std:: + string>( + &encodable_a_nullable_string_arg); + ErrorOr< + AllNullableTypesWithoutRecursion> + output = api->SendMultipleNullableTypesWithoutRecursion( + a_nullable_bool_arg, + a_nullable_int_arg, + a_nullable_string_arg); + 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); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableInt" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_a_nullable_int_arg = + args.at( + 0); + const auto* a_nullable_int_arg = + std::get_if< + int64_t>( + &encodable_a_nullable_int_arg); + ErrorOr< + std::optional< + int64_t>> + output = + api->EchoNullableInt( + a_nullable_int_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableDouble" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_a_nullable_double_arg = + args.at( + 0); + const auto* a_nullable_double_arg = + std::get_if< + double>( + &encodable_a_nullable_double_arg); + ErrorOr< + std::optional< + double>> + output = + api->EchoNullableDouble( + a_nullable_double_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableBool" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_a_nullable_bool_arg = + args.at( + 0); + const auto* a_nullable_bool_arg = + std::get_if< + bool>( + &encodable_a_nullable_bool_arg); + ErrorOr< + std::optional< + bool>> + output = + api->EchoNullableBool( + a_nullable_bool_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableString" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_a_nullable_string_arg = + args.at( + 0); + const auto* a_nullable_string_arg = + std::get_if< + std:: + string>( + &encodable_a_nullable_string_arg); + ErrorOr> + output = + api->EchoNullableString( + a_nullable_string_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableUint8List" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_a_nullable_uint8_list_arg = + args.at( + 0); + const auto* a_nullable_uint8_list_arg = + std::get_if< + std::vector< + uint8_t>>( + &encodable_a_nullable_uint8_list_arg); + ErrorOr>> + output = + api->EchoNullableUint8List( + a_nullable_uint8_list_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableObject" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_a_nullable_object_arg = + args.at( + 0); + const auto* + a_nullable_object_arg = + &encodable_a_nullable_object_arg; + ErrorOr< + std::optional< + EncodableValue>> + output = + api->EchoNullableObject( + a_nullable_object_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableList" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_a_nullable_list_arg = + args.at( + 0); + const auto* a_nullable_list_arg = + std::get_if< + EncodableList>( + &encodable_a_nullable_list_arg); + ErrorOr< + std::optional< + EncodableList>> + output = + api->EchoNullableList( + a_nullable_list_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnumList" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_enum_list_arg = + args.at( + 0); + const auto* enum_list_arg = + std::get_if< + EncodableList>( + &encodable_enum_list_arg); + ErrorOr< + std::optional< + EncodableList>> + output = + api->EchoNullableEnumList( + enum_list_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableClassList" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_class_list_arg = + args.at( + 0); + const auto* class_list_arg = + std::get_if< + EncodableList>( + &encodable_class_list_arg); + ErrorOr< + std::optional< + EncodableList>> + output = + api->EchoNullableClassList( + class_list_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullEnumList" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_enum_list_arg = + args.at( + 0); + const auto* enum_list_arg = + std::get_if< + EncodableList>( + &encodable_enum_list_arg); + ErrorOr< + std::optional< + EncodableList>> + output = + api->EchoNullableNonNullEnumList( + enum_list_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullClassList" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_class_list_arg = + args.at( + 0); + const auto* class_list_arg = + std::get_if< + EncodableList>( + &encodable_class_list_arg); + ErrorOr< + std::optional< + EncodableList>> + output = + api->EchoNullableNonNullClassList( + class_list_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableMap" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_map_arg = + args.at( + 0); + const auto* map_arg = + std::get_if< + EncodableMap>( + &encodable_map_arg); + ErrorOr< + std::optional< + EncodableMap>> + output = + api->EchoNullableMap( + map_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableStringMap" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_string_map_arg = + args.at( + 0); + const auto* string_map_arg = + std::get_if< + EncodableMap>( + &encodable_string_map_arg); + ErrorOr< + std::optional< + EncodableMap>> + output = + api->EchoNullableStringMap( + string_map_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableIntMap" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_int_map_arg = + args.at( + 0); + const auto* int_map_arg = + std::get_if< + EncodableMap>( + &encodable_int_map_arg); + ErrorOr< + std::optional< + EncodableMap>> + output = + api->EchoNullableIntMap( + int_map_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnumMap" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_enum_map_arg = + args.at( + 0); + const auto* enum_map_arg = + std::get_if< + EncodableMap>( + &encodable_enum_map_arg); + ErrorOr< + std::optional< + EncodableMap>> + output = + api->EchoNullableEnumMap( + enum_map_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableClassMap" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_class_map_arg = + args.at( + 0); + const auto* class_map_arg = + std::get_if< + EncodableMap>( + &encodable_class_map_arg); + ErrorOr< + std::optional< + EncodableMap>> + output = + api->EchoNullableClassMap( + class_map_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullStringMap" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_string_map_arg = + args.at( + 0); + const auto* string_map_arg = + std::get_if< + EncodableMap>( + &encodable_string_map_arg); + ErrorOr< + std::optional< + EncodableMap>> + output = + api->EchoNullableNonNullStringMap( + string_map_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullIntMap" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_int_map_arg = + args.at( + 0); + const auto* int_map_arg = + std::get_if< + EncodableMap>( + &encodable_int_map_arg); + ErrorOr< + std::optional< + EncodableMap>> + output = + api->EchoNullableNonNullIntMap( + int_map_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullEnumMap" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_enum_map_arg = + args.at( + 0); + const auto* enum_map_arg = + std::get_if< + EncodableMap>( + &encodable_enum_map_arg); + ErrorOr< + std::optional< + EncodableMap>> + output = + api->EchoNullableNonNullEnumMap( + enum_map_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullClassMap" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_class_map_arg = + args.at( + 0); + const auto* class_map_arg = + std::get_if< + EncodableMap>( + &encodable_class_map_arg); + ErrorOr< + std::optional< + EncodableMap>> + output = + api->EchoNullableNonNullClassMap( + class_map_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnum" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_an_enum_arg = + args.at( + 0); + AnEnum + an_enum_arg_value; + const AnEnum* + an_enum_arg = + nullptr; + if (!encodable_an_enum_arg + .IsNull()) { + an_enum_arg_value = std::any_cast< + const AnEnum&>( + std::get< + CustomEncodableValue>( + encodable_an_enum_arg)); + an_enum_arg = + &an_enum_arg_value; + } + ErrorOr< + std::optional< + AnEnum>> + output = api->EchoNullableEnum( + an_enum_arg + ? &(*an_enum_arg) + : nullptr); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(CustomEncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAnotherNullableEnum" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_another_enum_arg = + args.at( + 0); + AnotherEnum + another_enum_arg_value; + const AnotherEnum* + another_enum_arg = + nullptr; + if (!encodable_another_enum_arg + .IsNull()) { + another_enum_arg_value = + std::any_cast< + const AnotherEnum&>( + std::get< + CustomEncodableValue>( + encodable_another_enum_arg)); + another_enum_arg = + &another_enum_arg_value; + } + ErrorOr< + std::optional< + AnotherEnum>> + output = api->EchoAnotherNullableEnum( + another_enum_arg + ? &(*another_enum_arg) + : nullptr); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(CustomEncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalNullableInt" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_a_nullable_int_arg = + args.at( + 0); + const auto* a_nullable_int_arg = + std::get_if< + int64_t>( + &encodable_a_nullable_int_arg); + ErrorOr< + std::optional< + int64_t>> + output = + api->EchoOptionalNullableInt( + a_nullable_int_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedNullableString" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_a_nullable_string_arg = + args.at( + 0); + const auto* a_nullable_string_arg = + std::get_if< + std:: + string>( + &encodable_a_nullable_string_arg); + ErrorOr> + output = + api->EchoNamedNullableString( + a_nullable_string_arg); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.noopAsync" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + api->NoopAsync( + [reply]( + std::optional< + FlutterError>&& + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncInt" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_an_int_arg = + args.at( + 0); + if (encodable_an_int_arg + .IsNull()) { + reply(WrapError( + "an_int_arg unexpectedly null.")); + return; + } + const int64_t an_int_arg = + encodable_an_int_arg + .LongValue(); + api->EchoAsyncInt( + an_int_arg, + [reply]( + ErrorOr< + int64_t>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncDouble" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_a_double_arg = + args.at( + 0); + if (encodable_a_double_arg + .IsNull()) { + reply(WrapError( + "a_double_arg unexpectedly null.")); + return; + } + const auto& a_double_arg = + std::get< + double>( + encodable_a_double_arg); + api->EchoAsyncDouble( + a_double_arg, + [reply]( + ErrorOr< + double>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncBool" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_a_bool_arg = + args.at( + 0); + if (encodable_a_bool_arg + .IsNull()) { + reply(WrapError( + "a_bool_arg unexpectedly null.")); + return; + } + const auto& a_bool_arg = + std::get< + bool>( + encodable_a_bool_arg); + api->EchoAsyncBool( + a_bool_arg, + [reply]( + ErrorOr< + bool>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncString" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_a_string_arg = + args.at( + 0); + if (encodable_a_string_arg + .IsNull()) { + reply(WrapError( + "a_string_arg unexpectedly null.")); + return; + } + const auto& a_string_arg = + std::get< + std:: + string>( + encodable_a_string_arg); + api->EchoAsyncString( + a_string_arg, + [reply]( + ErrorOr< + std:: + string>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncUint8List" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_a_uint8_list_arg = + args.at( + 0); + if (encodable_a_uint8_list_arg + .IsNull()) { + reply(WrapError( + "a_uint8_list_arg unexpectedly null.")); + return; + } + const auto& a_uint8_list_arg = + std::get< + std::vector< + uint8_t>>( + encodable_a_uint8_list_arg); + api->EchoAsyncUint8List( + a_uint8_list_arg, + [reply]( + ErrorOr>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncObject" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_an_object_arg = + args.at( + 0); + if (encodable_an_object_arg + .IsNull()) { + reply(WrapError( + "an_object_arg unexpectedly null.")); + return; + } + const auto& + an_object_arg = + encodable_an_object_arg; + api->EchoAsyncObject( + an_object_arg, + [reply]( + ErrorOr< + EncodableValue>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncList" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_list_arg = + args.at( + 0); + if (encodable_list_arg + .IsNull()) { + reply(WrapError( + "list_arg unexpectedly null.")); + return; + } + const auto& list_arg = + std::get< + EncodableList>( + encodable_list_arg); + api->EchoAsyncList( + list_arg, + [reply]( + ErrorOr< + EncodableList>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnumList" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_enum_list_arg = + args.at( + 0); + if (encodable_enum_list_arg + .IsNull()) { + reply(WrapError( + "enum_list_arg unexpectedly null.")); + return; + } + const auto& enum_list_arg = + std::get< + EncodableList>( + encodable_enum_list_arg); + api->EchoAsyncEnumList( + enum_list_arg, + [reply]( + ErrorOr< + EncodableList>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncClassList" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_class_list_arg = + args.at( + 0); + if (encodable_class_list_arg + .IsNull()) { + reply(WrapError( + "class_list_arg unexpectedly null.")); + return; + } + const auto& class_list_arg = + std::get< + EncodableList>( + encodable_class_list_arg); + api->EchoAsyncClassList( + class_list_arg, + [reply]( + ErrorOr< + EncodableList>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncMap" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_map_arg = + args.at( + 0); + if (encodable_map_arg + .IsNull()) { + reply(WrapError( + "map_arg unexpectedly null.")); + return; + } + const auto& map_arg = + std::get< + EncodableMap>( + encodable_map_arg); + api->EchoAsyncMap( + map_arg, + [reply]( + ErrorOr< + EncodableMap>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncStringMap" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_string_map_arg = + args.at( + 0); + if (encodable_string_map_arg + .IsNull()) { + reply(WrapError( + "string_map_arg unexpectedly null.")); + return; + } + const auto& string_map_arg = + std::get< + EncodableMap>( + encodable_string_map_arg); + api->EchoAsyncStringMap( + string_map_arg, + [reply]( + ErrorOr< + EncodableMap>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncIntMap" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_int_map_arg = + args.at( + 0); + if (encodable_int_map_arg + .IsNull()) { + reply(WrapError( + "int_map_arg unexpectedly null.")); + return; + } + const auto& int_map_arg = + std::get< + EncodableMap>( + encodable_int_map_arg); + api->EchoAsyncIntMap( + int_map_arg, + [reply]( + ErrorOr< + EncodableMap>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnumMap" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_enum_map_arg = + args.at( + 0); + if (encodable_enum_map_arg + .IsNull()) { + reply(WrapError( + "enum_map_arg unexpectedly null.")); + return; + } + const auto& enum_map_arg = + std::get< + EncodableMap>( + encodable_enum_map_arg); + api->EchoAsyncEnumMap( + enum_map_arg, + [reply]( + ErrorOr< + EncodableMap>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncClassMap" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_class_map_arg = + args.at( + 0); + if (encodable_class_map_arg + .IsNull()) { + reply(WrapError( + "class_map_arg unexpectedly null.")); + return; + } + const auto& class_map_arg = + std::get< + EncodableMap>( + encodable_class_map_arg); + api->EchoAsyncClassMap( + class_map_arg, + [reply]( + ErrorOr< + EncodableMap>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnum" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_an_enum_arg = + args.at( + 0); + if (encodable_an_enum_arg + .IsNull()) { + reply(WrapError( + "an_enum_arg unexpectedly null.")); + return; + } + const auto& an_enum_arg = + std::any_cast< + const AnEnum&>( + std::get< + CustomEncodableValue>( + encodable_an_enum_arg)); + api->EchoAsyncEnum( + an_enum_arg, + [reply]( + ErrorOr< + AnEnum>&& + 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); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAnotherAsyncEnum" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_another_enum_arg = + args.at( + 0); + if (encodable_another_enum_arg + .IsNull()) { + reply(WrapError( + "another_enum_arg unexpectedly null.")); + return; + } + const auto& another_enum_arg = + std::any_cast< + const AnotherEnum&>( + std::get< + CustomEncodableValue>( + encodable_another_enum_arg)); + api->EchoAnotherAsyncEnum( + another_enum_arg, + [reply]( + ErrorOr< + AnotherEnum>&& + 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); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncError" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + api->ThrowAsyncError( + [reply]( + ErrorOr>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncErrorFromVoid" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + api->ThrowAsyncErrorFromVoid( + [reply]( + std::optional< + FlutterError>&& + 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.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncFlutterError" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + api->ThrowAsyncFlutterError( + [reply]( + ErrorOr>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncAllTypes" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_everything_arg = + args.at( + 0); + if (encodable_everything_arg + .IsNull()) { + reply(WrapError( + "everything_arg unexpectedly null.")); + return; + } + const auto& everything_arg = + std::any_cast< + const AllTypes&>( + std::get< + CustomEncodableValue>( + encodable_everything_arg)); + api->EchoAsyncAllTypes( + everything_arg, + [reply]( + ErrorOr< + AllTypes>&& + 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); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_everything_arg = + args.at( + 0); + const auto* everything_arg = + encodable_everything_arg + .IsNull() + ? nullptr + : &(std::any_cast< + const AllNullableTypes&>( + std::get< + CustomEncodableValue>( + encodable_everything_arg))); + api->EchoAsyncNullableAllNullableTypes( + everything_arg, + [reply]( + ErrorOr>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(CustomEncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypesWithoutRecursion" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_everything_arg = + args.at( + 0); + const auto* everything_arg = + encodable_everything_arg + .IsNull() + ? nullptr + : &(std::any_cast< + const AllNullableTypesWithoutRecursion&>( + std::get< + CustomEncodableValue>( + encodable_everything_arg))); + api->EchoAsyncNullableAllNullableTypesWithoutRecursion( + everything_arg, + [reply]( + ErrorOr>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(CustomEncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableInt" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_an_int_arg = + args.at( + 0); + const auto* an_int_arg = + std::get_if< + int64_t>( + &encodable_an_int_arg); + api->EchoAsyncNullableInt( + an_int_arg, + [reply]( + ErrorOr>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableDouble" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_a_double_arg = + args.at( + 0); + const auto* a_double_arg = + std::get_if< + double>( + &encodable_a_double_arg); + api->EchoAsyncNullableDouble( + a_double_arg, + [reply]( + ErrorOr>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableBool" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_a_bool_arg = + args.at( + 0); + const auto* a_bool_arg = + std::get_if< + bool>( + &encodable_a_bool_arg); + api->EchoAsyncNullableBool( + a_bool_arg, + [reply]( + ErrorOr>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableString" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& message, const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_a_string_arg = + args.at( + 0); + const auto* a_string_arg = + std::get_if< + std:: + string>( + &encodable_a_string_arg); + api->EchoAsyncNullableString( + a_string_arg, + [reply]( + ErrorOr>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableUint8List" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_a_uint8_list_arg = + args.at( + 0); + const auto* a_uint8_list_arg = + std::get_if< + std::vector< + uint8_t>>( + &encodable_a_uint8_list_arg); + api->EchoAsyncNullableUint8List( + a_uint8_list_arg, + [reply]( + ErrorOr>>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableObject" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_an_object_arg = + args.at( + 0); + const auto* + an_object_arg = + &encodable_an_object_arg; + api->EchoAsyncNullableObject( + an_object_arg, + [reply]( + ErrorOr>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableList" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_list_arg = + args.at( + 0); + const auto* list_arg = + std::get_if< + EncodableList>( + &encodable_list_arg); + api->EchoAsyncNullableList( + list_arg, + [reply]( + ErrorOr>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnumList" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_enum_list_arg = + args.at( + 0); + const auto* enum_list_arg = + std::get_if< + EncodableList>( + &encodable_enum_list_arg); + api->EchoAsyncNullableEnumList( + enum_list_arg, + [reply]( + ErrorOr>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableClassList" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_class_list_arg = + args.at( + 0); + const auto* class_list_arg = + std::get_if< + EncodableList>( + &encodable_class_list_arg); + api->EchoAsyncNullableClassList( + class_list_arg, + [reply]( + ErrorOr>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableMap" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_map_arg = + args.at( + 0); + const auto* map_arg = + std::get_if< + EncodableMap>( + &encodable_map_arg); + api->EchoAsyncNullableMap( + map_arg, + [reply]( + ErrorOr>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableStringMap" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_string_map_arg = + args.at( + 0); + const auto* string_map_arg = + std::get_if< + EncodableMap>( + &encodable_string_map_arg); + api->EchoAsyncNullableStringMap( + string_map_arg, + [reply]( + ErrorOr>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableIntMap" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_int_map_arg = + args.at( + 0); + const auto* int_map_arg = + std::get_if< + EncodableMap>( + &encodable_int_map_arg); + api->EchoAsyncNullableIntMap( + int_map_arg, + [reply]( + ErrorOr>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnumMap" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_enum_map_arg = + args.at( + 0); + const auto* enum_map_arg = + std::get_if< + EncodableMap>( + &encodable_enum_map_arg); + api->EchoAsyncNullableEnumMap( + enum_map_arg, + [reply]( + ErrorOr>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableClassMap" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_class_map_arg = + args.at( + 0); + const auto* class_map_arg = + std::get_if< + EncodableMap>( + &encodable_class_map_arg); + api->EchoAsyncNullableClassMap( + class_map_arg, + [reply]( + ErrorOr>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnum" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_an_enum_arg = + args.at( + 0); + AnEnum + an_enum_arg_value; + const AnEnum* + an_enum_arg = + nullptr; + if (!encodable_an_enum_arg + .IsNull()) { + an_enum_arg_value = std::any_cast< + const AnEnum&>( + std::get< + CustomEncodableValue>( + encodable_an_enum_arg)); + an_enum_arg = + &an_enum_arg_value; + } + api->EchoAsyncNullableEnum( + an_enum_arg + ? &(*an_enum_arg) + : nullptr, + [reply]( + ErrorOr>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(CustomEncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAnotherAsyncNullableEnum" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_another_enum_arg = + args.at( + 0); + AnotherEnum + another_enum_arg_value; + const AnotherEnum* + another_enum_arg = + nullptr; + if (!encodable_another_enum_arg + .IsNull()) { + another_enum_arg_value = + std::any_cast< + const AnotherEnum&>( + std::get< + CustomEncodableValue>( + encodable_another_enum_arg)); + another_enum_arg = + &another_enum_arg_value; + } + api->EchoAnotherAsyncNullableEnum( + another_enum_arg + ? &(*another_enum_arg) + : nullptr, + [reply]( + ErrorOr>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(CustomEncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.defaultIsMainThread" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + ErrorOr< + bool> + output = + api->DefaultIsMainThread(); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.taskQueueIsBackgroundThread" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + ErrorOr< + bool> + output = + api->TaskQueueIsBackgroundThread(); + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterNoop" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + api->CallFlutterNoop( + [reply]( + std::optional< + FlutterError>&& + 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowError" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + api->CallFlutterThrowError( + [reply]( + ErrorOr>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + api->CallFlutterThrowErrorFromVoid( + [reply]( + std::optional< + FlutterError>&& + 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllTypes" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_everything_arg = + args.at( + 0); + if (encodable_everything_arg + .IsNull()) { + reply(WrapError( + "everything_arg unexpectedly null.")); + return; + } + const auto& everything_arg = + std::any_cast< + const AllTypes&>( + std::get< + CustomEncodableValue>( + encodable_everything_arg)); + api->CallFlutterEchoAllTypes( + everything_arg, + [reply]( + ErrorOr< + AllTypes>&& + 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); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypes" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_everything_arg = + args.at( + 0); + const auto* everything_arg = + encodable_everything_arg + .IsNull() + ? nullptr + : &(std::any_cast< + const AllNullableTypes&>( + std::get< + CustomEncodableValue>( + encodable_everything_arg))); + api->CallFlutterEchoAllNullableTypes( + everything_arg, + [reply]( + ErrorOr>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(CustomEncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_a_nullable_bool_arg = + args.at( + 0); + const auto* a_nullable_bool_arg = + std::get_if< + bool>( + &encodable_a_nullable_bool_arg); + const auto& encodable_a_nullable_int_arg = + args.at( + 1); + const auto* a_nullable_int_arg = + std::get_if< + int64_t>( + &encodable_a_nullable_int_arg); + const auto& encodable_a_nullable_string_arg = + args.at( + 2); + const auto* a_nullable_string_arg = + std::get_if< + std:: + string>( + &encodable_a_nullable_string_arg); + api->CallFlutterSendMultipleNullableTypes( + a_nullable_bool_arg, + a_nullable_int_arg, + a_nullable_string_arg, + [reply]( + ErrorOr< + AllNullableTypes>&& + 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); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypesWithoutRecursion" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_everything_arg = + args.at( + 0); + const auto* everything_arg = + encodable_everything_arg + .IsNull() + ? nullptr + : &(std::any_cast< + const AllNullableTypesWithoutRecursion&>( + std::get< + CustomEncodableValue>( + encodable_everything_arg))); + api->CallFlutterEchoAllNullableTypesWithoutRecursion( + everything_arg, + [reply]( + ErrorOr>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(CustomEncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypesWithoutRecursion" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_a_nullable_bool_arg = + args.at( + 0); + const auto* a_nullable_bool_arg = + std::get_if< + bool>( + &encodable_a_nullable_bool_arg); + const auto& encodable_a_nullable_int_arg = + args.at( + 1); + const auto* a_nullable_int_arg = + std::get_if< + int64_t>( + &encodable_a_nullable_int_arg); + const auto& encodable_a_nullable_string_arg = + args.at( + 2); + const auto* a_nullable_string_arg = + std::get_if< + std:: + string>( + &encodable_a_nullable_string_arg); + api->CallFlutterSendMultipleNullableTypesWithoutRecursion( + a_nullable_bool_arg, + a_nullable_int_arg, + a_nullable_string_arg, + [reply]( + ErrorOr< + AllNullableTypesWithoutRecursion>&& + 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); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoBool" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_a_bool_arg = + args.at( + 0); + if (encodable_a_bool_arg + .IsNull()) { + reply(WrapError( + "a_bool_arg unexpectedly null.")); + return; + } + const auto& a_bool_arg = + std::get< + bool>( + encodable_a_bool_arg); + api->CallFlutterEchoBool( + a_bool_arg, + [reply]( + ErrorOr< + bool>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoInt" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_an_int_arg = + args.at( + 0); + if (encodable_an_int_arg + .IsNull()) { + reply(WrapError( + "an_int_arg unexpectedly null.")); + return; + } + const int64_t an_int_arg = + encodable_an_int_arg + .LongValue(); + api->CallFlutterEchoInt( + an_int_arg, + [reply]( + ErrorOr< + int64_t>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoDouble" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_a_double_arg = + args.at( + 0); + if (encodable_a_double_arg + .IsNull()) { + reply(WrapError( + "a_double_arg unexpectedly null.")); + return; + } + const auto& a_double_arg = + std::get< + double>( + encodable_a_double_arg); + api->CallFlutterEchoDouble( + a_double_arg, + [reply]( + ErrorOr< + double>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoString" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_a_string_arg = + args.at( + 0); + if (encodable_a_string_arg + .IsNull()) { + reply(WrapError( + "a_string_arg unexpectedly null.")); + return; + } + const auto& a_string_arg = + std::get< + std:: + string>( + encodable_a_string_arg); + api->CallFlutterEchoString( + a_string_arg, + [reply]( + ErrorOr< + std:: + string>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoUint8List" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_list_arg = + args.at( + 0); + if (encodable_list_arg + .IsNull()) { + reply(WrapError( + "list_arg unexpectedly null.")); + return; + } + const auto& list_arg = + std::get< + std::vector< + uint8_t>>( + encodable_list_arg); + api + ->CallFlutterEchoUint8List(list_arg, + [reply]( + ErrorOr>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoList" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_list_arg = + args.at( + 0); + if (encodable_list_arg + .IsNull()) { + reply(WrapError( + "list_arg unexpectedly null.")); + return; + } + const auto& list_arg = + std::get< + EncodableList>( + encodable_list_arg); + api->CallFlutterEchoList( + list_arg, + [reply]( + ErrorOr< + EncodableList>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnumList" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_enum_list_arg = + args.at( + 0); + if (encodable_enum_list_arg + .IsNull()) { + reply(WrapError( + "enum_list_arg unexpectedly null.")); + return; + } + const auto& enum_list_arg = + std::get< + EncodableList>( + encodable_enum_list_arg); + api->CallFlutterEchoEnumList( + enum_list_arg, + [reply]( + ErrorOr< + EncodableList>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoClassList" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_class_list_arg = + args.at( + 0); + if (encodable_class_list_arg + .IsNull()) { + reply(WrapError( + "class_list_arg unexpectedly null.")); + return; + } + const auto& class_list_arg = + std::get< + EncodableList>( + encodable_class_list_arg); + api->CallFlutterEchoClassList( + class_list_arg, + [reply]( + ErrorOr< + EncodableList>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullEnumList" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_enum_list_arg = + args.at( + 0); + if (encodable_enum_list_arg + .IsNull()) { + reply(WrapError( + "enum_list_arg unexpectedly null.")); + return; + } + const auto& enum_list_arg = + std::get< + EncodableList>( + encodable_enum_list_arg); + api->CallFlutterEchoNonNullEnumList( + enum_list_arg, + [reply]( + ErrorOr< + EncodableList>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullClassList" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_class_list_arg = + args.at( + 0); + if (encodable_class_list_arg + .IsNull()) { + reply(WrapError( + "class_list_arg unexpectedly null.")); + return; + } + const auto& class_list_arg = + std::get< + EncodableList>( + encodable_class_list_arg); + api + ->CallFlutterEchoNonNullClassList(class_list_arg, + [reply]( + ErrorOr&& output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoMap" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_map_arg = + args.at( + 0); + if (encodable_map_arg + .IsNull()) { + reply(WrapError( + "map_arg unexpectedly null.")); + return; + } + const auto& map_arg = + std::get< + EncodableMap>( + encodable_map_arg); + api->CallFlutterEchoMap( + map_arg, + [reply]( + ErrorOr< + EncodableMap>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoStringMap" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_string_map_arg = + args.at( + 0); + if (encodable_string_map_arg + .IsNull()) { + reply(WrapError( + "string_map_arg unexpectedly null.")); + return; + } + const auto& string_map_arg = + std::get< + EncodableMap>( + encodable_string_map_arg); + api->CallFlutterEchoStringMap( + string_map_arg, + [reply]( + ErrorOr< + EncodableMap>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoIntMap" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_int_map_arg = + args.at( + 0); + if (encodable_int_map_arg + .IsNull()) { + reply(WrapError( + "int_map_arg unexpectedly null.")); + return; + } + const auto& int_map_arg = + std::get< + EncodableMap>( + encodable_int_map_arg); + api->CallFlutterEchoIntMap( + int_map_arg, + [reply]( + ErrorOr< + EncodableMap>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnumMap" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_enum_map_arg = + args.at( + 0); + if (encodable_enum_map_arg + .IsNull()) { + reply(WrapError( + "enum_map_arg unexpectedly null.")); + return; + } + const auto& enum_map_arg = + std::get< + EncodableMap>( + encodable_enum_map_arg); + api->CallFlutterEchoEnumMap( + enum_map_arg, + [reply]( + ErrorOr< + EncodableMap>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoClassMap" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_class_map_arg = + args.at( + 0); + if (encodable_class_map_arg + .IsNull()) { + reply(WrapError( + "class_map_arg unexpectedly null.")); + return; + } + const auto& class_map_arg = + std::get< + EncodableMap>( + encodable_class_map_arg); + api->CallFlutterEchoClassMap( + class_map_arg, + [reply]( + ErrorOr< + EncodableMap>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullStringMap" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_string_map_arg = + args.at( + 0); + if (encodable_string_map_arg + .IsNull()) { + reply(WrapError( + "string_map_arg unexpectedly null.")); + return; + } + const auto& string_map_arg = + std::get< + EncodableMap>( + encodable_string_map_arg); + api + ->CallFlutterEchoNonNullStringMap(string_map_arg, + [reply]( + ErrorOr&& output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullIntMap" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_int_map_arg = + args.at( + 0); + if (encodable_int_map_arg + .IsNull()) { + reply(WrapError( + "int_map_arg unexpectedly null.")); + return; + } + const auto& int_map_arg = + std::get< + EncodableMap>( + encodable_int_map_arg); + api->CallFlutterEchoNonNullIntMap( + int_map_arg, + [reply]( + ErrorOr< + EncodableMap>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullEnumMap" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_enum_map_arg = + args.at( + 0); + if (encodable_enum_map_arg + .IsNull()) { + reply(WrapError( + "enum_map_arg unexpectedly null.")); + return; + } + const auto& enum_map_arg = + std::get< + EncodableMap>( + encodable_enum_map_arg); + api->CallFlutterEchoNonNullEnumMap( + enum_map_arg, + [reply]( + ErrorOr< + EncodableMap>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullClassMap" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_class_map_arg = + args.at( + 0); + if (encodable_class_map_arg + .IsNull()) { + reply(WrapError( + "class_map_arg unexpectedly null.")); + return; + } + const auto& class_map_arg = + std::get< + EncodableMap>( + encodable_class_map_arg); + api->CallFlutterEchoNonNullClassMap( + class_map_arg, + [reply]( + ErrorOr< + EncodableMap>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnum" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_an_enum_arg = + args.at( + 0); + if (encodable_an_enum_arg + .IsNull()) { + reply(WrapError( + "an_enum_arg unexpectedly null.")); + return; + } + const auto& an_enum_arg = + std::any_cast< + const AnEnum&>( + std::get< + CustomEncodableValue>( + encodable_an_enum_arg)); + api->CallFlutterEchoEnum( + an_enum_arg, + [reply]( + ErrorOr< + AnEnum>&& + 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); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAnotherEnum" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_another_enum_arg = + args.at( + 0); + if (encodable_another_enum_arg + .IsNull()) { + reply(WrapError( + "another_enum_arg unexpectedly null.")); + return; + } + const auto& another_enum_arg = + std::any_cast< + const AnotherEnum&>( + std::get< + CustomEncodableValue>( + encodable_another_enum_arg)); + api->CallFlutterEchoAnotherEnum( + another_enum_arg, + [reply]( + ErrorOr< + AnotherEnum>&& + 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); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableBool" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_a_bool_arg = + args.at( + 0); + const auto* a_bool_arg = + std::get_if< + bool>( + &encodable_a_bool_arg); + api->CallFlutterEchoNullableBool( + a_bool_arg, + [reply]( + ErrorOr>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableInt" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_an_int_arg = + args.at( + 0); + const auto* an_int_arg = + std::get_if< + int64_t>( + &encodable_an_int_arg); + api->CallFlutterEchoNullableInt( + an_int_arg, + [reply]( + ErrorOr>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableDouble" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_a_double_arg = + args.at( + 0); + const auto* a_double_arg = + std::get_if< + double>( + &encodable_a_double_arg); + api->CallFlutterEchoNullableDouble( + a_double_arg, + [reply]( + ErrorOr>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableString" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& message, const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_a_string_arg = + args.at( + 0); + const auto* a_string_arg = + std::get_if< + std:: + string>( + &encodable_a_string_arg); + api->CallFlutterEchoNullableString( + a_string_arg, + [reply]( + ErrorOr>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableUint8List" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_list_arg = + args.at( + 0); + const auto* list_arg = + std::get_if< + std::vector< + uint8_t>>( + &encodable_list_arg); + api->CallFlutterEchoNullableUint8List( + list_arg, + [reply]( + ErrorOr>>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableList" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_list_arg = + args.at( + 0); + const auto* list_arg = + std::get_if< + EncodableList>( + &encodable_list_arg); + api->CallFlutterEchoNullableList( + list_arg, + [reply]( + ErrorOr>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnumList" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_enum_list_arg = + args.at( + 0); + const auto* enum_list_arg = + std::get_if< + EncodableList>( + &encodable_enum_list_arg); + api->CallFlutterEchoNullableEnumList( + enum_list_arg, + [reply]( + ErrorOr>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableClassList" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_class_list_arg = + args.at( + 0); + const auto* class_list_arg = + std::get_if< + EncodableList>( + &encodable_class_list_arg); + api->CallFlutterEchoNullableClassList( + class_list_arg, + [reply]( + ErrorOr>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullEnumList" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_enum_list_arg = + args.at( + 0); + const auto* enum_list_arg = + std::get_if< + EncodableList>( + &encodable_enum_list_arg); + api->CallFlutterEchoNullableNonNullEnumList( + enum_list_arg, + [reply]( + ErrorOr>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullClassList" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_class_list_arg = + args.at( + 0); + const auto* class_list_arg = + std::get_if< + EncodableList>( + &encodable_class_list_arg); + api->CallFlutterEchoNullableNonNullClassList( + class_list_arg, + [reply]( + ErrorOr>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableMap" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_map_arg = + args.at( + 0); + const auto* map_arg = + std::get_if< + EncodableMap>( + &encodable_map_arg); + api->CallFlutterEchoNullableMap( + map_arg, + [reply]( + ErrorOr>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableStringMap" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_string_map_arg = + args.at( + 0); + const auto* string_map_arg = + std::get_if< + EncodableMap>( + &encodable_string_map_arg); + api->CallFlutterEchoNullableStringMap( + string_map_arg, + [reply]( + ErrorOr>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableIntMap" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_int_map_arg = + args.at( + 0); + const auto* int_map_arg = + std::get_if< + EncodableMap>( + &encodable_int_map_arg); + api->CallFlutterEchoNullableIntMap( + int_map_arg, + [reply]( + ErrorOr>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnumMap" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_enum_map_arg = + args.at( + 0); + const auto* enum_map_arg = + std::get_if< + EncodableMap>( + &encodable_enum_map_arg); + api->CallFlutterEchoNullableEnumMap( + enum_map_arg, + [reply]( + ErrorOr>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableClassMap" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_class_map_arg = + args.at( + 0); + const auto* class_map_arg = + std::get_if< + EncodableMap>( + &encodable_class_map_arg); + api->CallFlutterEchoNullableClassMap( + class_map_arg, + [reply]( + ErrorOr>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullStringMap" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_string_map_arg = + args.at( + 0); + const auto* string_map_arg = + std::get_if< + EncodableMap>( + &encodable_string_map_arg); + api->CallFlutterEchoNullableNonNullStringMap( + string_map_arg, + [reply]( + ErrorOr>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullIntMap" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_int_map_arg = + args.at( + 0); + const auto* int_map_arg = + std::get_if< + EncodableMap>( + &encodable_int_map_arg); + api->CallFlutterEchoNullableNonNullIntMap( + int_map_arg, + [reply]( + ErrorOr>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullEnumMap" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_enum_map_arg = + args.at( + 0); + const auto* enum_map_arg = + std::get_if< + EncodableMap>( + &encodable_enum_map_arg); + api->CallFlutterEchoNullableNonNullEnumMap( + enum_map_arg, + [reply]( + ErrorOr>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullClassMap" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_class_map_arg = + args.at( + 0); + const auto* class_map_arg = + std::get_if< + EncodableMap>( + &encodable_class_map_arg); + api->CallFlutterEchoNullableNonNullClassMap( + class_map_arg, + [reply]( + ErrorOr>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(EncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnum" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_an_enum_arg = + args.at( + 0); + AnEnum + an_enum_arg_value; + const AnEnum* + an_enum_arg = + nullptr; + if (!encodable_an_enum_arg + .IsNull()) { + an_enum_arg_value = std::any_cast< + const AnEnum&>( + std::get< + CustomEncodableValue>( + encodable_an_enum_arg)); + an_enum_arg = + &an_enum_arg_value; + } + api->CallFlutterEchoNullableEnum( + an_enum_arg + ? &(*an_enum_arg) + : nullptr, + [reply]( + ErrorOr>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(CustomEncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAnotherNullableEnum" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_another_enum_arg = + args.at( + 0); + AnotherEnum + another_enum_arg_value; + const AnotherEnum* + another_enum_arg = + nullptr; + if (!encodable_another_enum_arg + .IsNull()) { + another_enum_arg_value = + std::any_cast< + const AnotherEnum&>( + std::get< + CustomEncodableValue>( + encodable_another_enum_arg)); + another_enum_arg = + &another_enum_arg_value; + } + api->CallFlutterEchoAnotherNullableEnum( + another_enum_arg + ? &(*another_enum_arg) + : nullptr, + [reply]( + ErrorOr>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + auto output_optional = + std::move( + output) + .TakeValue(); + if (output_optional) { + wrapped + .push_back(CustomEncodableValue( + std::move( + output_optional) + .value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSmallApiEchoString" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_a_string_arg = + args.at( + 0); + if (encodable_a_string_arg + .IsNull()) { + reply(WrapError( + "a_string_arg unexpectedly null.")); + return; + } + const auto& a_string_arg = + std::get< + std:: + string>( + encodable_a_string_arg); + api + ->CallFlutterSmallApiEchoString(a_string_arg, + [reply]( + ErrorOr< + std:: + string>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + reply(EncodableValue( + std::move( + wrapped))); + }); + } catch ( + const std:: + exception& + exception) { + reply(WrapError( + exception + .what())); + } + }); + } else { + channel + .SetMessageHandler( + nullptr); + } + } + } + + EncodableValue + HostIntegrationCoreApi:: + WrapError( + std::string_view + error_message) { + return EncodableValue(EncodableList{ + EncodableValue( + std::string( + error_message)), + EncodableValue( + "Error"), + EncodableValue()}); + } + + EncodableValue + HostIntegrationCoreApi:: + WrapError( + const FlutterError& + error) { + return EncodableValue(EncodableList{ + EncodableValue( + error + .code()), + EncodableValue( + error + .message()), + error + .details()}); + } + + // Generated class from Pigeon that represents Flutter messages that can be called from C++. + FlutterIntegrationCoreApi:: + FlutterIntegrationCoreApi( + ::flutter:: + BinaryMessenger * + binary_messenger) + : binary_messenger_( + binary_messenger), + message_channel_suffix_( + "") { + } + + FlutterIntegrationCoreApi::FlutterIntegrationCoreApi( + ::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& + FlutterIntegrationCoreApi:: + GetCodec() { + return ::flutter::StandardMessageCodec:: + GetInstance( + &PigeonInternalCodecSerializer:: + GetInstance()); + } + + void + FlutterIntegrationCoreApi::Noop( + std::function< + void( + void)> && + on_success, + std::function< + void( + const FlutterError&)> && + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue + encoded_api_arguments = + EncodableValue(); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + on_success(); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::ThrowError( + std::function< + void( + const EncodableValue*)> && + on_success, + std::function< + void( + const FlutterError&)> && + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue + encoded_api_arguments = + EncodableValue(); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto* return_value = + &list_return_value + ->at( + 0); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::ThrowErrorFromVoid( + std::function< + void( + void)> && + on_success, + std::function< + void( + const FlutterError&)> && + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwErrorFromVoid" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue + encoded_api_arguments = + EncodableValue(); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + on_success(); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::EchoAllTypes( + const AllTypes& + everything_arg, + std::function&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + CustomEncodableValue( + everything_arg), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto& return_value = + std::any_cast< + const AllTypes&>( + std::get< + CustomEncodableValue>( + list_return_value + ->at( + 0))); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::EchoAllNullableTypes( + const AllNullableTypes* + everything_arg, + std::function&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + everything_arg + ? CustomEncodableValue( + *everything_arg) + : EncodableValue(), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto* return_value = + list_return_value + ->at( + 0) + .IsNull() + ? nullptr + : &(std::any_cast< + const AllNullableTypes&>( + std::get< + CustomEncodableValue>( + list_return_value + ->at( + 0)))); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::SendMultipleNullableTypes( + const bool* + a_nullable_bool_arg, + const int64_t* + a_nullable_int_arg, + const std:: + string* + a_nullable_string_arg, + std::function&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + a_nullable_bool_arg + ? EncodableValue( + *a_nullable_bool_arg) + : EncodableValue(), + a_nullable_int_arg + ? EncodableValue( + *a_nullable_int_arg) + : EncodableValue(), + a_nullable_string_arg + ? EncodableValue( + *a_nullable_string_arg) + : EncodableValue(), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto& return_value = + std::any_cast< + const AllNullableTypes&>( + std::get< + CustomEncodableValue>( + list_return_value + ->at( + 0))); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::EchoAllNullableTypesWithoutRecursion( + const AllNullableTypesWithoutRecursion* + everything_arg, + std::function&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + everything_arg + ? CustomEncodableValue( + *everything_arg) + : EncodableValue(), + }); + channel + .Send(encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto* + return_value = list_return_value + ->at( + 0) + .IsNull() + ? nullptr + : &( + std:: + any_cast(std:: + get(list_return_value + ->at( + 0)))); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::SendMultipleNullableTypesWithoutRecursion( + const bool* + a_nullable_bool_arg, + const int64_t* + a_nullable_int_arg, + const std:: + string* + a_nullable_string_arg, + std::function&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + a_nullable_bool_arg + ? EncodableValue( + *a_nullable_bool_arg) + : EncodableValue(), + a_nullable_int_arg + ? EncodableValue( + *a_nullable_int_arg) + : EncodableValue(), + a_nullable_string_arg + ? EncodableValue( + *a_nullable_string_arg) + : EncodableValue(), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto& return_value = + std::any_cast< + const AllNullableTypesWithoutRecursion&>( + std::get< + CustomEncodableValue>( + list_return_value + ->at( + 0))); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::EchoBool( + bool + a_bool_arg, + std::function< + void( + bool)>&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + EncodableValue( + a_bool_arg), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto& return_value = + std::get< + bool>( + list_return_value + ->at( + 0)); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::EchoInt( + int64_t + an_int_arg, + std::function< + void( + int64_t)>&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + EncodableValue( + an_int_arg), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const int64_t return_value = + list_return_value + ->at( + 0) + .LongValue(); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::EchoDouble( + double + a_double_arg, + std::function< + void( + double)>&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + EncodableValue( + a_double_arg), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto& return_value = + std::get< + double>( + list_return_value + ->at( + 0)); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::EchoString( + const std:: + string& + a_string_arg, + std::function&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + EncodableValue( + a_string_arg), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto& return_value = + std::get< + std:: + string>( + list_return_value + ->at( + 0)); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::EchoUint8List( + const std::vector< + uint8_t>& + list_arg, + std::function&)>&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + EncodableValue( + list_arg), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto& return_value = + std::get< + std::vector< + uint8_t>>( + list_return_value + ->at( + 0)); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::EchoList( + const EncodableList& + list_arg, + std::function&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + EncodableValue( + list_arg), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto& return_value = + std::get< + EncodableList>( + list_return_value + ->at( + 0)); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::EchoEnumList( + const EncodableList& + enum_list_arg, + std::function&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnumList" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + EncodableValue( + enum_list_arg), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto& return_value = + std::get< + EncodableList>( + list_return_value + ->at( + 0)); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::EchoClassList( + const EncodableList& + class_list_arg, + std::function&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoClassList" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + EncodableValue( + class_list_arg), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto& return_value = + std::get< + EncodableList>( + list_return_value + ->at( + 0)); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::EchoNonNullEnumList( + const EncodableList& + enum_list_arg, + std::function&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullEnumList" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + EncodableValue( + enum_list_arg), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto& return_value = + std::get< + EncodableList>( + list_return_value + ->at( + 0)); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::EchoNonNullClassList( + const EncodableList& + class_list_arg, + std::function&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullClassList" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + EncodableValue( + class_list_arg), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto& return_value = + std::get< + EncodableList>( + list_return_value + ->at( + 0)); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::EchoMap( + const EncodableMap& + map_arg, + std::function&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + EncodableValue( + map_arg), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto& return_value = + std::get< + EncodableMap>( + list_return_value + ->at( + 0)); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::EchoStringMap( + const EncodableMap& + string_map_arg, + std::function&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoStringMap" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + EncodableValue( + string_map_arg), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto& return_value = + std::get< + EncodableMap>( + list_return_value + ->at( + 0)); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::EchoIntMap( + const EncodableMap& + int_map_arg, + std::function&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoIntMap" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + EncodableValue( + int_map_arg), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto& return_value = + std::get< + EncodableMap>( + list_return_value + ->at( + 0)); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::EchoEnumMap( + const EncodableMap& + enum_map_arg, + std::function&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnumMap" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + EncodableValue( + enum_map_arg), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto& return_value = + std::get< + EncodableMap>( + list_return_value + ->at( + 0)); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::EchoClassMap( + const EncodableMap& + class_map_arg, + std::function&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoClassMap" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + EncodableValue( + class_map_arg), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto& return_value = + std::get< + EncodableMap>( + list_return_value + ->at( + 0)); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::EchoNonNullStringMap( + const EncodableMap& + string_map_arg, + std::function&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullStringMap" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + EncodableValue( + string_map_arg), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto& return_value = + std::get< + EncodableMap>( + list_return_value + ->at( + 0)); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::EchoNonNullIntMap( + const EncodableMap& + int_map_arg, + std::function&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullIntMap" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + EncodableValue( + int_map_arg), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto& return_value = + std::get< + EncodableMap>( + list_return_value + ->at( + 0)); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::EchoNonNullEnumMap( + const EncodableMap& + enum_map_arg, + std::function&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullEnumMap" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + EncodableValue( + enum_map_arg), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto& return_value = + std::get< + EncodableMap>( + list_return_value + ->at( + 0)); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::EchoNonNullClassMap( + const EncodableMap& + class_map_arg, + std::function&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullClassMap" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + EncodableValue( + class_map_arg), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto& return_value = + std::get< + EncodableMap>( + list_return_value + ->at( + 0)); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::EchoEnum( + const AnEnum& + an_enum_arg, + std::function&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + CustomEncodableValue( + an_enum_arg), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto& return_value = + std::any_cast< + const AnEnum&>( + std::get< + CustomEncodableValue>( + list_return_value + ->at( + 0))); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::EchoAnotherEnum( + const AnotherEnum& + another_enum_arg, + std::function&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAnotherEnum" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + CustomEncodableValue( + another_enum_arg), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto& return_value = + std::any_cast< + const AnotherEnum&>( + std::get< + CustomEncodableValue>( + list_return_value + ->at( + 0))); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::EchoNullableBool( + const bool* + a_bool_arg, + std::function&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + a_bool_arg + ? EncodableValue( + *a_bool_arg) + : EncodableValue(), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto* return_value = + std::get_if< + bool>( + &list_return_value + ->at( + 0)); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::EchoNullableInt( + const int64_t* + an_int_arg, + std::function&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + an_int_arg + ? EncodableValue( + *an_int_arg) + : EncodableValue(), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto* return_value = + std::get_if< + int64_t>( + &list_return_value + ->at( + 0)); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::EchoNullableDouble( + const double* + a_double_arg, + std::function&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + a_double_arg + ? EncodableValue( + *a_double_arg) + : EncodableValue(), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto* return_value = + std::get_if< + double>( + &list_return_value + ->at( + 0)); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::EchoNullableString( + const std:: + string* + a_string_arg, + std::function&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + a_string_arg + ? EncodableValue( + *a_string_arg) + : EncodableValue(), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto* return_value = + std::get_if< + std:: + string>( + &list_return_value + ->at( + 0)); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::EchoNullableUint8List( + const std::vector< + uint8_t>* + list_arg, + std::function*)>&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableUint8List" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + list_arg + ? EncodableValue( + *list_arg) + : EncodableValue(), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto* return_value = + std::get_if< + std::vector< + uint8_t>>( + &list_return_value + ->at( + 0)); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::EchoNullableList( + const EncodableList* + list_arg, + std::function&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + list_arg + ? EncodableValue( + *list_arg) + : EncodableValue(), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto* return_value = + std::get_if< + EncodableList>( + &list_return_value + ->at( + 0)); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::EchoNullableEnumList( + const EncodableList* + enum_list_arg, + std::function&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnumList" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + enum_list_arg + ? EncodableValue( + *enum_list_arg) + : EncodableValue(), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto* return_value = + std::get_if< + EncodableList>( + &list_return_value + ->at( + 0)); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::EchoNullableClassList( + const EncodableList* + class_list_arg, + std::function&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableClassList" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + class_list_arg + ? EncodableValue( + *class_list_arg) + : EncodableValue(), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto* return_value = + std::get_if< + EncodableList>( + &list_return_value + ->at( + 0)); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::EchoNullableNonNullEnumList( + const EncodableList* + enum_list_arg, + std::function&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullEnumList" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + enum_list_arg + ? EncodableValue( + *enum_list_arg) + : EncodableValue(), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto* return_value = + std::get_if< + EncodableList>( + &list_return_value + ->at( + 0)); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::EchoNullableNonNullClassList( + const EncodableList* + class_list_arg, + std::function&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullClassList" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + class_list_arg + ? EncodableValue( + *class_list_arg) + : EncodableValue(), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto* return_value = + std::get_if< + EncodableList>( + &list_return_value + ->at( + 0)); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::EchoNullableMap( + const EncodableMap* + map_arg, + std::function&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + map_arg + ? EncodableValue( + *map_arg) + : EncodableValue(), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto* return_value = + std::get_if< + EncodableMap>( + &list_return_value + ->at( + 0)); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::EchoNullableStringMap( + const EncodableMap* + string_map_arg, + std::function&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableStringMap" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + string_map_arg + ? EncodableValue( + *string_map_arg) + : EncodableValue(), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto* return_value = + std::get_if< + EncodableMap>( + &list_return_value + ->at( + 0)); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::EchoNullableIntMap( + const EncodableMap* + int_map_arg, + std::function&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableIntMap" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + int_map_arg + ? EncodableValue( + *int_map_arg) + : EncodableValue(), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto* return_value = + std::get_if< + EncodableMap>( + &list_return_value + ->at( + 0)); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::EchoNullableEnumMap( + const EncodableMap* + enum_map_arg, + std::function&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnumMap" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + enum_map_arg + ? EncodableValue( + *enum_map_arg) + : EncodableValue(), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto* return_value = + std::get_if< + EncodableMap>( + &list_return_value + ->at( + 0)); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::EchoNullableClassMap( + const EncodableMap* + class_map_arg, + std::function&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableClassMap" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + class_map_arg + ? EncodableValue( + *class_map_arg) + : EncodableValue(), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto* return_value = + std::get_if< + EncodableMap>( + &list_return_value + ->at( + 0)); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::EchoNullableNonNullStringMap( + const EncodableMap* + string_map_arg, + std::function&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullStringMap" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + string_map_arg + ? EncodableValue( + *string_map_arg) + : EncodableValue(), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto* return_value = + std::get_if< + EncodableMap>( + &list_return_value + ->at( + 0)); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::EchoNullableNonNullIntMap( + const EncodableMap* + int_map_arg, + std::function&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullIntMap" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + int_map_arg + ? EncodableValue( + *int_map_arg) + : EncodableValue(), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto* return_value = + std::get_if< + EncodableMap>( + &list_return_value + ->at( + 0)); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::EchoNullableNonNullEnumMap( + const EncodableMap* + enum_map_arg, + std::function&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullEnumMap" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + enum_map_arg + ? EncodableValue( + *enum_map_arg) + : EncodableValue(), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto* return_value = + std::get_if< + EncodableMap>( + &list_return_value + ->at( + 0)); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::EchoNullableNonNullClassMap( + const EncodableMap* + class_map_arg, + std::function&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullClassMap" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + class_map_arg + ? EncodableValue( + *class_map_arg) + : EncodableValue(), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto* return_value = + std::get_if< + EncodableMap>( + &list_return_value + ->at( + 0)); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::EchoNullableEnum( + const AnEnum* + an_enum_arg, + std::function&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnum" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + an_enum_arg + ? CustomEncodableValue( + *an_enum_arg) + : EncodableValue(), + }); + channel + .Send(encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = std::move(on_error)](const uint8_t* reply, size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + AnEnum + return_value_value; + const AnEnum* + return_value = + nullptr; + if (!list_return_value + ->at( + 0) + .IsNull()) { + return_value_value = std::any_cast< + const AnEnum&>( + std::get< + CustomEncodableValue>( + list_return_value + ->at( + 0))); + return_value = + &return_value_value; + } + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::EchoAnotherNullableEnum( + const AnotherEnum* + another_enum_arg, + std::function&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAnotherNullableEnum" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + another_enum_arg + ? CustomEncodableValue( + *another_enum_arg) + : EncodableValue(), + }); + channel + .Send(encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = std::move(on_error)](const uint8_t* reply, size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + AnotherEnum + return_value_value; + const AnotherEnum* + return_value = + nullptr; + if (!list_return_value + ->at( + 0) + .IsNull()) { + return_value_value = std::any_cast< + const AnotherEnum&>( + std::get< + CustomEncodableValue>( + list_return_value + ->at( + 0))); + return_value = + &return_value_value; + } + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::NoopAsync( + std::function< + void( + void)> && + on_success, + std::function< + void( + const FlutterError&)> && + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noopAsync" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue + encoded_api_arguments = + EncodableValue(); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + on_success(); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterIntegrationCoreApi::EchoAsyncString( + const std:: + string& + a_string_arg, + std::function&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAsyncString" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + EncodableValue( + a_string_arg), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto& return_value = + std::get< + std:: + string>( + list_return_value + ->at( + 0)); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + /// The codec used by HostTrivialApi. + const ::flutter:: + StandardMessageCodec& + HostTrivialApi:: + GetCodec() { + return ::flutter::StandardMessageCodec:: + GetInstance( + &PigeonInternalCodecSerializer:: + GetInstance()); + } + + // Sets up an instance of `HostTrivialApi` to handle messages through the `binary_messenger`. + void + HostTrivialApi::SetUp( + ::flutter:: + BinaryMessenger * + binary_messenger, + HostTrivialApi * + api) { + HostTrivialApi::SetUp( + binary_messenger, + api, + ""); + } + + void + HostTrivialApi::SetUp( + ::flutter:: + BinaryMessenger * + binary_messenger, + HostTrivialApi * + api, + const std:: + string& + message_channel_suffix) { + const std::string prepended_suffix = + message_channel_suffix + .length() > + 0 + ? std::string( + ".") + + message_channel_suffix + : ""; + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostTrivialApi.noop" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& message, const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + std::optional< + FlutterError> + output = + api->Noop(); + 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 + HostTrivialApi::WrapError( + std::string_view + error_message) { + return EncodableValue(EncodableList{ + EncodableValue( + std::string( + error_message)), + EncodableValue( + "Error"), + EncodableValue()}); + } + + EncodableValue + HostTrivialApi::WrapError( + const FlutterError& + error) { + return EncodableValue(EncodableList{ + EncodableValue( + error + .code()), + EncodableValue( + error + .message()), + error + .details()}); + } + + /// The codec used by HostSmallApi. + const ::flutter:: + StandardMessageCodec& + HostSmallApi:: + GetCodec() { + return ::flutter::StandardMessageCodec:: + GetInstance( + &PigeonInternalCodecSerializer:: + GetInstance()); + } + + // Sets up an instance of `HostSmallApi` to handle messages through the `binary_messenger`. + void + HostSmallApi::SetUp( + ::flutter:: + BinaryMessenger * + binary_messenger, + HostSmallApi * + api) { + HostSmallApi::SetUp( + binary_messenger, + api, + ""); + } + + void + HostSmallApi::SetUp( + ::flutter:: + BinaryMessenger * + binary_messenger, + HostSmallApi * + api, + const std:: + string& + message_channel_suffix) { + const std::string prepended_suffix = + message_channel_suffix + .length() > + 0 + ? std::string( + ".") + + message_channel_suffix + : ""; + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.echo" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler([api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + const auto& args = + std::get< + EncodableList>( + message); + const auto& encodable_a_string_arg = + args.at( + 0); + if (encodable_a_string_arg + .IsNull()) { + reply(WrapError( + "a_string_arg unexpectedly null.")); + return; + } + const auto& a_string_arg = + std::get< + std:: + string>( + encodable_a_string_arg); + api->Echo( + a_string_arg, + [reply]( + ErrorOr< + std:: + string>&& + output) { + if (output + .has_error()) { + reply(WrapError( + output + .error())); + return; + } + EncodableList + wrapped; + wrapped + .push_back(EncodableValue( + std::move( + output) + .TakeValue())); + 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.pigeon_integration_tests.HostSmallApi.voidVoid" + + prepended_suffix, + &GetCodec()); + if (api != + nullptr) { + channel + .SetMessageHandler( + [api]( + const EncodableValue& + message, + const ::flutter:: + MessageReply< + EncodableValue>& + reply) { + try { + api->VoidVoid( + [reply]( + std::optional< + FlutterError>&& + 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 + HostSmallApi::WrapError( + std::string_view + error_message) { + return EncodableValue(EncodableList{ + EncodableValue( + std::string( + error_message)), + EncodableValue( + "Error"), + EncodableValue()}); + } + + EncodableValue + HostSmallApi::WrapError( + const FlutterError& + error) { + return EncodableValue(EncodableList{ + EncodableValue( + error + .code()), + EncodableValue( + error + .message()), + error + .details()}); + } + + // Generated class from Pigeon that represents Flutter messages that can be called from C++. + FlutterSmallApi::FlutterSmallApi( + ::flutter:: + BinaryMessenger * + binary_messenger) + : binary_messenger_( + binary_messenger), + message_channel_suffix_( + "") { + } + + FlutterSmallApi::FlutterSmallApi( + ::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& + FlutterSmallApi:: + GetCodec() { + return ::flutter::StandardMessageCodec:: + GetInstance( + &PigeonInternalCodecSerializer:: + GetInstance()); + } + + void + FlutterSmallApi::EchoWrappedList( + const TestMessage& + msg_arg, + std::function&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoWrappedList" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + CustomEncodableValue( + msg_arg), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto& return_value = + std::any_cast< + const TestMessage&>( + std::get< + CustomEncodableValue>( + list_return_value + ->at( + 0))); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + void + FlutterSmallApi::EchoString( + const std:: + string& + a_string_arg, + std::function&& + on_success, + std::function&& + on_error) { + const std::string + channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoString" + + message_channel_suffix_; + BasicMessageChannel<> channel( + binary_messenger_, + channel_name, + &GetCodec()); + EncodableValue encoded_api_arguments = + EncodableValue(EncodableList{ + EncodableValue( + a_string_arg), + }); + channel + .Send( + encoded_api_arguments, + [channel_name, + on_success = + std::move( + on_success), + on_error = + std::move( + on_error)]( + const uint8_t* + reply, + size_t + reply_size) { + std::unique_ptr< + EncodableValue> + response = + GetCodec() + .DecodeMessage( + reply, + reply_size); + const auto& + encodable_return_value = + *response; + const auto* list_return_value = + std::get_if< + EncodableList>( + &encodable_return_value); + if (list_return_value) { + if (list_return_value + ->size() > + 1) { + on_error(FlutterError( + std::get< + std:: + string>( + list_return_value + ->at( + 0)), + std::get< + std:: + string>( + list_return_value + ->at( + 1)), + list_return_value + ->at( + 2))); + } else { + const auto& return_value = + std::get< + std:: + string>( + list_return_value + ->at( + 0)); + on_success( + return_value); + } + } else { + on_error(CreateConnectionError( + channel_name)); + } + }); + } + + } // namespace core_tests_pigeontest diff --git a/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.h b/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.h index 24ca4540d6a8..e3e62dd62b9e 100644 --- a/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.h +++ b/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.h @@ -93,6 +93,7 @@ class UnusedClass { /// Returns a hash code value for the object. This method is supported for the /// benefit of hash tables. size_t Hash() const; + std::string ToString() const; private: static UnusedClass FromEncodableList(const ::flutter::EncodableList& list); @@ -227,6 +228,7 @@ class AllTypes { /// Returns a hash code value for the object. This method is supported for the /// benefit of hash tables. size_t Hash() const; + std::string ToString() const; private: static AllTypes FromEncodableList(const ::flutter::EncodableList& list); @@ -442,6 +444,7 @@ class AllNullableTypes { /// Returns a hash code value for the object. This method is supported for the /// benefit of hash tables. size_t Hash() const; + std::string ToString() const; private: static AllNullableTypes FromEncodableList( @@ -643,6 +646,7 @@ class AllNullableTypesWithoutRecursion { /// Returns a hash code value for the object. This method is supported for the /// benefit of hash tables. size_t Hash() const; + std::string ToString() const; private: static AllNullableTypesWithoutRecursion FromEncodableList( @@ -748,6 +752,7 @@ class AllClassesWrapper { /// Returns a hash code value for the object. This method is supported for the /// benefit of hash tables. size_t Hash() const; + std::string ToString() const; private: static AllClassesWrapper FromEncodableList( @@ -790,6 +795,7 @@ class TestMessage { /// Returns a hash code value for the object. This method is supported for the /// benefit of hash tables. size_t Hash() const; + std::string ToString() const; private: static TestMessage FromEncodableList(const ::flutter::EncodableList& list); diff --git a/packages/pigeon/pubspec.yaml b/packages/pigeon/pubspec.yaml index 804181258e69..3cf419595efb 100644 --- a/packages/pigeon/pubspec.yaml +++ b/packages/pigeon/pubspec.yaml @@ -2,7 +2,7 @@ name: pigeon description: Code generator tool to make communication between Flutter and the host platform type-safe and easier. repository: https://github.com/flutter/packages/tree/main/packages/pigeon issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+pigeon%22 -version: 26.3.4 # This must match the version in lib/src/generator_tools.dart +version: 26.4.0 # This must match the version in lib/src/generator_tools.dart environment: sdk: ^3.9.0 diff --git a/packages/pigeon/test/cpp_generator_test.dart b/packages/pigeon/test/cpp_generator_test.dart index 0c77bed2b1de..acfe6513caa2 100644 --- a/packages/pigeon/test/cpp_generator_test.dart +++ b/packages/pigeon/test/cpp_generator_test.dart @@ -571,6 +571,7 @@ void main() { #include #include #include +#include #include '''), ); @@ -2725,6 +2726,44 @@ void main() { expect(code, contains('bool Foo::operator==(const Foo& other) const {')); }); + test('data class ToString', () { + final root = Root( + apis: [], + classes: [ + Class( + name: 'Foo', + fields: [ + NamedType( + type: const TypeDeclaration(baseName: 'int', isNullable: false), + name: 'bar', + ), + ], + ), + ], + enums: [], + ); + final sink = StringBuffer(); + const generator = CppGenerator(); + final generatorOptions = OutputFileOptions( + fileType: FileType.source, + languageOptions: const InternalCppOptions( + cppHeaderOut: '', + cppSourceOut: '', + headerIncludePath: '', + ), + ); + generator.generate( + generatorOptions, + root, + sink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + final code = sink.toString(); + expect(code, contains('std::string Foo::ToString() const {')); + expect(code, contains('ss << "bar: ";')); + expect(code, contains('ss << bar_;')); + }); + test('data classes implement Hash', () { final root = Root( apis: [], diff --git a/packages/pigeon/test/dart_generator_test.dart b/packages/pigeon/test/dart_generator_test.dart index f3774fc75c92..01dd129b06b3 100644 --- a/packages/pigeon/test/dart_generator_test.dart +++ b/packages/pigeon/test/dart_generator_test.dart @@ -2151,4 +2151,32 @@ name: foobar expect(code, contains('bool operator ==(Object other) {')); expect(code, contains('int get hashCode =>')); }); + + test('data class toString', () { + final classDefinition = Class( + name: 'Foobar', + fields: [ + NamedType( + type: const TypeDeclaration(baseName: 'int', isNullable: true), + name: 'field1', + ), + ], + ); + final root = Root( + apis: [], + classes: [classDefinition], + enums: [], + ); + final sink = StringBuffer(); + const generator = DartGenerator(); + generator.generate( + const InternalDartOptions(ignoreLints: false), + root, + sink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + final code = sink.toString(); + expect(code, contains('String toString() {')); + expect(code, contains(r"return 'Foobar(field1: $field1)';")); + }); } diff --git a/packages/pigeon/test/gobject_generator_test.dart b/packages/pigeon/test/gobject_generator_test.dart index 8f44885a4617..1cb5c94728e3 100644 --- a/packages/pigeon/test/gobject_generator_test.dart +++ b/packages/pigeon/test/gobject_generator_test.dart @@ -1081,4 +1081,40 @@ void main() { expect(code, contains('guint test_package_input_hash(')); } }); + + test('data classes handle to_string', () { + final inputClass = Class( + name: 'Input', + fields: [ + NamedType( + type: const TypeDeclaration(baseName: 'String', isNullable: true), + name: 'input', + ), + ], + ); + final root = Root( + apis: [], + classes: [inputClass], + enums: [], + ); + final sink = StringBuffer(); + const generator = GObjectGenerator(); + final generatorOptions = OutputFileOptions( + fileType: FileType.source, + languageOptions: const InternalGObjectOptions( + headerIncludePath: '', + gobjectHeaderOut: '', + gobjectSourceOut: '', + ), + ); + generator.generate( + generatorOptions, + root, + sink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + final code = sink.toString(); + expect(code, contains('gchar* test_package_input_to_string(')); + expect(code, contains('g_string_new("Input(");')); + }); } diff --git a/packages/pigeon/test/java_generator_test.dart b/packages/pigeon/test/java_generator_test.dart index a5f0708abf58..0ca4fed593ca 100644 --- a/packages/pigeon/test/java_generator_test.dart +++ b/packages/pigeon/test/java_generator_test.dart @@ -1920,4 +1920,33 @@ void main() { expect(code, contains('public boolean equals(Object o) {')); expect(code, contains('public int hashCode() {')); }); + + test('data class toString', () { + final classDefinition = Class( + name: 'Foobar', + fields: [ + NamedType( + type: const TypeDeclaration(baseName: 'int', isNullable: true), + name: 'field1', + ), + ], + ); + final root = Root( + apis: [], + classes: [classDefinition], + enums: [], + ); + final sink = StringBuffer(); + const javaOptions = InternalJavaOptions(className: 'Messages', javaOut: ''); + const generator = JavaGenerator(); + generator.generate( + javaOptions, + root, + sink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + final code = sink.toString(); + expect(code, contains('public String toString() {')); + expect(code, contains('return "Foobar{" + "field1=" + field1 + "}";')); + }); } diff --git a/packages/pigeon/test/kotlin_generator_test.dart b/packages/pigeon/test/kotlin_generator_test.dart index fe9600e81bc1..ff58fb181e56 100644 --- a/packages/pigeon/test/kotlin_generator_test.dart +++ b/packages/pigeon/test/kotlin_generator_test.dart @@ -2171,4 +2171,33 @@ void main() { expect(code, contains('override fun equals(other: Any?): Boolean {')); expect(code, contains('override fun hashCode(): Int {')); }); + + test('data class toString', () { + final classDefinition = Class( + name: 'Foobar', + fields: [ + NamedType( + type: const TypeDeclaration(baseName: 'int', isNullable: true), + name: 'field1', + ), + ], + ); + final root = Root( + apis: [], + classes: [classDefinition], + enums: [], + ); + final sink = StringBuffer(); + const kotlinOptions = InternalKotlinOptions(kotlinOut: ''); + const generator = KotlinGenerator(); + generator.generate( + kotlinOptions, + root, + sink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + final code = sink.toString(); + expect(code, contains('override fun toString(): String {')); + expect(code, contains(r'return "Foobar(field1=$field1)"')); + }); } diff --git a/packages/pigeon/test/objc_generator_test.dart b/packages/pigeon/test/objc_generator_test.dart index fb18833f77bc..4f8507ca3be2 100644 --- a/packages/pigeon/test/objc_generator_test.dart +++ b/packages/pigeon/test/objc_generator_test.dart @@ -4099,4 +4099,47 @@ void main() { expect(code, contains('- (NSUInteger)hash {')); } }); + + test('data class description', () { + final root = Root( + apis: [], + classes: [ + Class( + name: 'Foo', + fields: [ + NamedType( + type: const TypeDeclaration(baseName: 'int', isNullable: false), + name: 'bar', + ), + ], + ), + ], + enums: [], + ); + final sink = StringBuffer(); + const generator = ObjcGenerator(); + final generatorOptions = OutputFileOptions( + fileType: FileType.source, + languageOptions: const InternalObjcOptions( + prefix: 'ABC', + objcHeaderOut: '', + objcSourceOut: '', + headerIncludePath: '', + ), + ); + generator.generate( + generatorOptions, + root, + sink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + final code = sink.toString(); + expect(code, contains('- (NSString *)description {')); + expect( + code, + contains( + 'return [NSString stringWithFormat:@"ABCFoo(bar: %@)", @(self.bar)];', + ), + ); + }); } diff --git a/packages/pigeon/test/pigeon_lib_test.dart b/packages/pigeon/test/pigeon_lib_test.dart index 7b2d3b78a1c7..ca0fe431d772 100644 --- a/packages/pigeon/test/pigeon_lib_test.dart +++ b/packages/pigeon/test/pigeon_lib_test.dart @@ -41,7 +41,7 @@ class _ValidatorGeneratorAdapter implements GeneratorAdapter { void main() { /// Creates a temporary file named [filename] then calls [callback] with a - /// [File] representing that temporary directory. The file will be deleted + /// [File] representing that temporary directory. The file will be deleted /// after the [callback] is executed. void withTempFile(String filename, void Function(File) callback) { final Directory dir = Directory.systemTemp.createTempSync(); diff --git a/packages/pigeon/test/swift_generator_test.dart b/packages/pigeon/test/swift_generator_test.dart index fa567e2b02c8..ac8e84781135 100644 --- a/packages/pigeon/test/swift_generator_test.dart +++ b/packages/pigeon/test/swift_generator_test.dart @@ -1853,4 +1853,34 @@ void main() { ); expect(code, contains('func hash(into hasher: inout Hasher) {')); }); + + test('data class toString', () { + final classDefinition = Class( + name: 'Foobar', + fields: [ + NamedType( + type: const TypeDeclaration(baseName: 'int', isNullable: true), + name: 'field1', + ), + ], + ); + final root = Root( + apis: [], + classes: [classDefinition], + enums: [], + ); + final sink = StringBuffer(); + const swiftOptions = InternalSwiftOptions(swiftOut: ''); + const generator = SwiftGenerator(); + generator.generate( + swiftOptions, + root, + sink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + final code = sink.toString(); + expect(code, contains(': Hashable, CustomStringConvertible')); + expect(code, contains('public var description: String {')); + expect(code, contains(r'return "Foobar(field1: \(field1))"')); + }); } From ebc37cc5777e74e11dde60aaa6a59c27b811a1e7 Mon Sep 17 00:00:00 2001 From: tarrinneal Date: Fri, 1 May 2026 14:25:59 -0700 Subject: [PATCH 2/2] gemini has good comments this time --- .../ios/Runner/EventChannelMessages.g.swift | 26 +- .../example/app/ios/Runner/Messages.g.swift | 21 +- .../example/app/windows/runner/messages.g.cpp | 483 +- .../pigeon/lib/src/cpp/cpp_generator.dart | 4 +- .../pigeon/lib/src/swift/swift_generator.dart | 52 +- .../Sources/test_plugin/CoreTests.gen.swift | 30 +- .../test_plugin/EventChannelTests.gen.swift | 48 +- .../test_plugin/ProxyApiTests.gen.swift | 18 +- .../ios/RunnerTests/IsNullishTests.swift | 14 +- .../windows/pigeon/core_tests.gen.cpp | 32450 ++++++---------- .../pigeon/test/swift_generator_test.dart | 5 +- 11 files changed, 11365 insertions(+), 21786 deletions(-) diff --git a/packages/pigeon/example/app/ios/Runner/EventChannelMessages.g.swift b/packages/pigeon/example/app/ios/Runner/EventChannelMessages.g.swift index 568b75b12813..9670f9f4ec8f 100644 --- a/packages/pigeon/example/app/ios/Runner/EventChannelMessages.g.swift +++ b/packages/pigeon/example/app/ios/Runner/EventChannelMessages.g.swift @@ -14,8 +14,8 @@ import Foundation #error("Unsupported platform.") #endif -#if DEBUG - func isNullish(_ value: Any?) -> Bool { +enum EventChannelMessagesPigeonInternal { + static func isNullish(_ value: Any?) -> Bool { guard let innerValue = value else { return true } @@ -26,19 +26,7 @@ import Foundation return innerValue is NSNull } -#else - private func isNullish(_ value: Any?) -> Bool { - guard let innerValue = value else { - return true - } - - if case Optional.some(Optional.none) = value { - return true - } - - return innerValue is NSNull - } -#endif +} private func nilOrValue(_ value: Any?) -> T? { if value is NSNull { return nil } @@ -161,7 +149,7 @@ protocol PlatformEvent { } /// Generated class from Pigeon that represents data sent in messages. -struct IntEvent: PlatformEvent, CustomStringConvertible { +struct IntEvent: PlatformEvent { var data: Int64 // swift-format-ignore: AlwaysUseLowerCamelCase @@ -190,12 +178,12 @@ struct IntEvent: PlatformEvent, CustomStringConvertible { } public var description: String { - return "IntEvent(data: \(data))" + return "IntEvent(data: \(String(describing: data)))" } } /// Generated class from Pigeon that represents data sent in messages. -struct StringEvent: PlatformEvent, CustomStringConvertible { +struct StringEvent: PlatformEvent { var data: String // swift-format-ignore: AlwaysUseLowerCamelCase @@ -224,7 +212,7 @@ struct StringEvent: PlatformEvent, CustomStringConvertible { } public var description: String { - return "StringEvent(data: \(data))" + return "StringEvent(data: \(String(describing: data)))" } } diff --git a/packages/pigeon/example/app/ios/Runner/Messages.g.swift b/packages/pigeon/example/app/ios/Runner/Messages.g.swift index 481f9ddd1176..00fe1d967477 100644 --- a/packages/pigeon/example/app/ios/Runner/Messages.g.swift +++ b/packages/pigeon/example/app/ios/Runner/Messages.g.swift @@ -64,8 +64,8 @@ private func createConnectionError(withChannelName channelName: String) -> Pigeo details: "") } -#if DEBUG - func isNullish(_ value: Any?) -> Bool { +enum MessagesPigeonInternal { + static func isNullish(_ value: Any?) -> Bool { guard let innerValue = value else { return true } @@ -76,19 +76,7 @@ private func createConnectionError(withChannelName channelName: String) -> Pigeo return innerValue is NSNull } -#else - private func isNullish(_ value: Any?) -> Bool { - guard let innerValue = value else { - return true - } - - if case Optional.some(Optional.none) = value { - return true - } - - return innerValue is NSNull - } -#endif +} private func nilOrValue(_ value: Any?) -> T? { if value is NSNull { return nil } @@ -256,7 +244,8 @@ struct MessageData: Hashable, CustomStringConvertible { } public var description: String { - return "MessageData(name: \(name), description: \(description), code: \(code), data: \(data))" + return + "MessageData(name: \(String(describing: name)), description: \(String(describing: description)), code: \(String(describing: code)), data: \(String(describing: data)))" } } diff --git a/packages/pigeon/example/app/windows/runner/messages.g.cpp b/packages/pigeon/example/app/windows/runner/messages.g.cpp index eb316c989edf..e3f744ac1b34 100644 --- a/packages/pigeon/example/app/windows/runner/messages.g.cpp +++ b/packages/pigeon/example/app/windows/runner/messages.g.cpp @@ -339,266 +339,261 @@ std::string MessageData::ToString() const { ss << *name_; } else { ss << "null"; - ss << ", description: "; - if (description_.has_value()) { - ss << *description_; - } else { - ss << "null"; - ss << ", code: "; - ss << code_; - ss << ", data: "; - ss << data_; - ss << ")"; - return ss.str(); - } + } + ss << ", description: "; + if (description_.has_value()) { + ss << *description_; + } else { + ss << "null"; + } + ss << ", code: "; + ss << code_; + ss << ", data: "; + ss << data_; + ss << ")"; + return ss.str(); +} - size_t PigeonInternalDeepHash(const MessageData& v) { return v.Hash(); } +size_t PigeonInternalDeepHash(const MessageData& v) { return v.Hash(); } - PigeonInternalCodecSerializer::PigeonInternalCodecSerializer() {} +PigeonInternalCodecSerializer::PigeonInternalCodecSerializer() {} - EncodableValue PigeonInternalCodecSerializer::ReadValueOfType( - uint8_t type, ::flutter::ByteStreamReader* stream) const { - switch (type) { - 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(MessageData::FromEncodableList( - std::get(ReadValue(stream)))); - } - default: - return ::flutter::StandardCodecSerializer::ReadValueOfType(type, - stream); - } +EncodableValue PigeonInternalCodecSerializer::ReadValueOfType( + uint8_t type, ::flutter::ByteStreamReader* stream) const { + switch (type) { + 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)); } - - void PigeonInternalCodecSerializer::WriteValue( - const EncodableValue& value, ::flutter::ByteStreamWriter* stream) - const { - if (const CustomEncodableValue* custom_value = - std::get_if(&value)) { - if (custom_value->type() == typeid(Code)) { - stream->WriteByte(129); - WriteValue(EncodableValue( - static_cast(std::any_cast(*custom_value))), - stream); - return; - } - if (custom_value->type() == typeid(MessageData)) { - stream->WriteByte(130); - WriteValue( - EncodableValue( - std::any_cast(*custom_value).ToEncodableList()), - stream); - return; - } - } - ::flutter::StandardCodecSerializer::WriteValue(value, stream); + case 130: { + return CustomEncodableValue(MessageData::FromEncodableList( + std::get(ReadValue(stream)))); } + default: + return ::flutter::StandardCodecSerializer::ReadValueOfType(type, stream); + } +} - /// The codec used by ExampleHostApi. - const ::flutter::StandardMessageCodec& ExampleHostApi::GetCodec() { - return ::flutter::StandardMessageCodec::GetInstance( - &PigeonInternalCodecSerializer::GetInstance()); +void PigeonInternalCodecSerializer::WriteValue( + const EncodableValue& value, ::flutter::ByteStreamWriter* stream) const { + if (const CustomEncodableValue* custom_value = + std::get_if(&value)) { + if (custom_value->type() == typeid(Code)) { + stream->WriteByte(129); + WriteValue( + EncodableValue(static_cast(std::any_cast(*custom_value))), + stream); + return; } - - // Sets up an instance of `ExampleHostApi` to handle messages through the - // `binary_messenger`. - void ExampleHostApi::SetUp(::flutter::BinaryMessenger * binary_messenger, - ExampleHostApi * api) { - ExampleHostApi::SetUp(binary_messenger, api, ""); + if (custom_value->type() == typeid(MessageData)) { + stream->WriteByte(130); + WriteValue( + EncodableValue( + std::any_cast(*custom_value).ToEncodableList()), + stream); + return; } + } + ::flutter::StandardCodecSerializer::WriteValue(value, stream); +} - void ExampleHostApi::SetUp(::flutter::BinaryMessenger * binary_messenger, - ExampleHostApi * api, - const std::string& message_channel_suffix) { - const std::string prepended_suffix = - message_channel_suffix.length() > 0 - ? std::string(".") + message_channel_suffix - : ""; - { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_example_" - "package.ExampleHostApi.getHostLanguage" + - prepended_suffix, - &GetCodec()); - if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const ::flutter::MessageReply& reply) { - try { - ErrorOr output = api->GetHostLanguage(); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - 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.pigeon_example_package.ExampleHostApi.add" + - 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_a_arg = args.at(0); - if (encodable_a_arg.IsNull()) { - reply(WrapError("a_arg unexpectedly null.")); - return; - } - const int64_t a_arg = encodable_a_arg.LongValue(); - const auto& encodable_b_arg = args.at(1); - if (encodable_b_arg.IsNull()) { - reply(WrapError("b_arg unexpectedly null.")); - return; - } - const int64_t b_arg = encodable_b_arg.LongValue(); - ErrorOr output = api->Add(a_arg, b_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - 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.pigeon_example_" - "package.ExampleHostApi.sendMessage" + - 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_message_arg = args.at(0); - if (encodable_message_arg.IsNull()) { - reply(WrapError("message_arg unexpectedly null.")); - return; - } - const auto& message_arg = std::any_cast( - std::get(encodable_message_arg)); - api->SendMessage( - message_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); +/// The codec used by ExampleHostApi. +const ::flutter::StandardMessageCodec& ExampleHostApi::GetCodec() { + return ::flutter::StandardMessageCodec::GetInstance( + &PigeonInternalCodecSerializer::GetInstance()); +} + +// Sets up an instance of `ExampleHostApi` to handle messages through the +// `binary_messenger`. +void ExampleHostApi::SetUp(::flutter::BinaryMessenger* binary_messenger, + ExampleHostApi* api) { + ExampleHostApi::SetUp(binary_messenger, api, ""); +} + +void ExampleHostApi::SetUp(::flutter::BinaryMessenger* binary_messenger, + ExampleHostApi* api, + const std::string& message_channel_suffix) { + const std::string prepended_suffix = + message_channel_suffix.length() > 0 + ? std::string(".") + message_channel_suffix + : ""; + { + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_example_package." + "ExampleHostApi.getHostLanguage" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const ::flutter::MessageReply& reply) { + try { + ErrorOr output = api->GetHostLanguage(); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + 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.pigeon_example_package.ExampleHostApi.add" + + 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_a_arg = args.at(0); + if (encodable_a_arg.IsNull()) { + reply(WrapError("a_arg unexpectedly null.")); + return; + } + const int64_t a_arg = encodable_a_arg.LongValue(); + const auto& encodable_b_arg = args.at(1); + if (encodable_b_arg.IsNull()) { + reply(WrapError("b_arg unexpectedly null.")); + return; + } + const int64_t b_arg = encodable_b_arg.LongValue(); + ErrorOr output = api->Add(a_arg, b_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + 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.pigeon_example_package.ExampleHostApi.sendMessage" + + 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_message_arg = args.at(0); + if (encodable_message_arg.IsNull()) { + reply(WrapError("message_arg unexpectedly null.")); + return; + } + const auto& message_arg = std::any_cast( + std::get(encodable_message_arg)); + api->SendMessage(message_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); }); - } else { - channel.SetMessageHandler(nullptr); - } - } + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); } + } +} - EncodableValue ExampleHostApi::WrapError(std::string_view error_message) { - return EncodableValue( - EncodableList{EncodableValue(std::string(error_message)), - EncodableValue("Error"), EncodableValue()}); - } +EncodableValue ExampleHostApi::WrapError(std::string_view error_message) { + return EncodableValue( + EncodableList{EncodableValue(std::string(error_message)), + EncodableValue("Error"), EncodableValue()}); +} - EncodableValue ExampleHostApi::WrapError(const FlutterError& error) { - return EncodableValue(EncodableList{EncodableValue(error.code()), - EncodableValue(error.message()), - error.details()}); - } +EncodableValue ExampleHostApi::WrapError(const FlutterError& error) { + return EncodableValue(EncodableList{EncodableValue(error.code()), + EncodableValue(error.message()), + error.details()}); +} - // Generated class from Pigeon that represents Flutter messages that can be - // called from C++. - MessageFlutterApi::MessageFlutterApi(::flutter::BinaryMessenger * - binary_messenger) - : binary_messenger_(binary_messenger), message_channel_suffix_("") {} - - MessageFlutterApi::MessageFlutterApi( - ::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& MessageFlutterApi::GetCodec() { - return ::flutter::StandardMessageCodec::GetInstance( - &PigeonInternalCodecSerializer::GetInstance()); - } +// Generated class from Pigeon that represents Flutter messages that can be +// called from C++. +MessageFlutterApi::MessageFlutterApi( + ::flutter::BinaryMessenger* binary_messenger) + : binary_messenger_(binary_messenger), message_channel_suffix_("") {} + +MessageFlutterApi::MessageFlutterApi( + ::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& MessageFlutterApi::GetCodec() { + return ::flutter::StandardMessageCodec::GetInstance( + &PigeonInternalCodecSerializer::GetInstance()); +} - void MessageFlutterApi::FlutterMethod( - const std::string* a_string_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_example_package.MessageFlutterApi." - "flutterMethod" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - a_string_arg ? EncodableValue(*a_string_arg) : EncodableValue(), - }); - channel.Send(encoded_api_arguments, - [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)](const uint8_t* reply, - size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error(FlutterError( - std::get(list_return_value->at(0)), +void MessageFlutterApi::FlutterMethod( + const std::string* a_string_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_example_package.MessageFlutterApi." + "flutterMethod" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + a_string_arg ? EncodableValue(*a_string_arg) : EncodableValue(), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); - } else { - const auto& return_value = - std::get(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); - } + } else { + const auto& return_value = + std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} - } // namespace pigeon_example +} // namespace pigeon_example diff --git a/packages/pigeon/lib/src/cpp/cpp_generator.dart b/packages/pigeon/lib/src/cpp/cpp_generator.dart index 00bb8507352d..938019f3aa43 100644 --- a/packages/pigeon/lib/src/cpp/cpp_generator.dart +++ b/packages/pigeon/lib/src/cpp/cpp_generator.dart @@ -1154,14 +1154,14 @@ class CppSourceGenerator extends StructuredGenerator { final comma = index == 0 ? '' : ', '; indent.writeln('ss << "$comma${field.name}: ";'); if (field.type.isNullable) { - indent.writeScoped('if ($name.has_value()) {', '} else {', () { + indent.writeScoped('if ($name.has_value()) {', '}', () { if (field.type.isClass) { indent.writeln('ss << $name->ToString();'); } else { indent.writeln('ss << *$name;'); } }); - indent.nest(1, () { + indent.writeScoped('else {', '}', () { indent.writeln('ss << "null";'); }); } else { diff --git a/packages/pigeon/lib/src/swift/swift_generator.dart b/packages/pigeon/lib/src/swift/swift_generator.dart index 35712f684870..2ed53a95b376 100644 --- a/packages/pigeon/lib/src/swift/swift_generator.dart +++ b/packages/pigeon/lib/src/swift/swift_generator.dart @@ -421,7 +421,7 @@ class SwiftGenerator extends StructuredGenerator { }) { final privateString = private ? 'private ' : ''; final extendsString = classDefinition.superClass != null - ? ': ${classDefinition.superClass!.name}, CustomStringConvertible' + ? ': ${classDefinition.superClass!.name}' : hashable ? ': Hashable, CustomStringConvertible' : ': CustomStringConvertible'; @@ -720,15 +720,23 @@ if (wrapped == nil) { Class classDefinition, { required String dartPackageName, }) { - indent.writeScoped('public var description: String {', '}', () { - final Iterable fieldStrings = classDefinition.fields.map(( - NamedType field, - ) { - return '${field.name}: \\(${field.name})'; - }); - final String fieldsConcat = fieldStrings.join(', '); - indent.writeln('return "${classDefinition.name}($fieldsConcat)"'); - }); + final overrideString = + (classDefinition.superClass != null && classDefinition.isSwiftClass) + ? 'override ' + : ''; + indent.writeScoped( + '${overrideString}public var description: String {', + '}', + () { + final Iterable fieldStrings = classDefinition.fields.map(( + NamedType field, + ) { + return '${field.name}: \\(String(describing: ${field.name}))'; + }); + final String fieldsConcat = fieldStrings.join(', '); + indent.writeln('return "${classDefinition.name}($fieldsConcat)"'); + }, + ); } @override @@ -1459,23 +1467,13 @@ if (wrapped == nil) { } } - void _writeIsNullish(Indent indent) { + void _writeIsNullish(InternalSwiftOptions generatorOptions, Indent indent) { indent.newln(); + final String uniqueComponent = + generatorOptions.fileSpecificClassNameComponent ?? ''; indent.format(''' -#if DEBUG - func isNullish(_ value: Any?) -> Bool { - guard let innerValue = value else { - return true - } - - if case Optional.some(Optional.none) = value { - return true - } - - return innerValue is NSNull - } -#else - private func isNullish(_ value: Any?) -> Bool { +enum ${uniqueComponent}PigeonInternal { + static func isNullish(_ value: Any?) -> Bool { guard let innerValue = value else { return true } @@ -1486,7 +1484,7 @@ if (wrapped == nil) { return innerValue is NSNull } -#endif'''); +}'''); } void _writeWrapResult(Indent indent) { @@ -1696,7 +1694,7 @@ func $deepHashName(value: Any?, hasher: inout Hasher) { _writeCreateConnectionError(generatorOptions, indent); } - _writeIsNullish(indent); + _writeIsNullish(generatorOptions, indent); _writeNilOrValue(indent); if (root.classes.isNotEmpty) { _writeDeepEquals(generatorOptions, indent); diff --git a/packages/pigeon/platform_tests/test_plugin/darwin/test_plugin/Sources/test_plugin/CoreTests.gen.swift b/packages/pigeon/platform_tests/test_plugin/darwin/test_plugin/Sources/test_plugin/CoreTests.gen.swift index a831882ba8c1..ccbc467b7344 100644 --- a/packages/pigeon/platform_tests/test_plugin/darwin/test_plugin/Sources/test_plugin/CoreTests.gen.swift +++ b/packages/pigeon/platform_tests/test_plugin/darwin/test_plugin/Sources/test_plugin/CoreTests.gen.swift @@ -65,8 +65,8 @@ private func createConnectionError(withChannelName channelName: String) -> Pigeo details: "") } -#if DEBUG - func isNullish(_ value: Any?) -> Bool { +enum CoreTestsPigeonInternal { + static func isNullish(_ value: Any?) -> Bool { guard let innerValue = value else { return true } @@ -77,19 +77,7 @@ private func createConnectionError(withChannelName channelName: String) -> Pigeo return innerValue is NSNull } -#else - private func isNullish(_ value: Any?) -> Bool { - guard let innerValue = value else { - return true - } - - if case Optional.some(Optional.none) = value { - return true - } - - return innerValue is NSNull - } -#endif +} private func nilOrValue(_ value: Any?) -> T? { if value is NSNull { return nil } @@ -247,7 +235,7 @@ struct UnusedClass: Hashable, CustomStringConvertible { } public var description: String { - return "UnusedClass(aField: \(aField))" + return "UnusedClass(aField: \(String(describing: aField)))" } } @@ -443,7 +431,7 @@ struct AllTypes: Hashable, CustomStringConvertible { public var description: String { return - "AllTypes(aBool: \(aBool), anInt: \(anInt), anInt64: \(anInt64), aDouble: \(aDouble), aByteArray: \(aByteArray), a4ByteArray: \(a4ByteArray), a8ByteArray: \(a8ByteArray), aFloatArray: \(aFloatArray), anEnum: \(anEnum), anotherEnum: \(anotherEnum), aString: \(aString), anObject: \(anObject), list: \(list), stringList: \(stringList), intList: \(intList), doubleList: \(doubleList), boolList: \(boolList), enumList: \(enumList), objectList: \(objectList), listList: \(listList), mapList: \(mapList), map: \(map), stringMap: \(stringMap), intMap: \(intMap), enumMap: \(enumMap), objectMap: \(objectMap), listMap: \(listMap), mapMap: \(mapMap))" + "AllTypes(aBool: \(String(describing: aBool)), anInt: \(String(describing: anInt)), anInt64: \(String(describing: anInt64)), aDouble: \(String(describing: aDouble)), aByteArray: \(String(describing: aByteArray)), a4ByteArray: \(String(describing: a4ByteArray)), a8ByteArray: \(String(describing: a8ByteArray)), aFloatArray: \(String(describing: aFloatArray)), anEnum: \(String(describing: anEnum)), anotherEnum: \(String(describing: anotherEnum)), aString: \(String(describing: aString)), anObject: \(String(describing: anObject)), list: \(String(describing: list)), stringList: \(String(describing: stringList)), intList: \(String(describing: intList)), doubleList: \(String(describing: doubleList)), boolList: \(String(describing: boolList)), enumList: \(String(describing: enumList)), objectList: \(String(describing: objectList)), listList: \(String(describing: listList)), mapList: \(String(describing: mapList)), map: \(String(describing: map)), stringMap: \(String(describing: stringMap)), intMap: \(String(describing: intMap)), enumMap: \(String(describing: enumMap)), objectMap: \(String(describing: objectMap)), listMap: \(String(describing: listMap)), mapMap: \(String(describing: mapMap)))" } } @@ -727,7 +715,7 @@ class AllNullableTypes: Hashable, CustomStringConvertible { public var description: String { return - "AllNullableTypes(aNullableBool: \(aNullableBool), aNullableInt: \(aNullableInt), aNullableInt64: \(aNullableInt64), aNullableDouble: \(aNullableDouble), aNullableByteArray: \(aNullableByteArray), aNullable4ByteArray: \(aNullable4ByteArray), aNullable8ByteArray: \(aNullable8ByteArray), aNullableFloatArray: \(aNullableFloatArray), aNullableEnum: \(aNullableEnum), anotherNullableEnum: \(anotherNullableEnum), aNullableString: \(aNullableString), aNullableObject: \(aNullableObject), allNullableTypes: \(allNullableTypes), list: \(list), stringList: \(stringList), intList: \(intList), doubleList: \(doubleList), boolList: \(boolList), enumList: \(enumList), objectList: \(objectList), listList: \(listList), mapList: \(mapList), recursiveClassList: \(recursiveClassList), map: \(map), stringMap: \(stringMap), intMap: \(intMap), enumMap: \(enumMap), objectMap: \(objectMap), listMap: \(listMap), mapMap: \(mapMap), recursiveClassMap: \(recursiveClassMap))" + "AllNullableTypes(aNullableBool: \(String(describing: aNullableBool)), aNullableInt: \(String(describing: aNullableInt)), aNullableInt64: \(String(describing: aNullableInt64)), aNullableDouble: \(String(describing: aNullableDouble)), aNullableByteArray: \(String(describing: aNullableByteArray)), aNullable4ByteArray: \(String(describing: aNullable4ByteArray)), aNullable8ByteArray: \(String(describing: aNullable8ByteArray)), aNullableFloatArray: \(String(describing: aNullableFloatArray)), aNullableEnum: \(String(describing: aNullableEnum)), anotherNullableEnum: \(String(describing: anotherNullableEnum)), aNullableString: \(String(describing: aNullableString)), aNullableObject: \(String(describing: aNullableObject)), allNullableTypes: \(String(describing: allNullableTypes)), list: \(String(describing: list)), stringList: \(String(describing: stringList)), intList: \(String(describing: intList)), doubleList: \(String(describing: doubleList)), boolList: \(String(describing: boolList)), enumList: \(String(describing: enumList)), objectList: \(String(describing: objectList)), listList: \(String(describing: listList)), mapList: \(String(describing: mapList)), recursiveClassList: \(String(describing: recursiveClassList)), map: \(String(describing: map)), stringMap: \(String(describing: stringMap)), intMap: \(String(describing: intMap)), enumMap: \(String(describing: enumMap)), objectMap: \(String(describing: objectMap)), listMap: \(String(describing: listMap)), mapMap: \(String(describing: mapMap)), recursiveClassMap: \(String(describing: recursiveClassMap)))" } } @@ -929,7 +917,7 @@ struct AllNullableTypesWithoutRecursion: Hashable, CustomStringConvertible { public var description: String { return - "AllNullableTypesWithoutRecursion(aNullableBool: \(aNullableBool), aNullableInt: \(aNullableInt), aNullableInt64: \(aNullableInt64), aNullableDouble: \(aNullableDouble), aNullableByteArray: \(aNullableByteArray), aNullable4ByteArray: \(aNullable4ByteArray), aNullable8ByteArray: \(aNullable8ByteArray), aNullableFloatArray: \(aNullableFloatArray), aNullableEnum: \(aNullableEnum), anotherNullableEnum: \(anotherNullableEnum), aNullableString: \(aNullableString), aNullableObject: \(aNullableObject), list: \(list), stringList: \(stringList), intList: \(intList), doubleList: \(doubleList), boolList: \(boolList), enumList: \(enumList), objectList: \(objectList), listList: \(listList), mapList: \(mapList), map: \(map), stringMap: \(stringMap), intMap: \(intMap), enumMap: \(enumMap), objectMap: \(objectMap), listMap: \(listMap), mapMap: \(mapMap))" + "AllNullableTypesWithoutRecursion(aNullableBool: \(String(describing: aNullableBool)), aNullableInt: \(String(describing: aNullableInt)), aNullableInt64: \(String(describing: aNullableInt64)), aNullableDouble: \(String(describing: aNullableDouble)), aNullableByteArray: \(String(describing: aNullableByteArray)), aNullable4ByteArray: \(String(describing: aNullable4ByteArray)), aNullable8ByteArray: \(String(describing: aNullable8ByteArray)), aNullableFloatArray: \(String(describing: aNullableFloatArray)), aNullableEnum: \(String(describing: aNullableEnum)), anotherNullableEnum: \(String(describing: anotherNullableEnum)), aNullableString: \(String(describing: aNullableString)), aNullableObject: \(String(describing: aNullableObject)), list: \(String(describing: list)), stringList: \(String(describing: stringList)), intList: \(String(describing: intList)), doubleList: \(String(describing: doubleList)), boolList: \(String(describing: boolList)), enumList: \(String(describing: enumList)), objectList: \(String(describing: objectList)), listList: \(String(describing: listList)), mapList: \(String(describing: mapList)), map: \(String(describing: map)), stringMap: \(String(describing: stringMap)), intMap: \(String(describing: intMap)), enumMap: \(String(describing: enumMap)), objectMap: \(String(describing: objectMap)), listMap: \(String(describing: listMap)), mapMap: \(String(describing: mapMap)))" } } @@ -1009,7 +997,7 @@ struct AllClassesWrapper: Hashable, CustomStringConvertible { public var description: String { return - "AllClassesWrapper(allNullableTypes: \(allNullableTypes), allNullableTypesWithoutRecursion: \(allNullableTypesWithoutRecursion), allTypes: \(allTypes), classList: \(classList), nullableClassList: \(nullableClassList), classMap: \(classMap), nullableClassMap: \(nullableClassMap))" + "AllClassesWrapper(allNullableTypes: \(String(describing: allNullableTypes)), allNullableTypesWithoutRecursion: \(String(describing: allNullableTypesWithoutRecursion)), allTypes: \(String(describing: allTypes)), classList: \(String(describing: classList)), nullableClassList: \(String(describing: nullableClassList)), classMap: \(String(describing: classMap)), nullableClassMap: \(String(describing: nullableClassMap)))" } } @@ -1045,7 +1033,7 @@ struct TestMessage: Hashable, CustomStringConvertible { } public var description: String { - return "TestMessage(testList: \(testList))" + return "TestMessage(testList: \(String(describing: testList)))" } } diff --git a/packages/pigeon/platform_tests/test_plugin/darwin/test_plugin/Sources/test_plugin/EventChannelTests.gen.swift b/packages/pigeon/platform_tests/test_plugin/darwin/test_plugin/Sources/test_plugin/EventChannelTests.gen.swift index d5c47e8c543c..0d9f5514911d 100644 --- a/packages/pigeon/platform_tests/test_plugin/darwin/test_plugin/Sources/test_plugin/EventChannelTests.gen.swift +++ b/packages/pigeon/platform_tests/test_plugin/darwin/test_plugin/Sources/test_plugin/EventChannelTests.gen.swift @@ -33,8 +33,8 @@ final class EventChannelTestsError: Error { } } -#if DEBUG - func isNullish(_ value: Any?) -> Bool { +enum EventChannelTestsPigeonInternal { + static func isNullish(_ value: Any?) -> Bool { guard let innerValue = value else { return true } @@ -45,19 +45,7 @@ final class EventChannelTestsError: Error { return innerValue is NSNull } -#else - private func isNullish(_ value: Any?) -> Bool { - guard let innerValue = value else { - return true - } - - if case Optional.some(Optional.none) = value { - return true - } - - return innerValue is NSNull - } -#endif +} private func nilOrValue(_ value: Any?) -> T? { if value is NSNull { return nil } @@ -466,7 +454,7 @@ class EventAllNullableTypes: Hashable, CustomStringConvertible { public var description: String { return - "EventAllNullableTypes(aNullableBool: \(aNullableBool), aNullableInt: \(aNullableInt), aNullableInt64: \(aNullableInt64), aNullableDouble: \(aNullableDouble), aNullableByteArray: \(aNullableByteArray), aNullable4ByteArray: \(aNullable4ByteArray), aNullable8ByteArray: \(aNullable8ByteArray), aNullableFloatArray: \(aNullableFloatArray), aNullableEnum: \(aNullableEnum), anotherNullableEnum: \(anotherNullableEnum), aNullableString: \(aNullableString), aNullableObject: \(aNullableObject), allNullableTypes: \(allNullableTypes), list: \(list), stringList: \(stringList), intList: \(intList), doubleList: \(doubleList), boolList: \(boolList), enumList: \(enumList), objectList: \(objectList), listList: \(listList), mapList: \(mapList), recursiveClassList: \(recursiveClassList), map: \(map), stringMap: \(stringMap), intMap: \(intMap), enumMap: \(enumMap), objectMap: \(objectMap), listMap: \(listMap), mapMap: \(mapMap), recursiveClassMap: \(recursiveClassMap))" + "EventAllNullableTypes(aNullableBool: \(String(describing: aNullableBool)), aNullableInt: \(String(describing: aNullableInt)), aNullableInt64: \(String(describing: aNullableInt64)), aNullableDouble: \(String(describing: aNullableDouble)), aNullableByteArray: \(String(describing: aNullableByteArray)), aNullable4ByteArray: \(String(describing: aNullable4ByteArray)), aNullable8ByteArray: \(String(describing: aNullable8ByteArray)), aNullableFloatArray: \(String(describing: aNullableFloatArray)), aNullableEnum: \(String(describing: aNullableEnum)), anotherNullableEnum: \(String(describing: anotherNullableEnum)), aNullableString: \(String(describing: aNullableString)), aNullableObject: \(String(describing: aNullableObject)), allNullableTypes: \(String(describing: allNullableTypes)), list: \(String(describing: list)), stringList: \(String(describing: stringList)), intList: \(String(describing: intList)), doubleList: \(String(describing: doubleList)), boolList: \(String(describing: boolList)), enumList: \(String(describing: enumList)), objectList: \(String(describing: objectList)), listList: \(String(describing: listList)), mapList: \(String(describing: mapList)), recursiveClassList: \(String(describing: recursiveClassList)), map: \(String(describing: map)), stringMap: \(String(describing: stringMap)), intMap: \(String(describing: intMap)), enumMap: \(String(describing: enumMap)), objectMap: \(String(describing: objectMap)), listMap: \(String(describing: listMap)), mapMap: \(String(describing: mapMap)), recursiveClassMap: \(String(describing: recursiveClassMap)))" } } @@ -477,7 +465,7 @@ protocol PlatformEvent { } /// Generated class from Pigeon that represents data sent in messages. -struct IntEvent: PlatformEvent, CustomStringConvertible { +struct IntEvent: PlatformEvent { var value: Int64 // swift-format-ignore: AlwaysUseLowerCamelCase @@ -506,12 +494,12 @@ struct IntEvent: PlatformEvent, CustomStringConvertible { } public var description: String { - return "IntEvent(value: \(value))" + return "IntEvent(value: \(String(describing: value)))" } } /// Generated class from Pigeon that represents data sent in messages. -struct StringEvent: PlatformEvent, CustomStringConvertible { +struct StringEvent: PlatformEvent { var value: String // swift-format-ignore: AlwaysUseLowerCamelCase @@ -540,12 +528,12 @@ struct StringEvent: PlatformEvent, CustomStringConvertible { } public var description: String { - return "StringEvent(value: \(value))" + return "StringEvent(value: \(String(describing: value)))" } } /// Generated class from Pigeon that represents data sent in messages. -struct BoolEvent: PlatformEvent, CustomStringConvertible { +struct BoolEvent: PlatformEvent { var value: Bool // swift-format-ignore: AlwaysUseLowerCamelCase @@ -574,12 +562,12 @@ struct BoolEvent: PlatformEvent, CustomStringConvertible { } public var description: String { - return "BoolEvent(value: \(value))" + return "BoolEvent(value: \(String(describing: value)))" } } /// Generated class from Pigeon that represents data sent in messages. -struct DoubleEvent: PlatformEvent, CustomStringConvertible { +struct DoubleEvent: PlatformEvent { var value: Double // swift-format-ignore: AlwaysUseLowerCamelCase @@ -608,12 +596,12 @@ struct DoubleEvent: PlatformEvent, CustomStringConvertible { } public var description: String { - return "DoubleEvent(value: \(value))" + return "DoubleEvent(value: \(String(describing: value)))" } } /// Generated class from Pigeon that represents data sent in messages. -struct ObjectsEvent: PlatformEvent, CustomStringConvertible { +struct ObjectsEvent: PlatformEvent { var value: Any // swift-format-ignore: AlwaysUseLowerCamelCase @@ -642,12 +630,12 @@ struct ObjectsEvent: PlatformEvent, CustomStringConvertible { } public var description: String { - return "ObjectsEvent(value: \(value))" + return "ObjectsEvent(value: \(String(describing: value)))" } } /// Generated class from Pigeon that represents data sent in messages. -struct EnumEvent: PlatformEvent, CustomStringConvertible { +struct EnumEvent: PlatformEvent { var value: EventEnum // swift-format-ignore: AlwaysUseLowerCamelCase @@ -676,12 +664,12 @@ struct EnumEvent: PlatformEvent, CustomStringConvertible { } public var description: String { - return "EnumEvent(value: \(value))" + return "EnumEvent(value: \(String(describing: value)))" } } /// Generated class from Pigeon that represents data sent in messages. -struct ClassEvent: PlatformEvent, CustomStringConvertible { +struct ClassEvent: PlatformEvent { var value: EventAllNullableTypes // swift-format-ignore: AlwaysUseLowerCamelCase @@ -710,7 +698,7 @@ struct ClassEvent: PlatformEvent, CustomStringConvertible { } public var description: String { - return "ClassEvent(value: \(value))" + return "ClassEvent(value: \(String(describing: value)))" } } diff --git a/packages/pigeon/platform_tests/test_plugin/darwin/test_plugin/Sources/test_plugin/ProxyApiTests.gen.swift b/packages/pigeon/platform_tests/test_plugin/darwin/test_plugin/Sources/test_plugin/ProxyApiTests.gen.swift index 15c41e1c9b67..c77dc71f58b3 100644 --- a/packages/pigeon/platform_tests/test_plugin/darwin/test_plugin/Sources/test_plugin/ProxyApiTests.gen.swift +++ b/packages/pigeon/platform_tests/test_plugin/darwin/test_plugin/Sources/test_plugin/ProxyApiTests.gen.swift @@ -65,8 +65,8 @@ private func createConnectionError(withChannelName channelName: String) -> Proxy details: "") } -#if DEBUG - func isNullish(_ value: Any?) -> Bool { +enum ProxyApiTestsPigeonInternal { + static func isNullish(_ value: Any?) -> Bool { guard let innerValue = value else { return true } @@ -77,19 +77,7 @@ private func createConnectionError(withChannelName channelName: String) -> Proxy return innerValue is NSNull } -#else - private func isNullish(_ value: Any?) -> Bool { - guard let innerValue = value else { - return true - } - - if case Optional.some(Optional.none) = value { - return true - } - - return innerValue is NSNull - } -#endif +} private func nilOrValue(_ value: Any?) -> T? { if value is NSNull { return nil } diff --git a/packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/IsNullishTests.swift b/packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/IsNullishTests.swift index 8f2b5d62cb08..fc797a060480 100644 --- a/packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/IsNullishTests.swift +++ b/packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/IsNullishTests.swift @@ -12,20 +12,20 @@ struct IsNullishTests { @Test func testNil() { let value: Any? = nil - #expect(isNullish(value) == true) + #expect(CoreTestsPigeonInternal.isNullish(value) == true) } @Test func testNSNull() { let value: Any? = NSNull() - #expect(isNullish(value) == true) + #expect(CoreTestsPigeonInternal.isNullish(value) == true) } @Test func testNestedNil() { let inner: Any? = nil let value: Any? = inner - #expect(isNullish(value) == true) + #expect(CoreTestsPigeonInternal.isNullish(value) == true) } @Test @@ -33,26 +33,26 @@ struct IsNullishTests { let innerMost: Any? = nil let inner: Any?? = innerMost let value: Any? = inner - #expect(isNullish(value) == true) + #expect(CoreTestsPigeonInternal.isNullish(value) == true) } @Test func testTypedNil() { let typedNil: String? = nil let value: Any? = typedNil - #expect(isNullish(value) == true) + #expect(CoreTestsPigeonInternal.isNullish(value) == true) } @Test func testNestedNSNull() { let inner: Any? = NSNull() let value: Any? = inner - #expect(isNullish(value) == true) + #expect(CoreTestsPigeonInternal.isNullish(value) == true) } @Test func testNonNullValue() { let value: Any? = "Hello" - #expect(isNullish(value) == false) + #expect(CoreTestsPigeonInternal.isNullish(value) == false) } } diff --git a/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.cpp b/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.cpp index 6d8d4a96524e..6302c3ad6234 100644 --- a/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.cpp +++ b/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.cpp @@ -300,21584 +300,11226 @@ std::string UnusedClass::ToString() const { ss << *a_field_; } else { ss << "null"; - ss << ")"; - return ss.str(); } + ss << ")"; + return ss.str(); +} - size_t PigeonInternalDeepHash(const UnusedClass& v) { return v.Hash(); } - - // AllTypes - - AllTypes::AllTypes( - bool a_bool, int64_t an_int, int64_t an_int64, double a_double, - const std::vector& a_byte_array, - const std::vector& a4_byte_array, - const std::vector& a8_byte_array, - const std::vector& a_float_array, const AnEnum& an_enum, - const AnotherEnum& another_enum, const std::string& a_string, - const EncodableValue& an_object, const EncodableList& list, - const EncodableList& string_list, const EncodableList& int_list, - const EncodableList& double_list, const EncodableList& bool_list, - const EncodableList& enum_list, const EncodableList& object_list, - const EncodableList& list_list, const EncodableList& map_list, - const EncodableMap& map, const EncodableMap& string_map, - const EncodableMap& int_map, const EncodableMap& enum_map, - const EncodableMap& object_map, const EncodableMap& list_map, - const EncodableMap& map_map) - : a_bool_(a_bool), - an_int_(an_int), - an_int64_(an_int64), - a_double_(a_double), - a_byte_array_(a_byte_array), - a4_byte_array_(a4_byte_array), - a8_byte_array_(a8_byte_array), - a_float_array_(a_float_array), - an_enum_(an_enum), - another_enum_(another_enum), - a_string_(a_string), - an_object_(an_object), - list_(list), - string_list_(string_list), - int_list_(int_list), - double_list_(double_list), - bool_list_(bool_list), - enum_list_(enum_list), - object_list_(object_list), - list_list_(list_list), - map_list_(map_list), - map_(map), - string_map_(string_map), - int_map_(int_map), - enum_map_(enum_map), - object_map_(object_map), - list_map_(list_map), - map_map_(map_map) {} - - bool AllTypes::a_bool() const { return a_bool_; } - - void AllTypes::set_a_bool(bool value_arg) { a_bool_ = value_arg; } - - int64_t AllTypes::an_int() const { return an_int_; } +size_t PigeonInternalDeepHash(const UnusedClass& v) { return v.Hash(); } + +// AllTypes + +AllTypes::AllTypes(bool a_bool, int64_t an_int, int64_t an_int64, + double a_double, const std::vector& a_byte_array, + const std::vector& a4_byte_array, + const std::vector& a8_byte_array, + const std::vector& a_float_array, + const AnEnum& an_enum, const AnotherEnum& another_enum, + const std::string& a_string, const EncodableValue& an_object, + const EncodableList& list, const EncodableList& string_list, + const EncodableList& int_list, + const EncodableList& double_list, + const EncodableList& bool_list, + const EncodableList& enum_list, + const EncodableList& object_list, + const EncodableList& list_list, + const EncodableList& map_list, const EncodableMap& map, + const EncodableMap& string_map, const EncodableMap& int_map, + const EncodableMap& enum_map, const EncodableMap& object_map, + const EncodableMap& list_map, const EncodableMap& map_map) + : a_bool_(a_bool), + an_int_(an_int), + an_int64_(an_int64), + a_double_(a_double), + a_byte_array_(a_byte_array), + a4_byte_array_(a4_byte_array), + a8_byte_array_(a8_byte_array), + a_float_array_(a_float_array), + an_enum_(an_enum), + another_enum_(another_enum), + a_string_(a_string), + an_object_(an_object), + list_(list), + string_list_(string_list), + int_list_(int_list), + double_list_(double_list), + bool_list_(bool_list), + enum_list_(enum_list), + object_list_(object_list), + list_list_(list_list), + map_list_(map_list), + map_(map), + string_map_(string_map), + int_map_(int_map), + enum_map_(enum_map), + object_map_(object_map), + list_map_(list_map), + map_map_(map_map) {} + +bool AllTypes::a_bool() const { return a_bool_; } + +void AllTypes::set_a_bool(bool value_arg) { a_bool_ = value_arg; } + +int64_t AllTypes::an_int() const { return an_int_; } + +void AllTypes::set_an_int(int64_t value_arg) { an_int_ = value_arg; } + +int64_t AllTypes::an_int64() const { return an_int64_; } + +void AllTypes::set_an_int64(int64_t value_arg) { an_int64_ = value_arg; } + +double AllTypes::a_double() const { return a_double_; } + +void AllTypes::set_a_double(double value_arg) { a_double_ = value_arg; } + +const std::vector& AllTypes::a_byte_array() const { + return a_byte_array_; +} - void AllTypes::set_an_int(int64_t value_arg) { an_int_ = value_arg; } +void AllTypes::set_a_byte_array(const std::vector& value_arg) { + a_byte_array_ = value_arg; +} - int64_t AllTypes::an_int64() const { return an_int64_; } +const std::vector& AllTypes::a4_byte_array() const { + return a4_byte_array_; +} - void AllTypes::set_an_int64(int64_t value_arg) { an_int64_ = value_arg; } +void AllTypes::set_a4_byte_array(const std::vector& value_arg) { + a4_byte_array_ = value_arg; +} - double AllTypes::a_double() const { return a_double_; } +const std::vector& AllTypes::a8_byte_array() const { + return a8_byte_array_; +} - void AllTypes::set_a_double(double value_arg) { a_double_ = value_arg; } +void AllTypes::set_a8_byte_array(const std::vector& value_arg) { + a8_byte_array_ = value_arg; +} - const std::vector& AllTypes::a_byte_array() const { - return a_byte_array_; - } +const std::vector& AllTypes::a_float_array() const { + return a_float_array_; +} - void AllTypes::set_a_byte_array(const std::vector& value_arg) { - a_byte_array_ = value_arg; - } +void AllTypes::set_a_float_array(const std::vector& value_arg) { + a_float_array_ = value_arg; +} - const std::vector& AllTypes::a4_byte_array() const { - return a4_byte_array_; - } +const AnEnum& AllTypes::an_enum() const { return an_enum_; } - void AllTypes::set_a4_byte_array(const std::vector& value_arg) { - a4_byte_array_ = value_arg; - } +void AllTypes::set_an_enum(const AnEnum& value_arg) { an_enum_ = value_arg; } - const std::vector& AllTypes::a8_byte_array() const { - return a8_byte_array_; - } +const AnotherEnum& AllTypes::another_enum() const { return another_enum_; } - void AllTypes::set_a8_byte_array(const std::vector& value_arg) { - a8_byte_array_ = value_arg; - } +void AllTypes::set_another_enum(const AnotherEnum& value_arg) { + another_enum_ = value_arg; +} - const std::vector& AllTypes::a_float_array() const { - return a_float_array_; - } +const std::string& AllTypes::a_string() const { return a_string_; } - void AllTypes::set_a_float_array(const std::vector& value_arg) { - a_float_array_ = value_arg; - } +void AllTypes::set_a_string(std::string_view value_arg) { + a_string_ = value_arg; +} - const AnEnum& AllTypes::an_enum() const { return an_enum_; } +const EncodableValue& AllTypes::an_object() const { return an_object_; } - void AllTypes::set_an_enum(const AnEnum& value_arg) { an_enum_ = value_arg; } +void AllTypes::set_an_object(const EncodableValue& value_arg) { + an_object_ = value_arg; +} - const AnotherEnum& AllTypes::another_enum() const { return another_enum_; } +const EncodableList& AllTypes::list() const { return list_; } - void AllTypes::set_another_enum(const AnotherEnum& value_arg) { - another_enum_ = value_arg; - } +void AllTypes::set_list(const EncodableList& value_arg) { list_ = value_arg; } - const std::string& AllTypes::a_string() const { return a_string_; } +const EncodableList& AllTypes::string_list() const { return string_list_; } - void AllTypes::set_a_string(std::string_view value_arg) { - a_string_ = value_arg; - } +void AllTypes::set_string_list(const EncodableList& value_arg) { + string_list_ = value_arg; +} - const EncodableValue& AllTypes::an_object() const { return an_object_; } +const EncodableList& AllTypes::int_list() const { return int_list_; } - void AllTypes::set_an_object(const EncodableValue& value_arg) { - an_object_ = value_arg; - } +void AllTypes::set_int_list(const EncodableList& value_arg) { + int_list_ = value_arg; +} - const EncodableList& AllTypes::list() const { return list_; } +const EncodableList& AllTypes::double_list() const { return double_list_; } - void AllTypes::set_list(const EncodableList& value_arg) { list_ = value_arg; } +void AllTypes::set_double_list(const EncodableList& value_arg) { + double_list_ = value_arg; +} - const EncodableList& AllTypes::string_list() const { return string_list_; } +const EncodableList& AllTypes::bool_list() const { return bool_list_; } - void AllTypes::set_string_list(const EncodableList& value_arg) { - string_list_ = value_arg; - } +void AllTypes::set_bool_list(const EncodableList& value_arg) { + bool_list_ = value_arg; +} - const EncodableList& AllTypes::int_list() const { return int_list_; } +const EncodableList& AllTypes::enum_list() const { return enum_list_; } - void AllTypes::set_int_list(const EncodableList& value_arg) { - int_list_ = value_arg; - } +void AllTypes::set_enum_list(const EncodableList& value_arg) { + enum_list_ = value_arg; +} - const EncodableList& AllTypes::double_list() const { return double_list_; } +const EncodableList& AllTypes::object_list() const { return object_list_; } - void AllTypes::set_double_list(const EncodableList& value_arg) { - double_list_ = value_arg; - } +void AllTypes::set_object_list(const EncodableList& value_arg) { + object_list_ = value_arg; +} - const EncodableList& AllTypes::bool_list() const { return bool_list_; } +const EncodableList& AllTypes::list_list() const { return list_list_; } - void AllTypes::set_bool_list(const EncodableList& value_arg) { - bool_list_ = value_arg; - } +void AllTypes::set_list_list(const EncodableList& value_arg) { + list_list_ = value_arg; +} - const EncodableList& AllTypes::enum_list() const { return enum_list_; } +const EncodableList& AllTypes::map_list() const { return map_list_; } - void AllTypes::set_enum_list(const EncodableList& value_arg) { - enum_list_ = value_arg; - } +void AllTypes::set_map_list(const EncodableList& value_arg) { + map_list_ = value_arg; +} - const EncodableList& AllTypes::object_list() const { return object_list_; } +const EncodableMap& AllTypes::map() const { return map_; } - void AllTypes::set_object_list(const EncodableList& value_arg) { - object_list_ = value_arg; - } +void AllTypes::set_map(const EncodableMap& value_arg) { map_ = value_arg; } - const EncodableList& AllTypes::list_list() const { return list_list_; } +const EncodableMap& AllTypes::string_map() const { return string_map_; } - void AllTypes::set_list_list(const EncodableList& value_arg) { - list_list_ = value_arg; - } +void AllTypes::set_string_map(const EncodableMap& value_arg) { + string_map_ = value_arg; +} - const EncodableList& AllTypes::map_list() const { return map_list_; } +const EncodableMap& AllTypes::int_map() const { return int_map_; } - void AllTypes::set_map_list(const EncodableList& value_arg) { - map_list_ = value_arg; - } +void AllTypes::set_int_map(const EncodableMap& value_arg) { + int_map_ = value_arg; +} - const EncodableMap& AllTypes::map() const { return map_; } +const EncodableMap& AllTypes::enum_map() const { return enum_map_; } - void AllTypes::set_map(const EncodableMap& value_arg) { map_ = value_arg; } +void AllTypes::set_enum_map(const EncodableMap& value_arg) { + enum_map_ = value_arg; +} - const EncodableMap& AllTypes::string_map() const { return string_map_; } +const EncodableMap& AllTypes::object_map() const { return object_map_; } - void AllTypes::set_string_map(const EncodableMap& value_arg) { - string_map_ = value_arg; - } +void AllTypes::set_object_map(const EncodableMap& value_arg) { + object_map_ = value_arg; +} - const EncodableMap& AllTypes::int_map() const { return int_map_; } +const EncodableMap& AllTypes::list_map() const { return list_map_; } - void AllTypes::set_int_map(const EncodableMap& value_arg) { - int_map_ = value_arg; - } +void AllTypes::set_list_map(const EncodableMap& value_arg) { + list_map_ = value_arg; +} - const EncodableMap& AllTypes::enum_map() const { return enum_map_; } +const EncodableMap& AllTypes::map_map() const { return map_map_; } - void AllTypes::set_enum_map(const EncodableMap& value_arg) { - enum_map_ = value_arg; - } +void AllTypes::set_map_map(const EncodableMap& value_arg) { + map_map_ = value_arg; +} - const EncodableMap& AllTypes::object_map() const { return object_map_; } +EncodableList AllTypes::ToEncodableList() const { + EncodableList list; + list.reserve(28); + list.push_back(EncodableValue(a_bool_)); + list.push_back(EncodableValue(an_int_)); + list.push_back(EncodableValue(an_int64_)); + list.push_back(EncodableValue(a_double_)); + list.push_back(EncodableValue(a_byte_array_)); + list.push_back(EncodableValue(a4_byte_array_)); + list.push_back(EncodableValue(a8_byte_array_)); + list.push_back(EncodableValue(a_float_array_)); + list.push_back(CustomEncodableValue(an_enum_)); + list.push_back(CustomEncodableValue(another_enum_)); + list.push_back(EncodableValue(a_string_)); + list.push_back(an_object_); + list.push_back(EncodableValue(list_)); + list.push_back(EncodableValue(string_list_)); + list.push_back(EncodableValue(int_list_)); + list.push_back(EncodableValue(double_list_)); + list.push_back(EncodableValue(bool_list_)); + list.push_back(EncodableValue(enum_list_)); + list.push_back(EncodableValue(object_list_)); + list.push_back(EncodableValue(list_list_)); + list.push_back(EncodableValue(map_list_)); + list.push_back(EncodableValue(map_)); + list.push_back(EncodableValue(string_map_)); + list.push_back(EncodableValue(int_map_)); + list.push_back(EncodableValue(enum_map_)); + list.push_back(EncodableValue(object_map_)); + list.push_back(EncodableValue(list_map_)); + list.push_back(EncodableValue(map_map_)); + return list; +} - void AllTypes::set_object_map(const EncodableMap& value_arg) { - object_map_ = value_arg; - } +AllTypes AllTypes::FromEncodableList(const EncodableList& list) { + AllTypes decoded( + std::get(list[0]), std::get(list[1]), + std::get(list[2]), std::get(list[3]), + std::get>(list[4]), + std::get>(list[5]), + std::get>(list[6]), + std::get>(list[7]), + std::any_cast(std::get(list[8])), + std::any_cast( + std::get(list[9])), + std::get(list[10]), list[11], + std::get(list[12]), std::get(list[13]), + std::get(list[14]), std::get(list[15]), + std::get(list[16]), std::get(list[17]), + std::get(list[18]), std::get(list[19]), + std::get(list[20]), std::get(list[21]), + std::get(list[22]), std::get(list[23]), + std::get(list[24]), std::get(list[25]), + std::get(list[26]), std::get(list[27])); + return decoded; +} - const EncodableMap& AllTypes::list_map() const { return list_map_; } +bool AllTypes::operator==(const AllTypes& other) const { + return PigeonInternalDeepEquals(a_bool_, other.a_bool_) && + PigeonInternalDeepEquals(an_int_, other.an_int_) && + PigeonInternalDeepEquals(an_int64_, other.an_int64_) && + PigeonInternalDeepEquals(a_double_, other.a_double_) && + PigeonInternalDeepEquals(a_byte_array_, other.a_byte_array_) && + PigeonInternalDeepEquals(a4_byte_array_, other.a4_byte_array_) && + PigeonInternalDeepEquals(a8_byte_array_, other.a8_byte_array_) && + PigeonInternalDeepEquals(a_float_array_, other.a_float_array_) && + PigeonInternalDeepEquals(an_enum_, other.an_enum_) && + PigeonInternalDeepEquals(another_enum_, other.another_enum_) && + PigeonInternalDeepEquals(a_string_, other.a_string_) && + PigeonInternalDeepEquals(an_object_, other.an_object_) && + PigeonInternalDeepEquals(list_, other.list_) && + PigeonInternalDeepEquals(string_list_, other.string_list_) && + PigeonInternalDeepEquals(int_list_, other.int_list_) && + PigeonInternalDeepEquals(double_list_, other.double_list_) && + PigeonInternalDeepEquals(bool_list_, other.bool_list_) && + PigeonInternalDeepEquals(enum_list_, other.enum_list_) && + PigeonInternalDeepEquals(object_list_, other.object_list_) && + PigeonInternalDeepEquals(list_list_, other.list_list_) && + PigeonInternalDeepEquals(map_list_, other.map_list_) && + PigeonInternalDeepEquals(map_, other.map_) && + PigeonInternalDeepEquals(string_map_, other.string_map_) && + PigeonInternalDeepEquals(int_map_, other.int_map_) && + PigeonInternalDeepEquals(enum_map_, other.enum_map_) && + PigeonInternalDeepEquals(object_map_, other.object_map_) && + PigeonInternalDeepEquals(list_map_, other.list_map_) && + PigeonInternalDeepEquals(map_map_, other.map_map_); +} - void AllTypes::set_list_map(const EncodableMap& value_arg) { - list_map_ = value_arg; - } +bool AllTypes::operator!=(const AllTypes& other) const { + return !(*this == other); +} - const EncodableMap& AllTypes::map_map() const { return map_map_; } +size_t AllTypes::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(a_bool_); + result = result * 31 + PigeonInternalDeepHash(an_int_); + result = result * 31 + PigeonInternalDeepHash(an_int64_); + result = result * 31 + PigeonInternalDeepHash(a_double_); + result = result * 31 + PigeonInternalDeepHash(a_byte_array_); + result = result * 31 + PigeonInternalDeepHash(a4_byte_array_); + result = result * 31 + PigeonInternalDeepHash(a8_byte_array_); + result = result * 31 + PigeonInternalDeepHash(a_float_array_); + result = result * 31 + PigeonInternalDeepHash(an_enum_); + result = result * 31 + PigeonInternalDeepHash(another_enum_); + result = result * 31 + PigeonInternalDeepHash(a_string_); + result = result * 31 + PigeonInternalDeepHash(an_object_); + result = result * 31 + PigeonInternalDeepHash(list_); + result = result * 31 + PigeonInternalDeepHash(string_list_); + result = result * 31 + PigeonInternalDeepHash(int_list_); + result = result * 31 + PigeonInternalDeepHash(double_list_); + result = result * 31 + PigeonInternalDeepHash(bool_list_); + result = result * 31 + PigeonInternalDeepHash(enum_list_); + result = result * 31 + PigeonInternalDeepHash(object_list_); + result = result * 31 + PigeonInternalDeepHash(list_list_); + result = result * 31 + PigeonInternalDeepHash(map_list_); + result = result * 31 + PigeonInternalDeepHash(map_); + result = result * 31 + PigeonInternalDeepHash(string_map_); + result = result * 31 + PigeonInternalDeepHash(int_map_); + result = result * 31 + PigeonInternalDeepHash(enum_map_); + result = result * 31 + PigeonInternalDeepHash(object_map_); + result = result * 31 + PigeonInternalDeepHash(list_map_); + result = result * 31 + PigeonInternalDeepHash(map_map_); + return result; +} - void AllTypes::set_map_map(const EncodableMap& value_arg) { - map_map_ = value_arg; - } +std::string AllTypes::ToString() const { + std::stringstream ss; + ss << "AllTypes("; + ss << "aBool: "; + ss << a_bool_; + ss << ", anInt: "; + ss << an_int_; + ss << ", anInt64: "; + ss << an_int64_; + ss << ", aDouble: "; + ss << a_double_; + ss << ", aByteArray: "; + ss << a_byte_array_; + ss << ", a4ByteArray: "; + ss << a4_byte_array_; + ss << ", a8ByteArray: "; + ss << a8_byte_array_; + ss << ", aFloatArray: "; + ss << a_float_array_; + ss << ", anEnum: "; + ss << an_enum_; + ss << ", anotherEnum: "; + ss << another_enum_; + ss << ", aString: "; + ss << a_string_; + ss << ", anObject: "; + ss << an_object_; + ss << ", list: "; + ss << list_; + ss << ", stringList: "; + ss << string_list_; + ss << ", intList: "; + ss << int_list_; + ss << ", doubleList: "; + ss << double_list_; + ss << ", boolList: "; + ss << bool_list_; + ss << ", enumList: "; + ss << enum_list_; + ss << ", objectList: "; + ss << object_list_; + ss << ", listList: "; + ss << list_list_; + ss << ", mapList: "; + ss << map_list_; + ss << ", map: "; + ss << map_; + ss << ", stringMap: "; + ss << string_map_; + ss << ", intMap: "; + ss << int_map_; + ss << ", enumMap: "; + ss << enum_map_; + ss << ", objectMap: "; + ss << object_map_; + ss << ", listMap: "; + ss << list_map_; + ss << ", mapMap: "; + ss << map_map_; + ss << ")"; + return ss.str(); +} - EncodableList AllTypes::ToEncodableList() const { - EncodableList list; - list.reserve(28); - list.push_back(EncodableValue(a_bool_)); - list.push_back(EncodableValue(an_int_)); - list.push_back(EncodableValue(an_int64_)); - list.push_back(EncodableValue(a_double_)); - list.push_back(EncodableValue(a_byte_array_)); - list.push_back(EncodableValue(a4_byte_array_)); - list.push_back(EncodableValue(a8_byte_array_)); - list.push_back(EncodableValue(a_float_array_)); - list.push_back(CustomEncodableValue(an_enum_)); - list.push_back(CustomEncodableValue(another_enum_)); - list.push_back(EncodableValue(a_string_)); - list.push_back(an_object_); - list.push_back(EncodableValue(list_)); - list.push_back(EncodableValue(string_list_)); - list.push_back(EncodableValue(int_list_)); - list.push_back(EncodableValue(double_list_)); - list.push_back(EncodableValue(bool_list_)); - list.push_back(EncodableValue(enum_list_)); - list.push_back(EncodableValue(object_list_)); - list.push_back(EncodableValue(list_list_)); - list.push_back(EncodableValue(map_list_)); - list.push_back(EncodableValue(map_)); - list.push_back(EncodableValue(string_map_)); - list.push_back(EncodableValue(int_map_)); - list.push_back(EncodableValue(enum_map_)); - list.push_back(EncodableValue(object_map_)); - list.push_back(EncodableValue(list_map_)); - list.push_back(EncodableValue(map_map_)); - return list; - } - - AllTypes AllTypes::FromEncodableList(const EncodableList& list) { - AllTypes decoded( - std::get(list[0]), std::get(list[1]), - std::get(list[2]), std::get(list[3]), - std::get>(list[4]), - std::get>(list[5]), - std::get>(list[6]), - std::get>(list[7]), - std::any_cast(std::get(list[8])), - std::any_cast( - std::get(list[9])), - std::get(list[10]), list[11], - std::get(list[12]), std::get(list[13]), - std::get(list[14]), std::get(list[15]), - std::get(list[16]), std::get(list[17]), - std::get(list[18]), std::get(list[19]), - std::get(list[20]), std::get(list[21]), - std::get(list[22]), std::get(list[23]), - std::get(list[24]), std::get(list[25]), - std::get(list[26]), std::get(list[27])); - return decoded; - } - - bool AllTypes::operator==(const AllTypes& other) const { - return PigeonInternalDeepEquals(a_bool_, other.a_bool_) && - PigeonInternalDeepEquals(an_int_, other.an_int_) && - PigeonInternalDeepEquals(an_int64_, other.an_int64_) && - PigeonInternalDeepEquals(a_double_, other.a_double_) && - PigeonInternalDeepEquals(a_byte_array_, other.a_byte_array_) && - PigeonInternalDeepEquals(a4_byte_array_, other.a4_byte_array_) && - PigeonInternalDeepEquals(a8_byte_array_, other.a8_byte_array_) && - PigeonInternalDeepEquals(a_float_array_, other.a_float_array_) && - PigeonInternalDeepEquals(an_enum_, other.an_enum_) && - PigeonInternalDeepEquals(another_enum_, other.another_enum_) && - PigeonInternalDeepEquals(a_string_, other.a_string_) && - PigeonInternalDeepEquals(an_object_, other.an_object_) && - PigeonInternalDeepEquals(list_, other.list_) && - PigeonInternalDeepEquals(string_list_, other.string_list_) && - PigeonInternalDeepEquals(int_list_, other.int_list_) && - PigeonInternalDeepEquals(double_list_, other.double_list_) && - PigeonInternalDeepEquals(bool_list_, other.bool_list_) && - PigeonInternalDeepEquals(enum_list_, other.enum_list_) && - PigeonInternalDeepEquals(object_list_, other.object_list_) && - PigeonInternalDeepEquals(list_list_, other.list_list_) && - PigeonInternalDeepEquals(map_list_, other.map_list_) && - PigeonInternalDeepEquals(map_, other.map_) && - PigeonInternalDeepEquals(string_map_, other.string_map_) && - PigeonInternalDeepEquals(int_map_, other.int_map_) && - PigeonInternalDeepEquals(enum_map_, other.enum_map_) && - PigeonInternalDeepEquals(object_map_, other.object_map_) && - PigeonInternalDeepEquals(list_map_, other.list_map_) && - PigeonInternalDeepEquals(map_map_, other.map_map_); - } - - bool AllTypes::operator!=(const AllTypes& other) const { - return !(*this == other); - } - - size_t AllTypes::Hash() const { - size_t result = 1; - result = result * 31 + PigeonInternalDeepHash(a_bool_); - result = result * 31 + PigeonInternalDeepHash(an_int_); - result = result * 31 + PigeonInternalDeepHash(an_int64_); - result = result * 31 + PigeonInternalDeepHash(a_double_); - result = result * 31 + PigeonInternalDeepHash(a_byte_array_); - result = result * 31 + PigeonInternalDeepHash(a4_byte_array_); - result = result * 31 + PigeonInternalDeepHash(a8_byte_array_); - result = result * 31 + PigeonInternalDeepHash(a_float_array_); - result = result * 31 + PigeonInternalDeepHash(an_enum_); - result = result * 31 + PigeonInternalDeepHash(another_enum_); - result = result * 31 + PigeonInternalDeepHash(a_string_); - result = result * 31 + PigeonInternalDeepHash(an_object_); - result = result * 31 + PigeonInternalDeepHash(list_); - result = result * 31 + PigeonInternalDeepHash(string_list_); - result = result * 31 + PigeonInternalDeepHash(int_list_); - result = result * 31 + PigeonInternalDeepHash(double_list_); - result = result * 31 + PigeonInternalDeepHash(bool_list_); - result = result * 31 + PigeonInternalDeepHash(enum_list_); - result = result * 31 + PigeonInternalDeepHash(object_list_); - result = result * 31 + PigeonInternalDeepHash(list_list_); - result = result * 31 + PigeonInternalDeepHash(map_list_); - result = result * 31 + PigeonInternalDeepHash(map_); - result = result * 31 + PigeonInternalDeepHash(string_map_); - result = result * 31 + PigeonInternalDeepHash(int_map_); - result = result * 31 + PigeonInternalDeepHash(enum_map_); - result = result * 31 + PigeonInternalDeepHash(object_map_); - result = result * 31 + PigeonInternalDeepHash(list_map_); - result = result * 31 + PigeonInternalDeepHash(map_map_); - return result; - } - - std::string AllTypes::ToString() const { - std::stringstream ss; - ss << "AllTypes("; - ss << "aBool: "; - ss << a_bool_; - ss << ", anInt: "; - ss << an_int_; - ss << ", anInt64: "; - ss << an_int64_; - ss << ", aDouble: "; - ss << a_double_; - ss << ", aByteArray: "; - ss << a_byte_array_; - ss << ", a4ByteArray: "; - ss << a4_byte_array_; - ss << ", a8ByteArray: "; - ss << a8_byte_array_; - ss << ", aFloatArray: "; - ss << a_float_array_; - ss << ", anEnum: "; - ss << an_enum_; - ss << ", anotherEnum: "; - ss << another_enum_; - ss << ", aString: "; - ss << a_string_; - ss << ", anObject: "; - ss << an_object_; - ss << ", list: "; - ss << list_; - ss << ", stringList: "; - ss << string_list_; - ss << ", intList: "; - ss << int_list_; - ss << ", doubleList: "; - ss << double_list_; - ss << ", boolList: "; - ss << bool_list_; - ss << ", enumList: "; - ss << enum_list_; - ss << ", objectList: "; - ss << object_list_; - ss << ", listList: "; - ss << list_list_; - ss << ", mapList: "; - ss << map_list_; - ss << ", map: "; - ss << map_; - ss << ", stringMap: "; - ss << string_map_; - ss << ", intMap: "; - ss << int_map_; - ss << ", enumMap: "; - ss << enum_map_; - ss << ", objectMap: "; - ss << object_map_; - ss << ", listMap: "; - ss << list_map_; - ss << ", mapMap: "; - ss << map_map_; - ss << ")"; - return ss.str(); - } - - size_t PigeonInternalDeepHash(const AllTypes& v) { return v.Hash(); } - - // AllNullableTypes - - AllNullableTypes::AllNullableTypes() {} - - AllNullableTypes::AllNullableTypes( - const bool* a_nullable_bool, const int64_t* a_nullable_int, - const int64_t* a_nullable_int64, const double* a_nullable_double, - const std::vector* a_nullable_byte_array, - const std::vector* a_nullable4_byte_array, - const std::vector* a_nullable8_byte_array, - const std::vector* a_nullable_float_array, - const AnEnum* a_nullable_enum, const AnotherEnum* another_nullable_enum, - const std::string* a_nullable_string, - const EncodableValue* a_nullable_object, - const AllNullableTypes* all_nullable_types, const EncodableList* list, - const EncodableList* string_list, const EncodableList* int_list, - const EncodableList* double_list, const EncodableList* bool_list, - const EncodableList* enum_list, const EncodableList* object_list, - const EncodableList* list_list, const EncodableList* map_list, - const EncodableList* recursive_class_list, const EncodableMap* map, - const EncodableMap* string_map, const EncodableMap* int_map, - const EncodableMap* enum_map, const EncodableMap* object_map, - const EncodableMap* list_map, const EncodableMap* map_map, - const EncodableMap* recursive_class_map) - : a_nullable_bool_(a_nullable_bool ? std::optional(*a_nullable_bool) - : std::nullopt), - a_nullable_int_(a_nullable_int ? std::optional(*a_nullable_int) +size_t PigeonInternalDeepHash(const AllTypes& v) { return v.Hash(); } + +// AllNullableTypes + +AllNullableTypes::AllNullableTypes() {} + +AllNullableTypes::AllNullableTypes( + const bool* a_nullable_bool, const int64_t* a_nullable_int, + const int64_t* a_nullable_int64, const double* a_nullable_double, + const std::vector* a_nullable_byte_array, + const std::vector* a_nullable4_byte_array, + const std::vector* a_nullable8_byte_array, + const std::vector* a_nullable_float_array, + const AnEnum* a_nullable_enum, const AnotherEnum* another_nullable_enum, + const std::string* a_nullable_string, + const EncodableValue* a_nullable_object, + const AllNullableTypes* all_nullable_types, const EncodableList* list, + const EncodableList* string_list, const EncodableList* int_list, + const EncodableList* double_list, const EncodableList* bool_list, + const EncodableList* enum_list, const EncodableList* object_list, + const EncodableList* list_list, const EncodableList* map_list, + const EncodableList* recursive_class_list, const EncodableMap* map, + const EncodableMap* string_map, const EncodableMap* int_map, + const EncodableMap* enum_map, const EncodableMap* object_map, + const EncodableMap* list_map, const EncodableMap* map_map, + const EncodableMap* recursive_class_map) + : a_nullable_bool_(a_nullable_bool ? std::optional(*a_nullable_bool) : std::nullopt), - a_nullable_int64_(a_nullable_int64 - ? std::optional(*a_nullable_int64) - : std::nullopt), - a_nullable_double_(a_nullable_double - ? std::optional(*a_nullable_double) - : std::nullopt), - a_nullable_byte_array_( - a_nullable_byte_array - ? std::optional>(*a_nullable_byte_array) - : std::nullopt), - a_nullable4_byte_array_( - a_nullable4_byte_array - ? std::optional>(*a_nullable4_byte_array) - : std::nullopt), - a_nullable8_byte_array_( - a_nullable8_byte_array - ? std::optional>(*a_nullable8_byte_array) - : std::nullopt), - a_nullable_float_array_( - a_nullable_float_array - ? std::optional>(*a_nullable_float_array) - : std::nullopt), - a_nullable_enum_(a_nullable_enum - ? std::optional(*a_nullable_enum) - : std::nullopt), - another_nullable_enum_( - another_nullable_enum - ? std::optional(*another_nullable_enum) - : std::nullopt), - a_nullable_string_(a_nullable_string - ? std::optional(*a_nullable_string) - : std::nullopt), - a_nullable_object_(a_nullable_object ? std::optional( - *a_nullable_object) - : std::nullopt), - all_nullable_types_( - all_nullable_types - ? std::make_unique(*all_nullable_types) - : nullptr), - list_(list ? std::optional(*list) : std::nullopt), - string_list_(string_list ? std::optional(*string_list) - : std::nullopt), - int_list_(int_list ? std::optional(*int_list) - : std::nullopt), - double_list_(double_list ? std::optional(*double_list) - : std::nullopt), - bool_list_(bool_list ? std::optional(*bool_list) + a_nullable_int_(a_nullable_int ? std::optional(*a_nullable_int) + : std::nullopt), + a_nullable_int64_(a_nullable_int64 + ? std::optional(*a_nullable_int64) + : std::nullopt), + a_nullable_double_(a_nullable_double + ? std::optional(*a_nullable_double) : std::nullopt), - enum_list_(enum_list ? std::optional(*enum_list) + a_nullable_byte_array_( + a_nullable_byte_array + ? std::optional>(*a_nullable_byte_array) + : std::nullopt), + a_nullable4_byte_array_( + a_nullable4_byte_array + ? std::optional>(*a_nullable4_byte_array) + : std::nullopt), + a_nullable8_byte_array_( + a_nullable8_byte_array + ? std::optional>(*a_nullable8_byte_array) + : std::nullopt), + a_nullable_float_array_( + a_nullable_float_array + ? std::optional>(*a_nullable_float_array) + : std::nullopt), + a_nullable_enum_(a_nullable_enum ? std::optional(*a_nullable_enum) + : std::nullopt), + another_nullable_enum_(another_nullable_enum ? std::optional( + *another_nullable_enum) + : std::nullopt), + a_nullable_string_(a_nullable_string + ? std::optional(*a_nullable_string) : std::nullopt), - object_list_(object_list ? std::optional(*object_list) - : std::nullopt), - list_list_(list_list ? std::optional(*list_list) + a_nullable_object_(a_nullable_object + ? std::optional(*a_nullable_object) : std::nullopt), - map_list_(map_list ? std::optional(*map_list) - : std::nullopt), - recursive_class_list_( - recursive_class_list - ? std::optional(*recursive_class_list) - : std::nullopt), - map_(map ? std::optional(*map) : std::nullopt), - string_map_(string_map ? std::optional(*string_map) + all_nullable_types_( + all_nullable_types + ? std::make_unique(*all_nullable_types) + : nullptr), + list_(list ? std::optional(*list) : std::nullopt), + string_list_(string_list ? std::optional(*string_list) : std::nullopt), - int_map_(int_map ? std::optional(*int_map) + int_list_(int_list ? std::optional(*int_list) : std::nullopt), - enum_map_(enum_map ? std::optional(*enum_map) + double_list_(double_list ? std::optional(*double_list) + : std::nullopt), + bool_list_(bool_list ? std::optional(*bool_list) + : std::nullopt), + enum_list_(enum_list ? std::optional(*enum_list) : std::nullopt), - object_map_(object_map ? std::optional(*object_map) + object_list_(object_list ? std::optional(*object_list) : std::nullopt), - list_map_(list_map ? std::optional(*list_map) + list_list_(list_list ? std::optional(*list_list) : std::nullopt), - map_map_(map_map ? std::optional(*map_map) + map_list_(map_list ? std::optional(*map_list) : std::nullopt), - recursive_class_map_(recursive_class_map ? std::optional( - *recursive_class_map) - : std::nullopt) {} - - AllNullableTypes::AllNullableTypes(const AllNullableTypes& other) - : a_nullable_bool_(other.a_nullable_bool_ - ? std::optional(*other.a_nullable_bool_) - : std::nullopt), - a_nullable_int_(other.a_nullable_int_ - ? std::optional(*other.a_nullable_int_) - : std::nullopt), - a_nullable_int64_(other.a_nullable_int64_ - ? std::optional(*other.a_nullable_int64_) - : std::nullopt), - a_nullable_double_( - other.a_nullable_double_ - ? std::optional(*other.a_nullable_double_) - : std::nullopt), - a_nullable_byte_array_(other.a_nullable_byte_array_ - ? std::optional>( - *other.a_nullable_byte_array_) - : std::nullopt), - a_nullable4_byte_array_(other.a_nullable4_byte_array_ - ? std::optional>( - *other.a_nullable4_byte_array_) - : std::nullopt), - a_nullable8_byte_array_(other.a_nullable8_byte_array_ - ? std::optional>( - *other.a_nullable8_byte_array_) - : std::nullopt), - a_nullable_float_array_(other.a_nullable_float_array_ - ? std::optional>( - *other.a_nullable_float_array_) - : std::nullopt), - a_nullable_enum_(other.a_nullable_enum_ - ? std::optional(*other.a_nullable_enum_) + recursive_class_list_(recursive_class_list ? std::optional( + *recursive_class_list) + : std::nullopt), + map_(map ? std::optional(*map) : std::nullopt), + string_map_(string_map ? std::optional(*string_map) : std::nullopt), - another_nullable_enum_( - other.another_nullable_enum_ - ? std::optional(*other.another_nullable_enum_) - : std::nullopt), - a_nullable_string_( - other.a_nullable_string_ - ? std::optional(*other.a_nullable_string_) - : std::nullopt), - a_nullable_object_( - other.a_nullable_object_ - ? std::optional(*other.a_nullable_object_) - : std::nullopt), - all_nullable_types_( - other.all_nullable_types_ - ? std::make_unique(*other.all_nullable_types_) - : nullptr), - list_(other.list_ ? std::optional(*other.list_) - : std::nullopt), - string_list_(other.string_list_ - ? std::optional(*other.string_list_) + int_map_(int_map ? std::optional(*int_map) : std::nullopt), + enum_map_(enum_map ? std::optional(*enum_map) : std::nullopt), - int_list_(other.int_list_ - ? std::optional(*other.int_list_) - : std::nullopt), - double_list_(other.double_list_ - ? std::optional(*other.double_list_) + object_map_(object_map ? std::optional(*object_map) + : std::nullopt), + list_map_(list_map ? std::optional(*list_map) : std::nullopt), - bool_list_(other.bool_list_ - ? std::optional(*other.bool_list_) + map_map_(map_map ? std::optional(*map_map) : std::nullopt), + recursive_class_map_(recursive_class_map ? std::optional( + *recursive_class_map) + : std::nullopt) {} + +AllNullableTypes::AllNullableTypes(const AllNullableTypes& other) + : a_nullable_bool_(other.a_nullable_bool_ + ? std::optional(*other.a_nullable_bool_) + : std::nullopt), + a_nullable_int_(other.a_nullable_int_ + ? std::optional(*other.a_nullable_int_) + : std::nullopt), + a_nullable_int64_(other.a_nullable_int64_ + ? std::optional(*other.a_nullable_int64_) + : std::nullopt), + a_nullable_double_(other.a_nullable_double_ + ? std::optional(*other.a_nullable_double_) + : std::nullopt), + a_nullable_byte_array_(other.a_nullable_byte_array_ + ? std::optional>( + *other.a_nullable_byte_array_) + : std::nullopt), + a_nullable4_byte_array_(other.a_nullable4_byte_array_ + ? std::optional>( + *other.a_nullable4_byte_array_) + : std::nullopt), + a_nullable8_byte_array_(other.a_nullable8_byte_array_ + ? std::optional>( + *other.a_nullable8_byte_array_) + : std::nullopt), + a_nullable_float_array_(other.a_nullable_float_array_ + ? std::optional>( + *other.a_nullable_float_array_) + : std::nullopt), + a_nullable_enum_(other.a_nullable_enum_ + ? std::optional(*other.a_nullable_enum_) + : std::nullopt), + another_nullable_enum_( + other.another_nullable_enum_ + ? std::optional(*other.another_nullable_enum_) + : std::nullopt), + a_nullable_string_( + other.a_nullable_string_ + ? std::optional(*other.a_nullable_string_) + : std::nullopt), + a_nullable_object_( + other.a_nullable_object_ + ? std::optional(*other.a_nullable_object_) + : std::nullopt), + all_nullable_types_( + other.all_nullable_types_ + ? std::make_unique(*other.all_nullable_types_) + : nullptr), + list_(other.list_ ? std::optional(*other.list_) + : std::nullopt), + string_list_(other.string_list_ + ? std::optional(*other.string_list_) : std::nullopt), - enum_list_(other.enum_list_ - ? std::optional(*other.enum_list_) + int_list_(other.int_list_ ? std::optional(*other.int_list_) + : std::nullopt), + double_list_(other.double_list_ + ? std::optional(*other.double_list_) : std::nullopt), - object_list_(other.object_list_ - ? std::optional(*other.object_list_) - : std::nullopt), - list_list_(other.list_list_ - ? std::optional(*other.list_list_) + bool_list_(other.bool_list_ + ? std::optional(*other.bool_list_) + : std::nullopt), + enum_list_(other.enum_list_ + ? std::optional(*other.enum_list_) + : std::nullopt), + object_list_(other.object_list_ + ? std::optional(*other.object_list_) : std::nullopt), - map_list_(other.map_list_ - ? std::optional(*other.map_list_) - : std::nullopt), - recursive_class_list_( - other.recursive_class_list_ - ? std::optional(*other.recursive_class_list_) - : std::nullopt), - map_(other.map_ ? std::optional(*other.map_) - : std::nullopt), - string_map_(other.string_map_ - ? std::optional(*other.string_map_) - : std::nullopt), - int_map_(other.int_map_ ? std::optional(*other.int_map_) + list_list_(other.list_list_ + ? std::optional(*other.list_list_) + : std::nullopt), + map_list_(other.map_list_ ? std::optional(*other.map_list_) : std::nullopt), - enum_map_(other.enum_map_ - ? std::optional(*other.enum_map_) + recursive_class_list_( + other.recursive_class_list_ + ? std::optional(*other.recursive_class_list_) + : std::nullopt), + map_(other.map_ ? std::optional(*other.map_) : std::nullopt), - object_map_(other.object_map_ - ? std::optional(*other.object_map_) - : std::nullopt), - list_map_(other.list_map_ - ? std::optional(*other.list_map_) + string_map_(other.string_map_ + ? std::optional(*other.string_map_) + : std::nullopt), + int_map_(other.int_map_ ? std::optional(*other.int_map_) + : std::nullopt), + enum_map_(other.enum_map_ ? std::optional(*other.enum_map_) + : std::nullopt), + object_map_(other.object_map_ + ? std::optional(*other.object_map_) : std::nullopt), - map_map_(other.map_map_ ? std::optional(*other.map_map_) + list_map_(other.list_map_ ? std::optional(*other.list_map_) : std::nullopt), - recursive_class_map_( - other.recursive_class_map_ - ? std::optional(*other.recursive_class_map_) - : std::nullopt) {} + map_map_(other.map_map_ ? std::optional(*other.map_map_) + : std::nullopt), + recursive_class_map_( + other.recursive_class_map_ + ? std::optional(*other.recursive_class_map_) + : std::nullopt) {} + +AllNullableTypes& AllNullableTypes::operator=(const AllNullableTypes& other) { + a_nullable_bool_ = other.a_nullable_bool_; + a_nullable_int_ = other.a_nullable_int_; + a_nullable_int64_ = other.a_nullable_int64_; + a_nullable_double_ = other.a_nullable_double_; + a_nullable_byte_array_ = other.a_nullable_byte_array_; + a_nullable4_byte_array_ = other.a_nullable4_byte_array_; + a_nullable8_byte_array_ = other.a_nullable8_byte_array_; + a_nullable_float_array_ = other.a_nullable_float_array_; + a_nullable_enum_ = other.a_nullable_enum_; + another_nullable_enum_ = other.another_nullable_enum_; + a_nullable_string_ = other.a_nullable_string_; + a_nullable_object_ = other.a_nullable_object_; + all_nullable_types_ = + other.all_nullable_types_ + ? std::make_unique(*other.all_nullable_types_) + : nullptr; + list_ = other.list_; + string_list_ = other.string_list_; + int_list_ = other.int_list_; + double_list_ = other.double_list_; + bool_list_ = other.bool_list_; + enum_list_ = other.enum_list_; + object_list_ = other.object_list_; + list_list_ = other.list_list_; + map_list_ = other.map_list_; + recursive_class_list_ = other.recursive_class_list_; + map_ = other.map_; + string_map_ = other.string_map_; + int_map_ = other.int_map_; + enum_map_ = other.enum_map_; + object_map_ = other.object_map_; + list_map_ = other.list_map_; + map_map_ = other.map_map_; + recursive_class_map_ = other.recursive_class_map_; + return *this; +} - AllNullableTypes& AllNullableTypes::operator=(const AllNullableTypes& other) { - a_nullable_bool_ = other.a_nullable_bool_; - a_nullable_int_ = other.a_nullable_int_; - a_nullable_int64_ = other.a_nullable_int64_; - a_nullable_double_ = other.a_nullable_double_; - a_nullable_byte_array_ = other.a_nullable_byte_array_; - a_nullable4_byte_array_ = other.a_nullable4_byte_array_; - a_nullable8_byte_array_ = other.a_nullable8_byte_array_; - a_nullable_float_array_ = other.a_nullable_float_array_; - a_nullable_enum_ = other.a_nullable_enum_; - another_nullable_enum_ = other.another_nullable_enum_; - a_nullable_string_ = other.a_nullable_string_; - a_nullable_object_ = other.a_nullable_object_; - all_nullable_types_ = - other.all_nullable_types_ - ? std::make_unique(*other.all_nullable_types_) - : nullptr; - list_ = other.list_; - string_list_ = other.string_list_; - int_list_ = other.int_list_; - double_list_ = other.double_list_; - bool_list_ = other.bool_list_; - enum_list_ = other.enum_list_; - object_list_ = other.object_list_; - list_list_ = other.list_list_; - map_list_ = other.map_list_; - recursive_class_list_ = other.recursive_class_list_; - map_ = other.map_; - string_map_ = other.string_map_; - int_map_ = other.int_map_; - enum_map_ = other.enum_map_; - object_map_ = other.object_map_; - list_map_ = other.list_map_; - map_map_ = other.map_map_; - recursive_class_map_ = other.recursive_class_map_; - return *this; - } +const bool* AllNullableTypes::a_nullable_bool() const { + return a_nullable_bool_ ? &(*a_nullable_bool_) : nullptr; +} - const bool* AllNullableTypes::a_nullable_bool() const { - return a_nullable_bool_ ? &(*a_nullable_bool_) : nullptr; - } +void AllNullableTypes::set_a_nullable_bool(const bool* value_arg) { + a_nullable_bool_ = value_arg ? std::optional(*value_arg) : std::nullopt; +} - void AllNullableTypes::set_a_nullable_bool(const bool* value_arg) { - a_nullable_bool_ = - value_arg ? std::optional(*value_arg) : std::nullopt; - } +void AllNullableTypes::set_a_nullable_bool(bool value_arg) { + a_nullable_bool_ = value_arg; +} - void AllNullableTypes::set_a_nullable_bool(bool value_arg) { - a_nullable_bool_ = value_arg; - } +const int64_t* AllNullableTypes::a_nullable_int() const { + return a_nullable_int_ ? &(*a_nullable_int_) : nullptr; +} - const int64_t* AllNullableTypes::a_nullable_int() const { - return a_nullable_int_ ? &(*a_nullable_int_) : nullptr; - } +void AllNullableTypes::set_a_nullable_int(const int64_t* value_arg) { + a_nullable_int_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} - void AllNullableTypes::set_a_nullable_int(const int64_t* value_arg) { - a_nullable_int_ = - value_arg ? std::optional(*value_arg) : std::nullopt; - } +void AllNullableTypes::set_a_nullable_int(int64_t value_arg) { + a_nullable_int_ = value_arg; +} - void AllNullableTypes::set_a_nullable_int(int64_t value_arg) { - a_nullable_int_ = value_arg; - } +const int64_t* AllNullableTypes::a_nullable_int64() const { + return a_nullable_int64_ ? &(*a_nullable_int64_) : nullptr; +} - const int64_t* AllNullableTypes::a_nullable_int64() const { - return a_nullable_int64_ ? &(*a_nullable_int64_) : nullptr; - } +void AllNullableTypes::set_a_nullable_int64(const int64_t* value_arg) { + a_nullable_int64_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} - void AllNullableTypes::set_a_nullable_int64(const int64_t* value_arg) { - a_nullable_int64_ = - value_arg ? std::optional(*value_arg) : std::nullopt; - } +void AllNullableTypes::set_a_nullable_int64(int64_t value_arg) { + a_nullable_int64_ = value_arg; +} - void AllNullableTypes::set_a_nullable_int64(int64_t value_arg) { - a_nullable_int64_ = value_arg; - } +const double* AllNullableTypes::a_nullable_double() const { + return a_nullable_double_ ? &(*a_nullable_double_) : nullptr; +} - const double* AllNullableTypes::a_nullable_double() const { - return a_nullable_double_ ? &(*a_nullable_double_) : nullptr; - } +void AllNullableTypes::set_a_nullable_double(const double* value_arg) { + a_nullable_double_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} - void AllNullableTypes::set_a_nullable_double(const double* value_arg) { - a_nullable_double_ = - value_arg ? std::optional(*value_arg) : std::nullopt; - } +void AllNullableTypes::set_a_nullable_double(double value_arg) { + a_nullable_double_ = value_arg; +} - void AllNullableTypes::set_a_nullable_double(double value_arg) { - a_nullable_double_ = value_arg; - } +const std::vector* AllNullableTypes::a_nullable_byte_array() const { + return a_nullable_byte_array_ ? &(*a_nullable_byte_array_) : nullptr; +} - const std::vector* AllNullableTypes::a_nullable_byte_array() const { - return a_nullable_byte_array_ ? &(*a_nullable_byte_array_) : nullptr; - } +void AllNullableTypes::set_a_nullable_byte_array( + const std::vector* value_arg) { + a_nullable_byte_array_ = value_arg + ? std::optional>(*value_arg) + : std::nullopt; +} - void AllNullableTypes::set_a_nullable_byte_array( - const std::vector* value_arg) { - a_nullable_byte_array_ = - value_arg ? std::optional>(*value_arg) - : std::nullopt; - } +void AllNullableTypes::set_a_nullable_byte_array( + const std::vector& value_arg) { + a_nullable_byte_array_ = value_arg; +} - void AllNullableTypes::set_a_nullable_byte_array( - const std::vector& value_arg) { - a_nullable_byte_array_ = value_arg; - } +const std::vector* AllNullableTypes::a_nullable4_byte_array() const { + return a_nullable4_byte_array_ ? &(*a_nullable4_byte_array_) : nullptr; +} - const std::vector* AllNullableTypes::a_nullable4_byte_array() const { - return a_nullable4_byte_array_ ? &(*a_nullable4_byte_array_) : nullptr; - } +void AllNullableTypes::set_a_nullable4_byte_array( + const std::vector* value_arg) { + a_nullable4_byte_array_ = + value_arg ? std::optional>(*value_arg) + : std::nullopt; +} - void AllNullableTypes::set_a_nullable4_byte_array( - const std::vector* value_arg) { - a_nullable4_byte_array_ = - value_arg ? std::optional>(*value_arg) - : std::nullopt; - } +void AllNullableTypes::set_a_nullable4_byte_array( + const std::vector& value_arg) { + a_nullable4_byte_array_ = value_arg; +} - void AllNullableTypes::set_a_nullable4_byte_array( - const std::vector& value_arg) { - a_nullable4_byte_array_ = value_arg; - } +const std::vector* AllNullableTypes::a_nullable8_byte_array() const { + return a_nullable8_byte_array_ ? &(*a_nullable8_byte_array_) : nullptr; +} - const std::vector* AllNullableTypes::a_nullable8_byte_array() const { - return a_nullable8_byte_array_ ? &(*a_nullable8_byte_array_) : nullptr; - } +void AllNullableTypes::set_a_nullable8_byte_array( + const std::vector* value_arg) { + a_nullable8_byte_array_ = + value_arg ? std::optional>(*value_arg) + : std::nullopt; +} - void AllNullableTypes::set_a_nullable8_byte_array( - const std::vector* value_arg) { - a_nullable8_byte_array_ = - value_arg ? std::optional>(*value_arg) - : std::nullopt; - } +void AllNullableTypes::set_a_nullable8_byte_array( + const std::vector& value_arg) { + a_nullable8_byte_array_ = value_arg; +} - void AllNullableTypes::set_a_nullable8_byte_array( - const std::vector& value_arg) { - a_nullable8_byte_array_ = value_arg; - } +const std::vector* AllNullableTypes::a_nullable_float_array() const { + return a_nullable_float_array_ ? &(*a_nullable_float_array_) : nullptr; +} - const std::vector* AllNullableTypes::a_nullable_float_array() const { - return a_nullable_float_array_ ? &(*a_nullable_float_array_) : nullptr; - } +void AllNullableTypes::set_a_nullable_float_array( + const std::vector* value_arg) { + a_nullable_float_array_ = + value_arg ? std::optional>(*value_arg) : std::nullopt; +} - void AllNullableTypes::set_a_nullable_float_array( - const std::vector* value_arg) { - a_nullable_float_array_ = - value_arg ? std::optional>(*value_arg) - : std::nullopt; - } +void AllNullableTypes::set_a_nullable_float_array( + const std::vector& value_arg) { + a_nullable_float_array_ = value_arg; +} - void AllNullableTypes::set_a_nullable_float_array( - const std::vector& value_arg) { - a_nullable_float_array_ = value_arg; - } +const AnEnum* AllNullableTypes::a_nullable_enum() const { + return a_nullable_enum_ ? &(*a_nullable_enum_) : nullptr; +} - const AnEnum* AllNullableTypes::a_nullable_enum() const { - return a_nullable_enum_ ? &(*a_nullable_enum_) : nullptr; - } +void AllNullableTypes::set_a_nullable_enum(const AnEnum* value_arg) { + a_nullable_enum_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} - void AllNullableTypes::set_a_nullable_enum(const AnEnum* value_arg) { - a_nullable_enum_ = - value_arg ? std::optional(*value_arg) : std::nullopt; - } +void AllNullableTypes::set_a_nullable_enum(const AnEnum& value_arg) { + a_nullable_enum_ = value_arg; +} - void AllNullableTypes::set_a_nullable_enum(const AnEnum& value_arg) { - a_nullable_enum_ = value_arg; - } +const AnotherEnum* AllNullableTypes::another_nullable_enum() const { + return another_nullable_enum_ ? &(*another_nullable_enum_) : nullptr; +} - const AnotherEnum* AllNullableTypes::another_nullable_enum() const { - return another_nullable_enum_ ? &(*another_nullable_enum_) : nullptr; - } +void AllNullableTypes::set_another_nullable_enum(const AnotherEnum* value_arg) { + another_nullable_enum_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} - void AllNullableTypes::set_another_nullable_enum( - const AnotherEnum* value_arg) { - another_nullable_enum_ = - value_arg ? std::optional(*value_arg) : std::nullopt; - } +void AllNullableTypes::set_another_nullable_enum(const AnotherEnum& value_arg) { + another_nullable_enum_ = value_arg; +} - void AllNullableTypes::set_another_nullable_enum( - const AnotherEnum& value_arg) { - another_nullable_enum_ = value_arg; - } +const std::string* AllNullableTypes::a_nullable_string() const { + return a_nullable_string_ ? &(*a_nullable_string_) : nullptr; +} - const std::string* AllNullableTypes::a_nullable_string() const { - return a_nullable_string_ ? &(*a_nullable_string_) : nullptr; - } +void AllNullableTypes::set_a_nullable_string( + const std::string_view* value_arg) { + a_nullable_string_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} - void AllNullableTypes::set_a_nullable_string( - const std::string_view* value_arg) { - a_nullable_string_ = - value_arg ? std::optional(*value_arg) : std::nullopt; - } +void AllNullableTypes::set_a_nullable_string(std::string_view value_arg) { + a_nullable_string_ = value_arg; +} - void AllNullableTypes::set_a_nullable_string(std::string_view value_arg) { - a_nullable_string_ = value_arg; - } +const EncodableValue* AllNullableTypes::a_nullable_object() const { + return a_nullable_object_ ? &(*a_nullable_object_) : nullptr; +} - const EncodableValue* AllNullableTypes::a_nullable_object() const { - return a_nullable_object_ ? &(*a_nullable_object_) : nullptr; - } +void AllNullableTypes::set_a_nullable_object(const EncodableValue* value_arg) { + a_nullable_object_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} - void AllNullableTypes::set_a_nullable_object( - const EncodableValue* value_arg) { - a_nullable_object_ = - value_arg ? std::optional(*value_arg) : std::nullopt; - } +void AllNullableTypes::set_a_nullable_object(const EncodableValue& value_arg) { + a_nullable_object_ = value_arg; +} - void AllNullableTypes::set_a_nullable_object( - const EncodableValue& value_arg) { - a_nullable_object_ = value_arg; - } +const AllNullableTypes* AllNullableTypes::all_nullable_types() const { + return all_nullable_types_.get(); +} - const AllNullableTypes* AllNullableTypes::all_nullable_types() const { - return all_nullable_types_.get(); - } +void AllNullableTypes::set_all_nullable_types( + const AllNullableTypes* value_arg) { + all_nullable_types_ = + value_arg ? std::make_unique(*value_arg) : nullptr; +} - void AllNullableTypes::set_all_nullable_types( - const AllNullableTypes* value_arg) { - all_nullable_types_ = - value_arg ? std::make_unique(*value_arg) : nullptr; - } +void AllNullableTypes::set_all_nullable_types( + const AllNullableTypes& value_arg) { + all_nullable_types_ = std::make_unique(value_arg); +} - void AllNullableTypes::set_all_nullable_types( - const AllNullableTypes& value_arg) { - all_nullable_types_ = std::make_unique(value_arg); - } +const EncodableList* AllNullableTypes::list() const { + return list_ ? &(*list_) : nullptr; +} - const EncodableList* AllNullableTypes::list() const { - return list_ ? &(*list_) : nullptr; - } +void AllNullableTypes::set_list(const EncodableList* value_arg) { + list_ = value_arg ? std::optional(*value_arg) : std::nullopt; +} - void AllNullableTypes::set_list(const EncodableList* value_arg) { - list_ = value_arg ? std::optional(*value_arg) : std::nullopt; - } +void AllNullableTypes::set_list(const EncodableList& value_arg) { + list_ = value_arg; +} - void AllNullableTypes::set_list(const EncodableList& value_arg) { - list_ = value_arg; - } +const EncodableList* AllNullableTypes::string_list() const { + return string_list_ ? &(*string_list_) : nullptr; +} - const EncodableList* AllNullableTypes::string_list() const { - return string_list_ ? &(*string_list_) : nullptr; - } +void AllNullableTypes::set_string_list(const EncodableList* value_arg) { + string_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} - void AllNullableTypes::set_string_list(const EncodableList* value_arg) { - string_list_ = - value_arg ? std::optional(*value_arg) : std::nullopt; - } +void AllNullableTypes::set_string_list(const EncodableList& value_arg) { + string_list_ = value_arg; +} - void AllNullableTypes::set_string_list(const EncodableList& value_arg) { - string_list_ = value_arg; - } +const EncodableList* AllNullableTypes::int_list() const { + return int_list_ ? &(*int_list_) : nullptr; +} - const EncodableList* AllNullableTypes::int_list() const { - return int_list_ ? &(*int_list_) : nullptr; - } +void AllNullableTypes::set_int_list(const EncodableList* value_arg) { + int_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} - void AllNullableTypes::set_int_list(const EncodableList* value_arg) { - int_list_ = - value_arg ? std::optional(*value_arg) : std::nullopt; - } +void AllNullableTypes::set_int_list(const EncodableList& value_arg) { + int_list_ = value_arg; +} - void AllNullableTypes::set_int_list(const EncodableList& value_arg) { - int_list_ = value_arg; - } +const EncodableList* AllNullableTypes::double_list() const { + return double_list_ ? &(*double_list_) : nullptr; +} - const EncodableList* AllNullableTypes::double_list() const { - return double_list_ ? &(*double_list_) : nullptr; - } +void AllNullableTypes::set_double_list(const EncodableList* value_arg) { + double_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} - void AllNullableTypes::set_double_list(const EncodableList* value_arg) { - double_list_ = - value_arg ? std::optional(*value_arg) : std::nullopt; - } +void AllNullableTypes::set_double_list(const EncodableList& value_arg) { + double_list_ = value_arg; +} - void AllNullableTypes::set_double_list(const EncodableList& value_arg) { - double_list_ = value_arg; - } +const EncodableList* AllNullableTypes::bool_list() const { + return bool_list_ ? &(*bool_list_) : nullptr; +} - const EncodableList* AllNullableTypes::bool_list() const { - return bool_list_ ? &(*bool_list_) : nullptr; - } +void AllNullableTypes::set_bool_list(const EncodableList* value_arg) { + bool_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} - void AllNullableTypes::set_bool_list(const EncodableList* value_arg) { - bool_list_ = - value_arg ? std::optional(*value_arg) : std::nullopt; - } +void AllNullableTypes::set_bool_list(const EncodableList& value_arg) { + bool_list_ = value_arg; +} - void AllNullableTypes::set_bool_list(const EncodableList& value_arg) { - bool_list_ = value_arg; - } +const EncodableList* AllNullableTypes::enum_list() const { + return enum_list_ ? &(*enum_list_) : nullptr; +} - const EncodableList* AllNullableTypes::enum_list() const { - return enum_list_ ? &(*enum_list_) : nullptr; - } +void AllNullableTypes::set_enum_list(const EncodableList* value_arg) { + enum_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} - void AllNullableTypes::set_enum_list(const EncodableList* value_arg) { - enum_list_ = - value_arg ? std::optional(*value_arg) : std::nullopt; - } +void AllNullableTypes::set_enum_list(const EncodableList& value_arg) { + enum_list_ = value_arg; +} - void AllNullableTypes::set_enum_list(const EncodableList& value_arg) { - enum_list_ = value_arg; - } +const EncodableList* AllNullableTypes::object_list() const { + return object_list_ ? &(*object_list_) : nullptr; +} - const EncodableList* AllNullableTypes::object_list() const { - return object_list_ ? &(*object_list_) : nullptr; - } +void AllNullableTypes::set_object_list(const EncodableList* value_arg) { + object_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} - void AllNullableTypes::set_object_list(const EncodableList* value_arg) { - object_list_ = - value_arg ? std::optional(*value_arg) : std::nullopt; - } +void AllNullableTypes::set_object_list(const EncodableList& value_arg) { + object_list_ = value_arg; +} - void AllNullableTypes::set_object_list(const EncodableList& value_arg) { - object_list_ = value_arg; - } +const EncodableList* AllNullableTypes::list_list() const { + return list_list_ ? &(*list_list_) : nullptr; +} - const EncodableList* AllNullableTypes::list_list() const { - return list_list_ ? &(*list_list_) : nullptr; - } +void AllNullableTypes::set_list_list(const EncodableList* value_arg) { + list_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} - void AllNullableTypes::set_list_list(const EncodableList* value_arg) { - list_list_ = - value_arg ? std::optional(*value_arg) : std::nullopt; - } +void AllNullableTypes::set_list_list(const EncodableList& value_arg) { + list_list_ = value_arg; +} - void AllNullableTypes::set_list_list(const EncodableList& value_arg) { - list_list_ = value_arg; - } +const EncodableList* AllNullableTypes::map_list() const { + return map_list_ ? &(*map_list_) : nullptr; +} - const EncodableList* AllNullableTypes::map_list() const { - return map_list_ ? &(*map_list_) : nullptr; - } +void AllNullableTypes::set_map_list(const EncodableList* value_arg) { + map_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} - void AllNullableTypes::set_map_list(const EncodableList* value_arg) { - map_list_ = - value_arg ? std::optional(*value_arg) : std::nullopt; - } +void AllNullableTypes::set_map_list(const EncodableList& value_arg) { + map_list_ = value_arg; +} - void AllNullableTypes::set_map_list(const EncodableList& value_arg) { - map_list_ = value_arg; - } +const EncodableList* AllNullableTypes::recursive_class_list() const { + return recursive_class_list_ ? &(*recursive_class_list_) : nullptr; +} - const EncodableList* AllNullableTypes::recursive_class_list() const { - return recursive_class_list_ ? &(*recursive_class_list_) : nullptr; - } +void AllNullableTypes::set_recursive_class_list( + const EncodableList* value_arg) { + recursive_class_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} - void AllNullableTypes::set_recursive_class_list( - const EncodableList* value_arg) { - recursive_class_list_ = - value_arg ? std::optional(*value_arg) : std::nullopt; - } +void AllNullableTypes::set_recursive_class_list( + const EncodableList& value_arg) { + recursive_class_list_ = value_arg; +} - void AllNullableTypes::set_recursive_class_list( - const EncodableList& value_arg) { - recursive_class_list_ = value_arg; - } +const EncodableMap* AllNullableTypes::map() const { + return map_ ? &(*map_) : nullptr; +} - const EncodableMap* AllNullableTypes::map() const { - return map_ ? &(*map_) : nullptr; - } +void AllNullableTypes::set_map(const EncodableMap* value_arg) { + map_ = value_arg ? std::optional(*value_arg) : std::nullopt; +} - void AllNullableTypes::set_map(const EncodableMap* value_arg) { - map_ = value_arg ? std::optional(*value_arg) : std::nullopt; - } +void AllNullableTypes::set_map(const EncodableMap& value_arg) { + map_ = value_arg; +} - void AllNullableTypes::set_map(const EncodableMap& value_arg) { - map_ = value_arg; - } +const EncodableMap* AllNullableTypes::string_map() const { + return string_map_ ? &(*string_map_) : nullptr; +} - const EncodableMap* AllNullableTypes::string_map() const { - return string_map_ ? &(*string_map_) : nullptr; - } +void AllNullableTypes::set_string_map(const EncodableMap* value_arg) { + string_map_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} - void AllNullableTypes::set_string_map(const EncodableMap* value_arg) { - string_map_ = - value_arg ? std::optional(*value_arg) : std::nullopt; +void AllNullableTypes::set_string_map(const EncodableMap& value_arg) { + string_map_ = value_arg; +} + +const EncodableMap* AllNullableTypes::int_map() const { + return int_map_ ? &(*int_map_) : nullptr; +} + +void AllNullableTypes::set_int_map(const EncodableMap* value_arg) { + int_map_ = value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypes::set_int_map(const EncodableMap& value_arg) { + int_map_ = value_arg; +} + +const EncodableMap* AllNullableTypes::enum_map() const { + return enum_map_ ? &(*enum_map_) : nullptr; +} + +void AllNullableTypes::set_enum_map(const EncodableMap* value_arg) { + enum_map_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypes::set_enum_map(const EncodableMap& value_arg) { + enum_map_ = value_arg; +} + +const EncodableMap* AllNullableTypes::object_map() const { + return object_map_ ? &(*object_map_) : nullptr; +} + +void AllNullableTypes::set_object_map(const EncodableMap* value_arg) { + object_map_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypes::set_object_map(const EncodableMap& value_arg) { + object_map_ = value_arg; +} + +const EncodableMap* AllNullableTypes::list_map() const { + return list_map_ ? &(*list_map_) : nullptr; +} + +void AllNullableTypes::set_list_map(const EncodableMap* value_arg) { + list_map_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypes::set_list_map(const EncodableMap& value_arg) { + list_map_ = value_arg; +} + +const EncodableMap* AllNullableTypes::map_map() const { + return map_map_ ? &(*map_map_) : nullptr; +} + +void AllNullableTypes::set_map_map(const EncodableMap* value_arg) { + map_map_ = value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypes::set_map_map(const EncodableMap& value_arg) { + map_map_ = value_arg; +} + +const EncodableMap* AllNullableTypes::recursive_class_map() const { + return recursive_class_map_ ? &(*recursive_class_map_) : nullptr; +} + +void AllNullableTypes::set_recursive_class_map(const EncodableMap* value_arg) { + recursive_class_map_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypes::set_recursive_class_map(const EncodableMap& value_arg) { + recursive_class_map_ = value_arg; +} + +EncodableList AllNullableTypes::ToEncodableList() const { + EncodableList list; + list.reserve(31); + list.push_back(a_nullable_bool_ ? EncodableValue(*a_nullable_bool_) + : EncodableValue()); + list.push_back(a_nullable_int_ ? EncodableValue(*a_nullable_int_) + : EncodableValue()); + list.push_back(a_nullable_int64_ ? EncodableValue(*a_nullable_int64_) + : EncodableValue()); + list.push_back(a_nullable_double_ ? EncodableValue(*a_nullable_double_) + : EncodableValue()); + list.push_back(a_nullable_byte_array_ + ? EncodableValue(*a_nullable_byte_array_) + : EncodableValue()); + list.push_back(a_nullable4_byte_array_ + ? EncodableValue(*a_nullable4_byte_array_) + : EncodableValue()); + list.push_back(a_nullable8_byte_array_ + ? EncodableValue(*a_nullable8_byte_array_) + : EncodableValue()); + list.push_back(a_nullable_float_array_ + ? EncodableValue(*a_nullable_float_array_) + : EncodableValue()); + list.push_back(a_nullable_enum_ ? CustomEncodableValue(*a_nullable_enum_) + : EncodableValue()); + list.push_back(another_nullable_enum_ + ? CustomEncodableValue(*another_nullable_enum_) + : EncodableValue()); + list.push_back(a_nullable_string_ ? EncodableValue(*a_nullable_string_) + : EncodableValue()); + list.push_back(a_nullable_object_ ? *a_nullable_object_ : EncodableValue()); + list.push_back(all_nullable_types_ + ? CustomEncodableValue(*all_nullable_types_) + : EncodableValue()); + list.push_back(list_ ? EncodableValue(*list_) : EncodableValue()); + list.push_back(string_list_ ? EncodableValue(*string_list_) + : EncodableValue()); + list.push_back(int_list_ ? EncodableValue(*int_list_) : EncodableValue()); + list.push_back(double_list_ ? EncodableValue(*double_list_) + : EncodableValue()); + list.push_back(bool_list_ ? EncodableValue(*bool_list_) : EncodableValue()); + list.push_back(enum_list_ ? EncodableValue(*enum_list_) : EncodableValue()); + list.push_back(object_list_ ? EncodableValue(*object_list_) + : EncodableValue()); + list.push_back(list_list_ ? EncodableValue(*list_list_) : EncodableValue()); + list.push_back(map_list_ ? EncodableValue(*map_list_) : EncodableValue()); + list.push_back(recursive_class_list_ ? EncodableValue(*recursive_class_list_) + : EncodableValue()); + list.push_back(map_ ? EncodableValue(*map_) : EncodableValue()); + list.push_back(string_map_ ? EncodableValue(*string_map_) : EncodableValue()); + list.push_back(int_map_ ? EncodableValue(*int_map_) : EncodableValue()); + list.push_back(enum_map_ ? EncodableValue(*enum_map_) : EncodableValue()); + list.push_back(object_map_ ? EncodableValue(*object_map_) : EncodableValue()); + list.push_back(list_map_ ? EncodableValue(*list_map_) : EncodableValue()); + list.push_back(map_map_ ? EncodableValue(*map_map_) : EncodableValue()); + list.push_back(recursive_class_map_ ? EncodableValue(*recursive_class_map_) + : EncodableValue()); + return list; +} + +AllNullableTypes AllNullableTypes::FromEncodableList( + const EncodableList& list) { + AllNullableTypes decoded; + auto& encodable_a_nullable_bool = list[0]; + if (!encodable_a_nullable_bool.IsNull()) { + decoded.set_a_nullable_bool(std::get(encodable_a_nullable_bool)); + } + auto& encodable_a_nullable_int = list[1]; + if (!encodable_a_nullable_int.IsNull()) { + decoded.set_a_nullable_int(std::get(encodable_a_nullable_int)); + } + auto& encodable_a_nullable_int64 = list[2]; + if (!encodable_a_nullable_int64.IsNull()) { + decoded.set_a_nullable_int64(std::get(encodable_a_nullable_int64)); + } + auto& encodable_a_nullable_double = list[3]; + if (!encodable_a_nullable_double.IsNull()) { + decoded.set_a_nullable_double( + std::get(encodable_a_nullable_double)); + } + auto& encodable_a_nullable_byte_array = list[4]; + if (!encodable_a_nullable_byte_array.IsNull()) { + decoded.set_a_nullable_byte_array( + std::get>(encodable_a_nullable_byte_array)); + } + auto& encodable_a_nullable4_byte_array = list[5]; + if (!encodable_a_nullable4_byte_array.IsNull()) { + decoded.set_a_nullable4_byte_array( + std::get>(encodable_a_nullable4_byte_array)); + } + auto& encodable_a_nullable8_byte_array = list[6]; + if (!encodable_a_nullable8_byte_array.IsNull()) { + decoded.set_a_nullable8_byte_array( + std::get>(encodable_a_nullable8_byte_array)); + } + auto& encodable_a_nullable_float_array = list[7]; + if (!encodable_a_nullable_float_array.IsNull()) { + decoded.set_a_nullable_float_array( + std::get>(encodable_a_nullable_float_array)); + } + auto& encodable_a_nullable_enum = list[8]; + if (!encodable_a_nullable_enum.IsNull()) { + decoded.set_a_nullable_enum(std::any_cast( + std::get(encodable_a_nullable_enum))); + } + auto& encodable_another_nullable_enum = list[9]; + if (!encodable_another_nullable_enum.IsNull()) { + decoded.set_another_nullable_enum(std::any_cast( + std::get(encodable_another_nullable_enum))); + } + auto& encodable_a_nullable_string = list[10]; + if (!encodable_a_nullable_string.IsNull()) { + decoded.set_a_nullable_string( + std::get(encodable_a_nullable_string)); + } + auto& encodable_a_nullable_object = list[11]; + if (!encodable_a_nullable_object.IsNull()) { + decoded.set_a_nullable_object(encodable_a_nullable_object); + } + auto& encodable_all_nullable_types = list[12]; + if (!encodable_all_nullable_types.IsNull()) { + decoded.set_all_nullable_types(std::any_cast( + std::get(encodable_all_nullable_types))); + } + auto& encodable_list = list[13]; + if (!encodable_list.IsNull()) { + decoded.set_list(std::get(encodable_list)); + } + auto& encodable_string_list = list[14]; + if (!encodable_string_list.IsNull()) { + decoded.set_string_list(std::get(encodable_string_list)); + } + auto& encodable_int_list = list[15]; + if (!encodable_int_list.IsNull()) { + decoded.set_int_list(std::get(encodable_int_list)); + } + auto& encodable_double_list = list[16]; + if (!encodable_double_list.IsNull()) { + decoded.set_double_list(std::get(encodable_double_list)); + } + auto& encodable_bool_list = list[17]; + if (!encodable_bool_list.IsNull()) { + decoded.set_bool_list(std::get(encodable_bool_list)); + } + auto& encodable_enum_list = list[18]; + if (!encodable_enum_list.IsNull()) { + decoded.set_enum_list(std::get(encodable_enum_list)); + } + auto& encodable_object_list = list[19]; + if (!encodable_object_list.IsNull()) { + decoded.set_object_list(std::get(encodable_object_list)); + } + auto& encodable_list_list = list[20]; + if (!encodable_list_list.IsNull()) { + decoded.set_list_list(std::get(encodable_list_list)); + } + auto& encodable_map_list = list[21]; + if (!encodable_map_list.IsNull()) { + decoded.set_map_list(std::get(encodable_map_list)); + } + auto& encodable_recursive_class_list = list[22]; + if (!encodable_recursive_class_list.IsNull()) { + decoded.set_recursive_class_list( + std::get(encodable_recursive_class_list)); + } + auto& encodable_map = list[23]; + if (!encodable_map.IsNull()) { + decoded.set_map(std::get(encodable_map)); + } + auto& encodable_string_map = list[24]; + if (!encodable_string_map.IsNull()) { + decoded.set_string_map(std::get(encodable_string_map)); + } + auto& encodable_int_map = list[25]; + if (!encodable_int_map.IsNull()) { + decoded.set_int_map(std::get(encodable_int_map)); + } + auto& encodable_enum_map = list[26]; + if (!encodable_enum_map.IsNull()) { + decoded.set_enum_map(std::get(encodable_enum_map)); + } + auto& encodable_object_map = list[27]; + if (!encodable_object_map.IsNull()) { + decoded.set_object_map(std::get(encodable_object_map)); + } + auto& encodable_list_map = list[28]; + if (!encodable_list_map.IsNull()) { + decoded.set_list_map(std::get(encodable_list_map)); + } + auto& encodable_map_map = list[29]; + if (!encodable_map_map.IsNull()) { + decoded.set_map_map(std::get(encodable_map_map)); + } + auto& encodable_recursive_class_map = list[30]; + if (!encodable_recursive_class_map.IsNull()) { + decoded.set_recursive_class_map( + std::get(encodable_recursive_class_map)); + } + return decoded; +} + +bool AllNullableTypes::operator==(const AllNullableTypes& other) const { + return PigeonInternalDeepEquals(a_nullable_bool_, other.a_nullable_bool_) && + PigeonInternalDeepEquals(a_nullable_int_, other.a_nullable_int_) && + PigeonInternalDeepEquals(a_nullable_int64_, other.a_nullable_int64_) && + PigeonInternalDeepEquals(a_nullable_double_, + other.a_nullable_double_) && + PigeonInternalDeepEquals(a_nullable_byte_array_, + other.a_nullable_byte_array_) && + PigeonInternalDeepEquals(a_nullable4_byte_array_, + other.a_nullable4_byte_array_) && + PigeonInternalDeepEquals(a_nullable8_byte_array_, + other.a_nullable8_byte_array_) && + PigeonInternalDeepEquals(a_nullable_float_array_, + other.a_nullable_float_array_) && + PigeonInternalDeepEquals(a_nullable_enum_, other.a_nullable_enum_) && + PigeonInternalDeepEquals(another_nullable_enum_, + other.another_nullable_enum_) && + PigeonInternalDeepEquals(a_nullable_string_, + other.a_nullable_string_) && + PigeonInternalDeepEquals(a_nullable_object_, + other.a_nullable_object_) && + PigeonInternalDeepEquals(all_nullable_types_, + other.all_nullable_types_) && + PigeonInternalDeepEquals(list_, other.list_) && + PigeonInternalDeepEquals(string_list_, other.string_list_) && + PigeonInternalDeepEquals(int_list_, other.int_list_) && + PigeonInternalDeepEquals(double_list_, other.double_list_) && + PigeonInternalDeepEquals(bool_list_, other.bool_list_) && + PigeonInternalDeepEquals(enum_list_, other.enum_list_) && + PigeonInternalDeepEquals(object_list_, other.object_list_) && + PigeonInternalDeepEquals(list_list_, other.list_list_) && + PigeonInternalDeepEquals(map_list_, other.map_list_) && + PigeonInternalDeepEquals(recursive_class_list_, + other.recursive_class_list_) && + PigeonInternalDeepEquals(map_, other.map_) && + PigeonInternalDeepEquals(string_map_, other.string_map_) && + PigeonInternalDeepEquals(int_map_, other.int_map_) && + PigeonInternalDeepEquals(enum_map_, other.enum_map_) && + PigeonInternalDeepEquals(object_map_, other.object_map_) && + PigeonInternalDeepEquals(list_map_, other.list_map_) && + PigeonInternalDeepEquals(map_map_, other.map_map_) && + PigeonInternalDeepEquals(recursive_class_map_, + other.recursive_class_map_); +} + +bool AllNullableTypes::operator!=(const AllNullableTypes& other) const { + return !(*this == other); +} + +size_t AllNullableTypes::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(a_nullable_bool_); + result = result * 31 + PigeonInternalDeepHash(a_nullable_int_); + result = result * 31 + PigeonInternalDeepHash(a_nullable_int64_); + result = result * 31 + PigeonInternalDeepHash(a_nullable_double_); + result = result * 31 + PigeonInternalDeepHash(a_nullable_byte_array_); + result = result * 31 + PigeonInternalDeepHash(a_nullable4_byte_array_); + result = result * 31 + PigeonInternalDeepHash(a_nullable8_byte_array_); + result = result * 31 + PigeonInternalDeepHash(a_nullable_float_array_); + result = result * 31 + PigeonInternalDeepHash(a_nullable_enum_); + result = result * 31 + PigeonInternalDeepHash(another_nullable_enum_); + result = result * 31 + PigeonInternalDeepHash(a_nullable_string_); + result = result * 31 + PigeonInternalDeepHash(a_nullable_object_); + result = result * 31 + PigeonInternalDeepHash(all_nullable_types_); + result = result * 31 + PigeonInternalDeepHash(list_); + result = result * 31 + PigeonInternalDeepHash(string_list_); + result = result * 31 + PigeonInternalDeepHash(int_list_); + result = result * 31 + PigeonInternalDeepHash(double_list_); + result = result * 31 + PigeonInternalDeepHash(bool_list_); + result = result * 31 + PigeonInternalDeepHash(enum_list_); + result = result * 31 + PigeonInternalDeepHash(object_list_); + result = result * 31 + PigeonInternalDeepHash(list_list_); + result = result * 31 + PigeonInternalDeepHash(map_list_); + result = result * 31 + PigeonInternalDeepHash(recursive_class_list_); + result = result * 31 + PigeonInternalDeepHash(map_); + result = result * 31 + PigeonInternalDeepHash(string_map_); + result = result * 31 + PigeonInternalDeepHash(int_map_); + result = result * 31 + PigeonInternalDeepHash(enum_map_); + result = result * 31 + PigeonInternalDeepHash(object_map_); + result = result * 31 + PigeonInternalDeepHash(list_map_); + result = result * 31 + PigeonInternalDeepHash(map_map_); + result = result * 31 + PigeonInternalDeepHash(recursive_class_map_); + return result; +} + +std::string AllNullableTypes::ToString() const { + std::stringstream ss; + ss << "AllNullableTypes("; + ss << "aNullableBool: "; + if (a_nullable_bool_.has_value()) { + ss << *a_nullable_bool_; + } else { + ss << "null"; + } + ss << ", aNullableInt: "; + if (a_nullable_int_.has_value()) { + ss << *a_nullable_int_; + } else { + ss << "null"; + } + ss << ", aNullableInt64: "; + if (a_nullable_int64_.has_value()) { + ss << *a_nullable_int64_; + } else { + ss << "null"; + } + ss << ", aNullableDouble: "; + if (a_nullable_double_.has_value()) { + ss << *a_nullable_double_; + } else { + ss << "null"; + } + ss << ", aNullableByteArray: "; + if (a_nullable_byte_array_.has_value()) { + ss << *a_nullable_byte_array_; + } else { + ss << "null"; + } + ss << ", aNullable4ByteArray: "; + if (a_nullable4_byte_array_.has_value()) { + ss << *a_nullable4_byte_array_; + } else { + ss << "null"; + } + ss << ", aNullable8ByteArray: "; + if (a_nullable8_byte_array_.has_value()) { + ss << *a_nullable8_byte_array_; + } else { + ss << "null"; + } + ss << ", aNullableFloatArray: "; + if (a_nullable_float_array_.has_value()) { + ss << *a_nullable_float_array_; + } else { + ss << "null"; + } + ss << ", aNullableEnum: "; + if (a_nullable_enum_.has_value()) { + ss << *a_nullable_enum_; + } else { + ss << "null"; + } + ss << ", anotherNullableEnum: "; + if (another_nullable_enum_.has_value()) { + ss << *another_nullable_enum_; + } else { + ss << "null"; + } + ss << ", aNullableString: "; + if (a_nullable_string_.has_value()) { + ss << *a_nullable_string_; + } else { + ss << "null"; + } + ss << ", aNullableObject: "; + if (a_nullable_object_.has_value()) { + ss << *a_nullable_object_; + } else { + ss << "null"; + } + ss << ", allNullableTypes: "; + if (all_nullable_types_.has_value()) { + ss << all_nullable_types_->ToString(); + } else { + ss << "null"; + } + ss << ", list: "; + if (list_.has_value()) { + ss << *list_; + } else { + ss << "null"; + } + ss << ", stringList: "; + if (string_list_.has_value()) { + ss << *string_list_; + } else { + ss << "null"; + } + ss << ", intList: "; + if (int_list_.has_value()) { + ss << *int_list_; + } else { + ss << "null"; + } + ss << ", doubleList: "; + if (double_list_.has_value()) { + ss << *double_list_; + } else { + ss << "null"; + } + ss << ", boolList: "; + if (bool_list_.has_value()) { + ss << *bool_list_; + } else { + ss << "null"; + } + ss << ", enumList: "; + if (enum_list_.has_value()) { + ss << *enum_list_; + } else { + ss << "null"; + } + ss << ", objectList: "; + if (object_list_.has_value()) { + ss << *object_list_; + } else { + ss << "null"; + } + ss << ", listList: "; + if (list_list_.has_value()) { + ss << *list_list_; + } else { + ss << "null"; + } + ss << ", mapList: "; + if (map_list_.has_value()) { + ss << *map_list_; + } else { + ss << "null"; + } + ss << ", recursiveClassList: "; + if (recursive_class_list_.has_value()) { + ss << *recursive_class_list_; + } else { + ss << "null"; + } + ss << ", map: "; + if (map_.has_value()) { + ss << *map_; + } else { + ss << "null"; + } + ss << ", stringMap: "; + if (string_map_.has_value()) { + ss << *string_map_; + } else { + ss << "null"; + } + ss << ", intMap: "; + if (int_map_.has_value()) { + ss << *int_map_; + } else { + ss << "null"; + } + ss << ", enumMap: "; + if (enum_map_.has_value()) { + ss << *enum_map_; + } else { + ss << "null"; + } + ss << ", objectMap: "; + if (object_map_.has_value()) { + ss << *object_map_; + } else { + ss << "null"; + } + ss << ", listMap: "; + if (list_map_.has_value()) { + ss << *list_map_; + } else { + ss << "null"; + } + ss << ", mapMap: "; + if (map_map_.has_value()) { + ss << *map_map_; + } else { + ss << "null"; + } + ss << ", recursiveClassMap: "; + if (recursive_class_map_.has_value()) { + ss << *recursive_class_map_; + } else { + ss << "null"; + } + ss << ")"; + return ss.str(); +} + +size_t PigeonInternalDeepHash(const AllNullableTypes& v) { return v.Hash(); } + +// AllNullableTypesWithoutRecursion + +AllNullableTypesWithoutRecursion::AllNullableTypesWithoutRecursion() {} + +AllNullableTypesWithoutRecursion::AllNullableTypesWithoutRecursion( + const bool* a_nullable_bool, const int64_t* a_nullable_int, + const int64_t* a_nullable_int64, const double* a_nullable_double, + const std::vector* a_nullable_byte_array, + const std::vector* a_nullable4_byte_array, + const std::vector* a_nullable8_byte_array, + const std::vector* a_nullable_float_array, + const AnEnum* a_nullable_enum, const AnotherEnum* another_nullable_enum, + const std::string* a_nullable_string, + const EncodableValue* a_nullable_object, const EncodableList* list, + const EncodableList* string_list, const EncodableList* int_list, + const EncodableList* double_list, const EncodableList* bool_list, + const EncodableList* enum_list, const EncodableList* object_list, + const EncodableList* list_list, const EncodableList* map_list, + const EncodableMap* map, const EncodableMap* string_map, + const EncodableMap* int_map, const EncodableMap* enum_map, + const EncodableMap* object_map, const EncodableMap* list_map, + const EncodableMap* map_map) + : a_nullable_bool_(a_nullable_bool ? std::optional(*a_nullable_bool) + : std::nullopt), + a_nullable_int_(a_nullable_int ? std::optional(*a_nullable_int) + : std::nullopt), + a_nullable_int64_(a_nullable_int64 + ? std::optional(*a_nullable_int64) + : std::nullopt), + a_nullable_double_(a_nullable_double + ? std::optional(*a_nullable_double) + : std::nullopt), + a_nullable_byte_array_( + a_nullable_byte_array + ? std::optional>(*a_nullable_byte_array) + : std::nullopt), + a_nullable4_byte_array_( + a_nullable4_byte_array + ? std::optional>(*a_nullable4_byte_array) + : std::nullopt), + a_nullable8_byte_array_( + a_nullable8_byte_array + ? std::optional>(*a_nullable8_byte_array) + : std::nullopt), + a_nullable_float_array_( + a_nullable_float_array + ? std::optional>(*a_nullable_float_array) + : std::nullopt), + a_nullable_enum_(a_nullable_enum ? std::optional(*a_nullable_enum) + : std::nullopt), + another_nullable_enum_(another_nullable_enum ? std::optional( + *another_nullable_enum) + : std::nullopt), + a_nullable_string_(a_nullable_string + ? std::optional(*a_nullable_string) + : std::nullopt), + a_nullable_object_(a_nullable_object + ? std::optional(*a_nullable_object) + : std::nullopt), + list_(list ? std::optional(*list) : std::nullopt), + string_list_(string_list ? std::optional(*string_list) + : std::nullopt), + int_list_(int_list ? std::optional(*int_list) + : std::nullopt), + double_list_(double_list ? std::optional(*double_list) + : std::nullopt), + bool_list_(bool_list ? std::optional(*bool_list) + : std::nullopt), + enum_list_(enum_list ? std::optional(*enum_list) + : std::nullopt), + object_list_(object_list ? std::optional(*object_list) + : std::nullopt), + list_list_(list_list ? std::optional(*list_list) + : std::nullopt), + map_list_(map_list ? std::optional(*map_list) + : std::nullopt), + map_(map ? std::optional(*map) : std::nullopt), + string_map_(string_map ? std::optional(*string_map) + : std::nullopt), + int_map_(int_map ? std::optional(*int_map) : std::nullopt), + enum_map_(enum_map ? std::optional(*enum_map) + : std::nullopt), + object_map_(object_map ? std::optional(*object_map) + : std::nullopt), + list_map_(list_map ? std::optional(*list_map) + : std::nullopt), + map_map_(map_map ? std::optional(*map_map) : std::nullopt) { +} + +const bool* AllNullableTypesWithoutRecursion::a_nullable_bool() const { + return a_nullable_bool_ ? &(*a_nullable_bool_) : nullptr; +} + +void AllNullableTypesWithoutRecursion::set_a_nullable_bool( + const bool* value_arg) { + a_nullable_bool_ = value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypesWithoutRecursion::set_a_nullable_bool(bool value_arg) { + a_nullable_bool_ = value_arg; +} + +const int64_t* AllNullableTypesWithoutRecursion::a_nullable_int() const { + return a_nullable_int_ ? &(*a_nullable_int_) : nullptr; +} + +void AllNullableTypesWithoutRecursion::set_a_nullable_int( + const int64_t* value_arg) { + a_nullable_int_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypesWithoutRecursion::set_a_nullable_int(int64_t value_arg) { + a_nullable_int_ = value_arg; +} + +const int64_t* AllNullableTypesWithoutRecursion::a_nullable_int64() const { + return a_nullable_int64_ ? &(*a_nullable_int64_) : nullptr; +} + +void AllNullableTypesWithoutRecursion::set_a_nullable_int64( + const int64_t* value_arg) { + a_nullable_int64_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypesWithoutRecursion::set_a_nullable_int64(int64_t value_arg) { + a_nullable_int64_ = value_arg; +} + +const double* AllNullableTypesWithoutRecursion::a_nullable_double() const { + return a_nullable_double_ ? &(*a_nullable_double_) : nullptr; +} + +void AllNullableTypesWithoutRecursion::set_a_nullable_double( + const double* value_arg) { + a_nullable_double_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypesWithoutRecursion::set_a_nullable_double(double value_arg) { + a_nullable_double_ = value_arg; +} + +const std::vector* +AllNullableTypesWithoutRecursion::a_nullable_byte_array() const { + return a_nullable_byte_array_ ? &(*a_nullable_byte_array_) : nullptr; +} + +void AllNullableTypesWithoutRecursion::set_a_nullable_byte_array( + const std::vector* value_arg) { + a_nullable_byte_array_ = value_arg + ? std::optional>(*value_arg) + : std::nullopt; +} + +void AllNullableTypesWithoutRecursion::set_a_nullable_byte_array( + const std::vector& value_arg) { + a_nullable_byte_array_ = value_arg; +} + +const std::vector* +AllNullableTypesWithoutRecursion::a_nullable4_byte_array() const { + return a_nullable4_byte_array_ ? &(*a_nullable4_byte_array_) : nullptr; +} + +void AllNullableTypesWithoutRecursion::set_a_nullable4_byte_array( + const std::vector* value_arg) { + a_nullable4_byte_array_ = + value_arg ? std::optional>(*value_arg) + : std::nullopt; +} + +void AllNullableTypesWithoutRecursion::set_a_nullable4_byte_array( + const std::vector& value_arg) { + a_nullable4_byte_array_ = value_arg; +} + +const std::vector* +AllNullableTypesWithoutRecursion::a_nullable8_byte_array() const { + return a_nullable8_byte_array_ ? &(*a_nullable8_byte_array_) : nullptr; +} + +void AllNullableTypesWithoutRecursion::set_a_nullable8_byte_array( + const std::vector* value_arg) { + a_nullable8_byte_array_ = + value_arg ? std::optional>(*value_arg) + : std::nullopt; +} + +void AllNullableTypesWithoutRecursion::set_a_nullable8_byte_array( + const std::vector& value_arg) { + a_nullable8_byte_array_ = value_arg; +} + +const std::vector* +AllNullableTypesWithoutRecursion::a_nullable_float_array() const { + return a_nullable_float_array_ ? &(*a_nullable_float_array_) : nullptr; +} + +void AllNullableTypesWithoutRecursion::set_a_nullable_float_array( + const std::vector* value_arg) { + a_nullable_float_array_ = + value_arg ? std::optional>(*value_arg) : std::nullopt; +} + +void AllNullableTypesWithoutRecursion::set_a_nullable_float_array( + const std::vector& value_arg) { + a_nullable_float_array_ = value_arg; +} + +const AnEnum* AllNullableTypesWithoutRecursion::a_nullable_enum() const { + return a_nullable_enum_ ? &(*a_nullable_enum_) : nullptr; +} + +void AllNullableTypesWithoutRecursion::set_a_nullable_enum( + const AnEnum* value_arg) { + a_nullable_enum_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypesWithoutRecursion::set_a_nullable_enum( + const AnEnum& value_arg) { + a_nullable_enum_ = value_arg; +} + +const AnotherEnum* AllNullableTypesWithoutRecursion::another_nullable_enum() + const { + return another_nullable_enum_ ? &(*another_nullable_enum_) : nullptr; +} + +void AllNullableTypesWithoutRecursion::set_another_nullable_enum( + const AnotherEnum* value_arg) { + another_nullable_enum_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypesWithoutRecursion::set_another_nullable_enum( + const AnotherEnum& value_arg) { + another_nullable_enum_ = value_arg; +} + +const std::string* AllNullableTypesWithoutRecursion::a_nullable_string() const { + return a_nullable_string_ ? &(*a_nullable_string_) : nullptr; +} + +void AllNullableTypesWithoutRecursion::set_a_nullable_string( + const std::string_view* value_arg) { + a_nullable_string_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypesWithoutRecursion::set_a_nullable_string( + std::string_view value_arg) { + a_nullable_string_ = value_arg; +} + +const EncodableValue* AllNullableTypesWithoutRecursion::a_nullable_object() + const { + return a_nullable_object_ ? &(*a_nullable_object_) : nullptr; +} + +void AllNullableTypesWithoutRecursion::set_a_nullable_object( + const EncodableValue* value_arg) { + a_nullable_object_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypesWithoutRecursion::set_a_nullable_object( + const EncodableValue& value_arg) { + a_nullable_object_ = value_arg; +} + +const EncodableList* AllNullableTypesWithoutRecursion::list() const { + return list_ ? &(*list_) : nullptr; +} + +void AllNullableTypesWithoutRecursion::set_list( + const EncodableList* value_arg) { + list_ = value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypesWithoutRecursion::set_list( + const EncodableList& value_arg) { + list_ = value_arg; +} + +const EncodableList* AllNullableTypesWithoutRecursion::string_list() const { + return string_list_ ? &(*string_list_) : nullptr; +} + +void AllNullableTypesWithoutRecursion::set_string_list( + const EncodableList* value_arg) { + string_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypesWithoutRecursion::set_string_list( + const EncodableList& value_arg) { + string_list_ = value_arg; +} + +const EncodableList* AllNullableTypesWithoutRecursion::int_list() const { + return int_list_ ? &(*int_list_) : nullptr; +} + +void AllNullableTypesWithoutRecursion::set_int_list( + const EncodableList* value_arg) { + int_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypesWithoutRecursion::set_int_list( + const EncodableList& value_arg) { + int_list_ = value_arg; +} + +const EncodableList* AllNullableTypesWithoutRecursion::double_list() const { + return double_list_ ? &(*double_list_) : nullptr; +} + +void AllNullableTypesWithoutRecursion::set_double_list( + const EncodableList* value_arg) { + double_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypesWithoutRecursion::set_double_list( + const EncodableList& value_arg) { + double_list_ = value_arg; +} + +const EncodableList* AllNullableTypesWithoutRecursion::bool_list() const { + return bool_list_ ? &(*bool_list_) : nullptr; +} + +void AllNullableTypesWithoutRecursion::set_bool_list( + const EncodableList* value_arg) { + bool_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypesWithoutRecursion::set_bool_list( + const EncodableList& value_arg) { + bool_list_ = value_arg; +} + +const EncodableList* AllNullableTypesWithoutRecursion::enum_list() const { + return enum_list_ ? &(*enum_list_) : nullptr; +} + +void AllNullableTypesWithoutRecursion::set_enum_list( + const EncodableList* value_arg) { + enum_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypesWithoutRecursion::set_enum_list( + const EncodableList& value_arg) { + enum_list_ = value_arg; +} + +const EncodableList* AllNullableTypesWithoutRecursion::object_list() const { + return object_list_ ? &(*object_list_) : nullptr; +} + +void AllNullableTypesWithoutRecursion::set_object_list( + const EncodableList* value_arg) { + object_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypesWithoutRecursion::set_object_list( + const EncodableList& value_arg) { + object_list_ = value_arg; +} + +const EncodableList* AllNullableTypesWithoutRecursion::list_list() const { + return list_list_ ? &(*list_list_) : nullptr; +} + +void AllNullableTypesWithoutRecursion::set_list_list( + const EncodableList* value_arg) { + list_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypesWithoutRecursion::set_list_list( + const EncodableList& value_arg) { + list_list_ = value_arg; +} + +const EncodableList* AllNullableTypesWithoutRecursion::map_list() const { + return map_list_ ? &(*map_list_) : nullptr; +} + +void AllNullableTypesWithoutRecursion::set_map_list( + const EncodableList* value_arg) { + map_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypesWithoutRecursion::set_map_list( + const EncodableList& value_arg) { + map_list_ = value_arg; +} + +const EncodableMap* AllNullableTypesWithoutRecursion::map() const { + return map_ ? &(*map_) : nullptr; +} + +void AllNullableTypesWithoutRecursion::set_map(const EncodableMap* value_arg) { + map_ = value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypesWithoutRecursion::set_map(const EncodableMap& value_arg) { + map_ = value_arg; +} + +const EncodableMap* AllNullableTypesWithoutRecursion::string_map() const { + return string_map_ ? &(*string_map_) : nullptr; +} + +void AllNullableTypesWithoutRecursion::set_string_map( + const EncodableMap* value_arg) { + string_map_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypesWithoutRecursion::set_string_map( + const EncodableMap& value_arg) { + string_map_ = value_arg; +} + +const EncodableMap* AllNullableTypesWithoutRecursion::int_map() const { + return int_map_ ? &(*int_map_) : nullptr; +} + +void AllNullableTypesWithoutRecursion::set_int_map( + const EncodableMap* value_arg) { + int_map_ = value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypesWithoutRecursion::set_int_map( + const EncodableMap& value_arg) { + int_map_ = value_arg; +} + +const EncodableMap* AllNullableTypesWithoutRecursion::enum_map() const { + return enum_map_ ? &(*enum_map_) : nullptr; +} + +void AllNullableTypesWithoutRecursion::set_enum_map( + const EncodableMap* value_arg) { + enum_map_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypesWithoutRecursion::set_enum_map( + const EncodableMap& value_arg) { + enum_map_ = value_arg; +} + +const EncodableMap* AllNullableTypesWithoutRecursion::object_map() const { + return object_map_ ? &(*object_map_) : nullptr; +} + +void AllNullableTypesWithoutRecursion::set_object_map( + const EncodableMap* value_arg) { + object_map_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypesWithoutRecursion::set_object_map( + const EncodableMap& value_arg) { + object_map_ = value_arg; +} + +const EncodableMap* AllNullableTypesWithoutRecursion::list_map() const { + return list_map_ ? &(*list_map_) : nullptr; +} + +void AllNullableTypesWithoutRecursion::set_list_map( + const EncodableMap* value_arg) { + list_map_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypesWithoutRecursion::set_list_map( + const EncodableMap& value_arg) { + list_map_ = value_arg; +} + +const EncodableMap* AllNullableTypesWithoutRecursion::map_map() const { + return map_map_ ? &(*map_map_) : nullptr; +} + +void AllNullableTypesWithoutRecursion::set_map_map( + const EncodableMap* value_arg) { + map_map_ = value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypesWithoutRecursion::set_map_map( + const EncodableMap& value_arg) { + map_map_ = value_arg; +} + +EncodableList AllNullableTypesWithoutRecursion::ToEncodableList() const { + EncodableList list; + list.reserve(28); + list.push_back(a_nullable_bool_ ? EncodableValue(*a_nullable_bool_) + : EncodableValue()); + list.push_back(a_nullable_int_ ? EncodableValue(*a_nullable_int_) + : EncodableValue()); + list.push_back(a_nullable_int64_ ? EncodableValue(*a_nullable_int64_) + : EncodableValue()); + list.push_back(a_nullable_double_ ? EncodableValue(*a_nullable_double_) + : EncodableValue()); + list.push_back(a_nullable_byte_array_ + ? EncodableValue(*a_nullable_byte_array_) + : EncodableValue()); + list.push_back(a_nullable4_byte_array_ + ? EncodableValue(*a_nullable4_byte_array_) + : EncodableValue()); + list.push_back(a_nullable8_byte_array_ + ? EncodableValue(*a_nullable8_byte_array_) + : EncodableValue()); + list.push_back(a_nullable_float_array_ + ? EncodableValue(*a_nullable_float_array_) + : EncodableValue()); + list.push_back(a_nullable_enum_ ? CustomEncodableValue(*a_nullable_enum_) + : EncodableValue()); + list.push_back(another_nullable_enum_ + ? CustomEncodableValue(*another_nullable_enum_) + : EncodableValue()); + list.push_back(a_nullable_string_ ? EncodableValue(*a_nullable_string_) + : EncodableValue()); + list.push_back(a_nullable_object_ ? *a_nullable_object_ : EncodableValue()); + list.push_back(list_ ? EncodableValue(*list_) : EncodableValue()); + list.push_back(string_list_ ? EncodableValue(*string_list_) + : EncodableValue()); + list.push_back(int_list_ ? EncodableValue(*int_list_) : EncodableValue()); + list.push_back(double_list_ ? EncodableValue(*double_list_) + : EncodableValue()); + list.push_back(bool_list_ ? EncodableValue(*bool_list_) : EncodableValue()); + list.push_back(enum_list_ ? EncodableValue(*enum_list_) : EncodableValue()); + list.push_back(object_list_ ? EncodableValue(*object_list_) + : EncodableValue()); + list.push_back(list_list_ ? EncodableValue(*list_list_) : EncodableValue()); + list.push_back(map_list_ ? EncodableValue(*map_list_) : EncodableValue()); + list.push_back(map_ ? EncodableValue(*map_) : EncodableValue()); + list.push_back(string_map_ ? EncodableValue(*string_map_) : EncodableValue()); + list.push_back(int_map_ ? EncodableValue(*int_map_) : EncodableValue()); + list.push_back(enum_map_ ? EncodableValue(*enum_map_) : EncodableValue()); + list.push_back(object_map_ ? EncodableValue(*object_map_) : EncodableValue()); + list.push_back(list_map_ ? EncodableValue(*list_map_) : EncodableValue()); + list.push_back(map_map_ ? EncodableValue(*map_map_) : EncodableValue()); + return list; +} + +AllNullableTypesWithoutRecursion +AllNullableTypesWithoutRecursion::FromEncodableList(const EncodableList& list) { + AllNullableTypesWithoutRecursion decoded; + auto& encodable_a_nullable_bool = list[0]; + if (!encodable_a_nullable_bool.IsNull()) { + decoded.set_a_nullable_bool(std::get(encodable_a_nullable_bool)); + } + auto& encodable_a_nullable_int = list[1]; + if (!encodable_a_nullable_int.IsNull()) { + decoded.set_a_nullable_int(std::get(encodable_a_nullable_int)); + } + auto& encodable_a_nullable_int64 = list[2]; + if (!encodable_a_nullable_int64.IsNull()) { + decoded.set_a_nullable_int64(std::get(encodable_a_nullable_int64)); + } + auto& encodable_a_nullable_double = list[3]; + if (!encodable_a_nullable_double.IsNull()) { + decoded.set_a_nullable_double( + std::get(encodable_a_nullable_double)); + } + auto& encodable_a_nullable_byte_array = list[4]; + if (!encodable_a_nullable_byte_array.IsNull()) { + decoded.set_a_nullable_byte_array( + std::get>(encodable_a_nullable_byte_array)); + } + auto& encodable_a_nullable4_byte_array = list[5]; + if (!encodable_a_nullable4_byte_array.IsNull()) { + decoded.set_a_nullable4_byte_array( + std::get>(encodable_a_nullable4_byte_array)); + } + auto& encodable_a_nullable8_byte_array = list[6]; + if (!encodable_a_nullable8_byte_array.IsNull()) { + decoded.set_a_nullable8_byte_array( + std::get>(encodable_a_nullable8_byte_array)); + } + auto& encodable_a_nullable_float_array = list[7]; + if (!encodable_a_nullable_float_array.IsNull()) { + decoded.set_a_nullable_float_array( + std::get>(encodable_a_nullable_float_array)); + } + auto& encodable_a_nullable_enum = list[8]; + if (!encodable_a_nullable_enum.IsNull()) { + decoded.set_a_nullable_enum(std::any_cast( + std::get(encodable_a_nullable_enum))); + } + auto& encodable_another_nullable_enum = list[9]; + if (!encodable_another_nullable_enum.IsNull()) { + decoded.set_another_nullable_enum(std::any_cast( + std::get(encodable_another_nullable_enum))); + } + auto& encodable_a_nullable_string = list[10]; + if (!encodable_a_nullable_string.IsNull()) { + decoded.set_a_nullable_string( + std::get(encodable_a_nullable_string)); + } + auto& encodable_a_nullable_object = list[11]; + if (!encodable_a_nullable_object.IsNull()) { + decoded.set_a_nullable_object(encodable_a_nullable_object); + } + auto& encodable_list = list[12]; + if (!encodable_list.IsNull()) { + decoded.set_list(std::get(encodable_list)); + } + auto& encodable_string_list = list[13]; + if (!encodable_string_list.IsNull()) { + decoded.set_string_list(std::get(encodable_string_list)); + } + auto& encodable_int_list = list[14]; + if (!encodable_int_list.IsNull()) { + decoded.set_int_list(std::get(encodable_int_list)); + } + auto& encodable_double_list = list[15]; + if (!encodable_double_list.IsNull()) { + decoded.set_double_list(std::get(encodable_double_list)); + } + auto& encodable_bool_list = list[16]; + if (!encodable_bool_list.IsNull()) { + decoded.set_bool_list(std::get(encodable_bool_list)); + } + auto& encodable_enum_list = list[17]; + if (!encodable_enum_list.IsNull()) { + decoded.set_enum_list(std::get(encodable_enum_list)); + } + auto& encodable_object_list = list[18]; + if (!encodable_object_list.IsNull()) { + decoded.set_object_list(std::get(encodable_object_list)); + } + auto& encodable_list_list = list[19]; + if (!encodable_list_list.IsNull()) { + decoded.set_list_list(std::get(encodable_list_list)); + } + auto& encodable_map_list = list[20]; + if (!encodable_map_list.IsNull()) { + decoded.set_map_list(std::get(encodable_map_list)); + } + auto& encodable_map = list[21]; + if (!encodable_map.IsNull()) { + decoded.set_map(std::get(encodable_map)); + } + auto& encodable_string_map = list[22]; + if (!encodable_string_map.IsNull()) { + decoded.set_string_map(std::get(encodable_string_map)); + } + auto& encodable_int_map = list[23]; + if (!encodable_int_map.IsNull()) { + decoded.set_int_map(std::get(encodable_int_map)); + } + auto& encodable_enum_map = list[24]; + if (!encodable_enum_map.IsNull()) { + decoded.set_enum_map(std::get(encodable_enum_map)); + } + auto& encodable_object_map = list[25]; + if (!encodable_object_map.IsNull()) { + decoded.set_object_map(std::get(encodable_object_map)); + } + auto& encodable_list_map = list[26]; + if (!encodable_list_map.IsNull()) { + decoded.set_list_map(std::get(encodable_list_map)); + } + auto& encodable_map_map = list[27]; + if (!encodable_map_map.IsNull()) { + decoded.set_map_map(std::get(encodable_map_map)); + } + return decoded; +} + +bool AllNullableTypesWithoutRecursion::operator==( + const AllNullableTypesWithoutRecursion& other) const { + return PigeonInternalDeepEquals(a_nullable_bool_, other.a_nullable_bool_) && + PigeonInternalDeepEquals(a_nullable_int_, other.a_nullable_int_) && + PigeonInternalDeepEquals(a_nullable_int64_, other.a_nullable_int64_) && + PigeonInternalDeepEquals(a_nullable_double_, + other.a_nullable_double_) && + PigeonInternalDeepEquals(a_nullable_byte_array_, + other.a_nullable_byte_array_) && + PigeonInternalDeepEquals(a_nullable4_byte_array_, + other.a_nullable4_byte_array_) && + PigeonInternalDeepEquals(a_nullable8_byte_array_, + other.a_nullable8_byte_array_) && + PigeonInternalDeepEquals(a_nullable_float_array_, + other.a_nullable_float_array_) && + PigeonInternalDeepEquals(a_nullable_enum_, other.a_nullable_enum_) && + PigeonInternalDeepEquals(another_nullable_enum_, + other.another_nullable_enum_) && + PigeonInternalDeepEquals(a_nullable_string_, + other.a_nullable_string_) && + PigeonInternalDeepEquals(a_nullable_object_, + other.a_nullable_object_) && + PigeonInternalDeepEquals(list_, other.list_) && + PigeonInternalDeepEquals(string_list_, other.string_list_) && + PigeonInternalDeepEquals(int_list_, other.int_list_) && + PigeonInternalDeepEquals(double_list_, other.double_list_) && + PigeonInternalDeepEquals(bool_list_, other.bool_list_) && + PigeonInternalDeepEquals(enum_list_, other.enum_list_) && + PigeonInternalDeepEquals(object_list_, other.object_list_) && + PigeonInternalDeepEquals(list_list_, other.list_list_) && + PigeonInternalDeepEquals(map_list_, other.map_list_) && + PigeonInternalDeepEquals(map_, other.map_) && + PigeonInternalDeepEquals(string_map_, other.string_map_) && + PigeonInternalDeepEquals(int_map_, other.int_map_) && + PigeonInternalDeepEquals(enum_map_, other.enum_map_) && + PigeonInternalDeepEquals(object_map_, other.object_map_) && + PigeonInternalDeepEquals(list_map_, other.list_map_) && + PigeonInternalDeepEquals(map_map_, other.map_map_); +} + +bool AllNullableTypesWithoutRecursion::operator!=( + const AllNullableTypesWithoutRecursion& other) const { + return !(*this == other); +} + +size_t AllNullableTypesWithoutRecursion::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(a_nullable_bool_); + result = result * 31 + PigeonInternalDeepHash(a_nullable_int_); + result = result * 31 + PigeonInternalDeepHash(a_nullable_int64_); + result = result * 31 + PigeonInternalDeepHash(a_nullable_double_); + result = result * 31 + PigeonInternalDeepHash(a_nullable_byte_array_); + result = result * 31 + PigeonInternalDeepHash(a_nullable4_byte_array_); + result = result * 31 + PigeonInternalDeepHash(a_nullable8_byte_array_); + result = result * 31 + PigeonInternalDeepHash(a_nullable_float_array_); + result = result * 31 + PigeonInternalDeepHash(a_nullable_enum_); + result = result * 31 + PigeonInternalDeepHash(another_nullable_enum_); + result = result * 31 + PigeonInternalDeepHash(a_nullable_string_); + result = result * 31 + PigeonInternalDeepHash(a_nullable_object_); + result = result * 31 + PigeonInternalDeepHash(list_); + result = result * 31 + PigeonInternalDeepHash(string_list_); + result = result * 31 + PigeonInternalDeepHash(int_list_); + result = result * 31 + PigeonInternalDeepHash(double_list_); + result = result * 31 + PigeonInternalDeepHash(bool_list_); + result = result * 31 + PigeonInternalDeepHash(enum_list_); + result = result * 31 + PigeonInternalDeepHash(object_list_); + result = result * 31 + PigeonInternalDeepHash(list_list_); + result = result * 31 + PigeonInternalDeepHash(map_list_); + result = result * 31 + PigeonInternalDeepHash(map_); + result = result * 31 + PigeonInternalDeepHash(string_map_); + result = result * 31 + PigeonInternalDeepHash(int_map_); + result = result * 31 + PigeonInternalDeepHash(enum_map_); + result = result * 31 + PigeonInternalDeepHash(object_map_); + result = result * 31 + PigeonInternalDeepHash(list_map_); + result = result * 31 + PigeonInternalDeepHash(map_map_); + return result; +} + +std::string AllNullableTypesWithoutRecursion::ToString() const { + std::stringstream ss; + ss << "AllNullableTypesWithoutRecursion("; + ss << "aNullableBool: "; + if (a_nullable_bool_.has_value()) { + ss << *a_nullable_bool_; + } else { + ss << "null"; + } + ss << ", aNullableInt: "; + if (a_nullable_int_.has_value()) { + ss << *a_nullable_int_; + } else { + ss << "null"; + } + ss << ", aNullableInt64: "; + if (a_nullable_int64_.has_value()) { + ss << *a_nullable_int64_; + } else { + ss << "null"; + } + ss << ", aNullableDouble: "; + if (a_nullable_double_.has_value()) { + ss << *a_nullable_double_; + } else { + ss << "null"; + } + ss << ", aNullableByteArray: "; + if (a_nullable_byte_array_.has_value()) { + ss << *a_nullable_byte_array_; + } else { + ss << "null"; + } + ss << ", aNullable4ByteArray: "; + if (a_nullable4_byte_array_.has_value()) { + ss << *a_nullable4_byte_array_; + } else { + ss << "null"; + } + ss << ", aNullable8ByteArray: "; + if (a_nullable8_byte_array_.has_value()) { + ss << *a_nullable8_byte_array_; + } else { + ss << "null"; + } + ss << ", aNullableFloatArray: "; + if (a_nullable_float_array_.has_value()) { + ss << *a_nullable_float_array_; + } else { + ss << "null"; + } + ss << ", aNullableEnum: "; + if (a_nullable_enum_.has_value()) { + ss << *a_nullable_enum_; + } else { + ss << "null"; + } + ss << ", anotherNullableEnum: "; + if (another_nullable_enum_.has_value()) { + ss << *another_nullable_enum_; + } else { + ss << "null"; + } + ss << ", aNullableString: "; + if (a_nullable_string_.has_value()) { + ss << *a_nullable_string_; + } else { + ss << "null"; + } + ss << ", aNullableObject: "; + if (a_nullable_object_.has_value()) { + ss << *a_nullable_object_; + } else { + ss << "null"; + } + ss << ", list: "; + if (list_.has_value()) { + ss << *list_; + } else { + ss << "null"; + } + ss << ", stringList: "; + if (string_list_.has_value()) { + ss << *string_list_; + } else { + ss << "null"; + } + ss << ", intList: "; + if (int_list_.has_value()) { + ss << *int_list_; + } else { + ss << "null"; + } + ss << ", doubleList: "; + if (double_list_.has_value()) { + ss << *double_list_; + } else { + ss << "null"; + } + ss << ", boolList: "; + if (bool_list_.has_value()) { + ss << *bool_list_; + } else { + ss << "null"; + } + ss << ", enumList: "; + if (enum_list_.has_value()) { + ss << *enum_list_; + } else { + ss << "null"; + } + ss << ", objectList: "; + if (object_list_.has_value()) { + ss << *object_list_; + } else { + ss << "null"; + } + ss << ", listList: "; + if (list_list_.has_value()) { + ss << *list_list_; + } else { + ss << "null"; + } + ss << ", mapList: "; + if (map_list_.has_value()) { + ss << *map_list_; + } else { + ss << "null"; + } + ss << ", map: "; + if (map_.has_value()) { + ss << *map_; + } else { + ss << "null"; + } + ss << ", stringMap: "; + if (string_map_.has_value()) { + ss << *string_map_; + } else { + ss << "null"; + } + ss << ", intMap: "; + if (int_map_.has_value()) { + ss << *int_map_; + } else { + ss << "null"; + } + ss << ", enumMap: "; + if (enum_map_.has_value()) { + ss << *enum_map_; + } else { + ss << "null"; + } + ss << ", objectMap: "; + if (object_map_.has_value()) { + ss << *object_map_; + } else { + ss << "null"; + } + ss << ", listMap: "; + if (list_map_.has_value()) { + ss << *list_map_; + } else { + ss << "null"; + } + ss << ", mapMap: "; + if (map_map_.has_value()) { + ss << *map_map_; + } else { + ss << "null"; + } + ss << ")"; + return ss.str(); +} + +size_t PigeonInternalDeepHash(const AllNullableTypesWithoutRecursion& v) { + return v.Hash(); +} + +// AllClassesWrapper + +AllClassesWrapper::AllClassesWrapper(const AllNullableTypes& all_nullable_types, + const EncodableList& class_list, + const EncodableMap& class_map) + : all_nullable_types_( + std::make_unique(all_nullable_types)), + class_list_(class_list), + class_map_(class_map) {} + +AllClassesWrapper::AllClassesWrapper(const AllNullableTypes& all_nullable_types, + const AllNullableTypesWithoutRecursion* + all_nullable_types_without_recursion, + const AllTypes* all_types, + const EncodableList& class_list, + const EncodableList* nullable_class_list, + const EncodableMap& class_map, + const EncodableMap* nullable_class_map) + : all_nullable_types_( + std::make_unique(all_nullable_types)), + all_nullable_types_without_recursion_( + all_nullable_types_without_recursion + ? std::make_unique( + *all_nullable_types_without_recursion) + : nullptr), + all_types_(all_types ? std::make_unique(*all_types) : nullptr), + class_list_(class_list), + nullable_class_list_(nullable_class_list ? std::optional( + *nullable_class_list) + : std::nullopt), + class_map_(class_map), + nullable_class_map_(nullable_class_map + ? std::optional(*nullable_class_map) + : std::nullopt) {} + +AllClassesWrapper::AllClassesWrapper(const AllClassesWrapper& other) + : all_nullable_types_( + std::make_unique(*other.all_nullable_types_)), + all_nullable_types_without_recursion_( + other.all_nullable_types_without_recursion_ + ? std::make_unique( + *other.all_nullable_types_without_recursion_) + : nullptr), + all_types_(other.all_types_ + ? std::make_unique(*other.all_types_) + : nullptr), + class_list_(other.class_list_), + nullable_class_list_( + other.nullable_class_list_ + ? std::optional(*other.nullable_class_list_) + : std::nullopt), + class_map_(other.class_map_), + nullable_class_map_( + other.nullable_class_map_ + ? std::optional(*other.nullable_class_map_) + : std::nullopt) {} + +AllClassesWrapper& AllClassesWrapper::operator=( + const AllClassesWrapper& other) { + all_nullable_types_ = + std::make_unique(*other.all_nullable_types_); + all_nullable_types_without_recursion_ = + other.all_nullable_types_without_recursion_ + ? std::make_unique( + *other.all_nullable_types_without_recursion_) + : nullptr; + all_types_ = other.all_types_ ? std::make_unique(*other.all_types_) + : nullptr; + class_list_ = other.class_list_; + nullable_class_list_ = other.nullable_class_list_; + class_map_ = other.class_map_; + nullable_class_map_ = other.nullable_class_map_; + return *this; +} + +const AllNullableTypes& AllClassesWrapper::all_nullable_types() const { + return *all_nullable_types_; +} + +void AllClassesWrapper::set_all_nullable_types( + const AllNullableTypes& value_arg) { + all_nullable_types_ = std::make_unique(value_arg); +} + +const AllNullableTypesWithoutRecursion* +AllClassesWrapper::all_nullable_types_without_recursion() const { + return all_nullable_types_without_recursion_.get(); +} + +void AllClassesWrapper::set_all_nullable_types_without_recursion( + const AllNullableTypesWithoutRecursion* value_arg) { + all_nullable_types_without_recursion_ = + value_arg ? std::make_unique(*value_arg) + : nullptr; +} + +void AllClassesWrapper::set_all_nullable_types_without_recursion( + const AllNullableTypesWithoutRecursion& value_arg) { + all_nullable_types_without_recursion_ = + std::make_unique(value_arg); +} + +const AllTypes* AllClassesWrapper::all_types() const { + return all_types_.get(); +} + +void AllClassesWrapper::set_all_types(const AllTypes* value_arg) { + all_types_ = value_arg ? std::make_unique(*value_arg) : nullptr; +} + +void AllClassesWrapper::set_all_types(const AllTypes& value_arg) { + all_types_ = std::make_unique(value_arg); +} + +const EncodableList& AllClassesWrapper::class_list() const { + return class_list_; +} + +void AllClassesWrapper::set_class_list(const EncodableList& value_arg) { + class_list_ = value_arg; +} + +const EncodableList* AllClassesWrapper::nullable_class_list() const { + return nullable_class_list_ ? &(*nullable_class_list_) : nullptr; +} + +void AllClassesWrapper::set_nullable_class_list( + const EncodableList* value_arg) { + nullable_class_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllClassesWrapper::set_nullable_class_list( + const EncodableList& value_arg) { + nullable_class_list_ = value_arg; +} + +const EncodableMap& AllClassesWrapper::class_map() const { return class_map_; } + +void AllClassesWrapper::set_class_map(const EncodableMap& value_arg) { + class_map_ = value_arg; +} + +const EncodableMap* AllClassesWrapper::nullable_class_map() const { + return nullable_class_map_ ? &(*nullable_class_map_) : nullptr; +} + +void AllClassesWrapper::set_nullable_class_map(const EncodableMap* value_arg) { + nullable_class_map_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllClassesWrapper::set_nullable_class_map(const EncodableMap& value_arg) { + nullable_class_map_ = value_arg; +} + +EncodableList AllClassesWrapper::ToEncodableList() const { + EncodableList list; + list.reserve(7); + list.push_back(CustomEncodableValue(*all_nullable_types_)); + list.push_back( + all_nullable_types_without_recursion_ + ? CustomEncodableValue(*all_nullable_types_without_recursion_) + : EncodableValue()); + list.push_back(all_types_ ? CustomEncodableValue(*all_types_) + : EncodableValue()); + list.push_back(EncodableValue(class_list_)); + list.push_back(nullable_class_list_ ? EncodableValue(*nullable_class_list_) + : EncodableValue()); + list.push_back(EncodableValue(class_map_)); + list.push_back(nullable_class_map_ ? EncodableValue(*nullable_class_map_) + : EncodableValue()); + return list; +} + +AllClassesWrapper AllClassesWrapper::FromEncodableList( + const EncodableList& list) { + AllClassesWrapper decoded(std::any_cast( + std::get(list[0])), + std::get(list[3]), + std::get(list[5])); + auto& encodable_all_nullable_types_without_recursion = list[1]; + if (!encodable_all_nullable_types_without_recursion.IsNull()) { + decoded.set_all_nullable_types_without_recursion( + std::any_cast( + std::get( + encodable_all_nullable_types_without_recursion))); + } + auto& encodable_all_types = list[2]; + if (!encodable_all_types.IsNull()) { + decoded.set_all_types(std::any_cast( + std::get(encodable_all_types))); + } + auto& encodable_nullable_class_list = list[4]; + if (!encodable_nullable_class_list.IsNull()) { + decoded.set_nullable_class_list( + std::get(encodable_nullable_class_list)); + } + auto& encodable_nullable_class_map = list[6]; + if (!encodable_nullable_class_map.IsNull()) { + decoded.set_nullable_class_map( + std::get(encodable_nullable_class_map)); + } + return decoded; +} + +bool AllClassesWrapper::operator==(const AllClassesWrapper& other) const { + return PigeonInternalDeepEquals(all_nullable_types_, + other.all_nullable_types_) && + PigeonInternalDeepEquals( + all_nullable_types_without_recursion_, + other.all_nullable_types_without_recursion_) && + PigeonInternalDeepEquals(all_types_, other.all_types_) && + PigeonInternalDeepEquals(class_list_, other.class_list_) && + PigeonInternalDeepEquals(nullable_class_list_, + other.nullable_class_list_) && + PigeonInternalDeepEquals(class_map_, other.class_map_) && + PigeonInternalDeepEquals(nullable_class_map_, + other.nullable_class_map_); +} + +bool AllClassesWrapper::operator!=(const AllClassesWrapper& other) const { + return !(*this == other); +} + +size_t AllClassesWrapper::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(all_nullable_types_); + result = result * 31 + + PigeonInternalDeepHash(all_nullable_types_without_recursion_); + result = result * 31 + PigeonInternalDeepHash(all_types_); + result = result * 31 + PigeonInternalDeepHash(class_list_); + result = result * 31 + PigeonInternalDeepHash(nullable_class_list_); + result = result * 31 + PigeonInternalDeepHash(class_map_); + result = result * 31 + PigeonInternalDeepHash(nullable_class_map_); + return result; +} + +std::string AllClassesWrapper::ToString() const { + std::stringstream ss; + ss << "AllClassesWrapper("; + ss << "allNullableTypes: "; + ss << all_nullable_types_.ToString(); + ss << ", allNullableTypesWithoutRecursion: "; + if (all_nullable_types_without_recursion_.has_value()) { + ss << all_nullable_types_without_recursion_->ToString(); + } else { + ss << "null"; + } + ss << ", allTypes: "; + if (all_types_.has_value()) { + ss << all_types_->ToString(); + } else { + ss << "null"; + } + ss << ", classList: "; + ss << class_list_; + ss << ", nullableClassList: "; + if (nullable_class_list_.has_value()) { + ss << *nullable_class_list_; + } else { + ss << "null"; + } + ss << ", classMap: "; + ss << class_map_; + ss << ", nullableClassMap: "; + if (nullable_class_map_.has_value()) { + ss << *nullable_class_map_; + } else { + ss << "null"; + } + ss << ")"; + return ss.str(); +} + +size_t PigeonInternalDeepHash(const AllClassesWrapper& v) { return v.Hash(); } + +// TestMessage + +TestMessage::TestMessage() {} + +TestMessage::TestMessage(const EncodableList* test_list) + : test_list_(test_list ? std::optional(*test_list) + : std::nullopt) {} + +const EncodableList* TestMessage::test_list() const { + return test_list_ ? &(*test_list_) : nullptr; +} + +void TestMessage::set_test_list(const EncodableList* value_arg) { + test_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void TestMessage::set_test_list(const EncodableList& value_arg) { + test_list_ = value_arg; +} + +EncodableList TestMessage::ToEncodableList() const { + EncodableList list; + list.reserve(1); + list.push_back(test_list_ ? EncodableValue(*test_list_) : EncodableValue()); + return list; +} + +TestMessage TestMessage::FromEncodableList(const EncodableList& list) { + TestMessage decoded; + auto& encodable_test_list = list[0]; + if (!encodable_test_list.IsNull()) { + decoded.set_test_list(std::get(encodable_test_list)); + } + return decoded; +} + +bool TestMessage::operator==(const TestMessage& other) const { + return PigeonInternalDeepEquals(test_list_, other.test_list_); +} + +bool TestMessage::operator!=(const TestMessage& other) const { + return !(*this == other); +} + +size_t TestMessage::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(test_list_); + return result; +} + +std::string TestMessage::ToString() const { + std::stringstream ss; + ss << "TestMessage("; + ss << "testList: "; + if (test_list_.has_value()) { + ss << *test_list_; + } else { + ss << "null"; + } + ss << ")"; + return ss.str(); +} + +size_t PigeonInternalDeepHash(const TestMessage& v) { return v.Hash(); } + +PigeonInternalCodecSerializer::PigeonInternalCodecSerializer() {} + +EncodableValue PigeonInternalCodecSerializer::ReadValueOfType( + uint8_t type, ::flutter::ByteStreamReader* stream) const { + switch (type) { + 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: { + return CustomEncodableValue(UnusedClass::FromEncodableList( + std::get(ReadValue(stream)))); + } + case 132: { + return CustomEncodableValue(AllTypes::FromEncodableList( + std::get(ReadValue(stream)))); + } + case 133: { + return CustomEncodableValue(AllNullableTypes::FromEncodableList( + std::get(ReadValue(stream)))); + } + case 134: { + return CustomEncodableValue( + AllNullableTypesWithoutRecursion::FromEncodableList( + std::get(ReadValue(stream)))); + } + case 135: { + return CustomEncodableValue(AllClassesWrapper::FromEncodableList( + std::get(ReadValue(stream)))); + } + case 136: { + return CustomEncodableValue(TestMessage::FromEncodableList( + std::get(ReadValue(stream)))); + } + default: + return ::flutter::StandardCodecSerializer::ReadValueOfType(type, stream); + } +} + +void PigeonInternalCodecSerializer::WriteValue( + const EncodableValue& value, ::flutter::ByteStreamWriter* stream) const { + if (const CustomEncodableValue* custom_value = + std::get_if(&value)) { + if (custom_value->type() == typeid(AnEnum)) { + stream->WriteByte(129); + WriteValue(EncodableValue( + static_cast(std::any_cast(*custom_value))), + stream); + return; + } + if (custom_value->type() == typeid(AnotherEnum)) { + stream->WriteByte(130); + WriteValue(EncodableValue(static_cast( + std::any_cast(*custom_value))), + stream); + return; + } + if (custom_value->type() == typeid(UnusedClass)) { + stream->WriteByte(131); + WriteValue( + EncodableValue( + std::any_cast(*custom_value).ToEncodableList()), + stream); + return; + } + if (custom_value->type() == typeid(AllTypes)) { + stream->WriteByte(132); + WriteValue(EncodableValue( + std::any_cast(*custom_value).ToEncodableList()), + stream); + return; + } + if (custom_value->type() == typeid(AllNullableTypes)) { + stream->WriteByte(133); + WriteValue( + EncodableValue( + std::any_cast(*custom_value).ToEncodableList()), + stream); + return; + } + if (custom_value->type() == typeid(AllNullableTypesWithoutRecursion)) { + stream->WriteByte(134); + WriteValue(EncodableValue(std::any_cast( + *custom_value) + .ToEncodableList()), + stream); + return; + } + if (custom_value->type() == typeid(AllClassesWrapper)) { + stream->WriteByte(135); + WriteValue(EncodableValue(std::any_cast(*custom_value) + .ToEncodableList()), + stream); + return; + } + if (custom_value->type() == typeid(TestMessage)) { + stream->WriteByte(136); + WriteValue( + EncodableValue( + std::any_cast(*custom_value).ToEncodableList()), + stream); + return; + } + } + ::flutter::StandardCodecSerializer::WriteValue(value, stream); +} + +/// The codec used by HostIntegrationCoreApi. +const ::flutter::StandardMessageCodec& HostIntegrationCoreApi::GetCodec() { + return ::flutter::StandardMessageCodec::GetInstance( + &PigeonInternalCodecSerializer::GetInstance()); +} + +// Sets up an instance of `HostIntegrationCoreApi` to handle messages through +// the `binary_messenger`. +void HostIntegrationCoreApi::SetUp(::flutter::BinaryMessenger* binary_messenger, + HostIntegrationCoreApi* api) { + HostIntegrationCoreApi::SetUp(binary_messenger, api, ""); +} + +void HostIntegrationCoreApi::SetUp(::flutter::BinaryMessenger* binary_messenger, + HostIntegrationCoreApi* api, + const std::string& message_channel_suffix) { + const std::string prepended_suffix = + message_channel_suffix.length() > 0 + ? std::string(".") + message_channel_suffix + : ""; + { + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.noop" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const ::flutter::MessageReply& reply) { + try { + std::optional output = api->Noop(); + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.echoAllTypes" + + 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_everything_arg = args.at(0); + if (encodable_everything_arg.IsNull()) { + reply(WrapError("everything_arg unexpectedly null.")); + return; + } + const auto& everything_arg = std::any_cast( + std::get(encodable_everything_arg)); + ErrorOr output = api->EchoAllTypes(everything_arg); + 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); + } + } + { + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.throwError" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const ::flutter::MessageReply& reply) { + try { + ErrorOr> output = api->ThrowError(); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.throwErrorFromVoid" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const ::flutter::MessageReply& reply) { + try { + std::optional output = api->ThrowErrorFromVoid(); + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.throwFlutterError" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const ::flutter::MessageReply& reply) { + try { + ErrorOr> output = + api->ThrowFlutterError(); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.echoInt" + + 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_an_int_arg = args.at(0); + if (encodable_an_int_arg.IsNull()) { + reply(WrapError("an_int_arg unexpectedly null.")); + return; + } + const int64_t an_int_arg = encodable_an_int_arg.LongValue(); + ErrorOr output = api->EchoInt(an_int_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.echoDouble" + + 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_a_double_arg = args.at(0); + if (encodable_a_double_arg.IsNull()) { + reply(WrapError("a_double_arg unexpectedly null.")); + return; + } + const auto& a_double_arg = + std::get(encodable_a_double_arg); + ErrorOr output = api->EchoDouble(a_double_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.echoBool" + + 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_a_bool_arg = args.at(0); + if (encodable_a_bool_arg.IsNull()) { + reply(WrapError("a_bool_arg unexpectedly null.")); + return; + } + const auto& a_bool_arg = std::get(encodable_a_bool_arg); + ErrorOr output = api->EchoBool(a_bool_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.echoString" + + 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_a_string_arg = args.at(0); + if (encodable_a_string_arg.IsNull()) { + reply(WrapError("a_string_arg unexpectedly null.")); + return; + } + const auto& a_string_arg = + std::get(encodable_a_string_arg); + ErrorOr output = api->EchoString(a_string_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.echoUint8List" + + 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_a_uint8_list_arg = args.at(0); + if (encodable_a_uint8_list_arg.IsNull()) { + reply(WrapError("a_uint8_list_arg unexpectedly null.")); + return; + } + const auto& a_uint8_list_arg = + std::get>(encodable_a_uint8_list_arg); + ErrorOr> output = + api->EchoUint8List(a_uint8_list_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.echoObject" + + 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_an_object_arg = args.at(0); + if (encodable_an_object_arg.IsNull()) { + reply(WrapError("an_object_arg unexpectedly null.")); + return; + } + const auto& an_object_arg = encodable_an_object_arg; + ErrorOr output = api->EchoObject(an_object_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.echoList" + + 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_list_arg = args.at(0); + if (encodable_list_arg.IsNull()) { + reply(WrapError("list_arg unexpectedly null.")); + return; + } + const auto& list_arg = + std::get(encodable_list_arg); + ErrorOr output = api->EchoList(list_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.echoEnumList" + + 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_enum_list_arg = args.at(0); + if (encodable_enum_list_arg.IsNull()) { + reply(WrapError("enum_list_arg unexpectedly null.")); + return; + } + const auto& enum_list_arg = + std::get(encodable_enum_list_arg); + ErrorOr output = api->EchoEnumList(enum_list_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.echoClassList" + + 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_class_list_arg = args.at(0); + if (encodable_class_list_arg.IsNull()) { + reply(WrapError("class_list_arg unexpectedly null.")); + return; + } + const auto& class_list_arg = + std::get(encodable_class_list_arg); + ErrorOr output = + api->EchoClassList(class_list_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.echoNonNullEnumList" + + 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_enum_list_arg = args.at(0); + if (encodable_enum_list_arg.IsNull()) { + reply(WrapError("enum_list_arg unexpectedly null.")); + return; + } + const auto& enum_list_arg = + std::get(encodable_enum_list_arg); + ErrorOr output = + api->EchoNonNullEnumList(enum_list_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNonNullClassList" + + 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_class_list_arg = args.at(0); + if (encodable_class_list_arg.IsNull()) { + reply(WrapError("class_list_arg unexpectedly null.")); + return; + } + const auto& class_list_arg = + std::get(encodable_class_list_arg); + ErrorOr output = + api->EchoNonNullClassList(class_list_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.echoMap" + + 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_map_arg = args.at(0); + if (encodable_map_arg.IsNull()) { + reply(WrapError("map_arg unexpectedly null.")); + return; + } + const auto& map_arg = std::get(encodable_map_arg); + ErrorOr output = api->EchoMap(map_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.echoStringMap" + + 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_string_map_arg = args.at(0); + if (encodable_string_map_arg.IsNull()) { + reply(WrapError("string_map_arg unexpectedly null.")); + return; + } + const auto& string_map_arg = + std::get(encodable_string_map_arg); + ErrorOr output = api->EchoStringMap(string_map_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.echoIntMap" + + 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_int_map_arg = args.at(0); + if (encodable_int_map_arg.IsNull()) { + reply(WrapError("int_map_arg unexpectedly null.")); + return; + } + const auto& int_map_arg = + std::get(encodable_int_map_arg); + ErrorOr output = api->EchoIntMap(int_map_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.echoEnumMap" + + 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_enum_map_arg = args.at(0); + if (encodable_enum_map_arg.IsNull()) { + reply(WrapError("enum_map_arg unexpectedly null.")); + return; + } + const auto& enum_map_arg = + std::get(encodable_enum_map_arg); + ErrorOr output = api->EchoEnumMap(enum_map_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.echoClassMap" + + 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_class_map_arg = args.at(0); + if (encodable_class_map_arg.IsNull()) { + reply(WrapError("class_map_arg unexpectedly null.")); + return; + } + const auto& class_map_arg = + std::get(encodable_class_map_arg); + ErrorOr output = api->EchoClassMap(class_map_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNonNullStringMap" + + 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_string_map_arg = args.at(0); + if (encodable_string_map_arg.IsNull()) { + reply(WrapError("string_map_arg unexpectedly null.")); + return; + } + const auto& string_map_arg = + std::get(encodable_string_map_arg); + ErrorOr output = + api->EchoNonNullStringMap(string_map_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.echoNonNullIntMap" + + 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_int_map_arg = args.at(0); + if (encodable_int_map_arg.IsNull()) { + reply(WrapError("int_map_arg unexpectedly null.")); + return; + } + const auto& int_map_arg = + std::get(encodable_int_map_arg); + ErrorOr output = + api->EchoNonNullIntMap(int_map_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.echoNonNullEnumMap" + + 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_enum_map_arg = args.at(0); + if (encodable_enum_map_arg.IsNull()) { + reply(WrapError("enum_map_arg unexpectedly null.")); + return; + } + const auto& enum_map_arg = + std::get(encodable_enum_map_arg); + ErrorOr output = + api->EchoNonNullEnumMap(enum_map_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.echoNonNullClassMap" + + 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_class_map_arg = args.at(0); + if (encodable_class_map_arg.IsNull()) { + reply(WrapError("class_map_arg unexpectedly null.")); + return; + } + const auto& class_map_arg = + std::get(encodable_class_map_arg); + ErrorOr output = + api->EchoNonNullClassMap(class_map_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.echoClassWrapper" + + 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_wrapper_arg = args.at(0); + if (encodable_wrapper_arg.IsNull()) { + reply(WrapError("wrapper_arg unexpectedly null.")); + return; + } + const auto& wrapper_arg = std::any_cast( + std::get(encodable_wrapper_arg)); + ErrorOr output = + api->EchoClassWrapper(wrapper_arg); + 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); + } + } + { + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoEnum" + + 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_an_enum_arg = args.at(0); + if (encodable_an_enum_arg.IsNull()) { + reply(WrapError("an_enum_arg unexpectedly null.")); + return; + } + const auto& an_enum_arg = std::any_cast( + std::get(encodable_an_enum_arg)); + ErrorOr output = api->EchoEnum(an_enum_arg); + 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); + } + } + { + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoAnotherEnum" + + 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_another_enum_arg = args.at(0); + if (encodable_another_enum_arg.IsNull()) { + reply(WrapError("another_enum_arg unexpectedly null.")); + return; + } + const auto& another_enum_arg = std::any_cast( + std::get(encodable_another_enum_arg)); + ErrorOr output = + api->EchoAnotherEnum(another_enum_arg); + 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); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNamedDefaultString" + + 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_a_string_arg = args.at(0); + if (encodable_a_string_arg.IsNull()) { + reply(WrapError("a_string_arg unexpectedly null.")); + return; + } + const auto& a_string_arg = + std::get(encodable_a_string_arg); + ErrorOr output = + api->EchoNamedDefaultString(a_string_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "echoOptionalDefaultDouble" + + 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_a_double_arg = args.at(0); + if (encodable_a_double_arg.IsNull()) { + reply(WrapError("a_double_arg unexpectedly null.")); + return; + } + const auto& a_double_arg = + std::get(encodable_a_double_arg); + ErrorOr output = + api->EchoOptionalDefaultDouble(a_double_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.echoRequiredInt" + + 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_an_int_arg = args.at(0); + if (encodable_an_int_arg.IsNull()) { + reply(WrapError("an_int_arg unexpectedly null.")); + return; + } + const int64_t an_int_arg = encodable_an_int_arg.LongValue(); + ErrorOr output = api->EchoRequiredInt(an_int_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "areAllNullableTypesEqual" + + 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_a_arg = args.at(0); + if (encodable_a_arg.IsNull()) { + reply(WrapError("a_arg unexpectedly null.")); + return; + } + const auto& a_arg = std::any_cast( + std::get(encodable_a_arg)); + const auto& encodable_b_arg = args.at(1); + if (encodable_b_arg.IsNull()) { + reply(WrapError("b_arg unexpectedly null.")); + return; + } + const auto& b_arg = std::any_cast( + std::get(encodable_b_arg)); + ErrorOr output = + api->AreAllNullableTypesEqual(a_arg, b_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "getAllNullableTypesHash" + + 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_value_arg = args.at(0); + if (encodable_value_arg.IsNull()) { + reply(WrapError("value_arg unexpectedly null.")); + return; + } + const auto& value_arg = std::any_cast( + std::get(encodable_value_arg)); + ErrorOr output = api->GetAllNullableTypesHash(value_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "getAllNullableTypesWithoutRecursionHash" + + 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_value_arg = args.at(0); + if (encodable_value_arg.IsNull()) { + reply(WrapError("value_arg unexpectedly null.")); + return; + } + const auto& value_arg = + std::any_cast( + std::get(encodable_value_arg)); + ErrorOr output = + api->GetAllNullableTypesWithoutRecursionHash(value_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAllNullableTypes" + + 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_everything_arg = args.at(0); + const auto* everything_arg = + encodable_everything_arg.IsNull() + ? nullptr + : &(std::any_cast( + std::get( + encodable_everything_arg))); + ErrorOr> output = + api->EchoAllNullableTypes(everything_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + CustomEncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAllNullableTypesWithoutRecursion" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler([api](const EncodableValue& message, + const ::flutter::MessageReply< + EncodableValue>& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_everything_arg = args.at(0); + const auto* everything_arg = + encodable_everything_arg.IsNull() + ? nullptr + : &(std::any_cast( + std::get( + encodable_everything_arg))); + ErrorOr> output = + api->EchoAllNullableTypesWithoutRecursion(everything_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + CustomEncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "extractNestedNullableString" + + 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_wrapper_arg = args.at(0); + if (encodable_wrapper_arg.IsNull()) { + reply(WrapError("wrapper_arg unexpectedly null.")); + return; + } + const auto& wrapper_arg = std::any_cast( + std::get(encodable_wrapper_arg)); + ErrorOr> output = + api->ExtractNestedNullableString(wrapper_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "createNestedNullableString" + + 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_nullable_string_arg = args.at(0); + const auto* nullable_string_arg = + std::get_if(&encodable_nullable_string_arg); + ErrorOr output = + api->CreateNestedNullableString(nullable_string_arg); + 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); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "sendMultipleNullableTypes" + + 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_a_nullable_bool_arg = args.at(0); + const auto* a_nullable_bool_arg = + std::get_if(&encodable_a_nullable_bool_arg); + const auto& encodable_a_nullable_int_arg = args.at(1); + const auto* a_nullable_int_arg = + std::get_if(&encodable_a_nullable_int_arg); + const auto& encodable_a_nullable_string_arg = args.at(2); + const auto* a_nullable_string_arg = + std::get_if(&encodable_a_nullable_string_arg); + ErrorOr output = api->SendMultipleNullableTypes( + a_nullable_bool_arg, a_nullable_int_arg, + a_nullable_string_arg); + 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); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "sendMultipleNullableTypesWithoutRecursion" + + 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_a_nullable_bool_arg = args.at(0); + const auto* a_nullable_bool_arg = + std::get_if(&encodable_a_nullable_bool_arg); + const auto& encodable_a_nullable_int_arg = args.at(1); + const auto* a_nullable_int_arg = + std::get_if(&encodable_a_nullable_int_arg); + const auto& encodable_a_nullable_string_arg = args.at(2); + const auto* a_nullable_string_arg = + std::get_if(&encodable_a_nullable_string_arg); + ErrorOr output = + api->SendMultipleNullableTypesWithoutRecursion( + a_nullable_bool_arg, a_nullable_int_arg, + a_nullable_string_arg); + 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); + } + } + { + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoNullableInt" + + 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_a_nullable_int_arg = args.at(0); + const auto* a_nullable_int_arg = + std::get_if(&encodable_a_nullable_int_arg); + ErrorOr> output = + api->EchoNullableInt(a_nullable_int_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.echoNullableDouble" + + 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_a_nullable_double_arg = args.at(0); + const auto* a_nullable_double_arg = + std::get_if(&encodable_a_nullable_double_arg); + ErrorOr> output = + api->EchoNullableDouble(a_nullable_double_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.echoNullableBool" + + 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_a_nullable_bool_arg = args.at(0); + const auto* a_nullable_bool_arg = + std::get_if(&encodable_a_nullable_bool_arg); + ErrorOr> output = + api->EchoNullableBool(a_nullable_bool_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.echoNullableString" + + 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_a_nullable_string_arg = args.at(0); + const auto* a_nullable_string_arg = + std::get_if(&encodable_a_nullable_string_arg); + ErrorOr> output = + api->EchoNullableString(a_nullable_string_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableUint8List" + + 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_a_nullable_uint8_list_arg = args.at(0); + const auto* a_nullable_uint8_list_arg = + std::get_if>( + &encodable_a_nullable_uint8_list_arg); + ErrorOr>> output = + api->EchoNullableUint8List(a_nullable_uint8_list_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.echoNullableObject" + + 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_a_nullable_object_arg = args.at(0); + const auto* a_nullable_object_arg = + &encodable_a_nullable_object_arg; + ErrorOr> output = + api->EchoNullableObject(a_nullable_object_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.echoNullableList" + + 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_a_nullable_list_arg = args.at(0); + const auto* a_nullable_list_arg = + std::get_if(&encodable_a_nullable_list_arg); + ErrorOr> output = + api->EchoNullableList(a_nullable_list_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableEnumList" + + 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_enum_list_arg = args.at(0); + const auto* enum_list_arg = + std::get_if(&encodable_enum_list_arg); + ErrorOr> output = + api->EchoNullableEnumList(enum_list_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableClassList" + + 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_class_list_arg = args.at(0); + const auto* class_list_arg = + std::get_if(&encodable_class_list_arg); + ErrorOr> output = + api->EchoNullableClassList(class_list_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableNonNullEnumList" + + 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_enum_list_arg = args.at(0); + const auto* enum_list_arg = + std::get_if(&encodable_enum_list_arg); + ErrorOr> output = + api->EchoNullableNonNullEnumList(enum_list_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableNonNullClassList" + + 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_class_list_arg = args.at(0); + const auto* class_list_arg = + std::get_if(&encodable_class_list_arg); + ErrorOr> output = + api->EchoNullableNonNullClassList(class_list_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.echoNullableMap" + + 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_map_arg = args.at(0); + const auto* map_arg = + std::get_if(&encodable_map_arg); + ErrorOr> output = + api->EchoNullableMap(map_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableStringMap" + + 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_string_map_arg = args.at(0); + const auto* string_map_arg = + std::get_if(&encodable_string_map_arg); + ErrorOr> output = + api->EchoNullableStringMap(string_map_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.echoNullableIntMap" + + 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_int_map_arg = args.at(0); + const auto* int_map_arg = + std::get_if(&encodable_int_map_arg); + ErrorOr> output = + api->EchoNullableIntMap(int_map_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.echoNullableEnumMap" + + 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_enum_map_arg = args.at(0); + const auto* enum_map_arg = + std::get_if(&encodable_enum_map_arg); + ErrorOr> output = + api->EchoNullableEnumMap(enum_map_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableClassMap" + + 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_class_map_arg = args.at(0); + const auto* class_map_arg = + std::get_if(&encodable_class_map_arg); + ErrorOr> output = + api->EchoNullableClassMap(class_map_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableNonNullStringMap" + + 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_string_map_arg = args.at(0); + const auto* string_map_arg = + std::get_if(&encodable_string_map_arg); + ErrorOr> output = + api->EchoNullableNonNullStringMap(string_map_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableNonNullIntMap" + + 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_int_map_arg = args.at(0); + const auto* int_map_arg = + std::get_if(&encodable_int_map_arg); + ErrorOr> output = + api->EchoNullableNonNullIntMap(int_map_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableNonNullEnumMap" + + 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_enum_map_arg = args.at(0); + const auto* enum_map_arg = + std::get_if(&encodable_enum_map_arg); + ErrorOr> output = + api->EchoNullableNonNullEnumMap(enum_map_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableNonNullClassMap" + + 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_class_map_arg = args.at(0); + const auto* class_map_arg = + std::get_if(&encodable_class_map_arg); + ErrorOr> output = + api->EchoNullableNonNullClassMap(class_map_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.echoNullableEnum" + + 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_an_enum_arg = args.at(0); + AnEnum an_enum_arg_value; + const AnEnum* an_enum_arg = nullptr; + if (!encodable_an_enum_arg.IsNull()) { + an_enum_arg_value = std::any_cast( + std::get(encodable_an_enum_arg)); + an_enum_arg = &an_enum_arg_value; + } + ErrorOr> output = api->EchoNullableEnum( + an_enum_arg ? &(*an_enum_arg) : nullptr); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + CustomEncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAnotherNullableEnum" + + 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_another_enum_arg = args.at(0); + AnotherEnum another_enum_arg_value; + const AnotherEnum* another_enum_arg = nullptr; + if (!encodable_another_enum_arg.IsNull()) { + another_enum_arg_value = std::any_cast( + std::get(encodable_another_enum_arg)); + another_enum_arg = &another_enum_arg_value; + } + ErrorOr> output = + api->EchoAnotherNullableEnum( + another_enum_arg ? &(*another_enum_arg) : nullptr); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + CustomEncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "echoOptionalNullableInt" + + 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_a_nullable_int_arg = args.at(0); + const auto* a_nullable_int_arg = + std::get_if(&encodable_a_nullable_int_arg); + ErrorOr> output = + api->EchoOptionalNullableInt(a_nullable_int_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNamedNullableString" + + 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_a_nullable_string_arg = args.at(0); + const auto* a_nullable_string_arg = + std::get_if(&encodable_a_nullable_string_arg); + ErrorOr> output = + api->EchoNamedNullableString(a_nullable_string_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.noopAsync" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const ::flutter::MessageReply& reply) { + try { + api->NoopAsync([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.pigeon_integration_tests." + "HostIntegrationCoreApi.echoAsyncInt" + + 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_an_int_arg = args.at(0); + if (encodable_an_int_arg.IsNull()) { + reply(WrapError("an_int_arg unexpectedly null.")); + return; + } + const int64_t an_int_arg = encodable_an_int_arg.LongValue(); + api->EchoAsyncInt(an_int_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.echoAsyncDouble" + + 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_a_double_arg = args.at(0); + if (encodable_a_double_arg.IsNull()) { + reply(WrapError("a_double_arg unexpectedly null.")); + return; + } + const auto& a_double_arg = + std::get(encodable_a_double_arg); + api->EchoAsyncDouble( + a_double_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.echoAsyncBool" + + 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_a_bool_arg = args.at(0); + if (encodable_a_bool_arg.IsNull()) { + reply(WrapError("a_bool_arg unexpectedly null.")); + return; + } + const auto& a_bool_arg = std::get(encodable_a_bool_arg); + api->EchoAsyncBool(a_bool_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.echoAsyncString" + + 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_a_string_arg = args.at(0); + if (encodable_a_string_arg.IsNull()) { + reply(WrapError("a_string_arg unexpectedly null.")); + return; + } + const auto& a_string_arg = + std::get(encodable_a_string_arg); + api->EchoAsyncString( + a_string_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.echoAsyncUint8List" + + 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_a_uint8_list_arg = args.at(0); + if (encodable_a_uint8_list_arg.IsNull()) { + reply(WrapError("a_uint8_list_arg unexpectedly null.")); + return; + } + const auto& a_uint8_list_arg = + std::get>(encodable_a_uint8_list_arg); + api->EchoAsyncUint8List( + a_uint8_list_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.echoAsyncObject" + + 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_an_object_arg = args.at(0); + if (encodable_an_object_arg.IsNull()) { + reply(WrapError("an_object_arg unexpectedly null.")); + return; + } + const auto& an_object_arg = encodable_an_object_arg; + api->EchoAsyncObject( + an_object_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.echoAsyncList" + + 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_list_arg = args.at(0); + if (encodable_list_arg.IsNull()) { + reply(WrapError("list_arg unexpectedly null.")); + return; + } + const auto& list_arg = + std::get(encodable_list_arg); + api->EchoAsyncList( + list_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.echoAsyncEnumList" + + 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_enum_list_arg = args.at(0); + if (encodable_enum_list_arg.IsNull()) { + reply(WrapError("enum_list_arg unexpectedly null.")); + return; + } + const auto& enum_list_arg = + std::get(encodable_enum_list_arg); + api->EchoAsyncEnumList( + enum_list_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.echoAsyncClassList" + + 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_class_list_arg = args.at(0); + if (encodable_class_list_arg.IsNull()) { + reply(WrapError("class_list_arg unexpectedly null.")); + return; + } + const auto& class_list_arg = + std::get(encodable_class_list_arg); + api->EchoAsyncClassList( + class_list_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.echoAsyncMap" + + 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_map_arg = args.at(0); + if (encodable_map_arg.IsNull()) { + reply(WrapError("map_arg unexpectedly null.")); + return; + } + const auto& map_arg = std::get(encodable_map_arg); + api->EchoAsyncMap( + map_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.echoAsyncStringMap" + + 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_string_map_arg = args.at(0); + if (encodable_string_map_arg.IsNull()) { + reply(WrapError("string_map_arg unexpectedly null.")); + return; + } + const auto& string_map_arg = + std::get(encodable_string_map_arg); + api->EchoAsyncStringMap( + string_map_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.echoAsyncIntMap" + + 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_int_map_arg = args.at(0); + if (encodable_int_map_arg.IsNull()) { + reply(WrapError("int_map_arg unexpectedly null.")); + return; + } + const auto& int_map_arg = + std::get(encodable_int_map_arg); + api->EchoAsyncIntMap( + int_map_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.echoAsyncEnumMap" + + 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_enum_map_arg = args.at(0); + if (encodable_enum_map_arg.IsNull()) { + reply(WrapError("enum_map_arg unexpectedly null.")); + return; + } + const auto& enum_map_arg = + std::get(encodable_enum_map_arg); + api->EchoAsyncEnumMap( + enum_map_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.echoAsyncClassMap" + + 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_class_map_arg = args.at(0); + if (encodable_class_map_arg.IsNull()) { + reply(WrapError("class_map_arg unexpectedly null.")); + return; + } + const auto& class_map_arg = + std::get(encodable_class_map_arg); + api->EchoAsyncClassMap( + class_map_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.echoAsyncEnum" + + 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_an_enum_arg = args.at(0); + if (encodable_an_enum_arg.IsNull()) { + reply(WrapError("an_enum_arg unexpectedly null.")); + return; + } + const auto& an_enum_arg = std::any_cast( + std::get(encodable_an_enum_arg)); + api->EchoAsyncEnum( + an_enum_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); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAnotherAsyncEnum" + + 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_another_enum_arg = args.at(0); + if (encodable_another_enum_arg.IsNull()) { + reply(WrapError("another_enum_arg unexpectedly null.")); + return; + } + const auto& another_enum_arg = std::any_cast( + std::get(encodable_another_enum_arg)); + api->EchoAnotherAsyncEnum( + another_enum_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); + } + } + { + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.throwAsyncError" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const ::flutter::MessageReply& reply) { + try { + api->ThrowAsyncError( + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "throwAsyncErrorFromVoid" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const ::flutter::MessageReply& reply) { + try { + api->ThrowAsyncErrorFromVoid( + [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.pigeon_integration_tests.HostIntegrationCoreApi." + "throwAsyncFlutterError" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const ::flutter::MessageReply& reply) { + try { + api->ThrowAsyncFlutterError( + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.echoAsyncAllTypes" + + 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_everything_arg = args.at(0); + if (encodable_everything_arg.IsNull()) { + reply(WrapError("everything_arg unexpectedly null.")); + return; + } + const auto& everything_arg = std::any_cast( + std::get(encodable_everything_arg)); + api->EchoAsyncAllTypes( + everything_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); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableAllNullableTypes" + + 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_everything_arg = args.at(0); + const auto* everything_arg = + encodable_everything_arg.IsNull() + ? nullptr + : &(std::any_cast( + std::get( + encodable_everything_arg))); + api->EchoAsyncNullableAllNullableTypes( + everything_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(CustomEncodableValue( + std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableAllNullableTypesWithoutRecursion" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler([api](const EncodableValue& message, + const ::flutter::MessageReply< + EncodableValue>& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_everything_arg = args.at(0); + const auto* everything_arg = + encodable_everything_arg.IsNull() + ? nullptr + : &(std::any_cast( + std::get( + encodable_everything_arg))); + api->EchoAsyncNullableAllNullableTypesWithoutRecursion( + everything_arg, + [reply](ErrorOr>&& + output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + CustomEncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableInt" + + 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_an_int_arg = args.at(0); + const auto* an_int_arg = + std::get_if(&encodable_an_int_arg); + api->EchoAsyncNullableInt( + an_int_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableDouble" + + 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_a_double_arg = args.at(0); + const auto* a_double_arg = + std::get_if(&encodable_a_double_arg); + api->EchoAsyncNullableDouble( + a_double_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableBool" + + 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_a_bool_arg = args.at(0); + const auto* a_bool_arg = std::get_if(&encodable_a_bool_arg); + api->EchoAsyncNullableBool( + a_bool_arg, [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableString" + + 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_a_string_arg = args.at(0); + const auto* a_string_arg = + std::get_if(&encodable_a_string_arg); + api->EchoAsyncNullableString( + a_string_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableUint8List" + + 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_a_uint8_list_arg = args.at(0); + const auto* a_uint8_list_arg = std::get_if>( + &encodable_a_uint8_list_arg); + api->EchoAsyncNullableUint8List( + a_uint8_list_arg, + [reply]( + ErrorOr>>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableObject" + + 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_an_object_arg = args.at(0); + const auto* an_object_arg = &encodable_an_object_arg; + api->EchoAsyncNullableObject( + an_object_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableList" + + 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_list_arg = args.at(0); + const auto* list_arg = + std::get_if(&encodable_list_arg); + api->EchoAsyncNullableList( + list_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableEnumList" + + 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_enum_list_arg = args.at(0); + const auto* enum_list_arg = + std::get_if(&encodable_enum_list_arg); + api->EchoAsyncNullableEnumList( + enum_list_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableClassList" + + 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_class_list_arg = args.at(0); + const auto* class_list_arg = + std::get_if(&encodable_class_list_arg); + api->EchoAsyncNullableClassList( + class_list_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableMap" + + 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_map_arg = args.at(0); + const auto* map_arg = + std::get_if(&encodable_map_arg); + api->EchoAsyncNullableMap( + map_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableStringMap" + + 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_string_map_arg = args.at(0); + const auto* string_map_arg = + std::get_if(&encodable_string_map_arg); + api->EchoAsyncNullableStringMap( + string_map_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableIntMap" + + 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_int_map_arg = args.at(0); + const auto* int_map_arg = + std::get_if(&encodable_int_map_arg); + api->EchoAsyncNullableIntMap( + int_map_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableEnumMap" + + 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_enum_map_arg = args.at(0); + const auto* enum_map_arg = + std::get_if(&encodable_enum_map_arg); + api->EchoAsyncNullableEnumMap( + enum_map_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableClassMap" + + 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_class_map_arg = args.at(0); + const auto* class_map_arg = + std::get_if(&encodable_class_map_arg); + api->EchoAsyncNullableClassMap( + class_map_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableEnum" + + 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_an_enum_arg = args.at(0); + AnEnum an_enum_arg_value; + const AnEnum* an_enum_arg = nullptr; + if (!encodable_an_enum_arg.IsNull()) { + an_enum_arg_value = std::any_cast( + std::get(encodable_an_enum_arg)); + an_enum_arg = &an_enum_arg_value; + } + api->EchoAsyncNullableEnum( + an_enum_arg ? &(*an_enum_arg) : nullptr, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(CustomEncodableValue( + std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAnotherAsyncNullableEnum" + + 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_another_enum_arg = args.at(0); + AnotherEnum another_enum_arg_value; + const AnotherEnum* another_enum_arg = nullptr; + if (!encodable_another_enum_arg.IsNull()) { + another_enum_arg_value = std::any_cast( + std::get(encodable_another_enum_arg)); + another_enum_arg = &another_enum_arg_value; + } + api->EchoAnotherAsyncNullableEnum( + another_enum_arg ? &(*another_enum_arg) : nullptr, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(CustomEncodableValue( + std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.defaultIsMainThread" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const ::flutter::MessageReply& reply) { + try { + ErrorOr output = api->DefaultIsMainThread(); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "taskQueueIsBackgroundThread" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const ::flutter::MessageReply& reply) { + try { + ErrorOr output = api->TaskQueueIsBackgroundThread(); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.callFlutterNoop" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const ::flutter::MessageReply& reply) { + try { + api->CallFlutterNoop( + [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.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterThrowError" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const ::flutter::MessageReply& reply) { + try { + api->CallFlutterThrowError( + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterThrowErrorFromVoid" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const ::flutter::MessageReply& reply) { + try { + api->CallFlutterThrowErrorFromVoid( + [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.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoAllTypes" + + 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_everything_arg = args.at(0); + if (encodable_everything_arg.IsNull()) { + reply(WrapError("everything_arg unexpectedly null.")); + return; + } + const auto& everything_arg = std::any_cast( + std::get(encodable_everything_arg)); + api->CallFlutterEchoAllTypes( + everything_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); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoAllNullableTypes" + + 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_everything_arg = args.at(0); + const auto* everything_arg = + encodable_everything_arg.IsNull() + ? nullptr + : &(std::any_cast( + std::get( + encodable_everything_arg))); + api->CallFlutterEchoAllNullableTypes( + everything_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(CustomEncodableValue( + std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterSendMultipleNullableTypes" + + 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_a_nullable_bool_arg = args.at(0); + const auto* a_nullable_bool_arg = + std::get_if(&encodable_a_nullable_bool_arg); + const auto& encodable_a_nullable_int_arg = args.at(1); + const auto* a_nullable_int_arg = + std::get_if(&encodable_a_nullable_int_arg); + const auto& encodable_a_nullable_string_arg = args.at(2); + const auto* a_nullable_string_arg = + std::get_if(&encodable_a_nullable_string_arg); + api->CallFlutterSendMultipleNullableTypes( + a_nullable_bool_arg, a_nullable_int_arg, + a_nullable_string_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); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoAllNullableTypesWithoutRecursion" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler([api](const EncodableValue& message, + const ::flutter::MessageReply< + EncodableValue>& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_everything_arg = args.at(0); + const auto* everything_arg = + encodable_everything_arg.IsNull() + ? nullptr + : &(std::any_cast( + std::get( + encodable_everything_arg))); + api->CallFlutterEchoAllNullableTypesWithoutRecursion( + everything_arg, + [reply](ErrorOr>&& + output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + CustomEncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterSendMultipleNullableTypesWithoutRecursion" + + 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_a_nullable_bool_arg = args.at(0); + const auto* a_nullable_bool_arg = + std::get_if(&encodable_a_nullable_bool_arg); + const auto& encodable_a_nullable_int_arg = args.at(1); + const auto* a_nullable_int_arg = + std::get_if(&encodable_a_nullable_int_arg); + const auto& encodable_a_nullable_string_arg = args.at(2); + const auto* a_nullable_string_arg = + std::get_if(&encodable_a_nullable_string_arg); + api->CallFlutterSendMultipleNullableTypesWithoutRecursion( + a_nullable_bool_arg, a_nullable_int_arg, + a_nullable_string_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); + } + } + { + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.callFlutterEchoBool" + + 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_a_bool_arg = args.at(0); + if (encodable_a_bool_arg.IsNull()) { + reply(WrapError("a_bool_arg unexpectedly null.")); + return; + } + const auto& a_bool_arg = std::get(encodable_a_bool_arg); + api->CallFlutterEchoBool( + a_bool_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.callFlutterEchoInt" + + 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_an_int_arg = args.at(0); + if (encodable_an_int_arg.IsNull()) { + reply(WrapError("an_int_arg unexpectedly null.")); + return; + } + const int64_t an_int_arg = encodable_an_int_arg.LongValue(); + api->CallFlutterEchoInt( + an_int_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoDouble" + + 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_a_double_arg = args.at(0); + if (encodable_a_double_arg.IsNull()) { + reply(WrapError("a_double_arg unexpectedly null.")); + return; + } + const auto& a_double_arg = + std::get(encodable_a_double_arg); + api->CallFlutterEchoDouble( + a_double_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoString" + + 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_a_string_arg = args.at(0); + if (encodable_a_string_arg.IsNull()) { + reply(WrapError("a_string_arg unexpectedly null.")); + return; + } + const auto& a_string_arg = + std::get(encodable_a_string_arg); + api->CallFlutterEchoString( + a_string_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoUint8List" + + 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_list_arg = args.at(0); + if (encodable_list_arg.IsNull()) { + reply(WrapError("list_arg unexpectedly null.")); + return; + } + const auto& list_arg = + std::get>(encodable_list_arg); + api->CallFlutterEchoUint8List( + list_arg, [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.callFlutterEchoList" + + 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_list_arg = args.at(0); + if (encodable_list_arg.IsNull()) { + reply(WrapError("list_arg unexpectedly null.")); + return; + } + const auto& list_arg = + std::get(encodable_list_arg); + api->CallFlutterEchoList( + list_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoEnumList" + + 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_enum_list_arg = args.at(0); + if (encodable_enum_list_arg.IsNull()) { + reply(WrapError("enum_list_arg unexpectedly null.")); + return; + } + const auto& enum_list_arg = + std::get(encodable_enum_list_arg); + api->CallFlutterEchoEnumList( + enum_list_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoClassList" + + 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_class_list_arg = args.at(0); + if (encodable_class_list_arg.IsNull()) { + reply(WrapError("class_list_arg unexpectedly null.")); + return; + } + const auto& class_list_arg = + std::get(encodable_class_list_arg); + api->CallFlutterEchoClassList( + class_list_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNonNullEnumList" + + 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_enum_list_arg = args.at(0); + if (encodable_enum_list_arg.IsNull()) { + reply(WrapError("enum_list_arg unexpectedly null.")); + return; + } + const auto& enum_list_arg = + std::get(encodable_enum_list_arg); + api->CallFlutterEchoNonNullEnumList( + enum_list_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNonNullClassList" + + 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_class_list_arg = args.at(0); + if (encodable_class_list_arg.IsNull()) { + reply(WrapError("class_list_arg unexpectedly null.")); + return; + } + const auto& class_list_arg = + std::get(encodable_class_list_arg); + api->CallFlutterEchoNonNullClassList( + class_list_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.callFlutterEchoMap" + + 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_map_arg = args.at(0); + if (encodable_map_arg.IsNull()) { + reply(WrapError("map_arg unexpectedly null.")); + return; + } + const auto& map_arg = std::get(encodable_map_arg); + api->CallFlutterEchoMap( + map_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoStringMap" + + 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_string_map_arg = args.at(0); + if (encodable_string_map_arg.IsNull()) { + reply(WrapError("string_map_arg unexpectedly null.")); + return; + } + const auto& string_map_arg = + std::get(encodable_string_map_arg); + api->CallFlutterEchoStringMap( + string_map_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoIntMap" + + 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_int_map_arg = args.at(0); + if (encodable_int_map_arg.IsNull()) { + reply(WrapError("int_map_arg unexpectedly null.")); + return; + } + const auto& int_map_arg = + std::get(encodable_int_map_arg); + api->CallFlutterEchoIntMap( + int_map_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoEnumMap" + + 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_enum_map_arg = args.at(0); + if (encodable_enum_map_arg.IsNull()) { + reply(WrapError("enum_map_arg unexpectedly null.")); + return; + } + const auto& enum_map_arg = + std::get(encodable_enum_map_arg); + api->CallFlutterEchoEnumMap( + enum_map_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoClassMap" + + 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_class_map_arg = args.at(0); + if (encodable_class_map_arg.IsNull()) { + reply(WrapError("class_map_arg unexpectedly null.")); + return; + } + const auto& class_map_arg = + std::get(encodable_class_map_arg); + api->CallFlutterEchoClassMap( + class_map_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNonNullStringMap" + + 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_string_map_arg = args.at(0); + if (encodable_string_map_arg.IsNull()) { + reply(WrapError("string_map_arg unexpectedly null.")); + return; + } + const auto& string_map_arg = + std::get(encodable_string_map_arg); + api->CallFlutterEchoNonNullStringMap( + string_map_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNonNullIntMap" + + 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_int_map_arg = args.at(0); + if (encodable_int_map_arg.IsNull()) { + reply(WrapError("int_map_arg unexpectedly null.")); + return; + } + const auto& int_map_arg = + std::get(encodable_int_map_arg); + api->CallFlutterEchoNonNullIntMap( + int_map_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNonNullEnumMap" + + 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_enum_map_arg = args.at(0); + if (encodable_enum_map_arg.IsNull()) { + reply(WrapError("enum_map_arg unexpectedly null.")); + return; + } + const auto& enum_map_arg = + std::get(encodable_enum_map_arg); + api->CallFlutterEchoNonNullEnumMap( + enum_map_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNonNullClassMap" + + 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_class_map_arg = args.at(0); + if (encodable_class_map_arg.IsNull()) { + reply(WrapError("class_map_arg unexpectedly null.")); + return; + } + const auto& class_map_arg = + std::get(encodable_class_map_arg); + api->CallFlutterEchoNonNullClassMap( + class_map_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + 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.pigeon_integration_tests." + "HostIntegrationCoreApi.callFlutterEchoEnum" + + 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_an_enum_arg = args.at(0); + if (encodable_an_enum_arg.IsNull()) { + reply(WrapError("an_enum_arg unexpectedly null.")); + return; + } + const auto& an_enum_arg = std::any_cast( + std::get(encodable_an_enum_arg)); + api->CallFlutterEchoEnum( + an_enum_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); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoAnotherEnum" + + 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_another_enum_arg = args.at(0); + if (encodable_another_enum_arg.IsNull()) { + reply(WrapError("another_enum_arg unexpectedly null.")); + return; + } + const auto& another_enum_arg = std::any_cast( + std::get(encodable_another_enum_arg)); + api->CallFlutterEchoAnotherEnum( + another_enum_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); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableBool" + + 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_a_bool_arg = args.at(0); + const auto* a_bool_arg = std::get_if(&encodable_a_bool_arg); + api->CallFlutterEchoNullableBool( + a_bool_arg, [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableInt" + + 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_an_int_arg = args.at(0); + const auto* an_int_arg = + std::get_if(&encodable_an_int_arg); + api->CallFlutterEchoNullableInt( + an_int_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableDouble" + + 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_a_double_arg = args.at(0); + const auto* a_double_arg = + std::get_if(&encodable_a_double_arg); + api->CallFlutterEchoNullableDouble( + a_double_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableString" + + 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_a_string_arg = args.at(0); + const auto* a_string_arg = + std::get_if(&encodable_a_string_arg); + api->CallFlutterEchoNullableString( + a_string_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableUint8List" + + 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_list_arg = args.at(0); + const auto* list_arg = + std::get_if>(&encodable_list_arg); + api->CallFlutterEchoNullableUint8List( + list_arg, + [reply]( + ErrorOr>>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableList" + + 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_list_arg = args.at(0); + const auto* list_arg = + std::get_if(&encodable_list_arg); + api->CallFlutterEchoNullableList( + list_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableEnumList" + + 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_enum_list_arg = args.at(0); + const auto* enum_list_arg = + std::get_if(&encodable_enum_list_arg); + api->CallFlutterEchoNullableEnumList( + enum_list_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableClassList" + + 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_class_list_arg = args.at(0); + const auto* class_list_arg = + std::get_if(&encodable_class_list_arg); + api->CallFlutterEchoNullableClassList( + class_list_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableNonNullEnumList" + + 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_enum_list_arg = args.at(0); + const auto* enum_list_arg = + std::get_if(&encodable_enum_list_arg); + api->CallFlutterEchoNullableNonNullEnumList( + enum_list_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableNonNullClassList" + + 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_class_list_arg = args.at(0); + const auto* class_list_arg = + std::get_if(&encodable_class_list_arg); + api->CallFlutterEchoNullableNonNullClassList( + class_list_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableMap" + + 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_map_arg = args.at(0); + const auto* map_arg = + std::get_if(&encodable_map_arg); + api->CallFlutterEchoNullableMap( + map_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableStringMap" + + 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_string_map_arg = args.at(0); + const auto* string_map_arg = + std::get_if(&encodable_string_map_arg); + api->CallFlutterEchoNullableStringMap( + string_map_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableIntMap" + + 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_int_map_arg = args.at(0); + const auto* int_map_arg = + std::get_if(&encodable_int_map_arg); + api->CallFlutterEchoNullableIntMap( + int_map_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableEnumMap" + + 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_enum_map_arg = args.at(0); + const auto* enum_map_arg = + std::get_if(&encodable_enum_map_arg); + api->CallFlutterEchoNullableEnumMap( + enum_map_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableClassMap" + + 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_class_map_arg = args.at(0); + const auto* class_map_arg = + std::get_if(&encodable_class_map_arg); + api->CallFlutterEchoNullableClassMap( + class_map_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableNonNullStringMap" + + 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_string_map_arg = args.at(0); + const auto* string_map_arg = + std::get_if(&encodable_string_map_arg); + api->CallFlutterEchoNullableNonNullStringMap( + string_map_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableNonNullIntMap" + + 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_int_map_arg = args.at(0); + const auto* int_map_arg = + std::get_if(&encodable_int_map_arg); + api->CallFlutterEchoNullableNonNullIntMap( + int_map_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableNonNullEnumMap" + + 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_enum_map_arg = args.at(0); + const auto* enum_map_arg = + std::get_if(&encodable_enum_map_arg); + api->CallFlutterEchoNullableNonNullEnumMap( + enum_map_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableNonNullClassMap" + + 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_class_map_arg = args.at(0); + const auto* class_map_arg = + std::get_if(&encodable_class_map_arg); + api->CallFlutterEchoNullableNonNullClassMap( + class_map_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableEnum" + + 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_an_enum_arg = args.at(0); + AnEnum an_enum_arg_value; + const AnEnum* an_enum_arg = nullptr; + if (!encodable_an_enum_arg.IsNull()) { + an_enum_arg_value = std::any_cast( + std::get(encodable_an_enum_arg)); + an_enum_arg = &an_enum_arg_value; + } + api->CallFlutterEchoNullableEnum( + an_enum_arg ? &(*an_enum_arg) : nullptr, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(CustomEncodableValue( + std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoAnotherNullableEnum" + + 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_another_enum_arg = args.at(0); + AnotherEnum another_enum_arg_value; + const AnotherEnum* another_enum_arg = nullptr; + if (!encodable_another_enum_arg.IsNull()) { + another_enum_arg_value = std::any_cast( + std::get(encodable_another_enum_arg)); + another_enum_arg = &another_enum_arg_value; + } + api->CallFlutterEchoAnotherNullableEnum( + another_enum_arg ? &(*another_enum_arg) : nullptr, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(CustomEncodableValue( + std::move(output_optional).value())); + } else { + 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.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterSmallApiEchoString" + + 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_a_string_arg = args.at(0); + if (encodable_a_string_arg.IsNull()) { + reply(WrapError("a_string_arg unexpectedly null.")); + return; + } + const auto& a_string_arg = + std::get(encodable_a_string_arg); + api->CallFlutterSmallApiEchoString( + a_string_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } } +} + +EncodableValue HostIntegrationCoreApi::WrapError( + std::string_view error_message) { + return EncodableValue( + EncodableList{EncodableValue(std::string(error_message)), + EncodableValue("Error"), EncodableValue()}); +} + +EncodableValue HostIntegrationCoreApi::WrapError(const FlutterError& error) { + return EncodableValue(EncodableList{EncodableValue(error.code()), + EncodableValue(error.message()), + error.details()}); +} + +// Generated class from Pigeon that represents Flutter messages that can be +// called from C++. +FlutterIntegrationCoreApi::FlutterIntegrationCoreApi( + ::flutter::BinaryMessenger* binary_messenger) + : binary_messenger_(binary_messenger), message_channel_suffix_("") {} + +FlutterIntegrationCoreApi::FlutterIntegrationCoreApi( + ::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& FlutterIntegrationCoreApi::GetCodec() { + return ::flutter::StandardMessageCodec::GetInstance( + &PigeonInternalCodecSerializer::GetInstance()); +} + +void FlutterIntegrationCoreApi::Noop( + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "noop" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + on_success(); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::ThrowError( + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "throwError" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto* return_value = &list_return_value->at(0); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::ThrowErrorFromVoid( + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "throwErrorFromVoid" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + on_success(); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoAllTypes( + const AllTypes& everything_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoAllTypes" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + CustomEncodableValue(everything_arg), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = std::any_cast( + std::get(list_return_value->at(0))); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoAllNullableTypes( + const AllNullableTypes* everything_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoAllNullableTypes" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + everything_arg ? CustomEncodableValue(*everything_arg) : EncodableValue(), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto* return_value = + list_return_value->at(0).IsNull() + ? nullptr + : &(std::any_cast( + std::get( + list_return_value->at(0)))); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::SendMultipleNullableTypes( + const bool* a_nullable_bool_arg, const int64_t* a_nullable_int_arg, + const std::string* a_nullable_string_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "sendMultipleNullableTypes" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + a_nullable_bool_arg ? EncodableValue(*a_nullable_bool_arg) + : EncodableValue(), + a_nullable_int_arg ? EncodableValue(*a_nullable_int_arg) + : EncodableValue(), + a_nullable_string_arg ? EncodableValue(*a_nullable_string_arg) + : EncodableValue(), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = std::any_cast( + std::get(list_return_value->at(0))); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoAllNullableTypesWithoutRecursion( + const AllNullableTypesWithoutRecursion* everything_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoAllNullableTypesWithoutRecursion" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + everything_arg ? CustomEncodableValue(*everything_arg) : EncodableValue(), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto* return_value = + list_return_value->at(0).IsNull() + ? nullptr + : &(std::any_cast( + std::get( + list_return_value->at(0)))); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::SendMultipleNullableTypesWithoutRecursion( + const bool* a_nullable_bool_arg, const int64_t* a_nullable_int_arg, + const std::string* a_nullable_string_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "sendMultipleNullableTypesWithoutRecursion" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + a_nullable_bool_arg ? EncodableValue(*a_nullable_bool_arg) + : EncodableValue(), + a_nullable_int_arg ? EncodableValue(*a_nullable_int_arg) + : EncodableValue(), + a_nullable_string_arg ? EncodableValue(*a_nullable_string_arg) + : EncodableValue(), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = + std::any_cast( + std::get(list_return_value->at(0))); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoBool( + bool a_bool_arg, std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoBool" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + EncodableValue(a_bool_arg), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoInt( + int64_t an_int_arg, std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoInt" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + EncodableValue(an_int_arg), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const int64_t return_value = list_return_value->at(0).LongValue(); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoDouble( + double a_double_arg, std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoDouble" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + EncodableValue(a_double_arg), + }); + channel.Send(encoded_api_arguments, [channel_name, + on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, + size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoString( + const std::string& a_string_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoString" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + EncodableValue(a_string_arg), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = + std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoUint8List( + const std::vector& list_arg, + std::function&)>&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoUint8List" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + EncodableValue(list_arg), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = + std::get>(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoList( + const EncodableList& list_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoList" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + EncodableValue(list_arg), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = + std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoEnumList( + const EncodableList& enum_list_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoEnumList" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + EncodableValue(enum_list_arg), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = + std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoClassList( + const EncodableList& class_list_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoClassList" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + EncodableValue(class_list_arg), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = + std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoNonNullEnumList( + const EncodableList& enum_list_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNonNullEnumList" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + EncodableValue(enum_list_arg), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = + std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoNonNullClassList( + const EncodableList& class_list_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNonNullClassList" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + EncodableValue(class_list_arg), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = + std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoMap( + const EncodableMap& map_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoMap" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + EncodableValue(map_arg), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = + std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoStringMap( + const EncodableMap& string_map_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoStringMap" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + EncodableValue(string_map_arg), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = + std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoIntMap( + const EncodableMap& int_map_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoIntMap" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + EncodableValue(int_map_arg), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = + std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoEnumMap( + const EncodableMap& enum_map_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoEnumMap" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + EncodableValue(enum_map_arg), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = + std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoClassMap( + const EncodableMap& class_map_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoClassMap" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + EncodableValue(class_map_arg), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = + std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} - void AllNullableTypes::set_string_map(const EncodableMap& value_arg) { - string_map_ = value_arg; - } +void FlutterIntegrationCoreApi::EchoNonNullStringMap( + const EncodableMap& string_map_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNonNullStringMap" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + EncodableValue(string_map_arg), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = + std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} - const EncodableMap* AllNullableTypes::int_map() const { - return int_map_ ? &(*int_map_) : nullptr; - } +void FlutterIntegrationCoreApi::EchoNonNullIntMap( + const EncodableMap& int_map_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNonNullIntMap" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + EncodableValue(int_map_arg), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = + std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} - void AllNullableTypes::set_int_map(const EncodableMap* value_arg) { - int_map_ = - value_arg ? std::optional(*value_arg) : std::nullopt; - } +void FlutterIntegrationCoreApi::EchoNonNullEnumMap( + const EncodableMap& enum_map_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNonNullEnumMap" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + EncodableValue(enum_map_arg), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = + std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} - void AllNullableTypes::set_int_map(const EncodableMap& value_arg) { - int_map_ = value_arg; - } +void FlutterIntegrationCoreApi::EchoNonNullClassMap( + const EncodableMap& class_map_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNonNullClassMap" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + EncodableValue(class_map_arg), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = + std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} - const EncodableMap* AllNullableTypes::enum_map() const { - return enum_map_ ? &(*enum_map_) : nullptr; - } +void FlutterIntegrationCoreApi::EchoEnum( + const AnEnum& an_enum_arg, std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoEnum" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + CustomEncodableValue(an_enum_arg), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = std::any_cast( + std::get(list_return_value->at(0))); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} - void AllNullableTypes::set_enum_map(const EncodableMap* value_arg) { - enum_map_ = - value_arg ? std::optional(*value_arg) : std::nullopt; - } +void FlutterIntegrationCoreApi::EchoAnotherEnum( + const AnotherEnum& another_enum_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoAnotherEnum" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + CustomEncodableValue(another_enum_arg), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = std::any_cast( + std::get(list_return_value->at(0))); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} - void AllNullableTypes::set_enum_map(const EncodableMap& value_arg) { - enum_map_ = value_arg; - } +void FlutterIntegrationCoreApi::EchoNullableBool( + const bool* a_bool_arg, std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNullableBool" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + a_bool_arg ? EncodableValue(*a_bool_arg) : EncodableValue(), + }); + channel.Send(encoded_api_arguments, [channel_name, + on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, + size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto* return_value = std::get_if(&list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} - const EncodableMap* AllNullableTypes::object_map() const { - return object_map_ ? &(*object_map_) : nullptr; - } +void FlutterIntegrationCoreApi::EchoNullableInt( + const int64_t* an_int_arg, std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNullableInt" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + an_int_arg ? EncodableValue(*an_int_arg) : EncodableValue(), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto* return_value = + std::get_if(&list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} - void AllNullableTypes::set_object_map(const EncodableMap* value_arg) { - object_map_ = - value_arg ? std::optional(*value_arg) : std::nullopt; - } +void FlutterIntegrationCoreApi::EchoNullableDouble( + const double* a_double_arg, std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNullableDouble" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + a_double_arg ? EncodableValue(*a_double_arg) : EncodableValue(), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto* return_value = + std::get_if(&list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} - void AllNullableTypes::set_object_map(const EncodableMap& value_arg) { - object_map_ = value_arg; - } +void FlutterIntegrationCoreApi::EchoNullableString( + const std::string* a_string_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNullableString" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + a_string_arg ? EncodableValue(*a_string_arg) : EncodableValue(), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto* return_value = + std::get_if(&list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} - const EncodableMap* AllNullableTypes::list_map() const { - return list_map_ ? &(*list_map_) : nullptr; - } +void FlutterIntegrationCoreApi::EchoNullableUint8List( + const std::vector* list_arg, + std::function*)>&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNullableUint8List" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + list_arg ? EncodableValue(*list_arg) : EncodableValue(), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto* return_value = + std::get_if>(&list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} - void AllNullableTypes::set_list_map(const EncodableMap* value_arg) { - list_map_ = - value_arg ? std::optional(*value_arg) : std::nullopt; - } +void FlutterIntegrationCoreApi::EchoNullableList( + const EncodableList* list_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNullableList" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + list_arg ? EncodableValue(*list_arg) : EncodableValue(), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto* return_value = + std::get_if(&list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} - void AllNullableTypes::set_list_map(const EncodableMap& value_arg) { - list_map_ = value_arg; - } +void FlutterIntegrationCoreApi::EchoNullableEnumList( + const EncodableList* enum_list_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNullableEnumList" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + enum_list_arg ? EncodableValue(*enum_list_arg) : EncodableValue(), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto* return_value = + std::get_if(&list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} - const EncodableMap* AllNullableTypes::map_map() const { - return map_map_ ? &(*map_map_) : nullptr; - } +void FlutterIntegrationCoreApi::EchoNullableClassList( + const EncodableList* class_list_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNullableClassList" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + class_list_arg ? EncodableValue(*class_list_arg) : EncodableValue(), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto* return_value = + std::get_if(&list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} - void AllNullableTypes::set_map_map(const EncodableMap* value_arg) { - map_map_ = - value_arg ? std::optional(*value_arg) : std::nullopt; - } +void FlutterIntegrationCoreApi::EchoNullableNonNullEnumList( + const EncodableList* enum_list_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNullableNonNullEnumList" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + enum_list_arg ? EncodableValue(*enum_list_arg) : EncodableValue(), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto* return_value = + std::get_if(&list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} - void AllNullableTypes::set_map_map(const EncodableMap& value_arg) { - map_map_ = value_arg; - } +void FlutterIntegrationCoreApi::EchoNullableNonNullClassList( + const EncodableList* class_list_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNullableNonNullClassList" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + class_list_arg ? EncodableValue(*class_list_arg) : EncodableValue(), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto* return_value = + std::get_if(&list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} - const EncodableMap* AllNullableTypes::recursive_class_map() const { - return recursive_class_map_ ? &(*recursive_class_map_) : nullptr; - } +void FlutterIntegrationCoreApi::EchoNullableMap( + const EncodableMap* map_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNullableMap" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + map_arg ? EncodableValue(*map_arg) : EncodableValue(), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto* return_value = + std::get_if(&list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} - void AllNullableTypes::set_recursive_class_map( - const EncodableMap* value_arg) { - recursive_class_map_ = - value_arg ? std::optional(*value_arg) : std::nullopt; - } +void FlutterIntegrationCoreApi::EchoNullableStringMap( + const EncodableMap* string_map_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNullableStringMap" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + string_map_arg ? EncodableValue(*string_map_arg) : EncodableValue(), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto* return_value = + std::get_if(&list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} - void AllNullableTypes::set_recursive_class_map( - const EncodableMap& value_arg) { - recursive_class_map_ = value_arg; - } +void FlutterIntegrationCoreApi::EchoNullableIntMap( + const EncodableMap* int_map_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNullableIntMap" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + int_map_arg ? EncodableValue(*int_map_arg) : EncodableValue(), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto* return_value = + std::get_if(&list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} - EncodableList AllNullableTypes::ToEncodableList() const { - EncodableList list; - list.reserve(31); - list.push_back(a_nullable_bool_ ? EncodableValue(*a_nullable_bool_) - : EncodableValue()); - list.push_back(a_nullable_int_ ? EncodableValue(*a_nullable_int_) - : EncodableValue()); - list.push_back(a_nullable_int64_ ? EncodableValue(*a_nullable_int64_) - : EncodableValue()); - list.push_back(a_nullable_double_ ? EncodableValue(*a_nullable_double_) - : EncodableValue()); - list.push_back(a_nullable_byte_array_ - ? EncodableValue(*a_nullable_byte_array_) - : EncodableValue()); - list.push_back(a_nullable4_byte_array_ - ? EncodableValue(*a_nullable4_byte_array_) - : EncodableValue()); - list.push_back(a_nullable8_byte_array_ - ? EncodableValue(*a_nullable8_byte_array_) - : EncodableValue()); - list.push_back(a_nullable_float_array_ - ? EncodableValue(*a_nullable_float_array_) - : EncodableValue()); - list.push_back(a_nullable_enum_ ? CustomEncodableValue(*a_nullable_enum_) - : EncodableValue()); - list.push_back(another_nullable_enum_ - ? CustomEncodableValue(*another_nullable_enum_) - : EncodableValue()); - list.push_back(a_nullable_string_ ? EncodableValue(*a_nullable_string_) - : EncodableValue()); - list.push_back(a_nullable_object_ ? *a_nullable_object_ : EncodableValue()); - list.push_back(all_nullable_types_ - ? CustomEncodableValue(*all_nullable_types_) - : EncodableValue()); - list.push_back(list_ ? EncodableValue(*list_) : EncodableValue()); - list.push_back(string_list_ ? EncodableValue(*string_list_) - : EncodableValue()); - list.push_back(int_list_ ? EncodableValue(*int_list_) : EncodableValue()); - list.push_back(double_list_ ? EncodableValue(*double_list_) - : EncodableValue()); - list.push_back(bool_list_ ? EncodableValue(*bool_list_) : EncodableValue()); - list.push_back(enum_list_ ? EncodableValue(*enum_list_) : EncodableValue()); - list.push_back(object_list_ ? EncodableValue(*object_list_) - : EncodableValue()); - list.push_back(list_list_ ? EncodableValue(*list_list_) : EncodableValue()); - list.push_back(map_list_ ? EncodableValue(*map_list_) : EncodableValue()); - list.push_back(recursive_class_list_ - ? EncodableValue(*recursive_class_list_) - : EncodableValue()); - list.push_back(map_ ? EncodableValue(*map_) : EncodableValue()); - list.push_back(string_map_ ? EncodableValue(*string_map_) - : EncodableValue()); - list.push_back(int_map_ ? EncodableValue(*int_map_) : EncodableValue()); - list.push_back(enum_map_ ? EncodableValue(*enum_map_) : EncodableValue()); - list.push_back(object_map_ ? EncodableValue(*object_map_) - : EncodableValue()); - list.push_back(list_map_ ? EncodableValue(*list_map_) : EncodableValue()); - list.push_back(map_map_ ? EncodableValue(*map_map_) : EncodableValue()); - list.push_back(recursive_class_map_ ? EncodableValue(*recursive_class_map_) - : EncodableValue()); - return list; - } - - AllNullableTypes AllNullableTypes::FromEncodableList( - const EncodableList& list) { - AllNullableTypes decoded; - auto& encodable_a_nullable_bool = list[0]; - if (!encodable_a_nullable_bool.IsNull()) { - decoded.set_a_nullable_bool(std::get(encodable_a_nullable_bool)); - } - auto& encodable_a_nullable_int = list[1]; - if (!encodable_a_nullable_int.IsNull()) { - decoded.set_a_nullable_int(std::get(encodable_a_nullable_int)); - } - auto& encodable_a_nullable_int64 = list[2]; - if (!encodable_a_nullable_int64.IsNull()) { - decoded.set_a_nullable_int64( - std::get(encodable_a_nullable_int64)); - } - auto& encodable_a_nullable_double = list[3]; - if (!encodable_a_nullable_double.IsNull()) { - decoded.set_a_nullable_double( - std::get(encodable_a_nullable_double)); - } - auto& encodable_a_nullable_byte_array = list[4]; - if (!encodable_a_nullable_byte_array.IsNull()) { - decoded.set_a_nullable_byte_array( - std::get>(encodable_a_nullable_byte_array)); - } - auto& encodable_a_nullable4_byte_array = list[5]; - if (!encodable_a_nullable4_byte_array.IsNull()) { - decoded.set_a_nullable4_byte_array( - std::get>(encodable_a_nullable4_byte_array)); - } - auto& encodable_a_nullable8_byte_array = list[6]; - if (!encodable_a_nullable8_byte_array.IsNull()) { - decoded.set_a_nullable8_byte_array( - std::get>(encodable_a_nullable8_byte_array)); - } - auto& encodable_a_nullable_float_array = list[7]; - if (!encodable_a_nullable_float_array.IsNull()) { - decoded.set_a_nullable_float_array( - std::get>(encodable_a_nullable_float_array)); - } - auto& encodable_a_nullable_enum = list[8]; - if (!encodable_a_nullable_enum.IsNull()) { - decoded.set_a_nullable_enum(std::any_cast( - std::get(encodable_a_nullable_enum))); - } - auto& encodable_another_nullable_enum = list[9]; - if (!encodable_another_nullable_enum.IsNull()) { - decoded.set_another_nullable_enum(std::any_cast( - std::get(encodable_another_nullable_enum))); - } - auto& encodable_a_nullable_string = list[10]; - if (!encodable_a_nullable_string.IsNull()) { - decoded.set_a_nullable_string( - std::get(encodable_a_nullable_string)); - } - auto& encodable_a_nullable_object = list[11]; - if (!encodable_a_nullable_object.IsNull()) { - decoded.set_a_nullable_object(encodable_a_nullable_object); - } - auto& encodable_all_nullable_types = list[12]; - if (!encodable_all_nullable_types.IsNull()) { - decoded.set_all_nullable_types(std::any_cast( - std::get(encodable_all_nullable_types))); - } - auto& encodable_list = list[13]; - if (!encodable_list.IsNull()) { - decoded.set_list(std::get(encodable_list)); - } - auto& encodable_string_list = list[14]; - if (!encodable_string_list.IsNull()) { - decoded.set_string_list(std::get(encodable_string_list)); - } - auto& encodable_int_list = list[15]; - if (!encodable_int_list.IsNull()) { - decoded.set_int_list(std::get(encodable_int_list)); - } - auto& encodable_double_list = list[16]; - if (!encodable_double_list.IsNull()) { - decoded.set_double_list(std::get(encodable_double_list)); - } - auto& encodable_bool_list = list[17]; - if (!encodable_bool_list.IsNull()) { - decoded.set_bool_list(std::get(encodable_bool_list)); - } - auto& encodable_enum_list = list[18]; - if (!encodable_enum_list.IsNull()) { - decoded.set_enum_list(std::get(encodable_enum_list)); - } - auto& encodable_object_list = list[19]; - if (!encodable_object_list.IsNull()) { - decoded.set_object_list(std::get(encodable_object_list)); - } - auto& encodable_list_list = list[20]; - if (!encodable_list_list.IsNull()) { - decoded.set_list_list(std::get(encodable_list_list)); - } - auto& encodable_map_list = list[21]; - if (!encodable_map_list.IsNull()) { - decoded.set_map_list(std::get(encodable_map_list)); - } - auto& encodable_recursive_class_list = list[22]; - if (!encodable_recursive_class_list.IsNull()) { - decoded.set_recursive_class_list( - std::get(encodable_recursive_class_list)); - } - auto& encodable_map = list[23]; - if (!encodable_map.IsNull()) { - decoded.set_map(std::get(encodable_map)); - } - auto& encodable_string_map = list[24]; - if (!encodable_string_map.IsNull()) { - decoded.set_string_map(std::get(encodable_string_map)); - } - auto& encodable_int_map = list[25]; - if (!encodable_int_map.IsNull()) { - decoded.set_int_map(std::get(encodable_int_map)); - } - auto& encodable_enum_map = list[26]; - if (!encodable_enum_map.IsNull()) { - decoded.set_enum_map(std::get(encodable_enum_map)); - } - auto& encodable_object_map = list[27]; - if (!encodable_object_map.IsNull()) { - decoded.set_object_map(std::get(encodable_object_map)); - } - auto& encodable_list_map = list[28]; - if (!encodable_list_map.IsNull()) { - decoded.set_list_map(std::get(encodable_list_map)); - } - auto& encodable_map_map = list[29]; - if (!encodable_map_map.IsNull()) { - decoded.set_map_map(std::get(encodable_map_map)); +void FlutterIntegrationCoreApi::EchoNullableEnumMap( + const EncodableMap* enum_map_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNullableEnumMap" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + enum_map_arg ? EncodableValue(*enum_map_arg) : EncodableValue(), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto* return_value = + std::get_if(&list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoNullableClassMap( + const EncodableMap* class_map_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNullableClassMap" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + class_map_arg ? EncodableValue(*class_map_arg) : EncodableValue(), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto* return_value = + std::get_if(&list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoNullableNonNullStringMap( + const EncodableMap* string_map_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNullableNonNullStringMap" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + string_map_arg ? EncodableValue(*string_map_arg) : EncodableValue(), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto* return_value = + std::get_if(&list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoNullableNonNullIntMap( + const EncodableMap* int_map_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNullableNonNullIntMap" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + int_map_arg ? EncodableValue(*int_map_arg) : EncodableValue(), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto* return_value = + std::get_if(&list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoNullableNonNullEnumMap( + const EncodableMap* enum_map_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNullableNonNullEnumMap" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + enum_map_arg ? EncodableValue(*enum_map_arg) : EncodableValue(), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto* return_value = + std::get_if(&list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoNullableNonNullClassMap( + const EncodableMap* class_map_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNullableNonNullClassMap" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + class_map_arg ? EncodableValue(*class_map_arg) : EncodableValue(), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto* return_value = + std::get_if(&list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoNullableEnum( + const AnEnum* an_enum_arg, std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNullableEnum" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + an_enum_arg ? CustomEncodableValue(*an_enum_arg) : EncodableValue(), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + AnEnum return_value_value; + const AnEnum* return_value = nullptr; + if (!list_return_value->at(0).IsNull()) { + return_value_value = std::any_cast( + std::get(list_return_value->at(0))); + return_value = &return_value_value; + } + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoAnotherNullableEnum( + const AnotherEnum* another_enum_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoAnotherNullableEnum" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + another_enum_arg ? CustomEncodableValue(*another_enum_arg) + : EncodableValue(), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + AnotherEnum return_value_value; + const AnotherEnum* return_value = nullptr; + if (!list_return_value->at(0).IsNull()) { + return_value_value = std::any_cast( + std::get(list_return_value->at(0))); + return_value = &return_value_value; + } + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::NoopAsync( + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "noopAsync" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + on_success(); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoAsyncString( + const std::string& a_string_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoAsyncString" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + EncodableValue(a_string_arg), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = + std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +/// The codec used by HostTrivialApi. +const ::flutter::StandardMessageCodec& HostTrivialApi::GetCodec() { + return ::flutter::StandardMessageCodec::GetInstance( + &PigeonInternalCodecSerializer::GetInstance()); +} + +// Sets up an instance of `HostTrivialApi` to handle messages through the +// `binary_messenger`. +void HostTrivialApi::SetUp(::flutter::BinaryMessenger* binary_messenger, + HostTrivialApi* api) { + HostTrivialApi::SetUp(binary_messenger, api, ""); +} + +void HostTrivialApi::SetUp(::flutter::BinaryMessenger* binary_messenger, + HostTrivialApi* api, + const std::string& message_channel_suffix) { + const std::string prepended_suffix = + message_channel_suffix.length() > 0 + ? std::string(".") + message_channel_suffix + : ""; + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostTrivialApi.noop" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const ::flutter::MessageReply& reply) { + try { + std::optional output = api->Noop(); + 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); } - auto& encodable_recursive_class_map = list[30]; - if (!encodable_recursive_class_map.IsNull()) { - decoded.set_recursive_class_map( - std::get(encodable_recursive_class_map)); + } +} + +EncodableValue HostTrivialApi::WrapError(std::string_view error_message) { + return EncodableValue( + EncodableList{EncodableValue(std::string(error_message)), + EncodableValue("Error"), EncodableValue()}); +} + +EncodableValue HostTrivialApi::WrapError(const FlutterError& error) { + return EncodableValue(EncodableList{EncodableValue(error.code()), + EncodableValue(error.message()), + error.details()}); +} + +/// The codec used by HostSmallApi. +const ::flutter::StandardMessageCodec& HostSmallApi::GetCodec() { + return ::flutter::StandardMessageCodec::GetInstance( + &PigeonInternalCodecSerializer::GetInstance()); +} + +// Sets up an instance of `HostSmallApi` to handle messages through the +// `binary_messenger`. +void HostSmallApi::SetUp(::flutter::BinaryMessenger* binary_messenger, + HostSmallApi* api) { + HostSmallApi::SetUp(binary_messenger, api, ""); +} + +void HostSmallApi::SetUp(::flutter::BinaryMessenger* binary_messenger, + HostSmallApi* api, + const std::string& message_channel_suffix) { + const std::string prepended_suffix = + message_channel_suffix.length() > 0 + ? std::string(".") + message_channel_suffix + : ""; + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.echo" + + 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_a_string_arg = args.at(0); + if (encodable_a_string_arg.IsNull()) { + reply(WrapError("a_string_arg unexpectedly null.")); + return; + } + const auto& a_string_arg = + std::get(encodable_a_string_arg); + api->Echo(a_string_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); } - return decoded; - } - - bool AllNullableTypes::operator==(const AllNullableTypes& other) const { - return PigeonInternalDeepEquals(a_nullable_bool_, other.a_nullable_bool_) && - PigeonInternalDeepEquals(a_nullable_int_, other.a_nullable_int_) && - PigeonInternalDeepEquals(a_nullable_int64_, - other.a_nullable_int64_) && - PigeonInternalDeepEquals(a_nullable_double_, - other.a_nullable_double_) && - PigeonInternalDeepEquals(a_nullable_byte_array_, - other.a_nullable_byte_array_) && - PigeonInternalDeepEquals(a_nullable4_byte_array_, - other.a_nullable4_byte_array_) && - PigeonInternalDeepEquals(a_nullable8_byte_array_, - other.a_nullable8_byte_array_) && - PigeonInternalDeepEquals(a_nullable_float_array_, - other.a_nullable_float_array_) && - PigeonInternalDeepEquals(a_nullable_enum_, other.a_nullable_enum_) && - PigeonInternalDeepEquals(another_nullable_enum_, - other.another_nullable_enum_) && - PigeonInternalDeepEquals(a_nullable_string_, - other.a_nullable_string_) && - PigeonInternalDeepEquals(a_nullable_object_, - other.a_nullable_object_) && - PigeonInternalDeepEquals(all_nullable_types_, - other.all_nullable_types_) && - PigeonInternalDeepEquals(list_, other.list_) && - PigeonInternalDeepEquals(string_list_, other.string_list_) && - PigeonInternalDeepEquals(int_list_, other.int_list_) && - PigeonInternalDeepEquals(double_list_, other.double_list_) && - PigeonInternalDeepEquals(bool_list_, other.bool_list_) && - PigeonInternalDeepEquals(enum_list_, other.enum_list_) && - PigeonInternalDeepEquals(object_list_, other.object_list_) && - PigeonInternalDeepEquals(list_list_, other.list_list_) && - PigeonInternalDeepEquals(map_list_, other.map_list_) && - PigeonInternalDeepEquals(recursive_class_list_, - other.recursive_class_list_) && - PigeonInternalDeepEquals(map_, other.map_) && - PigeonInternalDeepEquals(string_map_, other.string_map_) && - PigeonInternalDeepEquals(int_map_, other.int_map_) && - PigeonInternalDeepEquals(enum_map_, other.enum_map_) && - PigeonInternalDeepEquals(object_map_, other.object_map_) && - PigeonInternalDeepEquals(list_map_, other.list_map_) && - PigeonInternalDeepEquals(map_map_, other.map_map_) && - PigeonInternalDeepEquals(recursive_class_map_, - other.recursive_class_map_); - } - - bool AllNullableTypes::operator!=(const AllNullableTypes& other) const { - return !(*this == other); - } - - size_t AllNullableTypes::Hash() const { - size_t result = 1; - result = result * 31 + PigeonInternalDeepHash(a_nullable_bool_); - result = result * 31 + PigeonInternalDeepHash(a_nullable_int_); - result = result * 31 + PigeonInternalDeepHash(a_nullable_int64_); - result = result * 31 + PigeonInternalDeepHash(a_nullable_double_); - result = result * 31 + PigeonInternalDeepHash(a_nullable_byte_array_); - result = result * 31 + PigeonInternalDeepHash(a_nullable4_byte_array_); - result = result * 31 + PigeonInternalDeepHash(a_nullable8_byte_array_); - result = result * 31 + PigeonInternalDeepHash(a_nullable_float_array_); - result = result * 31 + PigeonInternalDeepHash(a_nullable_enum_); - result = result * 31 + PigeonInternalDeepHash(another_nullable_enum_); - result = result * 31 + PigeonInternalDeepHash(a_nullable_string_); - result = result * 31 + PigeonInternalDeepHash(a_nullable_object_); - result = result * 31 + PigeonInternalDeepHash(all_nullable_types_); - result = result * 31 + PigeonInternalDeepHash(list_); - result = result * 31 + PigeonInternalDeepHash(string_list_); - result = result * 31 + PigeonInternalDeepHash(int_list_); - result = result * 31 + PigeonInternalDeepHash(double_list_); - result = result * 31 + PigeonInternalDeepHash(bool_list_); - result = result * 31 + PigeonInternalDeepHash(enum_list_); - result = result * 31 + PigeonInternalDeepHash(object_list_); - result = result * 31 + PigeonInternalDeepHash(list_list_); - result = result * 31 + PigeonInternalDeepHash(map_list_); - result = result * 31 + PigeonInternalDeepHash(recursive_class_list_); - result = result * 31 + PigeonInternalDeepHash(map_); - result = result * 31 + PigeonInternalDeepHash(string_map_); - result = result * 31 + PigeonInternalDeepHash(int_map_); - result = result * 31 + PigeonInternalDeepHash(enum_map_); - result = result * 31 + PigeonInternalDeepHash(object_map_); - result = result * 31 + PigeonInternalDeepHash(list_map_); - result = result * 31 + PigeonInternalDeepHash(map_map_); - result = result * 31 + PigeonInternalDeepHash(recursive_class_map_); - return result; - } - - std::string AllNullableTypes::ToString() const { - std::stringstream ss; - ss << "AllNullableTypes("; - ss << "aNullableBool: "; - if (a_nullable_bool_.has_value()) { - ss << *a_nullable_bool_; + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.voidVoid" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const ::flutter::MessageReply& reply) { + try { + api->VoidVoid([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 { - ss << "null"; - ss << ", aNullableInt: "; - if (a_nullable_int_.has_value()) { - ss << *a_nullable_int_; - } else { - ss << "null"; - ss << ", aNullableInt64: "; - if (a_nullable_int64_.has_value()) { - ss << *a_nullable_int64_; + channel.SetMessageHandler(nullptr); + } + } +} + +EncodableValue HostSmallApi::WrapError(std::string_view error_message) { + return EncodableValue( + EncodableList{EncodableValue(std::string(error_message)), + EncodableValue("Error"), EncodableValue()}); +} + +EncodableValue HostSmallApi::WrapError(const FlutterError& error) { + return EncodableValue(EncodableList{EncodableValue(error.code()), + EncodableValue(error.message()), + error.details()}); +} + +// Generated class from Pigeon that represents Flutter messages that can be +// called from C++. +FlutterSmallApi::FlutterSmallApi(::flutter::BinaryMessenger* binary_messenger) + : binary_messenger_(binary_messenger), message_channel_suffix_("") {} + +FlutterSmallApi::FlutterSmallApi(::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& FlutterSmallApi::GetCodec() { + return ::flutter::StandardMessageCodec::GetInstance( + &PigeonInternalCodecSerializer::GetInstance()); +} + +void FlutterSmallApi::EchoWrappedList( + const TestMessage& msg_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi." + "echoWrappedList" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + CustomEncodableValue(msg_arg), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = std::any_cast( + std::get(list_return_value->at(0))); + on_success(return_value); + } } else { - ss << "null"; - ss << ", aNullableDouble: "; - if (a_nullable_double_.has_value()) { - ss << *a_nullable_double_; + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterSmallApi::EchoString( + const std::string& a_string_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoString" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + EncodableValue(a_string_arg), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); } else { - ss << "null"; - ss << ", aNullableByteArray: "; - if (a_nullable_byte_array_.has_value()) { - ss << *a_nullable_byte_array_; - } else { - ss << "null"; - ss << ", aNullable4ByteArray: "; - if (a_nullable4_byte_array_.has_value()) { - ss << *a_nullable4_byte_array_; - } else { - ss << "null"; - ss << ", aNullable8ByteArray: "; - if (a_nullable8_byte_array_.has_value()) { - ss << *a_nullable8_byte_array_; - } else { - ss << "null"; - ss << ", aNullableFloatArray: "; - if (a_nullable_float_array_.has_value()) { - ss << *a_nullable_float_array_; - } else { - ss << "null"; - ss << ", aNullableEnum: "; - if (a_nullable_enum_.has_value()) { - ss << *a_nullable_enum_; - } else { - ss << "null"; - ss << ", anotherNullableEnum: "; - if (another_nullable_enum_.has_value()) { - ss << *another_nullable_enum_; - } else { - ss << "null"; - ss << ", aNullableString: "; - if (a_nullable_string_.has_value()) { - ss << *a_nullable_string_; - } else { - ss << "null"; - ss << ", aNullableObject: "; - if (a_nullable_object_.has_value()) { - ss << *a_nullable_object_; - } else { - ss << "null"; - ss << ", allNullableTypes: "; - if (all_nullable_types_.has_value()) { - ss << all_nullable_types_->ToString(); - } else { - ss << "null"; - ss << ", list: "; - if (list_.has_value()) { - ss << *list_; - } else { - ss << "null"; - ss << ", stringList: "; - if (string_list_.has_value()) { - ss << *string_list_; - } else { - ss << "null"; - ss << ", intList: "; - if (int_list_.has_value()) { - ss << *int_list_; - } else { - ss << "null"; - ss << ", doubleList: "; - if (double_list_.has_value()) { - ss << *double_list_; - } else { - ss << "null"; - ss << ", boolList: "; - if (bool_list_.has_value()) { - ss << *bool_list_; - } else { - ss << "null"; - ss << ", enumList: "; - if (enum_list_.has_value()) { - ss << *enum_list_; - } else { - ss << "null"; - ss << ", objectList: "; - if (object_list_.has_value()) { - ss << *object_list_; - } else { - ss << "null"; - ss << ", listList: "; - if (list_list_.has_value()) { - ss << *list_list_; - } else { - ss << "null"; - ss << ", mapList: "; - if (map_list_.has_value()) { - ss << *map_list_; - } else { - ss << "null"; - ss << ", recursiveClassList: "; - if (recursive_class_list_ - .has_value()) { - ss << *recursive_class_list_; - } else { - ss << "null"; - ss << ", map: "; - if (map_.has_value()) { - ss << *map_; - } else { - ss << "null"; - ss << ", stringMap: "; - if (string_map_ - .has_value()) { - ss << *string_map_; - } else { - ss << "null"; - ss << ", intMap: "; - if (int_map_ - .has_value()) { - ss << *int_map_; - } else { - ss << "null"; - ss << ", enumMap: "; - if (enum_map_ - .has_value()) { - ss << *enum_map_; - } else { - ss << "null"; - ss << ", objectMap: "; - if (object_map_ - .has_value()) { - ss << *object_map_; - } else { - ss << "null"; - ss << ", listMap: "; - if (list_map_ - .has_value()) { - ss << *list_map_; - } else { - ss << "null"; - ss << ", " - "mapMap: "; - if (map_map_ - .has_value()) { - ss << *map_map_; - } else { - ss << "null"; - ss << ", " - "recursiv" - "eClassMa" - "p: "; - if (recursive_class_map_ - .has_value()) { - ss << *recursive_class_map_; - } else { - ss << "null"; - ss << ")"; - return ss - .str(); - } - - size_t - PigeonInternalDeepHash( - const AllNullableTypes& - v) { - return v - .Hash(); - } - - // AllNullableTypesWithoutRecursion - - AllNullableTypesWithoutRecursion:: - AllNullableTypesWithoutRecursion() { - } - - AllNullableTypesWithoutRecursion::AllNullableTypesWithoutRecursion( - const bool* - a_nullable_bool, - const int64_t* - a_nullable_int, - const int64_t* - a_nullable_int64, - const double* - a_nullable_double, - const std::vector< - uint8_t>* - a_nullable_byte_array, - const std::vector< - int32_t>* - a_nullable4_byte_array, - const std::vector< - int64_t>* - a_nullable8_byte_array, - const std::vector< - double>* - a_nullable_float_array, - const AnEnum* - a_nullable_enum, - const AnotherEnum* - another_nullable_enum, - const std:: - string* - a_nullable_string, - const EncodableValue* - a_nullable_object, - const EncodableList* - list, - const EncodableList* - string_list, - const EncodableList* - int_list, - const EncodableList* - double_list, - const EncodableList* - bool_list, - const EncodableList* - enum_list, - const EncodableList* - object_list, - const EncodableList* - list_list, - const EncodableList* - map_list, - const EncodableMap* - map, - const EncodableMap* - string_map, - const EncodableMap* - int_map, - const EncodableMap* - enum_map, - const EncodableMap* - object_map, - const EncodableMap* - list_map, - const EncodableMap* - map_map) - : a_nullable_bool_( - a_nullable_bool - ? std::optional< - bool>( - *a_nullable_bool) - : std:: - nullopt), - a_nullable_int_( - a_nullable_int - ? std::optional< - int64_t>( - *a_nullable_int) - : std:: - nullopt), - a_nullable_int64_( - a_nullable_int64 - ? std::optional< - int64_t>( - *a_nullable_int64) - : std:: - nullopt), - a_nullable_double_( - a_nullable_double - ? std::optional< - double>( - *a_nullable_double) - : std:: - nullopt), - a_nullable_byte_array_( - a_nullable_byte_array - ? std::optional< - std::vector< - uint8_t>>( - *a_nullable_byte_array) - : std:: - nullopt), - a_nullable4_byte_array_( - a_nullable4_byte_array - ? std::optional< - std::vector< - int32_t>>( - *a_nullable4_byte_array) - : std:: - nullopt), - a_nullable8_byte_array_( - a_nullable8_byte_array - ? std::optional< - std::vector< - int64_t>>( - *a_nullable8_byte_array) - : std:: - nullopt), - a_nullable_float_array_( - a_nullable_float_array - ? std::optional< - std::vector< - double>>( - *a_nullable_float_array) - : std:: - nullopt), - a_nullable_enum_( - a_nullable_enum - ? std::optional< - AnEnum>( - *a_nullable_enum) - : std:: - nullopt), - another_nullable_enum_( - another_nullable_enum - ? std::optional< - AnotherEnum>( - *another_nullable_enum) - : std:: - nullopt), - a_nullable_string_( - a_nullable_string - ? std::optional< - std:: - string>( - *a_nullable_string) - : std:: - nullopt), - a_nullable_object_( - a_nullable_object - ? std::optional< - EncodableValue>( - *a_nullable_object) - : std:: - nullopt), - list_( - list - ? std::optional< - EncodableList>( - *list) - : std:: - nullopt), - string_list_( - string_list - ? std::optional< - EncodableList>( - *string_list) - : std:: - nullopt), - int_list_( - int_list - ? std::optional< - EncodableList>( - *int_list) - : std:: - nullopt), - double_list_( - double_list - ? std::optional< - EncodableList>( - *double_list) - : std:: - nullopt), - bool_list_( - bool_list ? std::optional( - *bool_list) - : std:: - nullopt), - enum_list_( - enum_list - ? std::optional< - EncodableList>( - *enum_list) - : std:: - nullopt), - object_list_( - object_list - ? std::optional< - EncodableList>( - *object_list) - : std:: - nullopt), - list_list_( - list_list - ? std::optional< - EncodableList>( - *list_list) - : std:: - nullopt), - map_list_( - map_list - ? std::optional< - EncodableList>( - *map_list) - : std:: - nullopt), - map_( - map ? std::optional< - EncodableMap>( - *map) - : std:: - nullopt), - string_map_( - string_map - ? std::optional< - EncodableMap>( - *string_map) - : std:: - nullopt), - int_map_( - int_map - ? std::optional< - EncodableMap>( - *int_map) - : std:: - nullopt), - enum_map_( - enum_map - ? std::optional< - EncodableMap>( - *enum_map) - : std:: - nullopt), - object_map_( - object_map - ? std::optional< - EncodableMap>( - *object_map) - : std:: - nullopt), - list_map_( - list_map - ? std::optional< - EncodableMap>( - *list_map) - : std:: - nullopt), - map_map_( - map_map - ? std::optional< - EncodableMap>( - *map_map) - : std:: - nullopt) { - } - - const bool* - AllNullableTypesWithoutRecursion:: - a_nullable_bool() - const { - return a_nullable_bool_ - ? &(*a_nullable_bool_) - : nullptr; - } - - void - AllNullableTypesWithoutRecursion:: - set_a_nullable_bool( - const bool* - value_arg) { - a_nullable_bool_ = - value_arg - ? std::optional< - bool>( - *value_arg) - : std:: - nullopt; - } - - void - AllNullableTypesWithoutRecursion:: - set_a_nullable_bool( - bool - value_arg) { - a_nullable_bool_ = - value_arg; - } - - const int64_t* - AllNullableTypesWithoutRecursion:: - a_nullable_int() - const { - return a_nullable_int_ - ? &(*a_nullable_int_) - : nullptr; - } - - void - AllNullableTypesWithoutRecursion:: - set_a_nullable_int( - const int64_t* - value_arg) { - a_nullable_int_ = - value_arg - ? std::optional< - int64_t>( - *value_arg) - : std:: - nullopt; - } - - void - AllNullableTypesWithoutRecursion:: - set_a_nullable_int( - int64_t - value_arg) { - a_nullable_int_ = - value_arg; - } - - const int64_t* - AllNullableTypesWithoutRecursion:: - a_nullable_int64() - const { - return a_nullable_int64_ - ? &(*a_nullable_int64_) - : nullptr; - } - - void - AllNullableTypesWithoutRecursion:: - set_a_nullable_int64( - const int64_t* - value_arg) { - a_nullable_int64_ = - value_arg - ? std::optional< - int64_t>( - *value_arg) - : std:: - nullopt; - } - - void - AllNullableTypesWithoutRecursion:: - set_a_nullable_int64( - int64_t - value_arg) { - a_nullable_int64_ = - value_arg; - } - - const double* - AllNullableTypesWithoutRecursion:: - a_nullable_double() - const { - return a_nullable_double_ - ? &(*a_nullable_double_) - : nullptr; - } - - void - AllNullableTypesWithoutRecursion:: - set_a_nullable_double( - const double* - value_arg) { - a_nullable_double_ = - value_arg - ? std::optional< - double>( - *value_arg) - : std:: - nullopt; - } - - void - AllNullableTypesWithoutRecursion:: - set_a_nullable_double( - double - value_arg) { - a_nullable_double_ = - value_arg; - } - - const std::vector< - uint8_t>* - AllNullableTypesWithoutRecursion:: - a_nullable_byte_array() - const { - return a_nullable_byte_array_ - ? &(*a_nullable_byte_array_) - : nullptr; - } - - void - AllNullableTypesWithoutRecursion:: - set_a_nullable_byte_array( - const std::vector< - uint8_t>* - value_arg) { - a_nullable_byte_array_ = - value_arg - ? std::optional< - std::vector< - uint8_t>>( - *value_arg) - : std:: - nullopt; - } - - void - AllNullableTypesWithoutRecursion:: - set_a_nullable_byte_array( - const std::vector< - uint8_t>& - value_arg) { - a_nullable_byte_array_ = - value_arg; - } - - const std::vector< - int32_t>* - AllNullableTypesWithoutRecursion:: - a_nullable4_byte_array() - const { - return a_nullable4_byte_array_ - ? &(*a_nullable4_byte_array_) - : nullptr; - } - - void - AllNullableTypesWithoutRecursion:: - set_a_nullable4_byte_array( - const std::vector< - int32_t>* - value_arg) { - a_nullable4_byte_array_ = - value_arg - ? std::optional< - std::vector< - int32_t>>( - *value_arg) - : std:: - nullopt; - } - - void - AllNullableTypesWithoutRecursion:: - set_a_nullable4_byte_array( - const std::vector< - int32_t>& - value_arg) { - a_nullable4_byte_array_ = - value_arg; - } - - const std::vector< - int64_t>* - AllNullableTypesWithoutRecursion:: - a_nullable8_byte_array() - const { - return a_nullable8_byte_array_ - ? &(*a_nullable8_byte_array_) - : nullptr; - } - - void - AllNullableTypesWithoutRecursion:: - set_a_nullable8_byte_array( - const std::vector< - int64_t>* - value_arg) { - a_nullable8_byte_array_ = - value_arg - ? std::optional< - std::vector< - int64_t>>( - *value_arg) - : std:: - nullopt; - } - - void - AllNullableTypesWithoutRecursion:: - set_a_nullable8_byte_array( - const std::vector< - int64_t>& - value_arg) { - a_nullable8_byte_array_ = - value_arg; - } - - const std::vector< - double>* - AllNullableTypesWithoutRecursion:: - a_nullable_float_array() - const { - return a_nullable_float_array_ - ? &(*a_nullable_float_array_) - : nullptr; - } - - void - AllNullableTypesWithoutRecursion:: - set_a_nullable_float_array( - const std::vector< - double>* - value_arg) { - a_nullable_float_array_ = - value_arg - ? std::optional< - std::vector< - double>>( - *value_arg) - : std:: - nullopt; - } - - void - AllNullableTypesWithoutRecursion:: - set_a_nullable_float_array( - const std::vector< - double>& - value_arg) { - a_nullable_float_array_ = - value_arg; - } - - const AnEnum* - AllNullableTypesWithoutRecursion:: - a_nullable_enum() - const { - return a_nullable_enum_ - ? &(*a_nullable_enum_) - : nullptr; - } - - void - AllNullableTypesWithoutRecursion:: - set_a_nullable_enum( - const AnEnum* - value_arg) { - a_nullable_enum_ = - value_arg - ? std::optional< - AnEnum>( - *value_arg) - : std:: - nullopt; - } - - void - AllNullableTypesWithoutRecursion:: - set_a_nullable_enum( - const AnEnum& - value_arg) { - a_nullable_enum_ = - value_arg; - } - - const AnotherEnum* - AllNullableTypesWithoutRecursion:: - another_nullable_enum() - const { - return another_nullable_enum_ - ? &(*another_nullable_enum_) - : nullptr; - } - - void - AllNullableTypesWithoutRecursion:: - set_another_nullable_enum( - const AnotherEnum* - value_arg) { - another_nullable_enum_ = - value_arg - ? std::optional< - AnotherEnum>( - *value_arg) - : std:: - nullopt; - } - - void - AllNullableTypesWithoutRecursion:: - set_another_nullable_enum( - const AnotherEnum& - value_arg) { - another_nullable_enum_ = - value_arg; - } - - const std::string* - AllNullableTypesWithoutRecursion:: - a_nullable_string() - const { - return a_nullable_string_ - ? &(*a_nullable_string_) - : nullptr; - } - - void - AllNullableTypesWithoutRecursion:: - set_a_nullable_string( - const std:: - string_view* - value_arg) { - a_nullable_string_ = - value_arg - ? std::optional< - std:: - string>( - *value_arg) - : std:: - nullopt; - } - - void - AllNullableTypesWithoutRecursion:: - set_a_nullable_string( - std::string_view - value_arg) { - a_nullable_string_ = - value_arg; - } - - const EncodableValue* - AllNullableTypesWithoutRecursion:: - a_nullable_object() - const { - return a_nullable_object_ - ? &(*a_nullable_object_) - : nullptr; - } - - void - AllNullableTypesWithoutRecursion:: - set_a_nullable_object( - const EncodableValue* - value_arg) { - a_nullable_object_ = - value_arg - ? std::optional< - EncodableValue>( - *value_arg) - : std:: - nullopt; - } - - void - AllNullableTypesWithoutRecursion:: - set_a_nullable_object( - const EncodableValue& - value_arg) { - a_nullable_object_ = - value_arg; - } - - const EncodableList* - AllNullableTypesWithoutRecursion:: - list() - const { - return list_ - ? &(*list_) - : nullptr; - } - - void - AllNullableTypesWithoutRecursion:: - set_list( - const EncodableList* - value_arg) { - list_ = - value_arg - ? std::optional< - EncodableList>( - *value_arg) - : std:: - nullopt; - } - - void - AllNullableTypesWithoutRecursion:: - set_list( - const EncodableList& - value_arg) { - list_ = - value_arg; - } - - const EncodableList* - AllNullableTypesWithoutRecursion:: - string_list() - const { - return string_list_ - ? &(*string_list_) - : nullptr; - } - - void - AllNullableTypesWithoutRecursion:: - set_string_list( - const EncodableList* - value_arg) { - string_list_ = - value_arg - ? std::optional< - EncodableList>( - *value_arg) - : std:: - nullopt; - } - - void - AllNullableTypesWithoutRecursion:: - set_string_list( - const EncodableList& - value_arg) { - string_list_ = - value_arg; - } - - const EncodableList* - AllNullableTypesWithoutRecursion:: - int_list() - const { - return int_list_ - ? &(*int_list_) - : nullptr; - } - - void - AllNullableTypesWithoutRecursion:: - set_int_list( - const EncodableList* - value_arg) { - int_list_ = - value_arg - ? std::optional< - EncodableList>( - *value_arg) - : std:: - nullopt; - } - - void - AllNullableTypesWithoutRecursion:: - set_int_list( - const EncodableList& - value_arg) { - int_list_ = - value_arg; - } - - const EncodableList* - AllNullableTypesWithoutRecursion:: - double_list() - const { - return double_list_ - ? &(*double_list_) - : nullptr; - } - - void - AllNullableTypesWithoutRecursion:: - set_double_list( - const EncodableList* - value_arg) { - double_list_ = - value_arg - ? std::optional< - EncodableList>( - *value_arg) - : std:: - nullopt; - } - - void - AllNullableTypesWithoutRecursion:: - set_double_list( - const EncodableList& - value_arg) { - double_list_ = - value_arg; - } - - const EncodableList* - AllNullableTypesWithoutRecursion:: - bool_list() - const { - return bool_list_ - ? &(*bool_list_) - : nullptr; - } - - void - AllNullableTypesWithoutRecursion:: - set_bool_list( - const EncodableList* - value_arg) { - bool_list_ = - value_arg - ? std::optional< - EncodableList>( - *value_arg) - : std:: - nullopt; - } - - void - AllNullableTypesWithoutRecursion:: - set_bool_list( - const EncodableList& - value_arg) { - bool_list_ = - value_arg; - } - - const EncodableList* - AllNullableTypesWithoutRecursion:: - enum_list() - const { - return enum_list_ - ? &(*enum_list_) - : nullptr; - } - - void - AllNullableTypesWithoutRecursion:: - set_enum_list( - const EncodableList* - value_arg) { - enum_list_ = - value_arg - ? std::optional< - EncodableList>( - *value_arg) - : std:: - nullopt; - } - - void - AllNullableTypesWithoutRecursion:: - set_enum_list( - const EncodableList& - value_arg) { - enum_list_ = - value_arg; - } - - const EncodableList* - AllNullableTypesWithoutRecursion:: - object_list() - const { - return object_list_ - ? &(*object_list_) - : nullptr; - } - - void - AllNullableTypesWithoutRecursion:: - set_object_list( - const EncodableList* - value_arg) { - object_list_ = - value_arg - ? std::optional< - EncodableList>( - *value_arg) - : std:: - nullopt; - } - - void - AllNullableTypesWithoutRecursion:: - set_object_list( - const EncodableList& - value_arg) { - object_list_ = - value_arg; - } - - const EncodableList* - AllNullableTypesWithoutRecursion:: - list_list() - const { - return list_list_ - ? &(*list_list_) - : nullptr; - } - - void - AllNullableTypesWithoutRecursion:: - set_list_list( - const EncodableList* - value_arg) { - list_list_ = - value_arg - ? std::optional< - EncodableList>( - *value_arg) - : std:: - nullopt; - } - - void - AllNullableTypesWithoutRecursion:: - set_list_list( - const EncodableList& - value_arg) { - list_list_ = - value_arg; - } - - const EncodableList* - AllNullableTypesWithoutRecursion:: - map_list() - const { - return map_list_ - ? &(*map_list_) - : nullptr; - } - - void - AllNullableTypesWithoutRecursion:: - set_map_list( - const EncodableList* - value_arg) { - map_list_ = - value_arg - ? std::optional< - EncodableList>( - *value_arg) - : std:: - nullopt; - } - - void - AllNullableTypesWithoutRecursion:: - set_map_list( - const EncodableList& - value_arg) { - map_list_ = - value_arg; - } - - const EncodableMap* - AllNullableTypesWithoutRecursion:: - map() - const { - return map_ - ? &(*map_) - : nullptr; - } - - void - AllNullableTypesWithoutRecursion:: - set_map( - const EncodableMap* - value_arg) { - map_ = - value_arg - ? std::optional< - EncodableMap>( - *value_arg) - : std:: - nullopt; - } - - void - AllNullableTypesWithoutRecursion:: - set_map( - const EncodableMap& - value_arg) { - map_ = - value_arg; - } - - const EncodableMap* - AllNullableTypesWithoutRecursion:: - string_map() - const { - return string_map_ - ? &(*string_map_) - : nullptr; - } - - void - AllNullableTypesWithoutRecursion:: - set_string_map( - const EncodableMap* - value_arg) { - string_map_ = - value_arg - ? std::optional< - EncodableMap>( - *value_arg) - : std:: - nullopt; - } - - void - AllNullableTypesWithoutRecursion:: - set_string_map( - const EncodableMap& - value_arg) { - string_map_ = - value_arg; - } - - const EncodableMap* - AllNullableTypesWithoutRecursion:: - int_map() - const { - return int_map_ - ? &(*int_map_) - : nullptr; - } - - void - AllNullableTypesWithoutRecursion:: - set_int_map( - const EncodableMap* - value_arg) { - int_map_ = - value_arg - ? std::optional< - EncodableMap>( - *value_arg) - : std:: - nullopt; - } - - void - AllNullableTypesWithoutRecursion:: - set_int_map( - const EncodableMap& - value_arg) { - int_map_ = - value_arg; - } - - const EncodableMap* - AllNullableTypesWithoutRecursion:: - enum_map() - const { - return enum_map_ - ? &(*enum_map_) - : nullptr; - } - - void - AllNullableTypesWithoutRecursion:: - set_enum_map( - const EncodableMap* - value_arg) { - enum_map_ = - value_arg - ? std::optional< - EncodableMap>( - *value_arg) - : std:: - nullopt; - } - - void - AllNullableTypesWithoutRecursion:: - set_enum_map( - const EncodableMap& - value_arg) { - enum_map_ = - value_arg; - } - - const EncodableMap* - AllNullableTypesWithoutRecursion:: - object_map() - const { - return object_map_ - ? &(*object_map_) - : nullptr; - } - - void - AllNullableTypesWithoutRecursion:: - set_object_map( - const EncodableMap* - value_arg) { - object_map_ = - value_arg - ? std::optional< - EncodableMap>( - *value_arg) - : std:: - nullopt; - } - - void - AllNullableTypesWithoutRecursion:: - set_object_map( - const EncodableMap& - value_arg) { - object_map_ = - value_arg; - } - - const EncodableMap* - AllNullableTypesWithoutRecursion:: - list_map() - const { - return list_map_ - ? &(*list_map_) - : nullptr; - } - - void - AllNullableTypesWithoutRecursion:: - set_list_map( - const EncodableMap* - value_arg) { - list_map_ = - value_arg - ? std::optional< - EncodableMap>( - *value_arg) - : std:: - nullopt; - } - - void - AllNullableTypesWithoutRecursion:: - set_list_map( - const EncodableMap& - value_arg) { - list_map_ = - value_arg; - } - - const EncodableMap* - AllNullableTypesWithoutRecursion:: - map_map() - const { - return map_map_ - ? &(*map_map_) - : nullptr; - } - - void - AllNullableTypesWithoutRecursion:: - set_map_map( - const EncodableMap* - value_arg) { - map_map_ = - value_arg - ? std::optional< - EncodableMap>( - *value_arg) - : std:: - nullopt; - } - - void - AllNullableTypesWithoutRecursion:: - set_map_map( - const EncodableMap& - value_arg) { - map_map_ = - value_arg; - } - - EncodableList - AllNullableTypesWithoutRecursion:: - ToEncodableList() - const { - EncodableList - list; - list.reserve( - 28); - list.push_back( - a_nullable_bool_ - ? EncodableValue( - *a_nullable_bool_) - : EncodableValue()); - list.push_back( - a_nullable_int_ - ? EncodableValue( - *a_nullable_int_) - : EncodableValue()); - list.push_back( - a_nullable_int64_ - ? EncodableValue( - *a_nullable_int64_) - : EncodableValue()); - list.push_back( - a_nullable_double_ - ? EncodableValue( - *a_nullable_double_) - : EncodableValue()); - list.push_back( - a_nullable_byte_array_ - ? EncodableValue( - *a_nullable_byte_array_) - : EncodableValue()); - list.push_back( - a_nullable4_byte_array_ - ? EncodableValue( - *a_nullable4_byte_array_) - : EncodableValue()); - list.push_back( - a_nullable8_byte_array_ - ? EncodableValue( - *a_nullable8_byte_array_) - : EncodableValue()); - list.push_back( - a_nullable_float_array_ - ? EncodableValue( - *a_nullable_float_array_) - : EncodableValue()); - list.push_back( - a_nullable_enum_ - ? CustomEncodableValue( - *a_nullable_enum_) - : EncodableValue()); - list.push_back( - another_nullable_enum_ - ? CustomEncodableValue( - *another_nullable_enum_) - : EncodableValue()); - list.push_back( - a_nullable_string_ - ? EncodableValue( - *a_nullable_string_) - : EncodableValue()); - list.push_back( - a_nullable_object_ - ? *a_nullable_object_ - : EncodableValue()); - list.push_back( - list_ - ? EncodableValue( - *list_) - : EncodableValue()); - list.push_back( - string_list_ - ? EncodableValue( - *string_list_) - : EncodableValue()); - list.push_back( - int_list_ - ? EncodableValue( - *int_list_) - : EncodableValue()); - list.push_back( - double_list_ - ? EncodableValue( - *double_list_) - : EncodableValue()); - list.push_back( - bool_list_ - ? EncodableValue( - *bool_list_) - : EncodableValue()); - list.push_back( - enum_list_ - ? EncodableValue( - *enum_list_) - : EncodableValue()); - list.push_back( - object_list_ - ? EncodableValue( - *object_list_) - : EncodableValue()); - list.push_back( - list_list_ - ? EncodableValue( - *list_list_) - : EncodableValue()); - list.push_back( - map_list_ - ? EncodableValue( - *map_list_) - : EncodableValue()); - list.push_back( - map_ - ? EncodableValue( - *map_) - : EncodableValue()); - list.push_back( - string_map_ - ? EncodableValue( - *string_map_) - : EncodableValue()); - list.push_back( - int_map_ - ? EncodableValue( - *int_map_) - : EncodableValue()); - list.push_back( - enum_map_ - ? EncodableValue( - *enum_map_) - : EncodableValue()); - list.push_back( - object_map_ - ? EncodableValue( - *object_map_) - : EncodableValue()); - list.push_back( - list_map_ - ? EncodableValue( - *list_map_) - : EncodableValue()); - list.push_back( - map_map_ - ? EncodableValue( - *map_map_) - : EncodableValue()); - return list; - } - - AllNullableTypesWithoutRecursion - AllNullableTypesWithoutRecursion:: - FromEncodableList( - const EncodableList& - list) { - AllNullableTypesWithoutRecursion - decoded; - auto& - encodable_a_nullable_bool = - list[0]; - if (!encodable_a_nullable_bool - .IsNull()) { - decoded.set_a_nullable_bool( - std::get< - bool>( - encodable_a_nullable_bool)); - } - auto& - encodable_a_nullable_int = - list[1]; - if (!encodable_a_nullable_int - .IsNull()) { - decoded.set_a_nullable_int( - std::get< - int64_t>( - encodable_a_nullable_int)); - } - auto& - encodable_a_nullable_int64 = - list[2]; - if (!encodable_a_nullable_int64 - .IsNull()) { - decoded.set_a_nullable_int64( - std::get< - int64_t>( - encodable_a_nullable_int64)); - } - auto& - encodable_a_nullable_double = - list[3]; - if (!encodable_a_nullable_double - .IsNull()) { - decoded.set_a_nullable_double( - std::get< - double>( - encodable_a_nullable_double)); - } - auto& - encodable_a_nullable_byte_array = - list[4]; - if (!encodable_a_nullable_byte_array - .IsNull()) { - decoded.set_a_nullable_byte_array( - std::get< - std::vector< - uint8_t>>( - encodable_a_nullable_byte_array)); - } - auto& - encodable_a_nullable4_byte_array = - list[5]; - if (!encodable_a_nullable4_byte_array - .IsNull()) { - decoded.set_a_nullable4_byte_array( - std::get< - std::vector< - int32_t>>( - encodable_a_nullable4_byte_array)); - } - auto& - encodable_a_nullable8_byte_array = - list[6]; - if (!encodable_a_nullable8_byte_array - .IsNull()) { - decoded.set_a_nullable8_byte_array( - std::get< - std::vector< - int64_t>>( - encodable_a_nullable8_byte_array)); - } - auto& - encodable_a_nullable_float_array = - list[7]; - if (!encodable_a_nullable_float_array - .IsNull()) { - decoded.set_a_nullable_float_array( - std::get< - std::vector< - double>>( - encodable_a_nullable_float_array)); - } - auto& - encodable_a_nullable_enum = - list[8]; - if (!encodable_a_nullable_enum - .IsNull()) { - decoded.set_a_nullable_enum( - std::any_cast< - const AnEnum&>( - std::get< - CustomEncodableValue>( - encodable_a_nullable_enum))); - } - auto& - encodable_another_nullable_enum = - list[9]; - if (!encodable_another_nullable_enum - .IsNull()) { - decoded.set_another_nullable_enum( - std::any_cast< - const AnotherEnum&>( - std::get< - CustomEncodableValue>( - encodable_another_nullable_enum))); - } - auto& encodable_a_nullable_string = - list[10]; - if (!encodable_a_nullable_string - .IsNull()) { - decoded.set_a_nullable_string( - std::get< - std:: - string>( - encodable_a_nullable_string)); - } - auto& encodable_a_nullable_object = - list[11]; - if (!encodable_a_nullable_object - .IsNull()) { - decoded.set_a_nullable_object( - encodable_a_nullable_object); - } - auto& encodable_list = - list[12]; - if (!encodable_list - .IsNull()) { - decoded.set_list( - std::get< - EncodableList>( - encodable_list)); - } - auto& encodable_string_list = - list[13]; - if (!encodable_string_list - .IsNull()) { - decoded.set_string_list( - std::get< - EncodableList>( - encodable_string_list)); - } - auto& encodable_int_list = - list[14]; - if (!encodable_int_list - .IsNull()) { - decoded.set_int_list( - std::get< - EncodableList>( - encodable_int_list)); - } - auto& encodable_double_list = - list[15]; - if (!encodable_double_list - .IsNull()) { - decoded.set_double_list( - std::get< - EncodableList>( - encodable_double_list)); - } - auto& encodable_bool_list = - list[16]; - if (!encodable_bool_list - .IsNull()) { - decoded.set_bool_list( - std::get< - EncodableList>( - encodable_bool_list)); - } - auto& encodable_enum_list = - list[17]; - if (!encodable_enum_list - .IsNull()) { - decoded.set_enum_list( - std::get< - EncodableList>( - encodable_enum_list)); - } - auto& encodable_object_list = - list[18]; - if (!encodable_object_list - .IsNull()) { - decoded.set_object_list( - std::get< - EncodableList>( - encodable_object_list)); - } - auto& encodable_list_list = - list[19]; - if (!encodable_list_list - .IsNull()) { - decoded.set_list_list( - std::get< - EncodableList>( - encodable_list_list)); - } - auto& encodable_map_list = - list[20]; - if (!encodable_map_list - .IsNull()) { - decoded.set_map_list( - std::get< - EncodableList>( - encodable_map_list)); - } - auto& encodable_map = - list[21]; - if (!encodable_map - .IsNull()) { - decoded.set_map( - std::get< - EncodableMap>( - encodable_map)); - } - auto& encodable_string_map = - list[22]; - if (!encodable_string_map - .IsNull()) { - decoded.set_string_map( - std::get< - EncodableMap>( - encodable_string_map)); - } - auto& encodable_int_map = - list[23]; - if (!encodable_int_map - .IsNull()) { - decoded.set_int_map( - std::get< - EncodableMap>( - encodable_int_map)); - } - auto& encodable_enum_map = - list[24]; - if (!encodable_enum_map - .IsNull()) { - decoded.set_enum_map( - std::get< - EncodableMap>( - encodable_enum_map)); - } - auto& encodable_object_map = - list[25]; - if (!encodable_object_map - .IsNull()) { - decoded.set_object_map( - std::get< - EncodableMap>( - encodable_object_map)); - } - auto& encodable_list_map = - list[26]; - if (!encodable_list_map - .IsNull()) { - decoded.set_list_map( - std::get< - EncodableMap>( - encodable_list_map)); - } - auto& encodable_map_map = - list[27]; - if (!encodable_map_map - .IsNull()) { - decoded.set_map_map( - std::get< - EncodableMap>( - encodable_map_map)); - } - return decoded; - } - - bool - AllNullableTypesWithoutRecursion:: - operator==( - const AllNullableTypesWithoutRecursion& - other) - const { - return PigeonInternalDeepEquals( - a_nullable_bool_, - other - .a_nullable_bool_) && - PigeonInternalDeepEquals( - a_nullable_int_, - other - .a_nullable_int_) && - PigeonInternalDeepEquals( - a_nullable_int64_, - other - .a_nullable_int64_) && - PigeonInternalDeepEquals( - a_nullable_double_, - other - .a_nullable_double_) && - PigeonInternalDeepEquals( - a_nullable_byte_array_, - other - .a_nullable_byte_array_) && - PigeonInternalDeepEquals( - a_nullable4_byte_array_, - other - .a_nullable4_byte_array_) && - PigeonInternalDeepEquals( - a_nullable8_byte_array_, - other - .a_nullable8_byte_array_) && - PigeonInternalDeepEquals( - a_nullable_float_array_, - other - .a_nullable_float_array_) && - PigeonInternalDeepEquals( - a_nullable_enum_, - other - .a_nullable_enum_) && - PigeonInternalDeepEquals( - another_nullable_enum_, - other - .another_nullable_enum_) && - PigeonInternalDeepEquals( - a_nullable_string_, - other - .a_nullable_string_) && - PigeonInternalDeepEquals( - a_nullable_object_, - other - .a_nullable_object_) && - PigeonInternalDeepEquals( - list_, - other - .list_) && - PigeonInternalDeepEquals( - string_list_, - other - .string_list_) && - PigeonInternalDeepEquals( - int_list_, - other - .int_list_) && - PigeonInternalDeepEquals( - double_list_, - other - .double_list_) && - PigeonInternalDeepEquals( - bool_list_, - other - .bool_list_) && - PigeonInternalDeepEquals( - enum_list_, - other - .enum_list_) && - PigeonInternalDeepEquals( - object_list_, - other - .object_list_) && - PigeonInternalDeepEquals( - list_list_, - other - .list_list_) && - PigeonInternalDeepEquals( - map_list_, - other - .map_list_) && - PigeonInternalDeepEquals( - map_, - other - .map_) && - PigeonInternalDeepEquals( - string_map_, - other - .string_map_) && - PigeonInternalDeepEquals( - int_map_, - other - .int_map_) && - PigeonInternalDeepEquals( - enum_map_, - other - .enum_map_) && - PigeonInternalDeepEquals( - object_map_, - other - .object_map_) && - PigeonInternalDeepEquals( - list_map_, - other - .list_map_) && - PigeonInternalDeepEquals( - map_map_, - other - .map_map_); - } - - bool - AllNullableTypesWithoutRecursion:: - operator!=( - const AllNullableTypesWithoutRecursion& - other) - const { - return !( - *this == - other); - } - - size_t - AllNullableTypesWithoutRecursion:: - Hash() - const { - size_t - result = - 1; - result = - result * - 31 + - PigeonInternalDeepHash( - a_nullable_bool_); - result = - result * - 31 + - PigeonInternalDeepHash( - a_nullable_int_); - result = - result * - 31 + - PigeonInternalDeepHash( - a_nullable_int64_); - result = - result * - 31 + - PigeonInternalDeepHash( - a_nullable_double_); - result = - result * - 31 + - PigeonInternalDeepHash( - a_nullable_byte_array_); - result = - result * - 31 + - PigeonInternalDeepHash( - a_nullable4_byte_array_); - result = - result * - 31 + - PigeonInternalDeepHash( - a_nullable8_byte_array_); - result = - result * - 31 + - PigeonInternalDeepHash( - a_nullable_float_array_); - result = - result * - 31 + - PigeonInternalDeepHash( - a_nullable_enum_); - result = - result * - 31 + - PigeonInternalDeepHash( - another_nullable_enum_); - result = - result * - 31 + - PigeonInternalDeepHash( - a_nullable_string_); - result = - result * - 31 + - PigeonInternalDeepHash( - a_nullable_object_); - result = - result * - 31 + - PigeonInternalDeepHash( - list_); - result = - result * - 31 + - PigeonInternalDeepHash( - string_list_); - result = - result * - 31 + - PigeonInternalDeepHash( - int_list_); - result = - result * - 31 + - PigeonInternalDeepHash( - double_list_); - result = - result * - 31 + - PigeonInternalDeepHash( - bool_list_); - result = - result * - 31 + - PigeonInternalDeepHash( - enum_list_); - result = - result * - 31 + - PigeonInternalDeepHash( - object_list_); - result = - result * - 31 + - PigeonInternalDeepHash( - list_list_); - result = - result * - 31 + - PigeonInternalDeepHash( - map_list_); - result = - result * - 31 + - PigeonInternalDeepHash( - map_); - result = - result * - 31 + - PigeonInternalDeepHash( - string_map_); - result = - result * - 31 + - PigeonInternalDeepHash( - int_map_); - result = - result * - 31 + - PigeonInternalDeepHash( - enum_map_); - result = - result * - 31 + - PigeonInternalDeepHash( - object_map_); - result = - result * - 31 + - PigeonInternalDeepHash( - list_map_); - result = - result * - 31 + - PigeonInternalDeepHash( - map_map_); - return result; - } - - std::string - AllNullableTypesWithoutRecursion:: - ToString() - const { - std:: - stringstream - ss; - ss << "AllNul" - "lableT" - "ypesWi" - "thoutR" - "ecursi" - "on("; - ss << "aNulla" - "bleBoo" - "l: "; - if (a_nullable_bool_ - .has_value()) { - ss << *a_nullable_bool_; - } else { - ss << "nul" - "l"; - ss << ", " - "aNul" - "labl" - "eInt" - ": "; - if (a_nullable_int_ - .has_value()) { - ss << *a_nullable_int_; - } else { - ss << "nu" - "l" - "l"; - ss << ", " - "aN" - "ul" - "la" - "bl" - "eI" - "nt" - "64" - ":" - " "; - if (a_nullable_int64_ - .has_value()) { - ss << *a_nullable_int64_; - } else { - ss << "null"; - ss << ", aNullableDouble: "; - if (a_nullable_double_ - .has_value()) { - ss << *a_nullable_double_; - } else { - ss << "null"; - ss << ", aNullableByteArray: "; - if (a_nullable_byte_array_ - .has_value()) { - ss << *a_nullable_byte_array_; - } else { - ss << "null"; - ss << ", aNullable4ByteArray: "; - if (a_nullable4_byte_array_ - .has_value()) { - ss << *a_nullable4_byte_array_; - } else { - ss << "null"; - ss << ", aNullable8ByteArray: "; - if (a_nullable8_byte_array_ - .has_value()) { - ss << *a_nullable8_byte_array_; - } else { - ss << "null"; - ss << ", aNullableFloatArray: "; - if (a_nullable_float_array_ - .has_value()) { - ss << *a_nullable_float_array_; - } else { - ss << "null"; - ss << ", aNullableEnum: "; - if (a_nullable_enum_ - .has_value()) { - ss << *a_nullable_enum_; - } else { - ss << "null"; - ss << ", anotherNullableEnum: "; - if (another_nullable_enum_ - .has_value()) { - ss << *another_nullable_enum_; - } else { - ss << "null"; - ss << ", aNullableString: "; - if (a_nullable_string_ - .has_value()) { - ss << *a_nullable_string_; - } else { - ss << "null"; - ss << ", aNullableObject: "; - if (a_nullable_object_ - .has_value()) { - ss << *a_nullable_object_; - } else { - ss << "null"; - ss << ", list: "; - if (list_ - .has_value()) { - ss << *list_; - } else { - ss << "null"; - ss << ", stringList: "; - if (string_list_ - .has_value()) { - ss << *string_list_; - } else { - ss << "null"; - ss << ", intList: "; - if (int_list_ - .has_value()) { - ss << *int_list_; - } else { - ss << "null"; - ss << ", doubleList: "; - if (double_list_ - .has_value()) { - ss << *double_list_; - } else { - ss << "null"; - ss << ", boolList: "; - if (bool_list_ - .has_value()) { - ss << *bool_list_; - } else { - ss << "null"; - ss << ", enumList: "; - if (enum_list_ - .has_value()) { - ss << *enum_list_; - } else { - ss << "null"; - ss << ", objectList: "; - if (object_list_ - .has_value()) { - ss << *object_list_; - } else { - ss << "null"; - ss << ", listList: "; - if (list_list_ - .has_value()) { - ss << *list_list_; - } else { - ss << "null"; - ss << ", mapList: "; - if (map_list_ - .has_value()) { - ss << *map_list_; - } else { - ss << "null"; - ss << ", map: "; - if (map_.has_value()) { - ss << *map_; - } else { - ss << "null"; - ss << ", stringMap: "; - if (string_map_ - .has_value()) { - ss << *string_map_; - } else { - ss << "null"; - ss << ", intMap: "; - if (int_map_ - .has_value()) { - ss << *int_map_; - } else { - ss << "null"; - ss << ", enumMap: "; - if (enum_map_ - .has_value()) { - ss << *enum_map_; - } else { - ss << "null"; - ss << ", objectMap: "; - if (object_map_ - .has_value()) { - ss << *object_map_; - } else { - ss << "null"; - ss << ", listMap: "; - if (list_map_ - .has_value()) { - ss << *list_map_; - } else { - ss << "null"; - ss << ", mapMap: "; - if (map_map_ - .has_value()) { - ss << *map_map_; - } else { - ss << "null"; - ss << ")"; - return ss - .str(); - } - - size_t - PigeonInternalDeepHash( - const AllNullableTypesWithoutRecursion& - v) { - return v - .Hash(); - } - - // AllClassesWrapper - - AllClassesWrapper::AllClassesWrapper( - const AllNullableTypes& - all_nullable_types, - const EncodableList& - class_list, - const EncodableMap& - class_map) - : all_nullable_types_( - std::make_unique< - AllNullableTypes>( - all_nullable_types)), - class_list_( - class_list), - class_map_( - class_map) { - } - - AllClassesWrapper::AllClassesWrapper( - const AllNullableTypes& - all_nullable_types, - const AllNullableTypesWithoutRecursion* - all_nullable_types_without_recursion, - const AllTypes* - all_types, - const EncodableList& - class_list, - const EncodableList* - nullable_class_list, - const EncodableMap& - class_map, - const EncodableMap* - nullable_class_map) - : all_nullable_types_(std::make_unique(all_nullable_types)), all_nullable_types_without_recursion_(all_nullable_types_without_recursion ? std::make_unique(*all_nullable_types_without_recursion) : nullptr), all_types_(all_types ? std::make_unique(*all_types) : nullptr), class_list_(class_list), nullable_class_list_(nullable_class_list ? std::optional(*nullable_class_list) : std::nullopt), class_map_(class_map), nullable_class_map_(nullable_class_map ? std::optional(*nullable_class_map) : std::nullopt) { - } - - AllClassesWrapper:: - AllClassesWrapper( - const AllClassesWrapper& - other) - : all_nullable_types_( - std::make_unique< - AllNullableTypes>( - *other - .all_nullable_types_)), - all_nullable_types_without_recursion_( - other.all_nullable_types_without_recursion_ - ? std::make_unique< - AllNullableTypesWithoutRecursion>( - *other - .all_nullable_types_without_recursion_) - : nullptr), - all_types_( - other.all_types_ - ? std:: - make_unique< - AllTypes>(*other - .all_types_) - : nullptr), - class_list_( - other - .class_list_), - nullable_class_list_( - other.nullable_class_list_ - ? std::optional< - EncodableList>( - *other - .nullable_class_list_) - : std:: - nullopt), - class_map_( - other - .class_map_), - nullable_class_map_( - other.nullable_class_map_ ? std:: - optional< - EncodableMap>( - *other - .nullable_class_map_) - : std:: - nullopt) { - } - - AllClassesWrapper& - AllClassesWrapper:: - operator=( - const AllClassesWrapper& - other) { - all_nullable_types_ = - std::make_unique< - AllNullableTypes>( - *other - .all_nullable_types_); - all_nullable_types_without_recursion_ = - other.all_nullable_types_without_recursion_ - ? std::make_unique< - AllNullableTypesWithoutRecursion>( - *other - .all_nullable_types_without_recursion_) - : nullptr; - all_types_ = - other.all_types_ - ? std::make_unique< - AllTypes>( - *other - .all_types_) - : nullptr; - class_list_ = - other - .class_list_; - nullable_class_list_ = - other - .nullable_class_list_; - class_map_ = - other - .class_map_; - nullable_class_map_ = - other - .nullable_class_map_; - return *this; - } - - const AllNullableTypes& - AllClassesWrapper:: - all_nullable_types() - const { - return *all_nullable_types_; - } - - void - AllClassesWrapper:: - set_all_nullable_types( - const AllNullableTypes& - value_arg) { - all_nullable_types_ = - std::make_unique< - AllNullableTypes>( - value_arg); - } - - const AllNullableTypesWithoutRecursion* - AllClassesWrapper:: - all_nullable_types_without_recursion() - const { - return all_nullable_types_without_recursion_ - .get(); - } - - void - AllClassesWrapper:: - set_all_nullable_types_without_recursion( - const AllNullableTypesWithoutRecursion* - value_arg) { - all_nullable_types_without_recursion_ = - value_arg - ? std::make_unique< - AllNullableTypesWithoutRecursion>( - *value_arg) - : nullptr; - } - - void - AllClassesWrapper:: - set_all_nullable_types_without_recursion( - const AllNullableTypesWithoutRecursion& - value_arg) { - all_nullable_types_without_recursion_ = - std::make_unique< - AllNullableTypesWithoutRecursion>( - value_arg); - } - - const AllTypes* - AllClassesWrapper:: - all_types() - const { - return all_types_ - .get(); - } - - void - AllClassesWrapper:: - set_all_types( - const AllTypes* - value_arg) { - all_types_ = - value_arg - ? std::make_unique< - AllTypes>( - *value_arg) - : nullptr; - } - - void - AllClassesWrapper:: - set_all_types( - const AllTypes& - value_arg) { - all_types_ = - std::make_unique< - AllTypes>( - value_arg); - } - - const EncodableList& - AllClassesWrapper:: - class_list() - const { - return class_list_; - } - - void - AllClassesWrapper:: - set_class_list( - const EncodableList& - value_arg) { - class_list_ = - value_arg; - } - - const EncodableList* - AllClassesWrapper:: - nullable_class_list() - const { - return nullable_class_list_ - ? &(*nullable_class_list_) - : nullptr; - } - - void - AllClassesWrapper:: - set_nullable_class_list( - const EncodableList* - value_arg) { - nullable_class_list_ = - value_arg - ? std::optional< - EncodableList>( - *value_arg) - : std:: - nullopt; - } - - void - AllClassesWrapper:: - set_nullable_class_list( - const EncodableList& - value_arg) { - nullable_class_list_ = - value_arg; - } - - const EncodableMap& - AllClassesWrapper:: - class_map() - const { - return class_map_; - } - - void - AllClassesWrapper:: - set_class_map( - const EncodableMap& - value_arg) { - class_map_ = - value_arg; - } - - const EncodableMap* - AllClassesWrapper:: - nullable_class_map() - const { - return nullable_class_map_ - ? &(*nullable_class_map_) - : nullptr; - } - - void - AllClassesWrapper:: - set_nullable_class_map( - const EncodableMap* - value_arg) { - nullable_class_map_ = - value_arg - ? std::optional< - EncodableMap>( - *value_arg) - : std:: - nullopt; - } - - void - AllClassesWrapper:: - set_nullable_class_map( - const EncodableMap& - value_arg) { - nullable_class_map_ = - value_arg; - } - - EncodableList - AllClassesWrapper:: - ToEncodableList() - const { - EncodableList - list; - list.reserve( - 7); - list.push_back( - CustomEncodableValue( - *all_nullable_types_)); - list.push_back( - all_nullable_types_without_recursion_ - ? CustomEncodableValue( - *all_nullable_types_without_recursion_) - : EncodableValue()); - list.push_back( - all_types_ - ? CustomEncodableValue( - *all_types_) - : EncodableValue()); - list.push_back( - EncodableValue( - class_list_)); - list.push_back( - nullable_class_list_ - ? EncodableValue( - *nullable_class_list_) - : EncodableValue()); - list.push_back( - EncodableValue( - class_map_)); - list.push_back( - nullable_class_map_ - ? EncodableValue( - *nullable_class_map_) - : EncodableValue()); - return list; - } - - AllClassesWrapper - AllClassesWrapper:: - FromEncodableList( - const EncodableList& - list) { - AllClassesWrapper decoded( - std::any_cast< - const AllNullableTypes&>( - std::get< - CustomEncodableValue>( - list[0])), - std::get< - EncodableList>( - list[3]), - std::get< - EncodableMap>( - list[5])); - auto& encodable_all_nullable_types_without_recursion = - list[1]; - if (!encodable_all_nullable_types_without_recursion - .IsNull()) { - decoded - .set_all_nullable_types_without_recursion( - std::any_cast< - const AllNullableTypesWithoutRecursion&>( - std::get< - CustomEncodableValue>( - encodable_all_nullable_types_without_recursion))); - } - auto& encodable_all_types = - list[2]; - if (!encodable_all_types - .IsNull()) { - decoded - .set_all_types( - std::any_cast< - const AllTypes&>( - std::get< - CustomEncodableValue>( - encodable_all_types))); - } - auto& encodable_nullable_class_list = - list[4]; - if (!encodable_nullable_class_list - .IsNull()) { - decoded - .set_nullable_class_list( - std::get< - EncodableList>( - encodable_nullable_class_list)); - } - auto& encodable_nullable_class_map = - list[6]; - if (!encodable_nullable_class_map - .IsNull()) { - decoded - .set_nullable_class_map( - std::get< - EncodableMap>( - encodable_nullable_class_map)); - } - return decoded; - } - - bool - AllClassesWrapper:: - operator==( - const AllClassesWrapper& - other) - const { - return PigeonInternalDeepEquals( - all_nullable_types_, - other - .all_nullable_types_) && - PigeonInternalDeepEquals( - all_nullable_types_without_recursion_, - other - .all_nullable_types_without_recursion_) && - PigeonInternalDeepEquals( - all_types_, - other - .all_types_) && - PigeonInternalDeepEquals( - class_list_, - other - .class_list_) && - PigeonInternalDeepEquals( - nullable_class_list_, - other - .nullable_class_list_) && - PigeonInternalDeepEquals( - class_map_, - other - .class_map_) && - PigeonInternalDeepEquals( - nullable_class_map_, - other - .nullable_class_map_); - } - - bool - AllClassesWrapper:: - operator!=( - const AllClassesWrapper& - other) - const { - return !( - *this == - other); - } - - size_t - AllClassesWrapper:: - Hash() - const { - size_t result = - 1; - result = - result * - 31 + - PigeonInternalDeepHash( - all_nullable_types_); - result = - result * - 31 + - PigeonInternalDeepHash( - all_nullable_types_without_recursion_); - result = - result * - 31 + - PigeonInternalDeepHash( - all_types_); - result = - result * - 31 + - PigeonInternalDeepHash( - class_list_); - result = - result * - 31 + - PigeonInternalDeepHash( - nullable_class_list_); - result = - result * - 31 + - PigeonInternalDeepHash( - class_map_); - result = - result * - 31 + - PigeonInternalDeepHash( - nullable_class_map_); - return result; - } - - std::string - AllClassesWrapper:: - ToString() - const { - std::stringstream - ss; - ss << "AllClassesWrapper("; - ss << "allNullableTypes: "; - ss << all_nullable_types_ - .ToString(); - ss << ", allNullableTypesWithoutRecursion: "; - if (all_nullable_types_without_recursion_ - .has_value()) { - ss << all_nullable_types_without_recursion_ - ->ToString(); - } else { - ss << "null"; - ss << ", allTypes: "; - if (all_types_ - .has_value()) { - ss << all_types_ - ->ToString(); - } else { - ss << "null"; - ss << ", classList: "; - ss << class_list_; - ss << ", nullableClassList: "; - if (nullable_class_list_ - .has_value()) { - ss << *nullable_class_list_; - } else { - ss << "null"; - ss << ", classMap: "; - ss << class_map_; - ss << ", nullableClassMap: "; - if (nullable_class_map_ - .has_value()) { - ss << *nullable_class_map_; - } else { - ss << "null"; - ss << ")"; - return ss - .str(); - } - - size_t - PigeonInternalDeepHash( - const AllClassesWrapper& - v) { - return v - .Hash(); - } - - // TestMessage - - TestMessage:: - TestMessage() { - } - - TestMessage::TestMessage( - const EncodableList* - test_list) - : test_list_( - test_list - ? std::optional< - EncodableList>( - *test_list) - : std:: - nullopt) { - } - - const EncodableList* - TestMessage:: - test_list() - const { - return test_list_ - ? &(*test_list_) - : nullptr; - } - - void - TestMessage::set_test_list( - const EncodableList* - value_arg) { - test_list_ = - value_arg - ? std::optional< - EncodableList>( - *value_arg) - : std:: - nullopt; - } - - void - TestMessage::set_test_list( - const EncodableList& - value_arg) { - test_list_ = - value_arg; - } - - EncodableList - TestMessage:: - ToEncodableList() - const { - EncodableList - list; - list.reserve( - 1); - list.push_back( - test_list_ - ? EncodableValue( - *test_list_) - : EncodableValue()); - return list; - } - - TestMessage - TestMessage::FromEncodableList( - const EncodableList& - list) { - TestMessage - decoded; - auto& encodable_test_list = - list[0]; - if (!encodable_test_list - .IsNull()) { - decoded - .set_test_list( - std::get< - EncodableList>( - encodable_test_list)); - } - return decoded; - } - - bool - TestMessage:: - operator==( - const TestMessage& - other) - const { - return PigeonInternalDeepEquals( - test_list_, - other - .test_list_); - } - - bool - TestMessage:: - operator!=( - const TestMessage& - other) - const { - return !( - *this == - other); - } - - size_t - TestMessage:: - Hash() - const { - size_t result = - 1; - result = - result * - 31 + - PigeonInternalDeepHash( - test_list_); - return result; - } - - std::string - TestMessage:: - ToString() - const { - std::stringstream - ss; - ss << "TestMessage("; - ss << "testList: "; - if (test_list_ - .has_value()) { - ss << *test_list_; - } else { - ss << "null"; - ss << ")"; - return ss - .str(); - } - - size_t - PigeonInternalDeepHash( - const TestMessage& - v) { - return v - .Hash(); - } - - PigeonInternalCodecSerializer:: - PigeonInternalCodecSerializer() { - } - - EncodableValue - PigeonInternalCodecSerializer:: - ReadValueOfType( - uint8_t - type, - ::flutter:: - ByteStreamReader* - stream) - const { - switch ( - type) { - 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< - AnEnum>( - 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< - AnotherEnum>( - enum_arg_value)); - } - case 131: { - return CustomEncodableValue( - UnusedClass::FromEncodableList( - std::get< - EncodableList>( - ReadValue( - stream)))); - } - case 132: { - return CustomEncodableValue( - AllTypes::FromEncodableList( - std::get< - EncodableList>( - ReadValue( - stream)))); - } - case 133: { - return CustomEncodableValue( - AllNullableTypes::FromEncodableList( - std::get< - EncodableList>( - ReadValue( - stream)))); - } - case 134: { - return CustomEncodableValue( - AllNullableTypesWithoutRecursion::FromEncodableList( - std::get< - EncodableList>( - ReadValue( - stream)))); - } - case 135: { - return CustomEncodableValue( - AllClassesWrapper::FromEncodableList( - std::get< - EncodableList>( - ReadValue( - stream)))); - } - case 136: { - return CustomEncodableValue( - TestMessage::FromEncodableList( - std::get< - EncodableList>( - ReadValue( - stream)))); - } - default: - return ::flutter::StandardCodecSerializer:: - ReadValueOfType( - type, - stream); - } - } - - void - PigeonInternalCodecSerializer::WriteValue( - const EncodableValue& - value, - ::flutter:: - ByteStreamWriter* - stream) - const { - if (const CustomEncodableValue* custom_value = - std::get_if< - CustomEncodableValue>( - &value)) { - if (custom_value - ->type() == - typeid( - AnEnum)) { - stream - ->WriteByte( - 129); - WriteValue( - EncodableValue(static_cast< - int>( - std::any_cast< - AnEnum>( - *custom_value))), - stream); - return; - } - if (custom_value - ->type() == - typeid( - AnotherEnum)) { - stream - ->WriteByte( - 130); - WriteValue( - EncodableValue(static_cast< - int>( - std::any_cast< - AnotherEnum>( - *custom_value))), - stream); - return; - } - if (custom_value - ->type() == - typeid( - UnusedClass)) { - stream - ->WriteByte( - 131); - WriteValue( - EncodableValue( - std::any_cast< - UnusedClass>( - *custom_value) - .ToEncodableList()), - stream); - return; - } - if (custom_value - ->type() == - typeid( - AllTypes)) { - stream - ->WriteByte( - 132); - WriteValue( - EncodableValue( - std::any_cast< - AllTypes>( - *custom_value) - .ToEncodableList()), - stream); - return; - } - if (custom_value - ->type() == - typeid( - AllNullableTypes)) { - stream - ->WriteByte( - 133); - WriteValue( - EncodableValue( - std::any_cast< - AllNullableTypes>( - *custom_value) - .ToEncodableList()), - stream); - return; - } - if (custom_value - ->type() == - typeid( - AllNullableTypesWithoutRecursion)) { - stream - ->WriteByte( - 134); - WriteValue( - EncodableValue( - std::any_cast< - AllNullableTypesWithoutRecursion>( - *custom_value) - .ToEncodableList()), - stream); - return; - } - if (custom_value - ->type() == - typeid( - AllClassesWrapper)) { - stream - ->WriteByte( - 135); - WriteValue( - EncodableValue( - std::any_cast< - AllClassesWrapper>( - *custom_value) - .ToEncodableList()), - stream); - return; - } - if (custom_value - ->type() == - typeid( - TestMessage)) { - stream - ->WriteByte( - 136); - WriteValue( - EncodableValue( - std::any_cast< - TestMessage>( - *custom_value) - .ToEncodableList()), - stream); - return; - } - } - ::flutter::StandardCodecSerializer:: - WriteValue( - value, - stream); - } - - /// The codec used by HostIntegrationCoreApi. - const ::flutter:: - StandardMessageCodec& - HostIntegrationCoreApi:: - GetCodec() { - return ::flutter::StandardMessageCodec:: - GetInstance( - &PigeonInternalCodecSerializer:: - GetInstance()); - } - - // Sets up an instance of `HostIntegrationCoreApi` to handle messages through the `binary_messenger`. - void - HostIntegrationCoreApi::SetUp( - ::flutter:: - BinaryMessenger * - binary_messenger, - HostIntegrationCoreApi * - api) { - HostIntegrationCoreApi:: - SetUp( - binary_messenger, - api, - ""); - } - - void - HostIntegrationCoreApi::SetUp( - ::flutter:: - BinaryMessenger * - binary_messenger, - HostIntegrationCoreApi * - api, - const std:: - string& - message_channel_suffix) { - const std::string prepended_suffix = - message_channel_suffix - .length() > - 0 - ? std::string( - ".") + - message_channel_suffix - : ""; - { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noop" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& message, const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - std::optional< - FlutterError> - output = - api->Noop(); - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAllTypes" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_everything_arg = - args.at( - 0); - if (encodable_everything_arg - .IsNull()) { - reply(WrapError( - "everything_arg unexpectedly null.")); - return; - } - const auto& everything_arg = - std::any_cast< - const AllTypes&>( - std::get< - CustomEncodableValue>( - encodable_everything_arg)); - ErrorOr< - AllTypes> - output = - api->EchoAllTypes( - everything_arg); - 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); - } - } - { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwError" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - ErrorOr< - std::optional< - EncodableValue>> - output = - api->ThrowError(); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.throwErrorFromVoid" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api](const EncodableValue& - message, - const :: - flutter::MessageReply& reply) { - try { - std::optional< - FlutterError> - output = - api->ThrowErrorFromVoid(); - 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.pigeon_integration_tests.HostIntegrationCoreApi.throwFlutterError" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - ErrorOr< - std::optional< - EncodableValue>> - output = - api->ThrowFlutterError(); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoInt" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_an_int_arg = - args.at( - 0); - if (encodable_an_int_arg - .IsNull()) { - reply(WrapError( - "an_int_arg unexpectedly null.")); - return; - } - const int64_t an_int_arg = - encodable_an_int_arg - .LongValue(); - ErrorOr< - int64_t> - output = - api->EchoInt( - an_int_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoDouble" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_a_double_arg = - args.at( - 0); - if (encodable_a_double_arg - .IsNull()) { - reply(WrapError( - "a_double_arg unexpectedly null.")); - return; - } - const auto& a_double_arg = - std::get< - double>( - encodable_a_double_arg); - ErrorOr< - double> - output = - api->EchoDouble( - a_double_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoBool" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_a_bool_arg = - args.at( - 0); - if (encodable_a_bool_arg - .IsNull()) { - reply(WrapError( - "a_bool_arg unexpectedly null.")); - return; - } - const auto& a_bool_arg = - std::get< - bool>( - encodable_a_bool_arg); - ErrorOr output = - api->EchoBool( - a_bool_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoString" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_a_string_arg = - args.at( - 0); - if (encodable_a_string_arg - .IsNull()) { - reply(WrapError( - "a_string_arg unexpectedly null.")); - return; - } - const auto& a_string_arg = - std::get< - std:: - string>( - encodable_a_string_arg); - ErrorOr< - std:: - string> - output = - api->EchoString( - a_string_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoUint8List" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_a_uint8_list_arg = - args.at( - 0); - if (encodable_a_uint8_list_arg - .IsNull()) { - reply(WrapError( - "a_uint8_list_arg unexpectedly null.")); - return; - } - const auto& a_uint8_list_arg = - std::get< - std::vector< - uint8_t>>( - encodable_a_uint8_list_arg); - ErrorOr< - std::vector< - uint8_t>> - output = - api->EchoUint8List( - a_uint8_list_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoObject" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_an_object_arg = - args.at( - 0); - if (encodable_an_object_arg - .IsNull()) { - reply(WrapError( - "an_object_arg unexpectedly null.")); - return; - } - const auto& - an_object_arg = - encodable_an_object_arg; - ErrorOr< - EncodableValue> - output = - api->EchoObject( - an_object_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoList" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_list_arg = - args.at( - 0); - if (encodable_list_arg - .IsNull()) { - reply(WrapError( - "list_arg unexpectedly null.")); - return; - } - const auto& list_arg = - std::get< - EncodableList>( - encodable_list_arg); - ErrorOr< - EncodableList> - output = - api->EchoList( - list_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoEnumList" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_enum_list_arg = - args.at( - 0); - if (encodable_enum_list_arg - .IsNull()) { - reply(WrapError( - "enum_list_arg unexpectedly null.")); - return; - } - const auto& enum_list_arg = - std::get< - EncodableList>( - encodable_enum_list_arg); - ErrorOr< - EncodableList> - output = - api->EchoEnumList( - enum_list_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoClassList" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_class_list_arg = - args.at( - 0); - if (encodable_class_list_arg - .IsNull()) { - reply(WrapError( - "class_list_arg unexpectedly null.")); - return; - } - const auto& class_list_arg = - std::get< - EncodableList>( - encodable_class_list_arg); - ErrorOr< - EncodableList> - output = - api->EchoClassList( - class_list_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullEnumList" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_enum_list_arg = - args.at( - 0); - if (encodable_enum_list_arg - .IsNull()) { - reply(WrapError( - "enum_list_arg unexpectedly null.")); - return; - } - const auto& enum_list_arg = - std::get< - EncodableList>( - encodable_enum_list_arg); - ErrorOr< - EncodableList> - output = - api->EchoNonNullEnumList( - enum_list_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullClassList" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_class_list_arg = - args.at( - 0); - if (encodable_class_list_arg - .IsNull()) { - reply(WrapError( - "class_list_arg unexpectedly null.")); - return; - } - const auto& class_list_arg = - std::get< - EncodableList>( - encodable_class_list_arg); - ErrorOr< - EncodableList> - output = - api->EchoNonNullClassList( - class_list_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoMap" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_map_arg = - args.at( - 0); - if (encodable_map_arg - .IsNull()) { - reply(WrapError( - "map_arg unexpectedly null.")); - return; - } - const auto& map_arg = - std::get< - EncodableMap>( - encodable_map_arg); - ErrorOr< - EncodableMap> - output = - api->EchoMap( - map_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoStringMap" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_string_map_arg = - args.at( - 0); - if (encodable_string_map_arg - .IsNull()) { - reply(WrapError( - "string_map_arg unexpectedly null.")); - return; - } - const auto& string_map_arg = - std::get< - EncodableMap>( - encodable_string_map_arg); - ErrorOr< - EncodableMap> - output = - api->EchoStringMap( - string_map_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoIntMap" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_int_map_arg = - args.at( - 0); - if (encodable_int_map_arg - .IsNull()) { - reply(WrapError( - "int_map_arg unexpectedly null.")); - return; - } - const auto& int_map_arg = - std::get< - EncodableMap>( - encodable_int_map_arg); - ErrorOr< - EncodableMap> - output = - api->EchoIntMap( - int_map_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoEnumMap" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_enum_map_arg = - args.at( - 0); - if (encodable_enum_map_arg - .IsNull()) { - reply(WrapError( - "enum_map_arg unexpectedly null.")); - return; - } - const auto& enum_map_arg = - std::get< - EncodableMap>( - encodable_enum_map_arg); - ErrorOr< - EncodableMap> - output = - api->EchoEnumMap( - enum_map_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoClassMap" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_class_map_arg = - args.at( - 0); - if (encodable_class_map_arg - .IsNull()) { - reply(WrapError( - "class_map_arg unexpectedly null.")); - return; - } - const auto& class_map_arg = - std::get< - EncodableMap>( - encodable_class_map_arg); - ErrorOr< - EncodableMap> - output = - api->EchoClassMap( - class_map_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullStringMap" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_string_map_arg = - args.at( - 0); - if (encodable_string_map_arg - .IsNull()) { - reply(WrapError( - "string_map_arg unexpectedly null.")); - return; - } - const auto& string_map_arg = - std::get< - EncodableMap>( - encodable_string_map_arg); - ErrorOr< - EncodableMap> - output = - api->EchoNonNullStringMap( - string_map_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullIntMap" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_int_map_arg = - args.at( - 0); - if (encodable_int_map_arg - .IsNull()) { - reply(WrapError( - "int_map_arg unexpectedly null.")); - return; - } - const auto& int_map_arg = - std::get< - EncodableMap>( - encodable_int_map_arg); - ErrorOr< - EncodableMap> - output = - api->EchoNonNullIntMap( - int_map_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullEnumMap" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_enum_map_arg = - args.at( - 0); - if (encodable_enum_map_arg - .IsNull()) { - reply(WrapError( - "enum_map_arg unexpectedly null.")); - return; - } - const auto& enum_map_arg = - std::get< - EncodableMap>( - encodable_enum_map_arg); - ErrorOr< - EncodableMap> - output = - api->EchoNonNullEnumMap( - enum_map_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullClassMap" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_class_map_arg = - args.at( - 0); - if (encodable_class_map_arg - .IsNull()) { - reply(WrapError( - "class_map_arg unexpectedly null.")); - return; - } - const auto& class_map_arg = - std::get< - EncodableMap>( - encodable_class_map_arg); - ErrorOr< - EncodableMap> - output = - api->EchoNonNullClassMap( - class_map_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoClassWrapper" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_wrapper_arg = - args.at( - 0); - if (encodable_wrapper_arg - .IsNull()) { - reply(WrapError( - "wrapper_arg unexpectedly null.")); - return; - } - const auto& wrapper_arg = - std::any_cast< - const AllClassesWrapper&>( - std::get< - CustomEncodableValue>( - encodable_wrapper_arg)); - ErrorOr< - AllClassesWrapper> - output = - api->EchoClassWrapper( - wrapper_arg); - 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); - } - } - { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnum" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_an_enum_arg = - args.at( - 0); - if (encodable_an_enum_arg - .IsNull()) { - reply(WrapError( - "an_enum_arg unexpectedly null.")); - return; - } - const auto& an_enum_arg = - std::any_cast< - const AnEnum&>( - std::get< - CustomEncodableValue>( - encodable_an_enum_arg)); - ErrorOr< - AnEnum> - output = - api->EchoEnum( - an_enum_arg); - 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); - } - } - { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAnotherEnum" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_another_enum_arg = - args.at( - 0); - if (encodable_another_enum_arg - .IsNull()) { - reply(WrapError( - "another_enum_arg unexpectedly null.")); - return; - } - const auto& another_enum_arg = - std::any_cast< - const AnotherEnum&>( - std::get< - CustomEncodableValue>( - encodable_another_enum_arg)); - ErrorOr< - AnotherEnum> - output = - api->EchoAnotherEnum( - another_enum_arg); - 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); - } - } - { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedDefaultString" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_a_string_arg = - args.at( - 0); - if (encodable_a_string_arg - .IsNull()) { - reply(WrapError( - "a_string_arg unexpectedly null.")); - return; - } - const auto& a_string_arg = - std::get< - std:: - string>( - encodable_a_string_arg); - ErrorOr< - std:: - string> - output = - api->EchoNamedDefaultString( - a_string_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalDefaultDouble" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_a_double_arg = - args.at( - 0); - if (encodable_a_double_arg - .IsNull()) { - reply(WrapError( - "a_double_arg unexpectedly null.")); - return; - } - const auto& a_double_arg = - std::get< - double>( - encodable_a_double_arg); - ErrorOr< - double> - output = - api->EchoOptionalDefaultDouble( - a_double_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoRequiredInt" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_an_int_arg = - args.at( - 0); - if (encodable_an_int_arg - .IsNull()) { - reply(WrapError( - "an_int_arg unexpectedly null.")); - return; - } - const int64_t an_int_arg = - encodable_an_int_arg - .LongValue(); - ErrorOr< - int64_t> - output = - api->EchoRequiredInt( - an_int_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.areAllNullableTypesEqual" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_a_arg = - args.at( - 0); - if (encodable_a_arg - .IsNull()) { - reply(WrapError( - "a_arg unexpectedly null.")); - return; - } - const auto& a_arg = std::any_cast< - const AllNullableTypes&>( - std::get< - CustomEncodableValue>( - encodable_a_arg)); - const auto& encodable_b_arg = - args.at( - 1); - if (encodable_b_arg - .IsNull()) { - reply(WrapError( - "b_arg unexpectedly null.")); - return; - } - const auto& b_arg = std::any_cast< - const AllNullableTypes&>( - std::get< - CustomEncodableValue>( - encodable_b_arg)); - ErrorOr output = - api->AreAllNullableTypesEqual( - a_arg, - b_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.getAllNullableTypesHash" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_value_arg = - args.at( - 0); - if (encodable_value_arg - .IsNull()) { - reply(WrapError( - "value_arg unexpectedly null.")); - return; - } - const auto& value_arg = - std::any_cast< - const AllNullableTypes&>( - std::get< - CustomEncodableValue>( - encodable_value_arg)); - ErrorOr< - int64_t> - output = - api->GetAllNullableTypesHash( - value_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.getAllNullableTypesWithoutRecursionHash" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_value_arg = - args.at( - 0); - if (encodable_value_arg - .IsNull()) { - reply(WrapError( - "value_arg unexpectedly null.")); - return; - } - const auto& value_arg = - std::any_cast< - const AllNullableTypesWithoutRecursion&>( - std::get< - CustomEncodableValue>( - encodable_value_arg)); - ErrorOr< - int64_t> - output = - api->GetAllNullableTypesWithoutRecursionHash( - value_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypes" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_everything_arg = - args.at( - 0); - const auto* everything_arg = - encodable_everything_arg - .IsNull() - ? nullptr - : &(std::any_cast< - const AllNullableTypes&>( - std::get< - CustomEncodableValue>( - encodable_everything_arg))); - ErrorOr< - std::optional< - AllNullableTypes>> - output = - api->EchoAllNullableTypes( - everything_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(CustomEncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_everything_arg = - args.at( - 0); - const auto* everything_arg = - encodable_everything_arg - .IsNull() - ? nullptr - : &(std::any_cast< - const AllNullableTypesWithoutRecursion&>( - std::get< - CustomEncodableValue>( - encodable_everything_arg))); - ErrorOr< - std::optional< - AllNullableTypesWithoutRecursion>> - output = - api->EchoAllNullableTypesWithoutRecursion( - everything_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(CustomEncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.extractNestedNullableString" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_wrapper_arg = - args.at( - 0); - if (encodable_wrapper_arg - .IsNull()) { - reply(WrapError( - "wrapper_arg unexpectedly null.")); - return; - } - const auto& wrapper_arg = - std::any_cast< - const AllClassesWrapper&>( - std::get< - CustomEncodableValue>( - encodable_wrapper_arg)); - ErrorOr> - output = - api->ExtractNestedNullableString( - wrapper_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.createNestedNullableString" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api](const EncodableValue& - message, - const :: - flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_nullable_string_arg = - args.at( - 0); - const auto* nullable_string_arg = - std::get_if< - std:: - string>( - &encodable_nullable_string_arg); - ErrorOr< - AllClassesWrapper> - output = - api->CreateNestedNullableString( - nullable_string_arg); - 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); - } - } - { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypes" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_a_nullable_bool_arg = - args.at( - 0); - const auto* a_nullable_bool_arg = - std::get_if< - bool>( - &encodable_a_nullable_bool_arg); - const auto& encodable_a_nullable_int_arg = - args.at( - 1); - const auto* a_nullable_int_arg = - std::get_if< - int64_t>( - &encodable_a_nullable_int_arg); - const auto& encodable_a_nullable_string_arg = - args.at( - 2); - const auto* a_nullable_string_arg = - std::get_if< - std:: - string>( - &encodable_a_nullable_string_arg); - ErrorOr< - AllNullableTypes> - output = api->SendMultipleNullableTypes( - a_nullable_bool_arg, - a_nullable_int_arg, - a_nullable_string_arg); - 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); - } - } - { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_a_nullable_bool_arg = - args.at( - 0); - const auto* a_nullable_bool_arg = - std::get_if< - bool>( - &encodable_a_nullable_bool_arg); - const auto& encodable_a_nullable_int_arg = - args.at( - 1); - const auto* a_nullable_int_arg = - std::get_if< - int64_t>( - &encodable_a_nullable_int_arg); - const auto& encodable_a_nullable_string_arg = - args.at( - 2); - const auto* a_nullable_string_arg = - std::get_if< - std:: - string>( - &encodable_a_nullable_string_arg); - ErrorOr< - AllNullableTypesWithoutRecursion> - output = api->SendMultipleNullableTypesWithoutRecursion( - a_nullable_bool_arg, - a_nullable_int_arg, - a_nullable_string_arg); - 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); - } - } - { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableInt" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_a_nullable_int_arg = - args.at( - 0); - const auto* a_nullable_int_arg = - std::get_if< - int64_t>( - &encodable_a_nullable_int_arg); - ErrorOr< - std::optional< - int64_t>> - output = - api->EchoNullableInt( - a_nullable_int_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableDouble" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_a_nullable_double_arg = - args.at( - 0); - const auto* a_nullable_double_arg = - std::get_if< - double>( - &encodable_a_nullable_double_arg); - ErrorOr< - std::optional< - double>> - output = - api->EchoNullableDouble( - a_nullable_double_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableBool" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_a_nullable_bool_arg = - args.at( - 0); - const auto* a_nullable_bool_arg = - std::get_if< - bool>( - &encodable_a_nullable_bool_arg); - ErrorOr< - std::optional< - bool>> - output = - api->EchoNullableBool( - a_nullable_bool_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableString" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_a_nullable_string_arg = - args.at( - 0); - const auto* a_nullable_string_arg = - std::get_if< - std:: - string>( - &encodable_a_nullable_string_arg); - ErrorOr> - output = - api->EchoNullableString( - a_nullable_string_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableUint8List" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_a_nullable_uint8_list_arg = - args.at( - 0); - const auto* a_nullable_uint8_list_arg = - std::get_if< - std::vector< - uint8_t>>( - &encodable_a_nullable_uint8_list_arg); - ErrorOr>> - output = - api->EchoNullableUint8List( - a_nullable_uint8_list_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableObject" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_a_nullable_object_arg = - args.at( - 0); - const auto* - a_nullable_object_arg = - &encodable_a_nullable_object_arg; - ErrorOr< - std::optional< - EncodableValue>> - output = - api->EchoNullableObject( - a_nullable_object_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableList" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_a_nullable_list_arg = - args.at( - 0); - const auto* a_nullable_list_arg = - std::get_if< - EncodableList>( - &encodable_a_nullable_list_arg); - ErrorOr< - std::optional< - EncodableList>> - output = - api->EchoNullableList( - a_nullable_list_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnumList" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_enum_list_arg = - args.at( - 0); - const auto* enum_list_arg = - std::get_if< - EncodableList>( - &encodable_enum_list_arg); - ErrorOr< - std::optional< - EncodableList>> - output = - api->EchoNullableEnumList( - enum_list_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableClassList" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_class_list_arg = - args.at( - 0); - const auto* class_list_arg = - std::get_if< - EncodableList>( - &encodable_class_list_arg); - ErrorOr< - std::optional< - EncodableList>> - output = - api->EchoNullableClassList( - class_list_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullEnumList" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_enum_list_arg = - args.at( - 0); - const auto* enum_list_arg = - std::get_if< - EncodableList>( - &encodable_enum_list_arg); - ErrorOr< - std::optional< - EncodableList>> - output = - api->EchoNullableNonNullEnumList( - enum_list_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullClassList" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_class_list_arg = - args.at( - 0); - const auto* class_list_arg = - std::get_if< - EncodableList>( - &encodable_class_list_arg); - ErrorOr< - std::optional< - EncodableList>> - output = - api->EchoNullableNonNullClassList( - class_list_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableMap" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_map_arg = - args.at( - 0); - const auto* map_arg = - std::get_if< - EncodableMap>( - &encodable_map_arg); - ErrorOr< - std::optional< - EncodableMap>> - output = - api->EchoNullableMap( - map_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableStringMap" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_string_map_arg = - args.at( - 0); - const auto* string_map_arg = - std::get_if< - EncodableMap>( - &encodable_string_map_arg); - ErrorOr< - std::optional< - EncodableMap>> - output = - api->EchoNullableStringMap( - string_map_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableIntMap" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_int_map_arg = - args.at( - 0); - const auto* int_map_arg = - std::get_if< - EncodableMap>( - &encodable_int_map_arg); - ErrorOr< - std::optional< - EncodableMap>> - output = - api->EchoNullableIntMap( - int_map_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnumMap" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_enum_map_arg = - args.at( - 0); - const auto* enum_map_arg = - std::get_if< - EncodableMap>( - &encodable_enum_map_arg); - ErrorOr< - std::optional< - EncodableMap>> - output = - api->EchoNullableEnumMap( - enum_map_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableClassMap" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_class_map_arg = - args.at( - 0); - const auto* class_map_arg = - std::get_if< - EncodableMap>( - &encodable_class_map_arg); - ErrorOr< - std::optional< - EncodableMap>> - output = - api->EchoNullableClassMap( - class_map_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullStringMap" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_string_map_arg = - args.at( - 0); - const auto* string_map_arg = - std::get_if< - EncodableMap>( - &encodable_string_map_arg); - ErrorOr< - std::optional< - EncodableMap>> - output = - api->EchoNullableNonNullStringMap( - string_map_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullIntMap" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_int_map_arg = - args.at( - 0); - const auto* int_map_arg = - std::get_if< - EncodableMap>( - &encodable_int_map_arg); - ErrorOr< - std::optional< - EncodableMap>> - output = - api->EchoNullableNonNullIntMap( - int_map_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullEnumMap" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_enum_map_arg = - args.at( - 0); - const auto* enum_map_arg = - std::get_if< - EncodableMap>( - &encodable_enum_map_arg); - ErrorOr< - std::optional< - EncodableMap>> - output = - api->EchoNullableNonNullEnumMap( - enum_map_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullClassMap" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_class_map_arg = - args.at( - 0); - const auto* class_map_arg = - std::get_if< - EncodableMap>( - &encodable_class_map_arg); - ErrorOr< - std::optional< - EncodableMap>> - output = - api->EchoNullableNonNullClassMap( - class_map_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnum" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_an_enum_arg = - args.at( - 0); - AnEnum - an_enum_arg_value; - const AnEnum* - an_enum_arg = - nullptr; - if (!encodable_an_enum_arg - .IsNull()) { - an_enum_arg_value = std::any_cast< - const AnEnum&>( - std::get< - CustomEncodableValue>( - encodable_an_enum_arg)); - an_enum_arg = - &an_enum_arg_value; - } - ErrorOr< - std::optional< - AnEnum>> - output = api->EchoNullableEnum( - an_enum_arg - ? &(*an_enum_arg) - : nullptr); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(CustomEncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAnotherNullableEnum" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_another_enum_arg = - args.at( - 0); - AnotherEnum - another_enum_arg_value; - const AnotherEnum* - another_enum_arg = - nullptr; - if (!encodable_another_enum_arg - .IsNull()) { - another_enum_arg_value = - std::any_cast< - const AnotherEnum&>( - std::get< - CustomEncodableValue>( - encodable_another_enum_arg)); - another_enum_arg = - &another_enum_arg_value; - } - ErrorOr< - std::optional< - AnotherEnum>> - output = api->EchoAnotherNullableEnum( - another_enum_arg - ? &(*another_enum_arg) - : nullptr); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(CustomEncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalNullableInt" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_a_nullable_int_arg = - args.at( - 0); - const auto* a_nullable_int_arg = - std::get_if< - int64_t>( - &encodable_a_nullable_int_arg); - ErrorOr< - std::optional< - int64_t>> - output = - api->EchoOptionalNullableInt( - a_nullable_int_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedNullableString" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_a_nullable_string_arg = - args.at( - 0); - const auto* a_nullable_string_arg = - std::get_if< - std:: - string>( - &encodable_a_nullable_string_arg); - ErrorOr> - output = - api->EchoNamedNullableString( - a_nullable_string_arg); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.noopAsync" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - api->NoopAsync( - [reply]( - std::optional< - FlutterError>&& - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncInt" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_an_int_arg = - args.at( - 0); - if (encodable_an_int_arg - .IsNull()) { - reply(WrapError( - "an_int_arg unexpectedly null.")); - return; - } - const int64_t an_int_arg = - encodable_an_int_arg - .LongValue(); - api->EchoAsyncInt( - an_int_arg, - [reply]( - ErrorOr< - int64_t>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncDouble" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_a_double_arg = - args.at( - 0); - if (encodable_a_double_arg - .IsNull()) { - reply(WrapError( - "a_double_arg unexpectedly null.")); - return; - } - const auto& a_double_arg = - std::get< - double>( - encodable_a_double_arg); - api->EchoAsyncDouble( - a_double_arg, - [reply]( - ErrorOr< - double>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncBool" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_a_bool_arg = - args.at( - 0); - if (encodable_a_bool_arg - .IsNull()) { - reply(WrapError( - "a_bool_arg unexpectedly null.")); - return; - } - const auto& a_bool_arg = - std::get< - bool>( - encodable_a_bool_arg); - api->EchoAsyncBool( - a_bool_arg, - [reply]( - ErrorOr< - bool>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncString" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_a_string_arg = - args.at( - 0); - if (encodable_a_string_arg - .IsNull()) { - reply(WrapError( - "a_string_arg unexpectedly null.")); - return; - } - const auto& a_string_arg = - std::get< - std:: - string>( - encodable_a_string_arg); - api->EchoAsyncString( - a_string_arg, - [reply]( - ErrorOr< - std:: - string>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncUint8List" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_a_uint8_list_arg = - args.at( - 0); - if (encodable_a_uint8_list_arg - .IsNull()) { - reply(WrapError( - "a_uint8_list_arg unexpectedly null.")); - return; - } - const auto& a_uint8_list_arg = - std::get< - std::vector< - uint8_t>>( - encodable_a_uint8_list_arg); - api->EchoAsyncUint8List( - a_uint8_list_arg, - [reply]( - ErrorOr>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncObject" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_an_object_arg = - args.at( - 0); - if (encodable_an_object_arg - .IsNull()) { - reply(WrapError( - "an_object_arg unexpectedly null.")); - return; - } - const auto& - an_object_arg = - encodable_an_object_arg; - api->EchoAsyncObject( - an_object_arg, - [reply]( - ErrorOr< - EncodableValue>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncList" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_list_arg = - args.at( - 0); - if (encodable_list_arg - .IsNull()) { - reply(WrapError( - "list_arg unexpectedly null.")); - return; - } - const auto& list_arg = - std::get< - EncodableList>( - encodable_list_arg); - api->EchoAsyncList( - list_arg, - [reply]( - ErrorOr< - EncodableList>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnumList" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_enum_list_arg = - args.at( - 0); - if (encodable_enum_list_arg - .IsNull()) { - reply(WrapError( - "enum_list_arg unexpectedly null.")); - return; - } - const auto& enum_list_arg = - std::get< - EncodableList>( - encodable_enum_list_arg); - api->EchoAsyncEnumList( - enum_list_arg, - [reply]( - ErrorOr< - EncodableList>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncClassList" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_class_list_arg = - args.at( - 0); - if (encodable_class_list_arg - .IsNull()) { - reply(WrapError( - "class_list_arg unexpectedly null.")); - return; - } - const auto& class_list_arg = - std::get< - EncodableList>( - encodable_class_list_arg); - api->EchoAsyncClassList( - class_list_arg, - [reply]( - ErrorOr< - EncodableList>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncMap" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_map_arg = - args.at( - 0); - if (encodable_map_arg - .IsNull()) { - reply(WrapError( - "map_arg unexpectedly null.")); - return; - } - const auto& map_arg = - std::get< - EncodableMap>( - encodable_map_arg); - api->EchoAsyncMap( - map_arg, - [reply]( - ErrorOr< - EncodableMap>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncStringMap" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_string_map_arg = - args.at( - 0); - if (encodable_string_map_arg - .IsNull()) { - reply(WrapError( - "string_map_arg unexpectedly null.")); - return; - } - const auto& string_map_arg = - std::get< - EncodableMap>( - encodable_string_map_arg); - api->EchoAsyncStringMap( - string_map_arg, - [reply]( - ErrorOr< - EncodableMap>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncIntMap" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_int_map_arg = - args.at( - 0); - if (encodable_int_map_arg - .IsNull()) { - reply(WrapError( - "int_map_arg unexpectedly null.")); - return; - } - const auto& int_map_arg = - std::get< - EncodableMap>( - encodable_int_map_arg); - api->EchoAsyncIntMap( - int_map_arg, - [reply]( - ErrorOr< - EncodableMap>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnumMap" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_enum_map_arg = - args.at( - 0); - if (encodable_enum_map_arg - .IsNull()) { - reply(WrapError( - "enum_map_arg unexpectedly null.")); - return; - } - const auto& enum_map_arg = - std::get< - EncodableMap>( - encodable_enum_map_arg); - api->EchoAsyncEnumMap( - enum_map_arg, - [reply]( - ErrorOr< - EncodableMap>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncClassMap" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_class_map_arg = - args.at( - 0); - if (encodable_class_map_arg - .IsNull()) { - reply(WrapError( - "class_map_arg unexpectedly null.")); - return; - } - const auto& class_map_arg = - std::get< - EncodableMap>( - encodable_class_map_arg); - api->EchoAsyncClassMap( - class_map_arg, - [reply]( - ErrorOr< - EncodableMap>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnum" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_an_enum_arg = - args.at( - 0); - if (encodable_an_enum_arg - .IsNull()) { - reply(WrapError( - "an_enum_arg unexpectedly null.")); - return; - } - const auto& an_enum_arg = - std::any_cast< - const AnEnum&>( - std::get< - CustomEncodableValue>( - encodable_an_enum_arg)); - api->EchoAsyncEnum( - an_enum_arg, - [reply]( - ErrorOr< - AnEnum>&& - 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); - } - } - { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAnotherAsyncEnum" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_another_enum_arg = - args.at( - 0); - if (encodable_another_enum_arg - .IsNull()) { - reply(WrapError( - "another_enum_arg unexpectedly null.")); - return; - } - const auto& another_enum_arg = - std::any_cast< - const AnotherEnum&>( - std::get< - CustomEncodableValue>( - encodable_another_enum_arg)); - api->EchoAnotherAsyncEnum( - another_enum_arg, - [reply]( - ErrorOr< - AnotherEnum>&& - 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); - } - } - { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncError" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - api->ThrowAsyncError( - [reply]( - ErrorOr>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncErrorFromVoid" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - api->ThrowAsyncErrorFromVoid( - [reply]( - std::optional< - FlutterError>&& - 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.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncFlutterError" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - api->ThrowAsyncFlutterError( - [reply]( - ErrorOr>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncAllTypes" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_everything_arg = - args.at( - 0); - if (encodable_everything_arg - .IsNull()) { - reply(WrapError( - "everything_arg unexpectedly null.")); - return; - } - const auto& everything_arg = - std::any_cast< - const AllTypes&>( - std::get< - CustomEncodableValue>( - encodable_everything_arg)); - api->EchoAsyncAllTypes( - everything_arg, - [reply]( - ErrorOr< - AllTypes>&& - 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); - } - } - { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_everything_arg = - args.at( - 0); - const auto* everything_arg = - encodable_everything_arg - .IsNull() - ? nullptr - : &(std::any_cast< - const AllNullableTypes&>( - std::get< - CustomEncodableValue>( - encodable_everything_arg))); - api->EchoAsyncNullableAllNullableTypes( - everything_arg, - [reply]( - ErrorOr>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(CustomEncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypesWithoutRecursion" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_everything_arg = - args.at( - 0); - const auto* everything_arg = - encodable_everything_arg - .IsNull() - ? nullptr - : &(std::any_cast< - const AllNullableTypesWithoutRecursion&>( - std::get< - CustomEncodableValue>( - encodable_everything_arg))); - api->EchoAsyncNullableAllNullableTypesWithoutRecursion( - everything_arg, - [reply]( - ErrorOr>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(CustomEncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableInt" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_an_int_arg = - args.at( - 0); - const auto* an_int_arg = - std::get_if< - int64_t>( - &encodable_an_int_arg); - api->EchoAsyncNullableInt( - an_int_arg, - [reply]( - ErrorOr>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableDouble" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_a_double_arg = - args.at( - 0); - const auto* a_double_arg = - std::get_if< - double>( - &encodable_a_double_arg); - api->EchoAsyncNullableDouble( - a_double_arg, - [reply]( - ErrorOr>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableBool" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_a_bool_arg = - args.at( - 0); - const auto* a_bool_arg = - std::get_if< - bool>( - &encodable_a_bool_arg); - api->EchoAsyncNullableBool( - a_bool_arg, - [reply]( - ErrorOr>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableString" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& message, const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_a_string_arg = - args.at( - 0); - const auto* a_string_arg = - std::get_if< - std:: - string>( - &encodable_a_string_arg); - api->EchoAsyncNullableString( - a_string_arg, - [reply]( - ErrorOr>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableUint8List" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_a_uint8_list_arg = - args.at( - 0); - const auto* a_uint8_list_arg = - std::get_if< - std::vector< - uint8_t>>( - &encodable_a_uint8_list_arg); - api->EchoAsyncNullableUint8List( - a_uint8_list_arg, - [reply]( - ErrorOr>>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableObject" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_an_object_arg = - args.at( - 0); - const auto* - an_object_arg = - &encodable_an_object_arg; - api->EchoAsyncNullableObject( - an_object_arg, - [reply]( - ErrorOr>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableList" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_list_arg = - args.at( - 0); - const auto* list_arg = - std::get_if< - EncodableList>( - &encodable_list_arg); - api->EchoAsyncNullableList( - list_arg, - [reply]( - ErrorOr>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnumList" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_enum_list_arg = - args.at( - 0); - const auto* enum_list_arg = - std::get_if< - EncodableList>( - &encodable_enum_list_arg); - api->EchoAsyncNullableEnumList( - enum_list_arg, - [reply]( - ErrorOr>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableClassList" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_class_list_arg = - args.at( - 0); - const auto* class_list_arg = - std::get_if< - EncodableList>( - &encodable_class_list_arg); - api->EchoAsyncNullableClassList( - class_list_arg, - [reply]( - ErrorOr>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableMap" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_map_arg = - args.at( - 0); - const auto* map_arg = - std::get_if< - EncodableMap>( - &encodable_map_arg); - api->EchoAsyncNullableMap( - map_arg, - [reply]( - ErrorOr>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableStringMap" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_string_map_arg = - args.at( - 0); - const auto* string_map_arg = - std::get_if< - EncodableMap>( - &encodable_string_map_arg); - api->EchoAsyncNullableStringMap( - string_map_arg, - [reply]( - ErrorOr>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableIntMap" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_int_map_arg = - args.at( - 0); - const auto* int_map_arg = - std::get_if< - EncodableMap>( - &encodable_int_map_arg); - api->EchoAsyncNullableIntMap( - int_map_arg, - [reply]( - ErrorOr>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnumMap" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_enum_map_arg = - args.at( - 0); - const auto* enum_map_arg = - std::get_if< - EncodableMap>( - &encodable_enum_map_arg); - api->EchoAsyncNullableEnumMap( - enum_map_arg, - [reply]( - ErrorOr>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableClassMap" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_class_map_arg = - args.at( - 0); - const auto* class_map_arg = - std::get_if< - EncodableMap>( - &encodable_class_map_arg); - api->EchoAsyncNullableClassMap( - class_map_arg, - [reply]( - ErrorOr>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnum" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_an_enum_arg = - args.at( - 0); - AnEnum - an_enum_arg_value; - const AnEnum* - an_enum_arg = - nullptr; - if (!encodable_an_enum_arg - .IsNull()) { - an_enum_arg_value = std::any_cast< - const AnEnum&>( - std::get< - CustomEncodableValue>( - encodable_an_enum_arg)); - an_enum_arg = - &an_enum_arg_value; - } - api->EchoAsyncNullableEnum( - an_enum_arg - ? &(*an_enum_arg) - : nullptr, - [reply]( - ErrorOr>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(CustomEncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.echoAnotherAsyncNullableEnum" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_another_enum_arg = - args.at( - 0); - AnotherEnum - another_enum_arg_value; - const AnotherEnum* - another_enum_arg = - nullptr; - if (!encodable_another_enum_arg - .IsNull()) { - another_enum_arg_value = - std::any_cast< - const AnotherEnum&>( - std::get< - CustomEncodableValue>( - encodable_another_enum_arg)); - another_enum_arg = - &another_enum_arg_value; - } - api->EchoAnotherAsyncNullableEnum( - another_enum_arg - ? &(*another_enum_arg) - : nullptr, - [reply]( - ErrorOr>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(CustomEncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.defaultIsMainThread" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - ErrorOr< - bool> - output = - api->DefaultIsMainThread(); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.taskQueueIsBackgroundThread" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - ErrorOr< - bool> - output = - api->TaskQueueIsBackgroundThread(); - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterNoop" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - api->CallFlutterNoop( - [reply]( - std::optional< - FlutterError>&& - 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowError" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - api->CallFlutterThrowError( - [reply]( - ErrorOr>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - api->CallFlutterThrowErrorFromVoid( - [reply]( - std::optional< - FlutterError>&& - 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllTypes" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_everything_arg = - args.at( - 0); - if (encodable_everything_arg - .IsNull()) { - reply(WrapError( - "everything_arg unexpectedly null.")); - return; - } - const auto& everything_arg = - std::any_cast< - const AllTypes&>( - std::get< - CustomEncodableValue>( - encodable_everything_arg)); - api->CallFlutterEchoAllTypes( - everything_arg, - [reply]( - ErrorOr< - AllTypes>&& - 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); - } - } - { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypes" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_everything_arg = - args.at( - 0); - const auto* everything_arg = - encodable_everything_arg - .IsNull() - ? nullptr - : &(std::any_cast< - const AllNullableTypes&>( - std::get< - CustomEncodableValue>( - encodable_everything_arg))); - api->CallFlutterEchoAllNullableTypes( - everything_arg, - [reply]( - ErrorOr>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(CustomEncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_a_nullable_bool_arg = - args.at( - 0); - const auto* a_nullable_bool_arg = - std::get_if< - bool>( - &encodable_a_nullable_bool_arg); - const auto& encodable_a_nullable_int_arg = - args.at( - 1); - const auto* a_nullable_int_arg = - std::get_if< - int64_t>( - &encodable_a_nullable_int_arg); - const auto& encodable_a_nullable_string_arg = - args.at( - 2); - const auto* a_nullable_string_arg = - std::get_if< - std:: - string>( - &encodable_a_nullable_string_arg); - api->CallFlutterSendMultipleNullableTypes( - a_nullable_bool_arg, - a_nullable_int_arg, - a_nullable_string_arg, - [reply]( - ErrorOr< - AllNullableTypes>&& - 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); - } - } - { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypesWithoutRecursion" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_everything_arg = - args.at( - 0); - const auto* everything_arg = - encodable_everything_arg - .IsNull() - ? nullptr - : &(std::any_cast< - const AllNullableTypesWithoutRecursion&>( - std::get< - CustomEncodableValue>( - encodable_everything_arg))); - api->CallFlutterEchoAllNullableTypesWithoutRecursion( - everything_arg, - [reply]( - ErrorOr>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(CustomEncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypesWithoutRecursion" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_a_nullable_bool_arg = - args.at( - 0); - const auto* a_nullable_bool_arg = - std::get_if< - bool>( - &encodable_a_nullable_bool_arg); - const auto& encodable_a_nullable_int_arg = - args.at( - 1); - const auto* a_nullable_int_arg = - std::get_if< - int64_t>( - &encodable_a_nullable_int_arg); - const auto& encodable_a_nullable_string_arg = - args.at( - 2); - const auto* a_nullable_string_arg = - std::get_if< - std:: - string>( - &encodable_a_nullable_string_arg); - api->CallFlutterSendMultipleNullableTypesWithoutRecursion( - a_nullable_bool_arg, - a_nullable_int_arg, - a_nullable_string_arg, - [reply]( - ErrorOr< - AllNullableTypesWithoutRecursion>&& - 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); - } - } - { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoBool" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_a_bool_arg = - args.at( - 0); - if (encodable_a_bool_arg - .IsNull()) { - reply(WrapError( - "a_bool_arg unexpectedly null.")); - return; - } - const auto& a_bool_arg = - std::get< - bool>( - encodable_a_bool_arg); - api->CallFlutterEchoBool( - a_bool_arg, - [reply]( - ErrorOr< - bool>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoInt" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_an_int_arg = - args.at( - 0); - if (encodable_an_int_arg - .IsNull()) { - reply(WrapError( - "an_int_arg unexpectedly null.")); - return; - } - const int64_t an_int_arg = - encodable_an_int_arg - .LongValue(); - api->CallFlutterEchoInt( - an_int_arg, - [reply]( - ErrorOr< - int64_t>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoDouble" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_a_double_arg = - args.at( - 0); - if (encodable_a_double_arg - .IsNull()) { - reply(WrapError( - "a_double_arg unexpectedly null.")); - return; - } - const auto& a_double_arg = - std::get< - double>( - encodable_a_double_arg); - api->CallFlutterEchoDouble( - a_double_arg, - [reply]( - ErrorOr< - double>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoString" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_a_string_arg = - args.at( - 0); - if (encodable_a_string_arg - .IsNull()) { - reply(WrapError( - "a_string_arg unexpectedly null.")); - return; - } - const auto& a_string_arg = - std::get< - std:: - string>( - encodable_a_string_arg); - api->CallFlutterEchoString( - a_string_arg, - [reply]( - ErrorOr< - std:: - string>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoUint8List" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_list_arg = - args.at( - 0); - if (encodable_list_arg - .IsNull()) { - reply(WrapError( - "list_arg unexpectedly null.")); - return; - } - const auto& list_arg = - std::get< - std::vector< - uint8_t>>( - encodable_list_arg); - api - ->CallFlutterEchoUint8List(list_arg, - [reply]( - ErrorOr>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoList" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_list_arg = - args.at( - 0); - if (encodable_list_arg - .IsNull()) { - reply(WrapError( - "list_arg unexpectedly null.")); - return; - } - const auto& list_arg = - std::get< - EncodableList>( - encodable_list_arg); - api->CallFlutterEchoList( - list_arg, - [reply]( - ErrorOr< - EncodableList>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnumList" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_enum_list_arg = - args.at( - 0); - if (encodable_enum_list_arg - .IsNull()) { - reply(WrapError( - "enum_list_arg unexpectedly null.")); - return; - } - const auto& enum_list_arg = - std::get< - EncodableList>( - encodable_enum_list_arg); - api->CallFlutterEchoEnumList( - enum_list_arg, - [reply]( - ErrorOr< - EncodableList>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoClassList" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_class_list_arg = - args.at( - 0); - if (encodable_class_list_arg - .IsNull()) { - reply(WrapError( - "class_list_arg unexpectedly null.")); - return; - } - const auto& class_list_arg = - std::get< - EncodableList>( - encodable_class_list_arg); - api->CallFlutterEchoClassList( - class_list_arg, - [reply]( - ErrorOr< - EncodableList>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullEnumList" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_enum_list_arg = - args.at( - 0); - if (encodable_enum_list_arg - .IsNull()) { - reply(WrapError( - "enum_list_arg unexpectedly null.")); - return; - } - const auto& enum_list_arg = - std::get< - EncodableList>( - encodable_enum_list_arg); - api->CallFlutterEchoNonNullEnumList( - enum_list_arg, - [reply]( - ErrorOr< - EncodableList>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullClassList" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_class_list_arg = - args.at( - 0); - if (encodable_class_list_arg - .IsNull()) { - reply(WrapError( - "class_list_arg unexpectedly null.")); - return; - } - const auto& class_list_arg = - std::get< - EncodableList>( - encodable_class_list_arg); - api - ->CallFlutterEchoNonNullClassList(class_list_arg, - [reply]( - ErrorOr&& output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoMap" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_map_arg = - args.at( - 0); - if (encodable_map_arg - .IsNull()) { - reply(WrapError( - "map_arg unexpectedly null.")); - return; - } - const auto& map_arg = - std::get< - EncodableMap>( - encodable_map_arg); - api->CallFlutterEchoMap( - map_arg, - [reply]( - ErrorOr< - EncodableMap>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoStringMap" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_string_map_arg = - args.at( - 0); - if (encodable_string_map_arg - .IsNull()) { - reply(WrapError( - "string_map_arg unexpectedly null.")); - return; - } - const auto& string_map_arg = - std::get< - EncodableMap>( - encodable_string_map_arg); - api->CallFlutterEchoStringMap( - string_map_arg, - [reply]( - ErrorOr< - EncodableMap>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoIntMap" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_int_map_arg = - args.at( - 0); - if (encodable_int_map_arg - .IsNull()) { - reply(WrapError( - "int_map_arg unexpectedly null.")); - return; - } - const auto& int_map_arg = - std::get< - EncodableMap>( - encodable_int_map_arg); - api->CallFlutterEchoIntMap( - int_map_arg, - [reply]( - ErrorOr< - EncodableMap>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnumMap" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_enum_map_arg = - args.at( - 0); - if (encodable_enum_map_arg - .IsNull()) { - reply(WrapError( - "enum_map_arg unexpectedly null.")); - return; - } - const auto& enum_map_arg = - std::get< - EncodableMap>( - encodable_enum_map_arg); - api->CallFlutterEchoEnumMap( - enum_map_arg, - [reply]( - ErrorOr< - EncodableMap>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoClassMap" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_class_map_arg = - args.at( - 0); - if (encodable_class_map_arg - .IsNull()) { - reply(WrapError( - "class_map_arg unexpectedly null.")); - return; - } - const auto& class_map_arg = - std::get< - EncodableMap>( - encodable_class_map_arg); - api->CallFlutterEchoClassMap( - class_map_arg, - [reply]( - ErrorOr< - EncodableMap>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullStringMap" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_string_map_arg = - args.at( - 0); - if (encodable_string_map_arg - .IsNull()) { - reply(WrapError( - "string_map_arg unexpectedly null.")); - return; - } - const auto& string_map_arg = - std::get< - EncodableMap>( - encodable_string_map_arg); - api - ->CallFlutterEchoNonNullStringMap(string_map_arg, - [reply]( - ErrorOr&& output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullIntMap" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_int_map_arg = - args.at( - 0); - if (encodable_int_map_arg - .IsNull()) { - reply(WrapError( - "int_map_arg unexpectedly null.")); - return; - } - const auto& int_map_arg = - std::get< - EncodableMap>( - encodable_int_map_arg); - api->CallFlutterEchoNonNullIntMap( - int_map_arg, - [reply]( - ErrorOr< - EncodableMap>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullEnumMap" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_enum_map_arg = - args.at( - 0); - if (encodable_enum_map_arg - .IsNull()) { - reply(WrapError( - "enum_map_arg unexpectedly null.")); - return; - } - const auto& enum_map_arg = - std::get< - EncodableMap>( - encodable_enum_map_arg); - api->CallFlutterEchoNonNullEnumMap( - enum_map_arg, - [reply]( - ErrorOr< - EncodableMap>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullClassMap" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_class_map_arg = - args.at( - 0); - if (encodable_class_map_arg - .IsNull()) { - reply(WrapError( - "class_map_arg unexpectedly null.")); - return; - } - const auto& class_map_arg = - std::get< - EncodableMap>( - encodable_class_map_arg); - api->CallFlutterEchoNonNullClassMap( - class_map_arg, - [reply]( - ErrorOr< - EncodableMap>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnum" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_an_enum_arg = - args.at( - 0); - if (encodable_an_enum_arg - .IsNull()) { - reply(WrapError( - "an_enum_arg unexpectedly null.")); - return; - } - const auto& an_enum_arg = - std::any_cast< - const AnEnum&>( - std::get< - CustomEncodableValue>( - encodable_an_enum_arg)); - api->CallFlutterEchoEnum( - an_enum_arg, - [reply]( - ErrorOr< - AnEnum>&& - 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); - } - } - { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAnotherEnum" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_another_enum_arg = - args.at( - 0); - if (encodable_another_enum_arg - .IsNull()) { - reply(WrapError( - "another_enum_arg unexpectedly null.")); - return; - } - const auto& another_enum_arg = - std::any_cast< - const AnotherEnum&>( - std::get< - CustomEncodableValue>( - encodable_another_enum_arg)); - api->CallFlutterEchoAnotherEnum( - another_enum_arg, - [reply]( - ErrorOr< - AnotherEnum>&& - 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); - } - } - { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableBool" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_a_bool_arg = - args.at( - 0); - const auto* a_bool_arg = - std::get_if< - bool>( - &encodable_a_bool_arg); - api->CallFlutterEchoNullableBool( - a_bool_arg, - [reply]( - ErrorOr>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableInt" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_an_int_arg = - args.at( - 0); - const auto* an_int_arg = - std::get_if< - int64_t>( - &encodable_an_int_arg); - api->CallFlutterEchoNullableInt( - an_int_arg, - [reply]( - ErrorOr>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableDouble" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_a_double_arg = - args.at( - 0); - const auto* a_double_arg = - std::get_if< - double>( - &encodable_a_double_arg); - api->CallFlutterEchoNullableDouble( - a_double_arg, - [reply]( - ErrorOr>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableString" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& message, const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_a_string_arg = - args.at( - 0); - const auto* a_string_arg = - std::get_if< - std:: - string>( - &encodable_a_string_arg); - api->CallFlutterEchoNullableString( - a_string_arg, - [reply]( - ErrorOr>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableUint8List" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_list_arg = - args.at( - 0); - const auto* list_arg = - std::get_if< - std::vector< - uint8_t>>( - &encodable_list_arg); - api->CallFlutterEchoNullableUint8List( - list_arg, - [reply]( - ErrorOr>>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableList" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_list_arg = - args.at( - 0); - const auto* list_arg = - std::get_if< - EncodableList>( - &encodable_list_arg); - api->CallFlutterEchoNullableList( - list_arg, - [reply]( - ErrorOr>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnumList" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_enum_list_arg = - args.at( - 0); - const auto* enum_list_arg = - std::get_if< - EncodableList>( - &encodable_enum_list_arg); - api->CallFlutterEchoNullableEnumList( - enum_list_arg, - [reply]( - ErrorOr>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableClassList" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_class_list_arg = - args.at( - 0); - const auto* class_list_arg = - std::get_if< - EncodableList>( - &encodable_class_list_arg); - api->CallFlutterEchoNullableClassList( - class_list_arg, - [reply]( - ErrorOr>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullEnumList" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_enum_list_arg = - args.at( - 0); - const auto* enum_list_arg = - std::get_if< - EncodableList>( - &encodable_enum_list_arg); - api->CallFlutterEchoNullableNonNullEnumList( - enum_list_arg, - [reply]( - ErrorOr>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullClassList" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_class_list_arg = - args.at( - 0); - const auto* class_list_arg = - std::get_if< - EncodableList>( - &encodable_class_list_arg); - api->CallFlutterEchoNullableNonNullClassList( - class_list_arg, - [reply]( - ErrorOr>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableMap" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_map_arg = - args.at( - 0); - const auto* map_arg = - std::get_if< - EncodableMap>( - &encodable_map_arg); - api->CallFlutterEchoNullableMap( - map_arg, - [reply]( - ErrorOr>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableStringMap" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_string_map_arg = - args.at( - 0); - const auto* string_map_arg = - std::get_if< - EncodableMap>( - &encodable_string_map_arg); - api->CallFlutterEchoNullableStringMap( - string_map_arg, - [reply]( - ErrorOr>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableIntMap" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_int_map_arg = - args.at( - 0); - const auto* int_map_arg = - std::get_if< - EncodableMap>( - &encodable_int_map_arg); - api->CallFlutterEchoNullableIntMap( - int_map_arg, - [reply]( - ErrorOr>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnumMap" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_enum_map_arg = - args.at( - 0); - const auto* enum_map_arg = - std::get_if< - EncodableMap>( - &encodable_enum_map_arg); - api->CallFlutterEchoNullableEnumMap( - enum_map_arg, - [reply]( - ErrorOr>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableClassMap" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_class_map_arg = - args.at( - 0); - const auto* class_map_arg = - std::get_if< - EncodableMap>( - &encodable_class_map_arg); - api->CallFlutterEchoNullableClassMap( - class_map_arg, - [reply]( - ErrorOr>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullStringMap" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_string_map_arg = - args.at( - 0); - const auto* string_map_arg = - std::get_if< - EncodableMap>( - &encodable_string_map_arg); - api->CallFlutterEchoNullableNonNullStringMap( - string_map_arg, - [reply]( - ErrorOr>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullIntMap" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_int_map_arg = - args.at( - 0); - const auto* int_map_arg = - std::get_if< - EncodableMap>( - &encodable_int_map_arg); - api->CallFlutterEchoNullableNonNullIntMap( - int_map_arg, - [reply]( - ErrorOr>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullEnumMap" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_enum_map_arg = - args.at( - 0); - const auto* enum_map_arg = - std::get_if< - EncodableMap>( - &encodable_enum_map_arg); - api->CallFlutterEchoNullableNonNullEnumMap( - enum_map_arg, - [reply]( - ErrorOr>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullClassMap" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_class_map_arg = - args.at( - 0); - const auto* class_map_arg = - std::get_if< - EncodableMap>( - &encodable_class_map_arg); - api->CallFlutterEchoNullableNonNullClassMap( - class_map_arg, - [reply]( - ErrorOr>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(EncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnum" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_an_enum_arg = - args.at( - 0); - AnEnum - an_enum_arg_value; - const AnEnum* - an_enum_arg = - nullptr; - if (!encodable_an_enum_arg - .IsNull()) { - an_enum_arg_value = std::any_cast< - const AnEnum&>( - std::get< - CustomEncodableValue>( - encodable_an_enum_arg)); - an_enum_arg = - &an_enum_arg_value; - } - api->CallFlutterEchoNullableEnum( - an_enum_arg - ? &(*an_enum_arg) - : nullptr, - [reply]( - ErrorOr>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(CustomEncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAnotherNullableEnum" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_another_enum_arg = - args.at( - 0); - AnotherEnum - another_enum_arg_value; - const AnotherEnum* - another_enum_arg = - nullptr; - if (!encodable_another_enum_arg - .IsNull()) { - another_enum_arg_value = - std::any_cast< - const AnotherEnum&>( - std::get< - CustomEncodableValue>( - encodable_another_enum_arg)); - another_enum_arg = - &another_enum_arg_value; - } - api->CallFlutterEchoAnotherNullableEnum( - another_enum_arg - ? &(*another_enum_arg) - : nullptr, - [reply]( - ErrorOr>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - auto output_optional = - std::move( - output) - .TakeValue(); - if (output_optional) { - wrapped - .push_back(CustomEncodableValue( - std::move( - output_optional) - .value())); - } else { - 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.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSmallApiEchoString" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_a_string_arg = - args.at( - 0); - if (encodable_a_string_arg - .IsNull()) { - reply(WrapError( - "a_string_arg unexpectedly null.")); - return; - } - const auto& a_string_arg = - std::get< - std:: - string>( - encodable_a_string_arg); - api - ->CallFlutterSmallApiEchoString(a_string_arg, - [reply]( - ErrorOr< - std:: - string>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - reply(EncodableValue( - std::move( - wrapped))); - }); - } catch ( - const std:: - exception& - exception) { - reply(WrapError( - exception - .what())); - } - }); - } else { - channel - .SetMessageHandler( - nullptr); - } - } - } - - EncodableValue - HostIntegrationCoreApi:: - WrapError( - std::string_view - error_message) { - return EncodableValue(EncodableList{ - EncodableValue( - std::string( - error_message)), - EncodableValue( - "Error"), - EncodableValue()}); - } - - EncodableValue - HostIntegrationCoreApi:: - WrapError( - const FlutterError& - error) { - return EncodableValue(EncodableList{ - EncodableValue( - error - .code()), - EncodableValue( - error - .message()), - error - .details()}); - } - - // Generated class from Pigeon that represents Flutter messages that can be called from C++. - FlutterIntegrationCoreApi:: - FlutterIntegrationCoreApi( - ::flutter:: - BinaryMessenger * - binary_messenger) - : binary_messenger_( - binary_messenger), - message_channel_suffix_( - "") { - } - - FlutterIntegrationCoreApi::FlutterIntegrationCoreApi( - ::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& - FlutterIntegrationCoreApi:: - GetCodec() { - return ::flutter::StandardMessageCodec:: - GetInstance( - &PigeonInternalCodecSerializer:: - GetInstance()); - } - - void - FlutterIntegrationCoreApi::Noop( - std::function< - void( - void)> && - on_success, - std::function< - void( - const FlutterError&)> && - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue - encoded_api_arguments = - EncodableValue(); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - on_success(); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::ThrowError( - std::function< - void( - const EncodableValue*)> && - on_success, - std::function< - void( - const FlutterError&)> && - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue - encoded_api_arguments = - EncodableValue(); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto* return_value = - &list_return_value - ->at( - 0); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::ThrowErrorFromVoid( - std::function< - void( - void)> && - on_success, - std::function< - void( - const FlutterError&)> && - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwErrorFromVoid" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue - encoded_api_arguments = - EncodableValue(); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - on_success(); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::EchoAllTypes( - const AllTypes& - everything_arg, - std::function&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - CustomEncodableValue( - everything_arg), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto& return_value = - std::any_cast< - const AllTypes&>( - std::get< - CustomEncodableValue>( - list_return_value - ->at( - 0))); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::EchoAllNullableTypes( - const AllNullableTypes* - everything_arg, - std::function&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - everything_arg - ? CustomEncodableValue( - *everything_arg) - : EncodableValue(), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto* return_value = - list_return_value - ->at( - 0) - .IsNull() - ? nullptr - : &(std::any_cast< - const AllNullableTypes&>( - std::get< - CustomEncodableValue>( - list_return_value - ->at( - 0)))); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::SendMultipleNullableTypes( - const bool* - a_nullable_bool_arg, - const int64_t* - a_nullable_int_arg, - const std:: - string* - a_nullable_string_arg, - std::function&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - a_nullable_bool_arg - ? EncodableValue( - *a_nullable_bool_arg) - : EncodableValue(), - a_nullable_int_arg - ? EncodableValue( - *a_nullable_int_arg) - : EncodableValue(), - a_nullable_string_arg - ? EncodableValue( - *a_nullable_string_arg) - : EncodableValue(), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto& return_value = - std::any_cast< - const AllNullableTypes&>( - std::get< - CustomEncodableValue>( - list_return_value - ->at( - 0))); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::EchoAllNullableTypesWithoutRecursion( - const AllNullableTypesWithoutRecursion* - everything_arg, - std::function&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - everything_arg - ? CustomEncodableValue( - *everything_arg) - : EncodableValue(), - }); - channel - .Send(encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto* - return_value = list_return_value - ->at( - 0) - .IsNull() - ? nullptr - : &( - std:: - any_cast(std:: - get(list_return_value - ->at( - 0)))); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::SendMultipleNullableTypesWithoutRecursion( - const bool* - a_nullable_bool_arg, - const int64_t* - a_nullable_int_arg, - const std:: - string* - a_nullable_string_arg, - std::function&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - a_nullable_bool_arg - ? EncodableValue( - *a_nullable_bool_arg) - : EncodableValue(), - a_nullable_int_arg - ? EncodableValue( - *a_nullable_int_arg) - : EncodableValue(), - a_nullable_string_arg - ? EncodableValue( - *a_nullable_string_arg) - : EncodableValue(), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto& return_value = - std::any_cast< - const AllNullableTypesWithoutRecursion&>( - std::get< - CustomEncodableValue>( - list_return_value - ->at( - 0))); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::EchoBool( - bool - a_bool_arg, - std::function< - void( - bool)>&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - EncodableValue( - a_bool_arg), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto& return_value = - std::get< - bool>( - list_return_value - ->at( - 0)); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::EchoInt( - int64_t - an_int_arg, - std::function< - void( - int64_t)>&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - EncodableValue( - an_int_arg), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const int64_t return_value = - list_return_value - ->at( - 0) - .LongValue(); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::EchoDouble( - double - a_double_arg, - std::function< - void( - double)>&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - EncodableValue( - a_double_arg), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto& return_value = - std::get< - double>( - list_return_value - ->at( - 0)); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::EchoString( - const std:: - string& - a_string_arg, - std::function&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - EncodableValue( - a_string_arg), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto& return_value = - std::get< - std:: - string>( - list_return_value - ->at( - 0)); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::EchoUint8List( - const std::vector< - uint8_t>& - list_arg, - std::function&)>&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - EncodableValue( - list_arg), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto& return_value = - std::get< - std::vector< - uint8_t>>( - list_return_value - ->at( - 0)); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::EchoList( - const EncodableList& - list_arg, - std::function&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - EncodableValue( - list_arg), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto& return_value = - std::get< - EncodableList>( - list_return_value - ->at( - 0)); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::EchoEnumList( - const EncodableList& - enum_list_arg, - std::function&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnumList" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - EncodableValue( - enum_list_arg), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto& return_value = - std::get< - EncodableList>( - list_return_value - ->at( - 0)); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::EchoClassList( - const EncodableList& - class_list_arg, - std::function&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoClassList" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - EncodableValue( - class_list_arg), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto& return_value = - std::get< - EncodableList>( - list_return_value - ->at( - 0)); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::EchoNonNullEnumList( - const EncodableList& - enum_list_arg, - std::function&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullEnumList" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - EncodableValue( - enum_list_arg), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto& return_value = - std::get< - EncodableList>( - list_return_value - ->at( - 0)); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::EchoNonNullClassList( - const EncodableList& - class_list_arg, - std::function&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullClassList" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - EncodableValue( - class_list_arg), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto& return_value = - std::get< - EncodableList>( - list_return_value - ->at( - 0)); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::EchoMap( - const EncodableMap& - map_arg, - std::function&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - EncodableValue( - map_arg), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto& return_value = - std::get< - EncodableMap>( - list_return_value - ->at( - 0)); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::EchoStringMap( - const EncodableMap& - string_map_arg, - std::function&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoStringMap" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - EncodableValue( - string_map_arg), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto& return_value = - std::get< - EncodableMap>( - list_return_value - ->at( - 0)); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::EchoIntMap( - const EncodableMap& - int_map_arg, - std::function&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoIntMap" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - EncodableValue( - int_map_arg), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto& return_value = - std::get< - EncodableMap>( - list_return_value - ->at( - 0)); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::EchoEnumMap( - const EncodableMap& - enum_map_arg, - std::function&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnumMap" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - EncodableValue( - enum_map_arg), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto& return_value = - std::get< - EncodableMap>( - list_return_value - ->at( - 0)); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::EchoClassMap( - const EncodableMap& - class_map_arg, - std::function&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoClassMap" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - EncodableValue( - class_map_arg), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto& return_value = - std::get< - EncodableMap>( - list_return_value - ->at( - 0)); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::EchoNonNullStringMap( - const EncodableMap& - string_map_arg, - std::function&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullStringMap" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - EncodableValue( - string_map_arg), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto& return_value = - std::get< - EncodableMap>( - list_return_value - ->at( - 0)); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::EchoNonNullIntMap( - const EncodableMap& - int_map_arg, - std::function&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullIntMap" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - EncodableValue( - int_map_arg), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto& return_value = - std::get< - EncodableMap>( - list_return_value - ->at( - 0)); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::EchoNonNullEnumMap( - const EncodableMap& - enum_map_arg, - std::function&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullEnumMap" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - EncodableValue( - enum_map_arg), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto& return_value = - std::get< - EncodableMap>( - list_return_value - ->at( - 0)); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::EchoNonNullClassMap( - const EncodableMap& - class_map_arg, - std::function&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullClassMap" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - EncodableValue( - class_map_arg), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto& return_value = - std::get< - EncodableMap>( - list_return_value - ->at( - 0)); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::EchoEnum( - const AnEnum& - an_enum_arg, - std::function&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - CustomEncodableValue( - an_enum_arg), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto& return_value = - std::any_cast< - const AnEnum&>( - std::get< - CustomEncodableValue>( - list_return_value - ->at( - 0))); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::EchoAnotherEnum( - const AnotherEnum& - another_enum_arg, - std::function&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAnotherEnum" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - CustomEncodableValue( - another_enum_arg), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto& return_value = - std::any_cast< - const AnotherEnum&>( - std::get< - CustomEncodableValue>( - list_return_value - ->at( - 0))); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::EchoNullableBool( - const bool* - a_bool_arg, - std::function&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - a_bool_arg - ? EncodableValue( - *a_bool_arg) - : EncodableValue(), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto* return_value = - std::get_if< - bool>( - &list_return_value - ->at( - 0)); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::EchoNullableInt( - const int64_t* - an_int_arg, - std::function&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - an_int_arg - ? EncodableValue( - *an_int_arg) - : EncodableValue(), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto* return_value = - std::get_if< - int64_t>( - &list_return_value - ->at( - 0)); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::EchoNullableDouble( - const double* - a_double_arg, - std::function&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - a_double_arg - ? EncodableValue( - *a_double_arg) - : EncodableValue(), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto* return_value = - std::get_if< - double>( - &list_return_value - ->at( - 0)); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::EchoNullableString( - const std:: - string* - a_string_arg, - std::function&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - a_string_arg - ? EncodableValue( - *a_string_arg) - : EncodableValue(), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto* return_value = - std::get_if< - std:: - string>( - &list_return_value - ->at( - 0)); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::EchoNullableUint8List( - const std::vector< - uint8_t>* - list_arg, - std::function*)>&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableUint8List" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - list_arg - ? EncodableValue( - *list_arg) - : EncodableValue(), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto* return_value = - std::get_if< - std::vector< - uint8_t>>( - &list_return_value - ->at( - 0)); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::EchoNullableList( - const EncodableList* - list_arg, - std::function&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - list_arg - ? EncodableValue( - *list_arg) - : EncodableValue(), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto* return_value = - std::get_if< - EncodableList>( - &list_return_value - ->at( - 0)); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::EchoNullableEnumList( - const EncodableList* - enum_list_arg, - std::function&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnumList" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - enum_list_arg - ? EncodableValue( - *enum_list_arg) - : EncodableValue(), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto* return_value = - std::get_if< - EncodableList>( - &list_return_value - ->at( - 0)); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::EchoNullableClassList( - const EncodableList* - class_list_arg, - std::function&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableClassList" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - class_list_arg - ? EncodableValue( - *class_list_arg) - : EncodableValue(), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto* return_value = - std::get_if< - EncodableList>( - &list_return_value - ->at( - 0)); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::EchoNullableNonNullEnumList( - const EncodableList* - enum_list_arg, - std::function&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullEnumList" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - enum_list_arg - ? EncodableValue( - *enum_list_arg) - : EncodableValue(), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto* return_value = - std::get_if< - EncodableList>( - &list_return_value - ->at( - 0)); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::EchoNullableNonNullClassList( - const EncodableList* - class_list_arg, - std::function&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullClassList" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - class_list_arg - ? EncodableValue( - *class_list_arg) - : EncodableValue(), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto* return_value = - std::get_if< - EncodableList>( - &list_return_value - ->at( - 0)); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::EchoNullableMap( - const EncodableMap* - map_arg, - std::function&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - map_arg - ? EncodableValue( - *map_arg) - : EncodableValue(), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto* return_value = - std::get_if< - EncodableMap>( - &list_return_value - ->at( - 0)); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::EchoNullableStringMap( - const EncodableMap* - string_map_arg, - std::function&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableStringMap" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - string_map_arg - ? EncodableValue( - *string_map_arg) - : EncodableValue(), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto* return_value = - std::get_if< - EncodableMap>( - &list_return_value - ->at( - 0)); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::EchoNullableIntMap( - const EncodableMap* - int_map_arg, - std::function&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableIntMap" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - int_map_arg - ? EncodableValue( - *int_map_arg) - : EncodableValue(), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto* return_value = - std::get_if< - EncodableMap>( - &list_return_value - ->at( - 0)); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::EchoNullableEnumMap( - const EncodableMap* - enum_map_arg, - std::function&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnumMap" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - enum_map_arg - ? EncodableValue( - *enum_map_arg) - : EncodableValue(), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto* return_value = - std::get_if< - EncodableMap>( - &list_return_value - ->at( - 0)); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::EchoNullableClassMap( - const EncodableMap* - class_map_arg, - std::function&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableClassMap" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - class_map_arg - ? EncodableValue( - *class_map_arg) - : EncodableValue(), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto* return_value = - std::get_if< - EncodableMap>( - &list_return_value - ->at( - 0)); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::EchoNullableNonNullStringMap( - const EncodableMap* - string_map_arg, - std::function&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullStringMap" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - string_map_arg - ? EncodableValue( - *string_map_arg) - : EncodableValue(), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto* return_value = - std::get_if< - EncodableMap>( - &list_return_value - ->at( - 0)); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::EchoNullableNonNullIntMap( - const EncodableMap* - int_map_arg, - std::function&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullIntMap" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - int_map_arg - ? EncodableValue( - *int_map_arg) - : EncodableValue(), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto* return_value = - std::get_if< - EncodableMap>( - &list_return_value - ->at( - 0)); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::EchoNullableNonNullEnumMap( - const EncodableMap* - enum_map_arg, - std::function&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullEnumMap" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - enum_map_arg - ? EncodableValue( - *enum_map_arg) - : EncodableValue(), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto* return_value = - std::get_if< - EncodableMap>( - &list_return_value - ->at( - 0)); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::EchoNullableNonNullClassMap( - const EncodableMap* - class_map_arg, - std::function&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullClassMap" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - class_map_arg - ? EncodableValue( - *class_map_arg) - : EncodableValue(), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto* return_value = - std::get_if< - EncodableMap>( - &list_return_value - ->at( - 0)); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::EchoNullableEnum( - const AnEnum* - an_enum_arg, - std::function&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnum" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - an_enum_arg - ? CustomEncodableValue( - *an_enum_arg) - : EncodableValue(), - }); - channel - .Send(encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = std::move(on_error)](const uint8_t* reply, size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - AnEnum - return_value_value; - const AnEnum* - return_value = - nullptr; - if (!list_return_value - ->at( - 0) - .IsNull()) { - return_value_value = std::any_cast< - const AnEnum&>( - std::get< - CustomEncodableValue>( - list_return_value - ->at( - 0))); - return_value = - &return_value_value; - } - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::EchoAnotherNullableEnum( - const AnotherEnum* - another_enum_arg, - std::function&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAnotherNullableEnum" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - another_enum_arg - ? CustomEncodableValue( - *another_enum_arg) - : EncodableValue(), - }); - channel - .Send(encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = std::move(on_error)](const uint8_t* reply, size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - AnotherEnum - return_value_value; - const AnotherEnum* - return_value = - nullptr; - if (!list_return_value - ->at( - 0) - .IsNull()) { - return_value_value = std::any_cast< - const AnotherEnum&>( - std::get< - CustomEncodableValue>( - list_return_value - ->at( - 0))); - return_value = - &return_value_value; - } - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::NoopAsync( - std::function< - void( - void)> && - on_success, - std::function< - void( - const FlutterError&)> && - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noopAsync" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue - encoded_api_arguments = - EncodableValue(); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - on_success(); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterIntegrationCoreApi::EchoAsyncString( - const std:: - string& - a_string_arg, - std::function&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAsyncString" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - EncodableValue( - a_string_arg), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto& return_value = - std::get< - std:: - string>( - list_return_value - ->at( - 0)); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - /// The codec used by HostTrivialApi. - const ::flutter:: - StandardMessageCodec& - HostTrivialApi:: - GetCodec() { - return ::flutter::StandardMessageCodec:: - GetInstance( - &PigeonInternalCodecSerializer:: - GetInstance()); - } - - // Sets up an instance of `HostTrivialApi` to handle messages through the `binary_messenger`. - void - HostTrivialApi::SetUp( - ::flutter:: - BinaryMessenger * - binary_messenger, - HostTrivialApi * - api) { - HostTrivialApi::SetUp( - binary_messenger, - api, - ""); - } - - void - HostTrivialApi::SetUp( - ::flutter:: - BinaryMessenger * - binary_messenger, - HostTrivialApi * - api, - const std:: - string& - message_channel_suffix) { - const std::string prepended_suffix = - message_channel_suffix - .length() > - 0 - ? std::string( - ".") + - message_channel_suffix - : ""; - { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostTrivialApi.noop" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& message, const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - std::optional< - FlutterError> - output = - api->Noop(); - 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 - HostTrivialApi::WrapError( - std::string_view - error_message) { - return EncodableValue(EncodableList{ - EncodableValue( - std::string( - error_message)), - EncodableValue( - "Error"), - EncodableValue()}); - } - - EncodableValue - HostTrivialApi::WrapError( - const FlutterError& - error) { - return EncodableValue(EncodableList{ - EncodableValue( - error - .code()), - EncodableValue( - error - .message()), - error - .details()}); - } - - /// The codec used by HostSmallApi. - const ::flutter:: - StandardMessageCodec& - HostSmallApi:: - GetCodec() { - return ::flutter::StandardMessageCodec:: - GetInstance( - &PigeonInternalCodecSerializer:: - GetInstance()); - } - - // Sets up an instance of `HostSmallApi` to handle messages through the `binary_messenger`. - void - HostSmallApi::SetUp( - ::flutter:: - BinaryMessenger * - binary_messenger, - HostSmallApi * - api) { - HostSmallApi::SetUp( - binary_messenger, - api, - ""); - } - - void - HostSmallApi::SetUp( - ::flutter:: - BinaryMessenger * - binary_messenger, - HostSmallApi * - api, - const std:: - string& - message_channel_suffix) { - const std::string prepended_suffix = - message_channel_suffix - .length() > - 0 - ? std::string( - ".") + - message_channel_suffix - : ""; - { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.echo" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler([api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - const auto& args = - std::get< - EncodableList>( - message); - const auto& encodable_a_string_arg = - args.at( - 0); - if (encodable_a_string_arg - .IsNull()) { - reply(WrapError( - "a_string_arg unexpectedly null.")); - return; - } - const auto& a_string_arg = - std::get< - std:: - string>( - encodable_a_string_arg); - api->Echo( - a_string_arg, - [reply]( - ErrorOr< - std:: - string>&& - output) { - if (output - .has_error()) { - reply(WrapError( - output - .error())); - return; - } - EncodableList - wrapped; - wrapped - .push_back(EncodableValue( - std::move( - output) - .TakeValue())); - 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.pigeon_integration_tests.HostSmallApi.voidVoid" + - prepended_suffix, - &GetCodec()); - if (api != - nullptr) { - channel - .SetMessageHandler( - [api]( - const EncodableValue& - message, - const ::flutter:: - MessageReply< - EncodableValue>& - reply) { - try { - api->VoidVoid( - [reply]( - std::optional< - FlutterError>&& - 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 - HostSmallApi::WrapError( - std::string_view - error_message) { - return EncodableValue(EncodableList{ - EncodableValue( - std::string( - error_message)), - EncodableValue( - "Error"), - EncodableValue()}); - } - - EncodableValue - HostSmallApi::WrapError( - const FlutterError& - error) { - return EncodableValue(EncodableList{ - EncodableValue( - error - .code()), - EncodableValue( - error - .message()), - error - .details()}); - } - - // Generated class from Pigeon that represents Flutter messages that can be called from C++. - FlutterSmallApi::FlutterSmallApi( - ::flutter:: - BinaryMessenger * - binary_messenger) - : binary_messenger_( - binary_messenger), - message_channel_suffix_( - "") { - } - - FlutterSmallApi::FlutterSmallApi( - ::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& - FlutterSmallApi:: - GetCodec() { - return ::flutter::StandardMessageCodec:: - GetInstance( - &PigeonInternalCodecSerializer:: - GetInstance()); - } - - void - FlutterSmallApi::EchoWrappedList( - const TestMessage& - msg_arg, - std::function&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoWrappedList" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - CustomEncodableValue( - msg_arg), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto& return_value = - std::any_cast< - const TestMessage&>( - std::get< - CustomEncodableValue>( - list_return_value - ->at( - 0))); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - void - FlutterSmallApi::EchoString( - const std:: - string& - a_string_arg, - std::function&& - on_success, - std::function&& - on_error) { - const std::string - channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoString" + - message_channel_suffix_; - BasicMessageChannel<> channel( - binary_messenger_, - channel_name, - &GetCodec()); - EncodableValue encoded_api_arguments = - EncodableValue(EncodableList{ - EncodableValue( - a_string_arg), - }); - channel - .Send( - encoded_api_arguments, - [channel_name, - on_success = - std::move( - on_success), - on_error = - std::move( - on_error)]( - const uint8_t* - reply, - size_t - reply_size) { - std::unique_ptr< - EncodableValue> - response = - GetCodec() - .DecodeMessage( - reply, - reply_size); - const auto& - encodable_return_value = - *response; - const auto* list_return_value = - std::get_if< - EncodableList>( - &encodable_return_value); - if (list_return_value) { - if (list_return_value - ->size() > - 1) { - on_error(FlutterError( - std::get< - std:: - string>( - list_return_value - ->at( - 0)), - std::get< - std:: - string>( - list_return_value - ->at( - 1)), - list_return_value - ->at( - 2))); - } else { - const auto& return_value = - std::get< - std:: - string>( - list_return_value - ->at( - 0)); - on_success( - return_value); - } - } else { - on_error(CreateConnectionError( - channel_name)); - } - }); - } - - } // namespace core_tests_pigeontest + const auto& return_value = + std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +} // namespace core_tests_pigeontest diff --git a/packages/pigeon/test/swift_generator_test.dart b/packages/pigeon/test/swift_generator_test.dart index ac8e84781135..101fbb4a2688 100644 --- a/packages/pigeon/test/swift_generator_test.dart +++ b/packages/pigeon/test/swift_generator_test.dart @@ -1881,6 +1881,9 @@ void main() { final code = sink.toString(); expect(code, contains(': Hashable, CustomStringConvertible')); expect(code, contains('public var description: String {')); - expect(code, contains(r'return "Foobar(field1: \(field1))"')); + expect( + code, + contains(r'return "Foobar(field1: \(String(describing: field1)))"'), + ); }); }