chore!: rename API key schemas (#27828)

chore!: rename API schemas
This commit is contained in:
Jason Rasmussen
2026-04-15 15:58:26 -04:00
committed by GitHub
parent 8ee5d3039a
commit 792cb9148b
15 changed files with 251 additions and 251 deletions
+19 -19
View File
@@ -10,9 +10,9 @@
part of openapi.api;
class APIKeyCreateDto {
/// Returns a new [APIKeyCreateDto] instance.
APIKeyCreateDto({
class ApiKeyCreateDto {
/// Returns a new [ApiKeyCreateDto] instance.
ApiKeyCreateDto({
this.name,
this.permissions = const [],
});
@@ -30,7 +30,7 @@ class APIKeyCreateDto {
List<Permission> permissions;
@override
bool operator ==(Object other) => identical(this, other) || other is APIKeyCreateDto &&
bool operator ==(Object other) => identical(this, other) || other is ApiKeyCreateDto &&
other.name == name &&
_deepEquality.equals(other.permissions, permissions);
@@ -41,7 +41,7 @@ class APIKeyCreateDto {
(permissions.hashCode);
@override
String toString() => 'APIKeyCreateDto[name=$name, permissions=$permissions]';
String toString() => 'ApiKeyCreateDto[name=$name, permissions=$permissions]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@@ -54,15 +54,15 @@ class APIKeyCreateDto {
return json;
}
/// Returns a new [APIKeyCreateDto] instance and imports its values from
/// Returns a new [ApiKeyCreateDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static APIKeyCreateDto? fromJson(dynamic value) {
upgradeDto(value, "APIKeyCreateDto");
static ApiKeyCreateDto? fromJson(dynamic value) {
upgradeDto(value, "ApiKeyCreateDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return APIKeyCreateDto(
return ApiKeyCreateDto(
name: mapValueOfType<String>(json, r'name'),
permissions: Permission.listFromJson(json[r'permissions']),
);
@@ -70,11 +70,11 @@ class APIKeyCreateDto {
return null;
}
static List<APIKeyCreateDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <APIKeyCreateDto>[];
static List<ApiKeyCreateDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <ApiKeyCreateDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = APIKeyCreateDto.fromJson(row);
final value = ApiKeyCreateDto.fromJson(row);
if (value != null) {
result.add(value);
}
@@ -83,12 +83,12 @@ class APIKeyCreateDto {
return result.toList(growable: growable);
}
static Map<String, APIKeyCreateDto> mapFromJson(dynamic json) {
final map = <String, APIKeyCreateDto>{};
static Map<String, ApiKeyCreateDto> mapFromJson(dynamic json) {
final map = <String, ApiKeyCreateDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = APIKeyCreateDto.fromJson(entry.value);
final value = ApiKeyCreateDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
@@ -97,14 +97,14 @@ class APIKeyCreateDto {
return map;
}
// maps a json object with a list of APIKeyCreateDto-objects as value to a dart map
static Map<String, List<APIKeyCreateDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<APIKeyCreateDto>>{};
// maps a json object with a list of ApiKeyCreateDto-objects as value to a dart map
static Map<String, List<ApiKeyCreateDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<ApiKeyCreateDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = APIKeyCreateDto.listFromJson(entry.value, growable: growable,);
map[entry.key] = ApiKeyCreateDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
+21 -21
View File
@@ -10,20 +10,20 @@
part of openapi.api;
class APIKeyCreateResponseDto {
/// Returns a new [APIKeyCreateResponseDto] instance.
APIKeyCreateResponseDto({
class ApiKeyCreateResponseDto {
/// Returns a new [ApiKeyCreateResponseDto] instance.
ApiKeyCreateResponseDto({
required this.apiKey,
required this.secret,
});
APIKeyResponseDto apiKey;
ApiKeyResponseDto apiKey;
/// API key secret (only shown once)
String secret;
@override
bool operator ==(Object other) => identical(this, other) || other is APIKeyCreateResponseDto &&
bool operator ==(Object other) => identical(this, other) || other is ApiKeyCreateResponseDto &&
other.apiKey == apiKey &&
other.secret == secret;
@@ -34,7 +34,7 @@ class APIKeyCreateResponseDto {
(secret.hashCode);
@override
String toString() => 'APIKeyCreateResponseDto[apiKey=$apiKey, secret=$secret]';
String toString() => 'ApiKeyCreateResponseDto[apiKey=$apiKey, secret=$secret]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@@ -43,27 +43,27 @@ class APIKeyCreateResponseDto {
return json;
}
/// Returns a new [APIKeyCreateResponseDto] instance and imports its values from
/// Returns a new [ApiKeyCreateResponseDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static APIKeyCreateResponseDto? fromJson(dynamic value) {
upgradeDto(value, "APIKeyCreateResponseDto");
static ApiKeyCreateResponseDto? fromJson(dynamic value) {
upgradeDto(value, "ApiKeyCreateResponseDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return APIKeyCreateResponseDto(
apiKey: APIKeyResponseDto.fromJson(json[r'apiKey'])!,
return ApiKeyCreateResponseDto(
apiKey: ApiKeyResponseDto.fromJson(json[r'apiKey'])!,
secret: mapValueOfType<String>(json, r'secret')!,
);
}
return null;
}
static List<APIKeyCreateResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <APIKeyCreateResponseDto>[];
static List<ApiKeyCreateResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <ApiKeyCreateResponseDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = APIKeyCreateResponseDto.fromJson(row);
final value = ApiKeyCreateResponseDto.fromJson(row);
if (value != null) {
result.add(value);
}
@@ -72,12 +72,12 @@ class APIKeyCreateResponseDto {
return result.toList(growable: growable);
}
static Map<String, APIKeyCreateResponseDto> mapFromJson(dynamic json) {
final map = <String, APIKeyCreateResponseDto>{};
static Map<String, ApiKeyCreateResponseDto> mapFromJson(dynamic json) {
final map = <String, ApiKeyCreateResponseDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = APIKeyCreateResponseDto.fromJson(entry.value);
final value = ApiKeyCreateResponseDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
@@ -86,14 +86,14 @@ class APIKeyCreateResponseDto {
return map;
}
// maps a json object with a list of APIKeyCreateResponseDto-objects as value to a dart map
static Map<String, List<APIKeyCreateResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<APIKeyCreateResponseDto>>{};
// maps a json object with a list of ApiKeyCreateResponseDto-objects as value to a dart map
static Map<String, List<ApiKeyCreateResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<ApiKeyCreateResponseDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = APIKeyCreateResponseDto.listFromJson(entry.value, growable: growable,);
map[entry.key] = ApiKeyCreateResponseDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
+19 -19
View File
@@ -10,9 +10,9 @@
part of openapi.api;
class APIKeyResponseDto {
/// Returns a new [APIKeyResponseDto] instance.
APIKeyResponseDto({
class ApiKeyResponseDto {
/// Returns a new [ApiKeyResponseDto] instance.
ApiKeyResponseDto({
required this.createdAt,
required this.id,
required this.name,
@@ -36,7 +36,7 @@ class APIKeyResponseDto {
DateTime updatedAt;
@override
bool operator ==(Object other) => identical(this, other) || other is APIKeyResponseDto &&
bool operator ==(Object other) => identical(this, other) || other is ApiKeyResponseDto &&
other.createdAt == createdAt &&
other.id == id &&
other.name == name &&
@@ -53,7 +53,7 @@ class APIKeyResponseDto {
(updatedAt.hashCode);
@override
String toString() => 'APIKeyResponseDto[createdAt=$createdAt, id=$id, name=$name, permissions=$permissions, updatedAt=$updatedAt]';
String toString() => 'ApiKeyResponseDto[createdAt=$createdAt, id=$id, name=$name, permissions=$permissions, updatedAt=$updatedAt]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@@ -69,15 +69,15 @@ class APIKeyResponseDto {
return json;
}
/// Returns a new [APIKeyResponseDto] instance and imports its values from
/// Returns a new [ApiKeyResponseDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static APIKeyResponseDto? fromJson(dynamic value) {
upgradeDto(value, "APIKeyResponseDto");
static ApiKeyResponseDto? fromJson(dynamic value) {
upgradeDto(value, "ApiKeyResponseDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return APIKeyResponseDto(
return ApiKeyResponseDto(
createdAt: mapDateTime(json, r'createdAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')!,
id: mapValueOfType<String>(json, r'id')!,
name: mapValueOfType<String>(json, r'name')!,
@@ -88,11 +88,11 @@ class APIKeyResponseDto {
return null;
}
static List<APIKeyResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <APIKeyResponseDto>[];
static List<ApiKeyResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <ApiKeyResponseDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = APIKeyResponseDto.fromJson(row);
final value = ApiKeyResponseDto.fromJson(row);
if (value != null) {
result.add(value);
}
@@ -101,12 +101,12 @@ class APIKeyResponseDto {
return result.toList(growable: growable);
}
static Map<String, APIKeyResponseDto> mapFromJson(dynamic json) {
final map = <String, APIKeyResponseDto>{};
static Map<String, ApiKeyResponseDto> mapFromJson(dynamic json) {
final map = <String, ApiKeyResponseDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = APIKeyResponseDto.fromJson(entry.value);
final value = ApiKeyResponseDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
@@ -115,14 +115,14 @@ class APIKeyResponseDto {
return map;
}
// maps a json object with a list of APIKeyResponseDto-objects as value to a dart map
static Map<String, List<APIKeyResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<APIKeyResponseDto>>{};
// maps a json object with a list of ApiKeyResponseDto-objects as value to a dart map
static Map<String, List<ApiKeyResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<ApiKeyResponseDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = APIKeyResponseDto.listFromJson(entry.value, growable: growable,);
map[entry.key] = ApiKeyResponseDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
+19 -19
View File
@@ -10,9 +10,9 @@
part of openapi.api;
class APIKeyUpdateDto {
/// Returns a new [APIKeyUpdateDto] instance.
APIKeyUpdateDto({
class ApiKeyUpdateDto {
/// Returns a new [ApiKeyUpdateDto] instance.
ApiKeyUpdateDto({
this.name,
this.permissions = const [],
});
@@ -30,7 +30,7 @@ class APIKeyUpdateDto {
List<Permission> permissions;
@override
bool operator ==(Object other) => identical(this, other) || other is APIKeyUpdateDto &&
bool operator ==(Object other) => identical(this, other) || other is ApiKeyUpdateDto &&
other.name == name &&
_deepEquality.equals(other.permissions, permissions);
@@ -41,7 +41,7 @@ class APIKeyUpdateDto {
(permissions.hashCode);
@override
String toString() => 'APIKeyUpdateDto[name=$name, permissions=$permissions]';
String toString() => 'ApiKeyUpdateDto[name=$name, permissions=$permissions]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@@ -54,15 +54,15 @@ class APIKeyUpdateDto {
return json;
}
/// Returns a new [APIKeyUpdateDto] instance and imports its values from
/// Returns a new [ApiKeyUpdateDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static APIKeyUpdateDto? fromJson(dynamic value) {
upgradeDto(value, "APIKeyUpdateDto");
static ApiKeyUpdateDto? fromJson(dynamic value) {
upgradeDto(value, "ApiKeyUpdateDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return APIKeyUpdateDto(
return ApiKeyUpdateDto(
name: mapValueOfType<String>(json, r'name'),
permissions: Permission.listFromJson(json[r'permissions']),
);
@@ -70,11 +70,11 @@ class APIKeyUpdateDto {
return null;
}
static List<APIKeyUpdateDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <APIKeyUpdateDto>[];
static List<ApiKeyUpdateDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <ApiKeyUpdateDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = APIKeyUpdateDto.fromJson(row);
final value = ApiKeyUpdateDto.fromJson(row);
if (value != null) {
result.add(value);
}
@@ -83,12 +83,12 @@ class APIKeyUpdateDto {
return result.toList(growable: growable);
}
static Map<String, APIKeyUpdateDto> mapFromJson(dynamic json) {
final map = <String, APIKeyUpdateDto>{};
static Map<String, ApiKeyUpdateDto> mapFromJson(dynamic json) {
final map = <String, ApiKeyUpdateDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = APIKeyUpdateDto.fromJson(entry.value);
final value = ApiKeyUpdateDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
@@ -97,14 +97,14 @@ class APIKeyUpdateDto {
return map;
}
// maps a json object with a list of APIKeyUpdateDto-objects as value to a dart map
static Map<String, List<APIKeyUpdateDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<APIKeyUpdateDto>>{};
// maps a json object with a list of ApiKeyUpdateDto-objects as value to a dart map
static Map<String, List<ApiKeyUpdateDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<ApiKeyUpdateDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = APIKeyUpdateDto.listFromJson(entry.value, growable: growable,);
map[entry.key] = ApiKeyUpdateDto.listFromJson(entry.value, growable: growable,);
}
}
return map;