chore(shorebird_code_push_protocol): bump space_gen pin + regen (#3726)

This commit is contained in:
Eric Seidel
2026-05-01 09:00:02 -07:00
committed by GitHub
parent 3d9bcf9fe3
commit 9d0a5ffcdf
12 changed files with 50 additions and 44 deletions
@@ -13,6 +13,8 @@ T parseFromJson<T>(
) {
try {
return build();
// Rewrapping TypeError as FormatException is the whole point.
// ignore: avoid_catching_errors
} on TypeError catch (error) {
throw FormatException('Failed to parse $className from JSON: $error', json);
}
@@ -1,8 +1,11 @@
// Spec descriptions copy prose verbatim into dartdoc, where `[x]`
// inside a sentence (placeholder text, ALL_CAPS tokens, license
// templates) is parsed as a symbol reference even when no such
// symbol exists. Suppress file-locally so the lint stays live
// elsewhere; spec authors do not always escape brackets.
// ignore_for_file: comment_references
import 'package:meta/meta.dart';
import 'package:shorebird_code_push_protocol/model_helpers.dart';
import 'package:shorebird_code_push_protocol/shorebird_code_push_protocol.dart'
show Patch;
import 'package:shorebird_code_push_protocol/src/models/patch.dart' show Patch;
/// {@template create_patch_response}
/// The response body for POST /apps/{appId}/patches. Deliberately
@@ -11,7 +11,8 @@ class GetGcpDownloadSpeedTestUrl200Response {
required this.downloadUrl,
});
/// Converts a `Map<String, dynamic>` to a [GetGcpDownloadSpeedTestUrl200Response].
/// Converts a `Map<String, dynamic>` to a
/// [GetGcpDownloadSpeedTestUrl200Response].
factory GetGcpDownloadSpeedTestUrl200Response.fromJson(
Map<String, dynamic> json,
) {
@@ -38,7 +39,8 @@ class GetGcpDownloadSpeedTestUrl200Response {
/// The GCP-signed download URL.
final String downloadUrl;
/// Converts a [GetGcpDownloadSpeedTestUrl200Response] to a `Map<String, dynamic>`.
/// Converts a [GetGcpDownloadSpeedTestUrl200Response]
/// to a `Map<String, dynamic>`.
Map<String, dynamic> toJson() {
return {
'download_url': downloadUrl,
@@ -11,7 +11,8 @@ class GetGcpUploadSpeedTestUrl200Response {
required this.uploadUrl,
});
/// Converts a `Map<String, dynamic>` to a [GetGcpUploadSpeedTestUrl200Response].
/// Converts a `Map<String, dynamic>` to a
/// [GetGcpUploadSpeedTestUrl200Response].
factory GetGcpUploadSpeedTestUrl200Response.fromJson(
Map<String, dynamic> json,
) {
@@ -38,7 +39,8 @@ class GetGcpUploadSpeedTestUrl200Response {
/// The GCP-signed upload URL.
final String uploadUrl;
/// Converts a [GetGcpUploadSpeedTestUrl200Response] to a `Map<String, dynamic>`.
/// Converts a [GetGcpUploadSpeedTestUrl200Response]
/// to a `Map<String, dynamic>`.
Map<String, dynamic> toJson() {
return {
'upload_url': uploadUrl,
@@ -10,7 +10,7 @@ enum AppCollaboratorRole {
const AppCollaboratorRole._(this.value);
/// Creates a AppCollaboratorRole from a json string.
/// Creates a AppCollaboratorRole from a json value.
factory AppCollaboratorRole.fromJson(String json) {
return AppCollaboratorRole.values.firstWhere(
(value) => value.value == json,
@@ -19,7 +19,7 @@ enum AppCollaboratorRole {
);
}
/// Convenience to create a nullable type from a nullable json object.
/// Convenience to create a nullable type from a nullable json value.
/// Useful when parsing optional fields.
static AppCollaboratorRole? maybeFromJson(String? json) {
if (json == null) {
@@ -28,14 +28,14 @@ enum AppCollaboratorRole {
return AppCollaboratorRole.fromJson(json);
}
/// The value of the enum, as a string. This is the exact value
/// The value of the enum. This is the exact value
/// from the OpenAPI spec and will be used for network transport.
final String value;
/// Converts the enum to a json string.
/// Converts the enum to its json value.
String toJson() => value;
/// Returns the string value of the enum.
/// Returns the string form of the enum.
@override
String toString() => value;
}
@@ -9,7 +9,7 @@ enum OrganizationType {
const OrganizationType._(this.value);
/// Creates a OrganizationType from a json string.
/// Creates a OrganizationType from a json value.
factory OrganizationType.fromJson(String json) {
return OrganizationType.values.firstWhere(
(value) => value.value == json,
@@ -18,7 +18,7 @@ enum OrganizationType {
);
}
/// Convenience to create a nullable type from a nullable json object.
/// Convenience to create a nullable type from a nullable json value.
/// Useful when parsing optional fields.
static OrganizationType? maybeFromJson(String? json) {
if (json == null) {
@@ -27,14 +27,14 @@ enum OrganizationType {
return OrganizationType.fromJson(json);
}
/// The value of the enum, as a string. This is the exact value
/// The value of the enum. This is the exact value
/// from the OpenAPI spec and will be used for network transport.
final String value;
/// Converts the enum to a json string.
/// Converts the enum to its json value.
String toJson() => value;
/// Returns the string value of the enum.
/// Returns the string form of the enum.
@override
String toString() => value;
}
@@ -28,7 +28,8 @@ class PrivateUser {
id: json['id'] as int,
email: json['email'] as String,
displayName: json['display_name'] as String?,
hasActiveSubscription: json['has_active_subscription'] as bool?,
hasActiveSubscription:
json['has_active_subscription'] as bool? ?? false,
stripeCustomerId: json['stripe_customer_id'] as String?,
jwtIssuer: json['jwt_issuer'] as String,
patchOverageLimit: json['patch_overage_limit'] as int?,
@@ -17,7 +17,7 @@ enum ReleasePlatform {
const ReleasePlatform._(this.value);
/// Creates a ReleasePlatform from a json string.
/// Creates a ReleasePlatform from a json value.
factory ReleasePlatform.fromJson(String json) {
return ReleasePlatform.values.firstWhere(
(value) => value.value == json,
@@ -26,7 +26,7 @@ enum ReleasePlatform {
);
}
/// Convenience to create a nullable type from a nullable json object.
/// Convenience to create a nullable type from a nullable json value.
/// Useful when parsing optional fields.
static ReleasePlatform? maybeFromJson(String? json) {
if (json == null) {
@@ -35,14 +35,14 @@ enum ReleasePlatform {
return ReleasePlatform.fromJson(json);
}
/// The value of the enum, as a string. This is the exact value
/// The value of the enum. This is the exact value
/// from the OpenAPI spec and will be used for network transport.
final String value;
/// Converts the enum to a json string.
/// Converts the enum to its json value.
String toJson() => value;
/// Returns the string value of the enum.
/// Returns the string form of the enum.
@override
String toString() => value;
}
@@ -9,7 +9,7 @@ enum ReleaseStatus {
const ReleaseStatus._(this.value);
/// Creates a ReleaseStatus from a json string.
/// Creates a ReleaseStatus from a json value.
factory ReleaseStatus.fromJson(String json) {
return ReleaseStatus.values.firstWhere(
(value) => value.value == json,
@@ -17,7 +17,7 @@ enum ReleaseStatus {
);
}
/// Convenience to create a nullable type from a nullable json object.
/// Convenience to create a nullable type from a nullable json value.
/// Useful when parsing optional fields.
static ReleaseStatus? maybeFromJson(String? json) {
if (json == null) {
@@ -26,14 +26,14 @@ enum ReleaseStatus {
return ReleaseStatus.fromJson(json);
}
/// The value of the enum, as a string. This is the exact value
/// The value of the enum. This is the exact value
/// from the OpenAPI spec and will be used for network transport.
final String value;
/// Converts the enum to a json string.
/// Converts the enum to its json value.
String toJson() => value;
/// Returns the string value of the enum.
/// Returns the string form of the enum.
@override
String toString() => value;
}
@@ -21,7 +21,7 @@ enum Role {
const Role._(this.value);
/// Creates a Role from a json string.
/// Creates a Role from a json value.
factory Role.fromJson(String json) {
return Role.values.firstWhere(
(value) => value.value == json,
@@ -29,7 +29,7 @@ enum Role {
);
}
/// Convenience to create a nullable type from a nullable json object.
/// Convenience to create a nullable type from a nullable json value.
/// Useful when parsing optional fields.
static Role? maybeFromJson(String? json) {
if (json == null) {
@@ -38,14 +38,14 @@ enum Role {
return Role.fromJson(json);
}
/// The value of the enum, as a string. This is the exact value
/// The value of the enum. This is the exact value
/// from the OpenAPI spec and will be used for network transport.
final String value;
/// Converts the enum to a json string.
/// Converts the enum to its json value.
String toJson() => value;
/// Returns the string value of the enum.
/// Returns the string form of the enum.
@override
String toString() => value;
}
@@ -16,9 +16,6 @@ dependencies:
dev_dependencies:
mocktail: ^1.0.5
# Only used by `tool/gen.dart` to regenerate lib/src/ from the OpenAPI
# spec. Pinned to a git commit until space_gen publishes to pub.dev.
space_gen:
git:
url: https://github.com/eseidel/space_gen.git
ref: 58b4410a9b25bf58e3f76a4ae979cad52d4909cc
# spec.
space_gen: ^1.2.2
test: ^1.31.1
+5 -6
View File
@@ -676,12 +676,11 @@ packages:
space_gen:
dependency: transitive
description:
path: "."
ref: "58b4410a9b25bf58e3f76a4ae979cad52d4909cc"
resolved-ref: "58b4410a9b25bf58e3f76a4ae979cad52d4909cc"
url: "https://github.com/eseidel/space_gen.git"
source: git
version: "1.0.1"
name: space_gen
sha256: "3aea8da8ffba5802110322093ef4e921e297d9b55ffa073a74b6cb38fd225ee1"
url: "https://pub.dev"
source: hosted
version: "1.2.2"
stack_trace:
dependency: transitive
description: