updateUpload method
Updates an uploaded test spec.
May throw ArgumentException. May throw NotFoundException. May throw LimitExceededException. May throw ServiceAccountException.
Parameter arn
:
The Amazon Resource Name (ARN) of the uploaded test spec.
Parameter contentType
:
The upload's content type (for example, application/x-yaml
).
Parameter editContent
:
Set to true if the YAML file has changed and must be updated. Otherwise,
set to false.
Parameter name
:
The upload's test spec file name. The name must not contain any forward
slashes (/). The test spec file name must end with the .yaml
or .yml
file extension.
Implementation
Future<UpdateUploadResult> updateUpload({
required String arn,
String? contentType,
bool? editContent,
String? name,
}) async {
ArgumentError.checkNotNull(arn, 'arn');
_s.validateStringLength(
'arn',
arn,
32,
1011,
isRequired: true,
);
_s.validateStringLength(
'contentType',
contentType,
0,
64,
);
_s.validateStringLength(
'name',
name,
0,
256,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'DeviceFarm_20150623.UpdateUpload'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'arn': arn,
if (contentType != null) 'contentType': contentType,
if (editContent != null) 'editContent': editContent,
if (name != null) 'name': name,
},
);
return UpdateUploadResult.fromJson(jsonResponse.body);
}