searchAvatars method
Future<Response<List<Avatar> > >
searchAvatars({
- bool? featured,
- SortOption? sort,
- String? user,
- String? userId,
- int? n = 60,
- OrderOption? order,
- int? offset,
- String? tag,
- String? notag,
- ReleaseStatus? releaseStatus,
- String? maxUnityVersion,
- String? minUnityVersion,
- String? platform,
- CancelToken? cancelToken,
- Map<
String, dynamic> ? headers, - Map<
String, dynamic> ? extra, - ValidateStatus? validateStatus,
- ProgressCallback? onSendProgress,
- ProgressCallback? onReceiveProgress,
Search Avatars Search and list avatars by query filters. You can only search your own or featured avatars. It is not possible as a normal user to search other peoples avatars.
Parameters:
featured
- Filters on featured results.sort
- The sort order of the results.user
- Set tome
for searching own avatars.userId
- Filter by UserID.n
- The number of objects to return.order
- Result orderingoffset
- A zero-based offset from the default object sorting from where search results start.tag
- Tags to include (comma-separated). Any of the tags needs to be present.notag
- Tags to exclude (comma-separated).releaseStatus
- Filter by ReleaseStatus.maxUnityVersion
- The maximum Unity version supported by the asset.minUnityVersion
- The minimum Unity version supported by the asset.platform
- The platform the asset supports.cancelToken
- ACancelToken
that can be used to cancel the operationheaders
- Can be used to add additional headers to the requestextras
- Can be used to add flags to the requestvalidateStatus
- AValidateStatus
callback that can be used to determine request success based on the HTTP status of the responseonSendProgress
- AProgressCallback
that can be used to get the send progressonReceiveProgress
- AProgressCallback
that can be used to get the receive progress
Returns a Future containing a Response
with a List<Avatar> as data
Throws DioException
if API call or serialization fails
Implementation
Future<Response<List<Avatar>>> searchAvatars({
bool? featured,
SortOption? sort,
String? user,
String? userId,
int? n = 60,
OrderOption? order,
int? offset,
String? tag,
String? notag,
ReleaseStatus? releaseStatus,
String? maxUnityVersion,
String? minUnityVersion,
String? platform,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/avatars';
final _options = Options(
method: r'GET',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'apiKey',
'name': 'authCookie',
'keyName': 'auth',
'where': '',
},
],
...?extra,
},
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{
if (featured != null) r'featured': featured,
if (sort != null) r'sort': sort,
if (user != null) r'user': user,
if (userId != null) r'userId': userId,
if (n != null) r'n': n,
if (order != null) r'order': order,
if (offset != null) r'offset': offset,
if (tag != null) r'tag': tag,
if (notag != null) r'notag': notag,
if (releaseStatus != null) r'releaseStatus': releaseStatus,
if (maxUnityVersion != null) r'maxUnityVersion': maxUnityVersion,
if (minUnityVersion != null) r'minUnityVersion': minUnityVersion,
if (platform != null) r'platform': platform,
};
final _response = await _dio.request<Object>(
_path,
options: _options,
queryParameters: _queryParameters,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
List<Avatar>? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null
? null
: deserialize<List<Avatar>, Avatar>(rawData, 'List<Avatar>',
growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<List<Avatar>>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}