diff --git a/vrchat_dart_generated/README.md b/vrchat_dart_generated/README.md index 4e59327..bd3b89f 100644 --- a/vrchat_dart_generated/README.md +++ b/vrchat_dart_generated/README.md @@ -189,6 +189,9 @@ Class | Method | HTTP request | Description [*FilesApi*](doc/FilesApi.md) | [**getFileDataUploadStatus**](doc/FilesApi.md#getfiledatauploadstatus) | **GET** /file/{fileId}/{versionId}/{fileType}/status | Check FileData Upload Status [*FilesApi*](doc/FilesApi.md) | [**getFiles**](doc/FilesApi.md#getfiles) | **GET** /files | List Files [*FilesApi*](doc/FilesApi.md) | [**startFileDataUpload**](doc/FilesApi.md#startfiledataupload) | **PUT** /file/{fileId}/{versionId}/{fileType}/start | Start FileData Upload +[*FilesApi*](doc/FilesApi.md) | [**uploadGalleryImage**](doc/FilesApi.md#uploadgalleryimage) | **POST** /gallery | Upload gallery image +[*FilesApi*](doc/FilesApi.md) | [**uploadIcon**](doc/FilesApi.md#uploadicon) | **POST** /icon | Upload icon +[*FilesApi*](doc/FilesApi.md) | [**uploadImage**](doc/FilesApi.md#uploadimage) | **POST** /file/image | Upload gallery image, icon, emoji or sticker [*FriendsApi*](doc/FriendsApi.md) | [**deleteFriendRequest**](doc/FriendsApi.md#deletefriendrequest) | **DELETE** /user/{userId}/friendRequest | Delete Friend Request [*FriendsApi*](doc/FriendsApi.md) | [**friend**](doc/FriendsApi.md#friend) | **POST** /user/{userId}/friendRequest | Send Friend Request [*FriendsApi*](doc/FriendsApi.md) | [**getFriendStatus**](doc/FriendsApi.md#getfriendstatus) | **GET** /user/{userId}/friendStatus | Check Friend Status diff --git a/vrchat_dart_generated/doc/File.md b/vrchat_dart_generated/doc/File.md index e6eec50..08874fa 100644 --- a/vrchat_dart_generated/doc/File.md +++ b/vrchat_dart_generated/doc/File.md @@ -8,6 +8,8 @@ import 'package:vrchat_dart_generated/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**animationStyle** | **String** | | [optional] +**maskTag** | **String** | | [optional] **extension_** | **String** | | **id** | **String** | | **mimeType** | [**MIMEType**](MIMEType.md) | | diff --git a/vrchat_dart_generated/doc/FilesApi.md b/vrchat_dart_generated/doc/FilesApi.md index 7136fb5..904ff2c 100644 --- a/vrchat_dart_generated/doc/FilesApi.md +++ b/vrchat_dart_generated/doc/FilesApi.md @@ -19,6 +19,9 @@ Method | HTTP request | Description [**getFileDataUploadStatus**](FilesApi.md#getfiledatauploadstatus) | **GET** /file/{fileId}/{versionId}/{fileType}/status | Check FileData Upload Status [**getFiles**](FilesApi.md#getfiles) | **GET** /files | List Files [**startFileDataUpload**](FilesApi.md#startfiledataupload) | **PUT** /file/{fileId}/{versionId}/{fileType}/start | Start FileData Upload +[**uploadGalleryImage**](FilesApi.md#uploadgalleryimage) | **POST** /gallery | Upload gallery image +[**uploadIcon**](FilesApi.md#uploadicon) | **POST** /icon | Upload icon +[**uploadImage**](FilesApi.md#uploadimage) | **POST** /file/image | Upload gallery image, icon, emoji or sticker # **createFile** @@ -518,3 +521,150 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **uploadGalleryImage** +> File uploadGalleryImage(file) + +Upload gallery image + +Upload a gallery image + +### Example +```dart +import 'package:vrchat_dart_generated/api.dart'; +// TODO Configure API key authorization: authCookie +//defaultApiClient.getAuthentication('authCookie').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('authCookie').apiKeyPrefix = 'Bearer'; + +final api = VrchatDartGenerated().getFilesApi(); +final MultipartFile file = BINARY_DATA_HERE; // MultipartFile | The binary blob of the png file. + +try { + final response = api.uploadGalleryImage(file); + print(response); +} catch on DioException (e) { + print('Exception when calling FilesApi->uploadGalleryImage: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **file** | **MultipartFile**| The binary blob of the png file. | + +### Return type + +[**File**](File.md) + +### Authorization + +[authCookie](../README.md#authCookie) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **uploadIcon** +> File uploadIcon(file) + +Upload icon + +Upload an icon + +### Example +```dart +import 'package:vrchat_dart_generated/api.dart'; +// TODO Configure API key authorization: authCookie +//defaultApiClient.getAuthentication('authCookie').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('authCookie').apiKeyPrefix = 'Bearer'; + +final api = VrchatDartGenerated().getFilesApi(); +final MultipartFile file = BINARY_DATA_HERE; // MultipartFile | The binary blob of the png file. + +try { + final response = api.uploadIcon(file); + print(response); +} catch on DioException (e) { + print('Exception when calling FilesApi->uploadIcon: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **file** | **MultipartFile**| The binary blob of the png file. | + +### Return type + +[**File**](File.md) + +### Authorization + +[authCookie](../README.md#authCookie) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **uploadImage** +> File uploadImage(file, tag, animationStyle, maskTag) + +Upload gallery image, icon, emoji or sticker + +Upload an image, which can be an icon, gallery image, sticker or emoji + +### Example +```dart +import 'package:vrchat_dart_generated/api.dart'; +// TODO Configure API key authorization: authCookie +//defaultApiClient.getAuthentication('authCookie').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('authCookie').apiKeyPrefix = 'Bearer'; + +final api = VrchatDartGenerated().getFilesApi(); +final MultipartFile file = BINARY_DATA_HERE; // MultipartFile | The binary blob of the png file. +final String tag = tag_example; // String | Needs to be either icon, gallery, sticker or emoji +final String animationStyle = animationStyle_example; // String | Animation style for sticker, required for sticker. +final String maskTag = maskTag_example; // String | Mask of the sticker, optional for sticker. + +try { + final response = api.uploadImage(file, tag, animationStyle, maskTag); + print(response); +} catch on DioException (e) { + print('Exception when calling FilesApi->uploadImage: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **file** | **MultipartFile**| The binary blob of the png file. | + **tag** | **String**| Needs to be either icon, gallery, sticker or emoji | + **animationStyle** | **String**| Animation style for sticker, required for sticker. | [optional] + **maskTag** | **String**| Mask of the sticker, optional for sticker. | [optional] + +### Return type + +[**File**](File.md) + +### Authorization + +[authCookie](../README.md#authCookie) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/vrchat_dart_generated/lib/src/api/files_api.dart b/vrchat_dart_generated/lib/src/api/files_api.dart index 90b309b..4a8ee53 100644 --- a/vrchat_dart_generated/lib/src/api/files_api.dart +++ b/vrchat_dart_generated/lib/src/api/files_api.dart @@ -909,4 +909,298 @@ class FilesApi { extra: _response.extra, ); } + + /// Upload gallery image + /// Upload a gallery image + /// + /// Parameters: + /// * [file] - The binary blob of the png file. + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [File] as data + /// Throws [DioException] if API call or serialization fails + Future> uploadGalleryImage({ + required MultipartFile file, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/gallery'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'apiKey', + 'name': 'authCookie', + 'keyName': 'auth', + 'where': '', + }, + ], + ...?extra, + }, + contentType: 'multipart/form-data', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try {} catch (error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + File? _responseData; + + try { + final rawData = _response.data; + _responseData = rawData == null + ? null + : deserialize(rawData, 'File', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Upload icon + /// Upload an icon + /// + /// Parameters: + /// * [file] - The binary blob of the png file. + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [File] as data + /// Throws [DioException] if API call or serialization fails + Future> uploadIcon({ + required MultipartFile file, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/icon'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'apiKey', + 'name': 'authCookie', + 'keyName': 'auth', + 'where': '', + }, + ], + ...?extra, + }, + contentType: 'multipart/form-data', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try {} catch (error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + File? _responseData; + + try { + final rawData = _response.data; + _responseData = rawData == null + ? null + : deserialize(rawData, 'File', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Upload gallery image, icon, emoji or sticker + /// Upload an image, which can be an icon, gallery image, sticker or emoji + /// + /// Parameters: + /// * [file] - The binary blob of the png file. + /// * [tag] - Needs to be either icon, gallery, sticker or emoji + /// * [animationStyle] - Animation style for sticker, required for sticker. + /// * [maskTag] - Mask of the sticker, optional for sticker. + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [File] as data + /// Throws [DioException] if API call or serialization fails + Future> uploadImage({ + required MultipartFile file, + required String tag, + String? animationStyle, + String? maskTag, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/file/image'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'apiKey', + 'name': 'authCookie', + 'keyName': 'auth', + 'where': '', + }, + ], + ...?extra, + }, + contentType: 'multipart/form-data', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try {} catch (error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + File? _responseData; + + try { + final rawData = _response.data; + _responseData = rawData == null + ? null + : deserialize(rawData, 'File', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } } diff --git a/vrchat_dart_generated/lib/src/model/file.dart b/vrchat_dart_generated/lib/src/model/file.dart index 631b7ef..ebe2354 100644 --- a/vrchat_dart_generated/lib/src/model/file.dart +++ b/vrchat_dart_generated/lib/src/model/file.dart @@ -18,6 +18,8 @@ part 'file.g.dart'; class File { /// Returns a new [File] instance. File({ + this.animationStyle, + this.maskTag, required this.extension_, required this.id, required this.mimeType, @@ -27,6 +29,20 @@ class File { required this.versions, }); + @JsonKey( + name: r'animationStyle', + required: false, + includeIfNull: false, + ) + final String? animationStyle; + + @JsonKey( + name: r'maskTag', + required: false, + includeIfNull: false, + ) + final String? maskTag; + @JsonKey( name: r'extension', required: true, @@ -84,6 +100,8 @@ class File { bool operator ==(Object other) => identical(this, other) || other is File && + other.animationStyle == animationStyle && + other.maskTag == maskTag && other.extension_ == extension_ && other.id == id && other.mimeType == mimeType && @@ -94,6 +112,8 @@ class File { @override int get hashCode => + animationStyle.hashCode + + maskTag.hashCode + extension_.hashCode + id.hashCode + mimeType.hashCode + diff --git a/vrchat_dart_generated/lib/src/model/file.g.dart b/vrchat_dart_generated/lib/src/model/file.g.dart index aaf7161..cf3f459 100644 --- a/vrchat_dart_generated/lib/src/model/file.g.dart +++ b/vrchat_dart_generated/lib/src/model/file.g.dart @@ -25,6 +25,9 @@ File _$FileFromJson(Map json) => $checkedCreate( ], ); final val = File( + animationStyle: + $checkedConvert('animationStyle', (v) => v as String?), + maskTag: $checkedConvert('maskTag', (v) => v as String?), extension_: $checkedConvert('extension', (v) => v as String), id: $checkedConvert('id', (v) => v as String), mimeType: $checkedConvert( @@ -44,15 +47,26 @@ File _$FileFromJson(Map json) => $checkedCreate( fieldKeyMap: const {'extension_': 'extension'}, ); -Map _$FileToJson(File instance) => { - 'extension': instance.extension_, - 'id': instance.id, - 'mimeType': _$MIMETypeEnumMap[instance.mimeType]!, - 'name': instance.name, - 'ownerId': instance.ownerId, - 'tags': instance.tags, - 'versions': instance.versions.map((e) => e.toJson()).toList(), - }; +Map _$FileToJson(File instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('animationStyle', instance.animationStyle); + writeNotNull('maskTag', instance.maskTag); + val['extension'] = instance.extension_; + val['id'] = instance.id; + val['mimeType'] = _$MIMETypeEnumMap[instance.mimeType]!; + val['name'] = instance.name; + val['ownerId'] = instance.ownerId; + val['tags'] = instance.tags; + val['versions'] = instance.versions.map((e) => e.toJson()).toList(); + return val; +} const _$MIMETypeEnumMap = { MIMEType.imageSlashJpeg: 'image/jpeg',