Arguments constructor
Arguments(
- Variables variables, {
- required String filePath,
- required String binaryType,
- String? credentialFile,
- String? clientId,
- String? clientSecret,
- String? appId,
- String? releaseNotes,
- String language = 'en-US',
- bool submit = true,
- int releaseType = 1,
- Duration pollInterval = const Duration(seconds: 15),
- Duration pollTimeout = const Duration(minutes: 10),
- String baseUrl = defaultBaseUrl,
- Dio? dio,
Implementation
Arguments(
Variables variables, {
required super.filePath,
required super.binaryType,
this.credentialFile,
this.clientId,
this.clientSecret,
this.appId,
this.releaseNotes,
this.language = 'en-US',
this.submit = true,
this.releaseType = 1,
this.pollInterval = const Duration(seconds: 15),
this.pollTimeout = const Duration(minutes: 10),
this.baseUrl = defaultBaseUrl,
Dio? dio,
}) : _dio = dio ?? Dio(BaseOptions(baseUrl: baseUrl)),
super('huawei', variables) {
final serviceAccount = credentialFile?.trim().isNotEmpty == true;
final apiClient = clientId?.trim().isNotEmpty == true &&
clientSecret?.trim().isNotEmpty == true;
if (serviceAccount == apiClient) {
throw ArgumentError(
'Huawei requires either credential-file (recommended Service Account) '
'or both client-id and client-secret, but not both modes.',
);
}
if (!{'apk', 'aab'}.contains(binaryType.toLowerCase())) {
throw ArgumentError("Huawei binary-type must be 'apk' or 'aab'.");
}
if (releaseType != 1) {
throw ArgumentError(
'Huawei currently supports release-type 1 only; phased release '
'requires additional rollout settings.',
);
}
}