upload method

Future<DeobfuscationFilesUploadResponse> upload(
  1. String packageName,
  2. String editId,
  3. int apkVersionCode,
  4. String deobfuscationFileType, {
  5. String? $fields,
  6. UploadOptions uploadOptions = commons.UploadOptions.defaultOptions,
  7. Media? uploadMedia,
})

Uploads a new deobfuscation file and attaches to the specified APK.

Request parameters:

packageName - Unique identifier for the Android app.

editId - Unique identifier for this edit.

apkVersionCode - The version code of the APK whose Deobfuscation File is being uploaded.

deobfuscationFileType - The type of the deobfuscation file. Possible string values are:

  • "deobfuscationFileTypeUnspecified" : Unspecified deobfuscation file type.
  • "proguard" : Proguard deobfuscation file type.
  • "nativeCode" : Native debugging symbols file type.

$fields - Selector specifying which fields to include in a partial response.

uploadMedia - The media to upload.

uploadOptions - Options for the media upload. Streaming Media without the length being known ahead of time is only supported via resumable uploads.

Completes with a DeobfuscationFilesUploadResponse.

Completes with a commons.ApiRequestError if the API endpoint returned an error.

If the used http.Client completes with an error when making a REST call, this method will complete with the same error.

Implementation

async.Future<DeobfuscationFilesUploadResponse> upload(
  core.String packageName,
  core.String editId,
  core.int apkVersionCode,
  core.String deobfuscationFileType, {
  core.String? $fields,
  commons.UploadOptions uploadOptions = commons.UploadOptions.defaultOptions,
  commons.Media? uploadMedia,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if ($fields != null) 'fields': [$fields],
  };

  core.String url_;
  if (uploadMedia == null) {
    url_ = 'androidpublisher/v3/applications/' +
        commons.escapeVariable('$packageName') +
        '/edits/' +
        commons.escapeVariable('$editId') +
        '/apks/' +
        commons.escapeVariable('$apkVersionCode') +
        '/deobfuscationFiles/' +
        commons.escapeVariable('$deobfuscationFileType');
  } else if (uploadOptions is commons.ResumableUploadOptions) {
    url_ = '/resumable/upload/androidpublisher/v3/applications/' +
        commons.escapeVariable('$packageName') +
        '/edits/' +
        commons.escapeVariable('$editId') +
        '/apks/' +
        commons.escapeVariable('$apkVersionCode') +
        '/deobfuscationFiles/' +
        commons.escapeVariable('$deobfuscationFileType');
  } else {
    url_ = '/upload/androidpublisher/v3/applications/' +
        commons.escapeVariable('$packageName') +
        '/edits/' +
        commons.escapeVariable('$editId') +
        '/apks/' +
        commons.escapeVariable('$apkVersionCode') +
        '/deobfuscationFiles/' +
        commons.escapeVariable('$deobfuscationFileType');
  }

  final response_ = await _requester.request(
    url_,
    'POST',
    queryParams: queryParams_,
    uploadMedia: uploadMedia,
    uploadOptions: uploadOptions,
  );
  return DeobfuscationFilesUploadResponse.fromJson(
      response_ as core.Map<core.String, core.dynamic>);
}