diff --git a/lib/src/api/default_api.dart b/lib/src/api/default_api.dart index 3b0177c..1e43c41 100644 --- a/lib/src/api/default_api.dart +++ b/lib/src/api/default_api.dart @@ -25,7 +25,6 @@ import 'package:tuuli_api/src/model/table_items_response.dart'; import 'package:tuuli_api/src/model/user_update_definition.dart'; class DefaultApi { - final Dio _dio; final Serializers _serializers; @@ -33,12 +32,12 @@ class DefaultApi { const DefaultApi(this._dio, this._serializers); /// Create Item - /// + /// /// /// Parameters: - /// * [tableName] - /// * [body] - /// * [accessToken] + /// * [tableName] + /// * [body] + /// * [accessToken] /// * [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 @@ -48,9 +47,9 @@ class DefaultApi { /// /// Returns a [Future] containing a [Response] with a [OkResponse] as data /// Throws [DioError] if API call or serialization fails - Future> createItemItemsTableNamePost({ + Future> createItemItemsTableNamePost({ required String tableName, - required JsonObject body, + required Map body, String? accessToken, CancelToken? cancelToken, Map? headers, @@ -59,7 +58,8 @@ class DefaultApi { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = r'/items/{tableName}/+'.replaceAll('{' r'tableName' '}', tableName.toString()); + final _path = r'/items/{tableName}/+' + .replaceAll('{' r'tableName' '}', tableName.toString()); final _options = Options( method: r'POST', headers: { @@ -78,10 +78,9 @@ class DefaultApi { try { _bodyData = body; - - } catch(error, stackTrace) { + } catch (error, stackTrace) { throw DioError( - requestOptions: _options.compose( + requestOptions: _options.compose( _dio.options, _path, ), @@ -108,7 +107,6 @@ class DefaultApi { _response.data!, specifiedType: _responseType, ) as OkResponse; - } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -135,9 +133,9 @@ class DefaultApi { /// Parameter `columns` should be a list of strings Each string should be in a following format: `column_name:column_type[:column_options]` Where *column_type* should be one of the following: - serial - str - bool - datetime - float - int - int:asset - int:user Also *column_options* can be one of the following: - unique - default Example: ```json [ \"id:serial:primary\", \"name:str:unique\", \"description:str\", \"is_active:bool\", \"price:float\", \"quantity:int\", \"creator_id:int:user\", \"asset_id:int:asset\" ] ``` Notes: 1. you cannot use *unique* and *default* at the same time 2. in current implementation you cannot use *default*, because there is no way to specify default value /// /// Parameters: - /// * [tableName] - /// * [requestBody] - /// * [accessToken] + /// * [tableName] + /// * [requestBody] + /// * [accessToken] /// * [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 @@ -147,7 +145,7 @@ class DefaultApi { /// /// Returns a [Future] containing a [Response] with a [OkResponse] as data /// Throws [DioError] if API call or serialization fails - Future> createTableApiCreateTableTableNamePost({ + Future> createTableApiCreateTableTableNamePost({ required String tableName, required BuiltList requestBody, String? accessToken, @@ -158,7 +156,8 @@ class DefaultApi { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = r'/api/createTable/{tableName}'.replaceAll('{' r'tableName' '}', tableName.toString()); + final _path = r'/api/createTable/{tableName}' + .replaceAll('{' r'tableName' '}', tableName.toString()); final _options = Options( method: r'POST', headers: { @@ -178,10 +177,9 @@ class DefaultApi { try { const _type = FullType(BuiltList, [FullType(String)]); _bodyData = _serializers.serialize(requestBody, specifiedType: _type); - - } catch(error, stackTrace) { + } catch (error, stackTrace) { throw DioError( - requestOptions: _options.compose( + requestOptions: _options.compose( _dio.options, _path, ), @@ -208,7 +206,6 @@ class DefaultApi { _response.data!, specifiedType: _responseType, ) as OkResponse; - } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -232,11 +229,11 @@ class DefaultApi { } /// Create User - /// + /// /// /// Parameters: - /// * [createUserDefinition] - /// * [accessToken] + /// * [createUserDefinition] + /// * [accessToken] /// * [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 @@ -246,7 +243,7 @@ class DefaultApi { /// /// Returns a [Future] containing a [Response] with a [OkResponse] as data /// Throws [DioError] if API call or serialization fails - Future> createUserApiUsersPost({ + Future> createUserApiUsersPost({ required CreateUserDefinition createUserDefinition, String? accessToken, CancelToken? cancelToken, @@ -275,11 +272,11 @@ class DefaultApi { try { const _type = FullType(CreateUserDefinition); - _bodyData = _serializers.serialize(createUserDefinition, specifiedType: _type); - - } catch(error, stackTrace) { + _bodyData = + _serializers.serialize(createUserDefinition, specifiedType: _type); + } catch (error, stackTrace) { throw DioError( - requestOptions: _options.compose( + requestOptions: _options.compose( _dio.options, _path, ), @@ -306,7 +303,6 @@ class DefaultApi { _response.data!, specifiedType: _responseType, ) as OkResponse; - } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -330,12 +326,12 @@ class DefaultApi { } /// Delete Item From Table - /// + /// /// /// Parameters: - /// * [tableName] - /// * [columnConditionCompat] - /// * [accessToken] + /// * [tableName] + /// * [columnConditionCompat] + /// * [accessToken] /// * [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 @@ -345,7 +341,7 @@ class DefaultApi { /// /// Returns a [Future] containing a [Response] with a [OkResponse] as data /// Throws [DioError] if API call or serialization fails - Future> deleteItemFromTableItemsTableNamePost({ + Future> deleteItemFromTableItemsTableNamePost({ required String tableName, required BuiltList columnConditionCompat, String? accessToken, @@ -356,7 +352,8 @@ class DefaultApi { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = r'/items/{tableName}/-'.replaceAll('{' r'tableName' '}', tableName.toString()); + final _path = r'/items/{tableName}/-' + .replaceAll('{' r'tableName' '}', tableName.toString()); final _options = Options( method: r'POST', headers: { @@ -375,11 +372,11 @@ class DefaultApi { try { const _type = FullType(BuiltList, [FullType(ColumnConditionCompat)]); - _bodyData = _serializers.serialize(columnConditionCompat, specifiedType: _type); - - } catch(error, stackTrace) { + _bodyData = + _serializers.serialize(columnConditionCompat, specifiedType: _type); + } catch (error, stackTrace) { throw DioError( - requestOptions: _options.compose( + requestOptions: _options.compose( _dio.options, _path, ), @@ -406,7 +403,6 @@ class DefaultApi { _response.data!, specifiedType: _responseType, ) as OkResponse; - } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -430,11 +426,11 @@ class DefaultApi { } /// Drop Table - /// + /// /// /// Parameters: - /// * [tableName] - /// * [accessToken] + /// * [tableName] + /// * [accessToken] /// * [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 @@ -444,7 +440,7 @@ class DefaultApi { /// /// Returns a [Future] containing a [Response] with a [OkResponse] as data /// Throws [DioError] if API call or serialization fails - Future> dropTableApiDropTableTableNamePost({ + Future> dropTableApiDropTableTableNamePost({ required String tableName, String? accessToken, CancelToken? cancelToken, @@ -454,7 +450,8 @@ class DefaultApi { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = r'/api/dropTable/{tableName}'.replaceAll('{' r'tableName' '}', tableName.toString()); + final _path = r'/api/dropTable/{tableName}' + .replaceAll('{' r'tableName' '}', tableName.toString()); final _options = Options( method: r'POST', headers: { @@ -484,7 +481,6 @@ class DefaultApi { _response.data!, specifiedType: _responseType, ) as OkResponse; - } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -508,10 +504,10 @@ class DefaultApi { } /// Get Access Token - /// + /// /// /// Parameters: - /// * [authModel] + /// * [authModel] /// * [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 @@ -521,7 +517,7 @@ class DefaultApi { /// /// Returns a [Future] containing a [Response] with a [AccessTokenResponse] as data /// Throws [DioError] if API call or serialization fails - Future> getAccessTokenApiGetAccessTokenPost({ + Future> getAccessTokenApiGetAccessTokenPost({ required AuthModel authModel, CancelToken? cancelToken, Map? headers, @@ -549,10 +545,9 @@ class DefaultApi { try { const _type = FullType(AuthModel); _bodyData = _serializers.serialize(authModel, specifiedType: _type); - - } catch(error, stackTrace) { + } catch (error, stackTrace) { throw DioError( - requestOptions: _options.compose( + requestOptions: _options.compose( _dio.options, _path, ), @@ -579,7 +574,6 @@ class DefaultApi { _response.data!, specifiedType: _responseType, ) as AccessTokenResponse; - } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -603,10 +597,10 @@ class DefaultApi { } /// Get Asset - /// + /// /// /// Parameters: - /// * [fid] + /// * [fid] /// * [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 @@ -616,7 +610,7 @@ class DefaultApi { /// /// Returns a [Future] containing a [Response] with a [JsonObject] as data /// Throws [DioError] if API call or serialization fails - Future> getAssetAssetsFidGet({ + Future> getAssetAssetsFidGet({ required String fid, CancelToken? cancelToken, Map? headers, @@ -654,7 +648,6 @@ class DefaultApi { _response.data!, specifiedType: _responseType, ) as JsonObject; - } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -678,12 +671,12 @@ class DefaultApi { } /// Get Items From Table - /// + /// /// /// Parameters: - /// * [tableName] - /// * [itemsFieldSelectorList] - /// * [accessToken] + /// * [tableName] + /// * [itemsFieldSelectorList] + /// * [accessToken] /// * [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 @@ -693,7 +686,7 @@ class DefaultApi { /// /// Returns a [Future] containing a [Response] with a [TableItemsResponse] as data /// Throws [DioError] if API call or serialization fails - Future> getItemsFromTableItemsTableNamePost({ + Future> getItemsFromTableItemsTableNamePost({ required String tableName, required ItemsFieldSelectorList itemsFieldSelectorList, String? accessToken, @@ -704,7 +697,8 @@ class DefaultApi { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = r'/items/{tableName}'.replaceAll('{' r'tableName' '}', tableName.toString()); + final _path = r'/items/{tableName}' + .replaceAll('{' r'tableName' '}', tableName.toString()); final _options = Options( method: r'POST', headers: { @@ -723,11 +717,11 @@ class DefaultApi { try { const _type = FullType(ItemsFieldSelectorList); - _bodyData = _serializers.serialize(itemsFieldSelectorList, specifiedType: _type); - - } catch(error, stackTrace) { + _bodyData = + _serializers.serialize(itemsFieldSelectorList, specifiedType: _type); + } catch (error, stackTrace) { throw DioError( - requestOptions: _options.compose( + requestOptions: _options.compose( _dio.options, _path, ), @@ -754,7 +748,6 @@ class DefaultApi { _response.data!, specifiedType: _responseType, ) as TableItemsResponse; - } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -778,10 +771,10 @@ class DefaultApi { } /// List Tables - /// + /// /// /// Parameters: - /// * [accessToken] + /// * [accessToken] /// * [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 @@ -791,7 +784,7 @@ class DefaultApi { /// /// Returns a [Future] containing a [Response] with a [BuiltList] as data /// Throws [DioError] if API call or serialization fails - Future>> listTablesApiListTablesGet({ + Future>> listTablesApiListTablesGet({ String? accessToken, CancelToken? cancelToken, Map? headers, @@ -830,7 +823,6 @@ class DefaultApi { _response.data!, specifiedType: _responseType, ) as BuiltList; - } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -854,11 +846,11 @@ class DefaultApi { } /// Put Asset - /// + /// /// /// Parameters: - /// * [asset] - /// * [accessToken] + /// * [asset] + /// * [accessToken] /// * [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 @@ -868,7 +860,7 @@ class DefaultApi { /// /// Returns a [Future] containing a [Response] with a [CreateAssetResponse] as data /// Throws [DioError] if API call or serialization fails - Future> putAssetAssetsPost({ + Future> putAssetAssetsPost({ required MultipartFile asset, String? accessToken, CancelToken? cancelToken, @@ -899,10 +891,9 @@ class DefaultApi { _bodyData = FormData.fromMap({ r'asset': asset, }); - - } catch(error, stackTrace) { + } catch (error, stackTrace) { throw DioError( - requestOptions: _options.compose( + requestOptions: _options.compose( _dio.options, _path, ), @@ -929,7 +920,6 @@ class DefaultApi { _response.data!, specifiedType: _responseType, ) as CreateAssetResponse; - } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -953,13 +943,13 @@ class DefaultApi { } /// Remove Asset - /// + /// /// /// Parameters: - /// * [assetId] - /// * [checkReferences] - /// * [deleteReferencing] - /// * [accessToken] + /// * [assetId] + /// * [checkReferences] + /// * [deleteReferencing] + /// * [accessToken] /// * [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 @@ -969,7 +959,7 @@ class DefaultApi { /// /// Returns a [Future] containing a [Response] with a [OkResponse] as data /// Throws [DioError] if API call or serialization fails - Future> removeAssetAssetsAssetIdPost({ + Future> removeAssetAssetsAssetIdPost({ required int assetId, bool? checkReferences = true, bool? deleteReferencing = false, @@ -981,7 +971,8 @@ class DefaultApi { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = r'/assets/{asset_id}/-'.replaceAll('{' r'asset_id' '}', assetId.toString()); + final _path = r'/assets/{asset_id}/-' + .replaceAll('{' r'asset_id' '}', assetId.toString()); final _options = Options( method: r'POST', headers: { @@ -996,8 +987,12 @@ class DefaultApi { ); final _queryParameters = { - if (checkReferences != null) r'check_references': encodeQueryParameter(_serializers, checkReferences, const FullType(bool)), - if (deleteReferencing != null) r'delete_referencing': encodeQueryParameter(_serializers, deleteReferencing, const FullType(bool)), + if (checkReferences != null) + r'check_references': encodeQueryParameter( + _serializers, checkReferences, const FullType(bool)), + if (deleteReferencing != null) + r'delete_referencing': encodeQueryParameter( + _serializers, deleteReferencing, const FullType(bool)), }; final _response = await _dio.request( @@ -1017,7 +1012,6 @@ class DefaultApi { _response.data!, specifiedType: _responseType, ) as OkResponse; - } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -1041,11 +1035,11 @@ class DefaultApi { } /// Remove User - /// + /// /// /// Parameters: - /// * [userId] - /// * [accessToken] + /// * [userId] + /// * [accessToken] /// * [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 @@ -1055,7 +1049,7 @@ class DefaultApi { /// /// Returns a [Future] containing a [Response] with a [OkResponse] as data /// Throws [DioError] if API call or serialization fails - Future> removeUserApiUsersPost({ + Future> removeUserApiUsersPost({ required int userId, String? accessToken, CancelToken? cancelToken, @@ -1080,7 +1074,8 @@ class DefaultApi { ); final _queryParameters = { - r'user_id': encodeQueryParameter(_serializers, userId, const FullType(int)), + r'user_id': + encodeQueryParameter(_serializers, userId, const FullType(int)), }; final _response = await _dio.request( @@ -1100,7 +1095,6 @@ class DefaultApi { _response.data!, specifiedType: _responseType, ) as OkResponse; - } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -1124,12 +1118,12 @@ class DefaultApi { } /// Update Asset Description - /// + /// /// /// Parameters: - /// * [assetId] - /// * [assetDescription] - /// * [accessToken] + /// * [assetId] + /// * [assetDescription] + /// * [accessToken] /// * [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 @@ -1139,7 +1133,7 @@ class DefaultApi { /// /// Returns a [Future] containing a [Response] with a [OkResponse] as data /// Throws [DioError] if API call or serialization fails - Future> updateAssetDescriptionAssetsAssetIdPost({ + Future> updateAssetDescriptionAssetsAssetIdPost({ required int assetId, required String assetDescription, String? accessToken, @@ -1150,7 +1144,8 @@ class DefaultApi { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = r'/assets/{asset_id}/*'.replaceAll('{' r'asset_id' '}', assetId.toString()); + final _path = r'/assets/{asset_id}/*' + .replaceAll('{' r'asset_id' '}', assetId.toString()); final _options = Options( method: r'POST', headers: { @@ -1165,7 +1160,8 @@ class DefaultApi { ); final _queryParameters = { - r'asset_description': encodeQueryParameter(_serializers, assetDescription, const FullType(String)), + r'asset_description': encodeQueryParameter( + _serializers, assetDescription, const FullType(String)), }; final _response = await _dio.request( @@ -1185,7 +1181,6 @@ class DefaultApi { _response.data!, specifiedType: _responseType, ) as OkResponse; - } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -1209,12 +1204,12 @@ class DefaultApi { } /// Update Item In Table - /// + /// /// /// Parameters: - /// * [tableName] - /// * [bodyUpdateItemInTableItemsTableNamePost] - /// * [accessToken] + /// * [tableName] + /// * [bodyUpdateItemInTableItemsTableNamePost] + /// * [accessToken] /// * [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 @@ -1224,9 +1219,10 @@ class DefaultApi { /// /// Returns a [Future] containing a [Response] with a [OkResponse] as data /// Throws [DioError] if API call or serialization fails - Future> updateItemInTableItemsTableNamePost({ + Future> updateItemInTableItemsTableNamePost({ required String tableName, - required BodyUpdateItemInTableItemsTableNamePost bodyUpdateItemInTableItemsTableNamePost, + required BodyUpdateItemInTableItemsTableNamePost + bodyUpdateItemInTableItemsTableNamePost, String? accessToken, CancelToken? cancelToken, Map? headers, @@ -1235,7 +1231,8 @@ class DefaultApi { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = r'/items/{tableName}/*'.replaceAll('{' r'tableName' '}', tableName.toString()); + final _path = r'/items/{tableName}/*' + .replaceAll('{' r'tableName' '}', tableName.toString()); final _options = Options( method: r'POST', headers: { @@ -1254,11 +1251,12 @@ class DefaultApi { try { const _type = FullType(BodyUpdateItemInTableItemsTableNamePost); - _bodyData = _serializers.serialize(bodyUpdateItemInTableItemsTableNamePost, specifiedType: _type); - - } catch(error, stackTrace) { + _bodyData = _serializers.serialize( + bodyUpdateItemInTableItemsTableNamePost, + specifiedType: _type); + } catch (error, stackTrace) { throw DioError( - requestOptions: _options.compose( + requestOptions: _options.compose( _dio.options, _path, ), @@ -1285,7 +1283,6 @@ class DefaultApi { _response.data!, specifiedType: _responseType, ) as OkResponse; - } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -1309,11 +1306,11 @@ class DefaultApi { } /// Update User - /// + /// /// /// Parameters: - /// * [userUpdateDefinition] - /// * [accessToken] + /// * [userUpdateDefinition] + /// * [accessToken] /// * [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 @@ -1323,7 +1320,7 @@ class DefaultApi { /// /// Returns a [Future] containing a [Response] with a [OkResponse] as data /// Throws [DioError] if API call or serialization fails - Future> updateUserApiUsersPost({ + Future> updateUserApiUsersPost({ required UserUpdateDefinition userUpdateDefinition, String? accessToken, CancelToken? cancelToken, @@ -1352,11 +1349,11 @@ class DefaultApi { try { const _type = FullType(UserUpdateDefinition); - _bodyData = _serializers.serialize(userUpdateDefinition, specifiedType: _type); - - } catch(error, stackTrace) { + _bodyData = + _serializers.serialize(userUpdateDefinition, specifiedType: _type); + } catch (error, stackTrace) { throw DioError( - requestOptions: _options.compose( + requestOptions: _options.compose( _dio.options, _path, ), @@ -1383,7 +1380,6 @@ class DefaultApi { _response.data!, specifiedType: _responseType, ) as OkResponse; - } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -1405,5 +1401,4 @@ class DefaultApi { extra: _response.extra, ); } - }