artifactShow method

Future<Response<V0ArtifactShowResponseModel>> artifactShow({
  1. required String appSlug,
  2. required String buildSlug,
  3. required String artifactSlug,
  4. int? download,
  5. CancelToken? cancelToken,
  6. Map<String, dynamic>? headers,
  7. Map<String, dynamic>? extra,
  8. ValidateStatus? validateStatus,
  9. ProgressCallback? onSendProgress,
  10. ProgressCallback? onReceiveProgress,
})

Get a specific build artifact

Retrieve data of a specific build artifact. The response output contains a time-limited download url (expires in 10 minutes) and a public install page URL. You can view the build artifact with both URLs, but the public install page url will not work unless you enable it.

Implementation

Future<Response<V0ArtifactShowResponseModel>> artifactShow({
  required String appSlug,
  required String buildSlug,
  required String artifactSlug,
  int? download,
  CancelToken? cancelToken,
  Map<String, dynamic>? headers,
  Map<String, dynamic>? extra,
  ValidateStatus? validateStatus,
  ProgressCallback? onSendProgress,
  ProgressCallback? onReceiveProgress,
}) async {
  final _path = r'/apps/{app-slug}/builds/{build-slug}/artifacts/{artifact-slug}'.replaceAll('{' r'app-slug' '}', appSlug.toString()).replaceAll('{' r'build-slug' '}', buildSlug.toString()).replaceAll('{' r'artifact-slug' '}', artifactSlug.toString());
  final _options = Options(
    method: r'GET',
    headers: <String, dynamic>{
      ...?headers,
    },
    extra: <String, dynamic>{
      'secure': <Map<String, String>>[
        {
          'type': 'apiKey',
          'name': 'AddonAuthToken',
          'keyName': 'Bitrise-Addon-Auth-Token',
          'where': 'header',
        },{
          'type': 'apiKey',
          'name': 'PersonalAccessToken',
          'keyName': 'Authorization',
          'where': 'header',
        },
      ],
      ...?extra,
    },
    contentType: [
      'application/json',
    ].first,
    validateStatus: validateStatus,
  );

  final _queryParameters = <String, dynamic>{
    if (download != null) r'download': download,
  };

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

  V0ArtifactShowResponseModel _responseData;

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

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

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