appListByOrganization method

Future<Response<V0AppListResponseModel>> appListByOrganization({
  1. required String orgSlug,
  2. String? sortBy,
  3. String? next,
  4. int? limit,
  5. CancelToken? cancelToken,
  6. Map<String, dynamic>? headers,
  7. Map<String, dynamic>? extra,
  8. ValidateStatus? validateStatus,
  9. ProgressCallback? onSendProgress,
  10. ProgressCallback? onReceiveProgress,
})

Get list of the apps for an organization

List all the available apps owned by a given organization. Find the organization URL of the organisations you are part of; be aware that the endpoint will not return any apps if the authenticated account is not a member of the given organisation.

Implementation

Future<Response<V0AppListResponseModel>> appListByOrganization({
  required String orgSlug,
  String? sortBy,
  String? next,
  int? limit,
  CancelToken? cancelToken,
  Map<String, dynamic>? headers,
  Map<String, dynamic>? extra,
  ValidateStatus? validateStatus,
  ProgressCallback? onSendProgress,
  ProgressCallback? onReceiveProgress,
}) async {
  final _path = r'/organizations/{org-slug}/apps'.replaceAll('{' r'org-slug' '}', orgSlug.toString());
  final _options = Options(
    method: r'GET',
    headers: <String, dynamic>{
      ...?headers,
    },
    extra: <String, dynamic>{
      'secure': <Map<String, String>>[
        {
          'type': 'apiKey',
          'name': 'PersonalAccessToken',
          'keyName': 'Authorization',
          'where': 'header',
        },
      ],
      ...?extra,
    },
    contentType: [
      'application/json',
    ].first,
    validateStatus: validateStatus,
  );

  final _queryParameters = <String, dynamic>{
    if (sortBy != null) r'sort_by': sortBy,
    if (next != null) r'next': next,
    if (limit != null) r'limit': limit,
  };

  final _response = await _dio.request<Object>(
    _path,
    options: _options,
    queryParameters: _queryParameters,
    cancelToken: cancelToken,
    onSendProgress: onSendProgress,
    onReceiveProgress: onReceiveProgress,
  );

  V0AppListResponseModel _responseData;

  try {
    const _responseType = FullType(V0AppListResponseModel);
    _responseData = _serializers.deserialize(
      _response.data!,
      specifiedType: _responseType,
    ) as V0AppListResponseModel;

  } catch (error) {
    throw DioError(
      requestOptions: _response.requestOptions,
      response: _response,
      type: DioErrorType.other,
      error: error,
    );
  }

  return Response<V0AppListResponseModel>(
    data: _responseData,
    headers: _response.headers,
    isRedirect: _response.isRedirect,
    requestOptions: _response.requestOptions,
    redirects: _response.redirects,
    statusCode: _response.statusCode,
    statusMessage: _response.statusMessage,
    extra: _response.extra,
  );
}