createApplication method
- required String author,
- required String description,
- required String name,
- String? homePageUrl,
- List<
String> ? labels, - String? licenseBody,
- String? licenseUrl,
- String? readmeBody,
- String? readmeUrl,
- String? semanticVersion,
- String? sourceCodeArchiveUrl,
- String? sourceCodeUrl,
- String? spdxLicenseId,
- String? templateBody,
- String? templateUrl,
Creates an application, optionally including an AWS SAM file to create the first application version in the same call.
May throw TooManyRequestsException. May throw BadRequestException. May throw InternalServerErrorException. May throw ConflictException. May throw ForbiddenException.
Parameter author
:
The name of the author publishing the app.
Minimum length=1. Maximum length=127.
Pattern "^a-z0-9?$";
Parameter description
:
The description of the application.
Minimum length=1. Maximum length=256
Parameter name
:
The name of the application that you want to publish.
Minimum length=1. Maximum length=140
Pattern: "a-zA-Z0-9\-
+";
Parameter homePageUrl
:
A URL with more information about the application, for example the
location of your GitHub repository for the application.
Parameter labels
:
Labels to improve discovery of apps in search results.
Minimum length=1. Maximum length=127. Maximum number of labels: 10
Pattern: "^a-zA-Z0-9+\-_:\/@
+$";
Parameter licenseBody
:
A local text file that contains the license of the app that matches the
spdxLicenseID value of your application.
The file has the format file://<path>/<filename>.
Maximum size 5 MB
You can specify only one of licenseBody and licenseUrl; otherwise, an error results.
Parameter licenseUrl
:
A link to the S3 object that contains the license of the app that matches
the spdxLicenseID value of your application.
Maximum size 5 MB
You can specify only one of licenseBody and licenseUrl; otherwise, an error results.
Parameter readmeBody
:
A local text readme file in Markdown language that contains a more
detailed description of the application and how it works.
The file has the format file://<path>/<filename>.
Maximum size 5 MB
You can specify only one of readmeBody and readmeUrl; otherwise, an error results.
Parameter readmeUrl
:
A link to the S3 object in Markdown language that contains a more detailed
description of the application and how it works.
Maximum size 5 MB
You can specify only one of readmeBody and readmeUrl; otherwise, an error results.
Parameter semanticVersion
:
The semantic version of the application:
Parameter sourceCodeArchiveUrl
:
A link to the S3 object that contains the ZIP archive of the source code
for this version of your application.
Maximum size 50 MB
Parameter sourceCodeUrl
:
A link to a public repository for the source code of your application, for
example the URL of a specific GitHub commit.
Parameter spdxLicenseId
:
A valid identifier from https://spdx.org/licenses/.
Parameter templateBody
:
The local raw packaged AWS SAM template file of your application.
The file has the format file://<path>/<filename>.
You can specify only one of templateBody and templateUrl; otherwise an error results.
Parameter templateUrl
:
A link to the S3 object containing the packaged AWS SAM template of your
application.
You can specify only one of templateBody and templateUrl; otherwise an error results.
Implementation
Future<CreateApplicationResponse> createApplication({
required String author,
required String description,
required String name,
String? homePageUrl,
List<String>? labels,
String? licenseBody,
String? licenseUrl,
String? readmeBody,
String? readmeUrl,
String? semanticVersion,
String? sourceCodeArchiveUrl,
String? sourceCodeUrl,
String? spdxLicenseId,
String? templateBody,
String? templateUrl,
}) async {
ArgumentError.checkNotNull(author, 'author');
ArgumentError.checkNotNull(description, 'description');
ArgumentError.checkNotNull(name, 'name');
final $payload = <String, dynamic>{
'author': author,
'description': description,
'name': name,
if (homePageUrl != null) 'homePageUrl': homePageUrl,
if (labels != null) 'labels': labels,
if (licenseBody != null) 'licenseBody': licenseBody,
if (licenseUrl != null) 'licenseUrl': licenseUrl,
if (readmeBody != null) 'readmeBody': readmeBody,
if (readmeUrl != null) 'readmeUrl': readmeUrl,
if (semanticVersion != null) 'semanticVersion': semanticVersion,
if (sourceCodeArchiveUrl != null)
'sourceCodeArchiveUrl': sourceCodeArchiveUrl,
if (sourceCodeUrl != null) 'sourceCodeUrl': sourceCodeUrl,
if (spdxLicenseId != null) 'spdxLicenseId': spdxLicenseId,
if (templateBody != null) 'templateBody': templateBody,
if (templateUrl != null) 'templateUrl': templateUrl,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/applications',
exceptionFnMap: _exceptionFns,
);
return CreateApplicationResponse.fromJson(response);
}