Skip to content

Commit

Permalink
Bump pigeon version to ^9.2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
manu-sncf committed Apr 14, 2023
1 parent 1247852 commit 7fc5e22
Show file tree
Hide file tree
Showing 7 changed files with 240 additions and 168 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.0.10

* Bump pigeon version to ^9.2.4

## 0.0.9

* Fixed SVG retrieval for languages with country code that don't have a match in SVG assets
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Autogenerated from Pigeon (v4.2.5), do not edit directly.
// Autogenerated from Pigeon (v9.2.4), do not edit directly.
// See also: https://pub.dev/packages/pigeon

package sncf.connect.tech.flutter_google_wallet;
Expand All @@ -12,102 +12,136 @@
import io.flutter.plugin.common.StandardMessageCodec;
import java.io.ByteArrayOutputStream;
import java.nio.ByteBuffer;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.HashMap;

/**Generated class from Pigeon. */
@SuppressWarnings({"unused", "unchecked", "CodeBlock2Expr", "RedundantSuppression"})
/** Generated class from Pigeon. */
@SuppressWarnings({"unused", "unchecked", "CodeBlock2Expr", "RedundantSuppression", "serial"})
public class Messages {

/** Error class for passing custom error details to Flutter via a thrown PlatformException. */
public static class FlutterError extends RuntimeException {

/** The error code. */
public final String code;

/** The error details. Must be a datatype supported by the api codec. */
public final Object details;

public FlutterError(@NonNull String code, @Nullable String message, @Nullable Object details)
{
super(message);
this.code = code;
this.details = details;
}
}

@NonNull
protected static ArrayList<Object> wrapError(@NonNull Throwable exception) {
ArrayList<Object> errorList = new ArrayList<Object>(3);
if (exception instanceof FlutterError) {
FlutterError error = (FlutterError) exception;
errorList.add(error.code);
errorList.add(error.getMessage());
errorList.add(error.details);
} else {
errorList.add(exception.toString());
errorList.add(exception.getClass().getSimpleName());
errorList.add(
"Cause: " + exception.getCause() + ", Stacktrace: " + Log.getStackTraceString(exception));
}
return errorList;
}
/** Generated interface from Pigeon that represents a handler of messages from Flutter. */
public interface GoogleWalletApi {

void initWalletClient();
@NonNull Boolean getWalletApiAvailabilityStatus();

@NonNull
Boolean getWalletApiAvailabilityStatus();

void savePasses(@NonNull String jsonPass, @NonNull Long addToGoogleWalletRequestCode);

/** The codec used by GoogleWalletApi. */
static MessageCodec<Object> getCodec() {
return new StandardMessageCodec(); }
static @NonNull MessageCodec<Object> getCodec() {
return new StandardMessageCodec();
}
/**Sets up an instance of `GoogleWalletApi` to handle messages through the `binaryMessenger`. */
static void setup(BinaryMessenger binaryMessenger, GoogleWalletApi api) {
static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable GoogleWalletApi api) {
{
BasicMessageChannel<Object> channel =
new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.GoogleWalletApi.initWalletClient", getCodec());
new BasicMessageChannel<>(
binaryMessenger, "dev.flutter.pigeon.GoogleWalletApi.initWalletClient", getCodec());
if (api != null) {
channel.setMessageHandler((message, reply) -> {
Map<String, Object> wrapped = new HashMap<>();
try {
api.initWalletClient();
wrapped.put("result", null);
}
catch (Error | RuntimeException exception) {
wrapped.put("error", wrapError(exception));
}
reply.reply(wrapped);
});
channel.setMessageHandler(
(message, reply) -> {
ArrayList<Object> wrapped = new ArrayList<Object>();
try {
api.initWalletClient();
wrapped.add(0, null);
}
catch (Throwable exception) {
ArrayList<Object> wrappedError = wrapError(exception);
wrapped = wrappedError;
}
reply.reply(wrapped);
});
} else {
channel.setMessageHandler(null);
}
}
{
BinaryMessenger.TaskQueue taskQueue = binaryMessenger.makeBackgroundTaskQueue();
BasicMessageChannel<Object> channel =
new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.GoogleWalletApi.getWalletApiAvailabilityStatus", getCodec(), taskQueue);
new BasicMessageChannel<>(
binaryMessenger, "dev.flutter.pigeon.GoogleWalletApi.getWalletApiAvailabilityStatus", getCodec(), taskQueue);
if (api != null) {
channel.setMessageHandler((message, reply) -> {
Map<String, Object> wrapped = new HashMap<>();
try {
Boolean output = api.getWalletApiAvailabilityStatus();
wrapped.put("result", output);
}
catch (Error | RuntimeException exception) {
wrapped.put("error", wrapError(exception));
}
reply.reply(wrapped);
});
channel.setMessageHandler(
(message, reply) -> {
ArrayList<Object> wrapped = new ArrayList<Object>();
try {
Boolean output = api.getWalletApiAvailabilityStatus();
wrapped.add(0, output);
}
catch (Throwable exception) {
ArrayList<Object> wrappedError = wrapError(exception);
wrapped = wrappedError;
}
reply.reply(wrapped);
});
} else {
channel.setMessageHandler(null);
}
}
{
BasicMessageChannel<Object> channel =
new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.GoogleWalletApi.savePasses", getCodec());
new BasicMessageChannel<>(
binaryMessenger, "dev.flutter.pigeon.GoogleWalletApi.savePasses", getCodec());
if (api != null) {
channel.setMessageHandler((message, reply) -> {
Map<String, Object> wrapped = new HashMap<>();
try {
ArrayList<Object> args = (ArrayList<Object>)message;
assert args != null;
String jsonPassArg = (String)args.get(0);
if (jsonPassArg == null) {
throw new NullPointerException("jsonPassArg unexpectedly null.");
}
Number addToGoogleWalletRequestCodeArg = (Number)args.get(1);
if (addToGoogleWalletRequestCodeArg == null) {
throw new NullPointerException("addToGoogleWalletRequestCodeArg unexpectedly null.");
}
api.savePasses(jsonPassArg, (addToGoogleWalletRequestCodeArg == null) ? null : addToGoogleWalletRequestCodeArg.longValue());
wrapped.put("result", null);
}
catch (Error | RuntimeException exception) {
wrapped.put("error", wrapError(exception));
}
reply.reply(wrapped);
});
channel.setMessageHandler(
(message, reply) -> {
ArrayList<Object> wrapped = new ArrayList<Object>();
ArrayList<Object> args = (ArrayList<Object>) message;
String jsonPassArg = (String) args.get(0);
Number addToGoogleWalletRequestCodeArg = (Number) args.get(1);
try {
api.savePasses(jsonPassArg, (addToGoogleWalletRequestCodeArg == null) ? null : addToGoogleWalletRequestCodeArg.longValue());
wrapped.add(0, null);
}
catch (Throwable exception) {
ArrayList<Object> wrappedError = wrapError(exception);
wrapped = wrappedError;
}
reply.reply(wrapped);
});
} else {
channel.setMessageHandler(null);
}
}
}
}
@NonNull private static Map<String, Object> wrapError(@NonNull Throwable exception) {
Map<String, Object> errorMap = new HashMap<>();
errorMap.put("message", exception.toString());
errorMap.put("code", exception.getClass().getSimpleName());
errorMap.put("details", "Cause: " + exception.getCause() + ", Stacktrace: " + Log.getStackTraceString(exception));
return errorMap;
}
}
Loading

0 comments on commit 7fc5e22

Please sign in to comment.