feat(web): show partners assets on the main timeline (#4933)

This commit is contained in:
Alex 2023-11-11 15:06:19 -06:00 committed by GitHub
parent 3b11854702
commit 35767591d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
59 changed files with 1929 additions and 172 deletions

View file

@ -49,7 +49,7 @@ class PartnerApi {
/// Parameters:
///
/// * [String] id (required):
Future<UserResponseDto?> createPartner(String id,) async {
Future<PartnerResponseDto?> createPartner(String id,) async {
final response = await createPartnerWithHttpInfo(id,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
@ -58,7 +58,7 @@ class PartnerApi {
// 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), 'UserResponseDto',) as UserResponseDto;
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'PartnerResponseDto',) as PartnerResponseDto;
}
return null;
@ -98,7 +98,7 @@ class PartnerApi {
/// Parameters:
///
/// * [String] direction (required):
Future<List<UserResponseDto>?> getPartners(String direction,) async {
Future<List<PartnerResponseDto>?> getPartners(String direction,) async {
final response = await getPartnersWithHttpInfo(direction,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
@ -108,8 +108,8 @@ class PartnerApi {
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<UserResponseDto>') as List)
.cast<UserResponseDto>()
return (await apiClient.deserializeAsync(responseBody, 'List<PartnerResponseDto>') as List)
.cast<PartnerResponseDto>()
.toList();
}
@ -155,4 +155,56 @@ class PartnerApi {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Performs an HTTP 'PUT /partner/{id}' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
///
/// * [UpdatePartnerDto] updatePartnerDto (required):
Future<Response> updatePartnerWithHttpInfo(String id, UpdatePartnerDto updatePartnerDto,) async {
// ignore: prefer_const_declarations
final path = r'/partner/{id}'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody = updatePartnerDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
path,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [String] id (required):
///
/// * [UpdatePartnerDto] updatePartnerDto (required):
Future<PartnerResponseDto?> updatePartner(String id, UpdatePartnerDto updatePartnerDto,) async {
final response = await updatePartnerWithHttpInfo(id, updatePartnerDto,);
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), 'PartnerResponseDto',) as PartnerResponseDto;
}
return null;
}
}