fixing errors for OpenAPI Clients
parent
78ec572508
commit
326e574bf0
|
|
@ -289,6 +289,7 @@ Class | Method | HTTP request | Description
|
|||
*UsersApi* | [**deleteUserLicense**](doc//UsersApi.md#deleteuserlicense) | **DELETE** /users/me/license | Delete user product key
|
||||
*UsersApi* | [**deleteUserOnboarding**](doc//UsersApi.md#deleteuseronboarding) | **DELETE** /users/me/onboarding | Delete user onboarding
|
||||
*UsersApi* | [**getMyPreferences**](doc//UsersApi.md#getmypreferences) | **GET** /users/me/preferences | Get my preferences
|
||||
*UsersApi* | [**getMyUploadStatistics**](doc//UsersApi.md#getmyuploadstatistics) | **GET** /users/me/stats/uploads | Get current user upload statistics
|
||||
*UsersApi* | [**getMyUser**](doc//UsersApi.md#getmyuser) | **GET** /users/me | Get current user
|
||||
*UsersApi* | [**getProfileImage**](doc//UsersApi.md#getprofileimage) | **GET** /users/{id}/profile-image | Retrieve user profile image
|
||||
*UsersApi* | [**getUser**](doc//UsersApi.md#getuser) | **GET** /users/{id} | Retrieve a user
|
||||
|
|
@ -656,6 +657,9 @@ Class | Method | HTTP request | Description
|
|||
- [UserResponseDto](doc//UserResponseDto.md)
|
||||
- [UserStatus](doc//UserStatus.md)
|
||||
- [UserUpdateMeDto](doc//UserUpdateMeDto.md)
|
||||
- [UserUploadStatsResponseDto](doc//UserUploadStatsResponseDto.md)
|
||||
- [UserUploadStatsResponseDtoSeriesInner](doc//UserUploadStatsResponseDtoSeriesInner.md)
|
||||
- [UserUploadStatsResponseDtoSummary](doc//UserUploadStatsResponseDtoSummary.md)
|
||||
- [ValidateAccessTokenResponseDto](doc//ValidateAccessTokenResponseDto.md)
|
||||
- [ValidateLibraryDto](doc//ValidateLibraryDto.md)
|
||||
- [ValidateLibraryImportPathResponseDto](doc//ValidateLibraryImportPathResponseDto.md)
|
||||
|
|
|
|||
|
|
@ -402,6 +402,9 @@ part 'model/user_preferences_update_dto.dart';
|
|||
part 'model/user_response_dto.dart';
|
||||
part 'model/user_status.dart';
|
||||
part 'model/user_update_me_dto.dart';
|
||||
part 'model/user_upload_stats_response_dto.dart';
|
||||
part 'model/user_upload_stats_response_dto_series_inner.dart';
|
||||
part 'model/user_upload_stats_response_dto_summary.dart';
|
||||
part 'model/validate_access_token_response_dto.dart';
|
||||
part 'model/validate_library_dto.dart';
|
||||
part 'model/validate_library_import_path_response_dto.dart';
|
||||
|
|
|
|||
|
|
@ -252,6 +252,77 @@ class UsersApi {
|
|||
return null;
|
||||
}
|
||||
|
||||
/// Get current user upload statistics
|
||||
///
|
||||
/// Retrieve daily upload counts for the current user.
|
||||
///
|
||||
/// Note: This method returns the HTTP [Response].
|
||||
///
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [DateTime] from:
|
||||
/// Start date in UTC
|
||||
///
|
||||
/// * [DateTime] to:
|
||||
/// End date in UTC
|
||||
Future<Response> getMyUploadStatisticsWithHttpInfo({ DateTime? from, DateTime? to, }) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final apiPath = r'/users/me/stats/uploads';
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
if (from != null) {
|
||||
queryParams.addAll(_queryParams('', 'from', from));
|
||||
}
|
||||
if (to != null) {
|
||||
queryParams.addAll(_queryParams('', 'to', to));
|
||||
}
|
||||
|
||||
const contentTypes = <String>[];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
apiPath,
|
||||
'GET',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
/// Get current user upload statistics
|
||||
///
|
||||
/// Retrieve daily upload counts for the current user.
|
||||
///
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [DateTime] from:
|
||||
/// Start date in UTC
|
||||
///
|
||||
/// * [DateTime] to:
|
||||
/// End date in UTC
|
||||
Future<UserUploadStatsResponseDto?> getMyUploadStatistics({ DateTime? from, DateTime? to, }) async {
|
||||
final response = await getMyUploadStatisticsWithHttpInfo( from: from, to: to, );
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
// When a remote server returns no body with a status of 204, we shall not decode it.
|
||||
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
||||
// FormatException when trying to decode an empty string.
|
||||
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
||||
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'UserUploadStatsResponseDto',) as UserUploadStatsResponseDto;
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Get current user
|
||||
///
|
||||
/// Retrieve information about the user making the API request.
|
||||
|
|
|
|||
|
|
@ -850,6 +850,12 @@ class ApiClient {
|
|||
return UserStatusTypeTransformer().decode(value);
|
||||
case 'UserUpdateMeDto':
|
||||
return UserUpdateMeDto.fromJson(value);
|
||||
case 'UserUploadStatsResponseDto':
|
||||
return UserUploadStatsResponseDto.fromJson(value);
|
||||
case 'UserUploadStatsResponseDtoSeriesInner':
|
||||
return UserUploadStatsResponseDtoSeriesInner.fromJson(value);
|
||||
case 'UserUploadStatsResponseDtoSummary':
|
||||
return UserUploadStatsResponseDtoSummary.fromJson(value);
|
||||
case 'ValidateAccessTokenResponseDto':
|
||||
return ValidateAccessTokenResponseDto.fromJson(value);
|
||||
case 'ValidateLibraryDto':
|
||||
|
|
|
|||
|
|
@ -0,0 +1,134 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.18
|
||||
|
||||
// ignore_for_file: unused_element, unused_import
|
||||
// ignore_for_file: always_put_required_named_parameters_first
|
||||
// ignore_for_file: constant_identifier_names
|
||||
// ignore_for_file: lines_longer_than_80_chars
|
||||
|
||||
part of openapi.api;
|
||||
|
||||
class UserUploadStatsResponseDto {
|
||||
/// Returns a new [UserUploadStatsResponseDto] instance.
|
||||
UserUploadStatsResponseDto({
|
||||
required this.from,
|
||||
this.series = const [],
|
||||
required this.summary,
|
||||
required this.to,
|
||||
required this.userId,
|
||||
});
|
||||
|
||||
/// Start date in UTC
|
||||
String from;
|
||||
|
||||
List<UserUploadStatsResponseDtoSeriesInner> series;
|
||||
|
||||
UserUploadStatsResponseDtoSummary summary;
|
||||
|
||||
/// End date in UTC
|
||||
String to;
|
||||
|
||||
/// User ID
|
||||
String userId;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is UserUploadStatsResponseDto &&
|
||||
other.from == from &&
|
||||
_deepEquality.equals(other.series, series) &&
|
||||
other.summary == summary &&
|
||||
other.to == to &&
|
||||
other.userId == userId;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(from.hashCode) +
|
||||
(series.hashCode) +
|
||||
(summary.hashCode) +
|
||||
(to.hashCode) +
|
||||
(userId.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'UserUploadStatsResponseDto[from=$from, series=$series, summary=$summary, to=$to, userId=$userId]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
json[r'from'] = this.from;
|
||||
json[r'series'] = this.series;
|
||||
json[r'summary'] = this.summary;
|
||||
json[r'to'] = this.to;
|
||||
json[r'userId'] = this.userId;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [UserUploadStatsResponseDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static UserUploadStatsResponseDto? fromJson(dynamic value) {
|
||||
upgradeDto(value, "UserUploadStatsResponseDto");
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
return UserUploadStatsResponseDto(
|
||||
from: mapValueOfType<String>(json, r'from')!,
|
||||
series: UserUploadStatsResponseDtoSeriesInner.listFromJson(json[r'series']),
|
||||
summary: UserUploadStatsResponseDtoSummary.fromJson(json[r'summary'])!,
|
||||
to: mapValueOfType<String>(json, r'to')!,
|
||||
userId: mapValueOfType<String>(json, r'userId')!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<UserUploadStatsResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <UserUploadStatsResponseDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = UserUploadStatsResponseDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, UserUploadStatsResponseDto> mapFromJson(dynamic json) {
|
||||
final map = <String, UserUploadStatsResponseDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = UserUploadStatsResponseDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of UserUploadStatsResponseDto-objects as value to a dart map
|
||||
static Map<String, List<UserUploadStatsResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<UserUploadStatsResponseDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
// ignore: parameter_assignments
|
||||
json = json.cast<String, dynamic>();
|
||||
for (final entry in json.entries) {
|
||||
map[entry.key] = UserUploadStatsResponseDto.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'from',
|
||||
'series',
|
||||
'summary',
|
||||
'to',
|
||||
'userId',
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,112 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.18
|
||||
|
||||
// ignore_for_file: unused_element, unused_import
|
||||
// ignore_for_file: always_put_required_named_parameters_first
|
||||
// ignore_for_file: constant_identifier_names
|
||||
// ignore_for_file: lines_longer_than_80_chars
|
||||
|
||||
part of openapi.api;
|
||||
|
||||
class UserUploadStatsResponseDtoSeriesInner {
|
||||
/// Returns a new [UserUploadStatsResponseDtoSeriesInner] instance.
|
||||
UserUploadStatsResponseDtoSeriesInner({
|
||||
required this.count,
|
||||
required this.date,
|
||||
});
|
||||
|
||||
/// Number of uploads
|
||||
///
|
||||
/// Minimum value: -9007199254740991
|
||||
/// Maximum value: 9007199254740991
|
||||
int count;
|
||||
|
||||
/// Date in UTC
|
||||
String date;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is UserUploadStatsResponseDtoSeriesInner &&
|
||||
other.count == count &&
|
||||
other.date == date;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(count.hashCode) +
|
||||
(date.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'UserUploadStatsResponseDtoSeriesInner[count=$count, date=$date]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
json[r'count'] = this.count;
|
||||
json[r'date'] = this.date;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [UserUploadStatsResponseDtoSeriesInner] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static UserUploadStatsResponseDtoSeriesInner? fromJson(dynamic value) {
|
||||
upgradeDto(value, "UserUploadStatsResponseDtoSeriesInner");
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
return UserUploadStatsResponseDtoSeriesInner(
|
||||
count: mapValueOfType<int>(json, r'count')!,
|
||||
date: mapValueOfType<String>(json, r'date')!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<UserUploadStatsResponseDtoSeriesInner> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <UserUploadStatsResponseDtoSeriesInner>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = UserUploadStatsResponseDtoSeriesInner.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, UserUploadStatsResponseDtoSeriesInner> mapFromJson(dynamic json) {
|
||||
final map = <String, UserUploadStatsResponseDtoSeriesInner>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = UserUploadStatsResponseDtoSeriesInner.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of UserUploadStatsResponseDtoSeriesInner-objects as value to a dart map
|
||||
static Map<String, List<UserUploadStatsResponseDtoSeriesInner>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<UserUploadStatsResponseDtoSeriesInner>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
// ignore: parameter_assignments
|
||||
json = json.cast<String, dynamic>();
|
||||
for (final entry in json.entries) {
|
||||
map[entry.key] = UserUploadStatsResponseDtoSeriesInner.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'count',
|
||||
'date',
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,103 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.18
|
||||
|
||||
// ignore_for_file: unused_element, unused_import
|
||||
// ignore_for_file: always_put_required_named_parameters_first
|
||||
// ignore_for_file: constant_identifier_names
|
||||
// ignore_for_file: lines_longer_than_80_chars
|
||||
|
||||
part of openapi.api;
|
||||
|
||||
class UserUploadStatsResponseDtoSummary {
|
||||
/// Returns a new [UserUploadStatsResponseDtoSummary] instance.
|
||||
UserUploadStatsResponseDtoSummary({
|
||||
required this.totalCount,
|
||||
});
|
||||
|
||||
/// Total number of uploads
|
||||
///
|
||||
/// Minimum value: -9007199254740991
|
||||
/// Maximum value: 9007199254740991
|
||||
int totalCount;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is UserUploadStatsResponseDtoSummary &&
|
||||
other.totalCount == totalCount;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(totalCount.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'UserUploadStatsResponseDtoSummary[totalCount=$totalCount]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
json[r'totalCount'] = this.totalCount;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [UserUploadStatsResponseDtoSummary] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static UserUploadStatsResponseDtoSummary? fromJson(dynamic value) {
|
||||
upgradeDto(value, "UserUploadStatsResponseDtoSummary");
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
return UserUploadStatsResponseDtoSummary(
|
||||
totalCount: mapValueOfType<int>(json, r'totalCount')!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<UserUploadStatsResponseDtoSummary> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <UserUploadStatsResponseDtoSummary>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = UserUploadStatsResponseDtoSummary.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, UserUploadStatsResponseDtoSummary> mapFromJson(dynamic json) {
|
||||
final map = <String, UserUploadStatsResponseDtoSummary>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = UserUploadStatsResponseDtoSummary.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of UserUploadStatsResponseDtoSummary-objects as value to a dart map
|
||||
static Map<String, List<UserUploadStatsResponseDtoSummary>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<UserUploadStatsResponseDtoSummary>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
// ignore: parameter_assignments
|
||||
json = json.cast<String, dynamic>();
|
||||
for (final entry in json.entries) {
|
||||
map[entry.key] = UserUploadStatsResponseDtoSummary.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'totalCount',
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -2655,6 +2655,24 @@ export type OnboardingDto = {
|
|||
/** Is user onboarded */
|
||||
isOnboarded: boolean;
|
||||
};
|
||||
export type UserUploadStatsResponseDto = {
|
||||
/** Start date in UTC */
|
||||
"from": string;
|
||||
series: {
|
||||
/** Number of uploads */
|
||||
count: number;
|
||||
/** Date in UTC */
|
||||
date: string;
|
||||
}[];
|
||||
summary: {
|
||||
/** Total number of uploads */
|
||||
totalCount: number;
|
||||
};
|
||||
/** End date in UTC */
|
||||
to: string;
|
||||
/** User ID */
|
||||
userId: string;
|
||||
};
|
||||
export type CreateProfileImageDto = {
|
||||
/** Profile image file */
|
||||
file: Blob;
|
||||
|
|
@ -6535,6 +6553,23 @@ export function updateMyPreferences({ userPreferencesUpdateDto }: {
|
|||
body: userPreferencesUpdateDto
|
||||
})));
|
||||
}
|
||||
/**
|
||||
* Get current user upload statistics
|
||||
*/
|
||||
export function getMyUploadStatistics({ $from, to }: {
|
||||
$from?: string;
|
||||
to?: string;
|
||||
}, opts?: Oazapfts.RequestOpts) {
|
||||
return oazapfts.ok(oazapfts.fetchJson<{
|
||||
status: 200;
|
||||
data: UserUploadStatsResponseDto;
|
||||
}>(`/users/me/stats/uploads${QS.query(QS.explode({
|
||||
"from": $from,
|
||||
to
|
||||
}))}`, {
|
||||
...opts
|
||||
}));
|
||||
}
|
||||
/**
|
||||
* Delete user profile image
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue