createProject method
Creates an empty project with a placement template. A project contains zero or more placements that adhere to the placement template defined in the project.
May throw InternalFailureException. May throw InvalidRequestException. May throw ResourceConflictException.
Parameter projectName
:
The name of the project to create.
Parameter description
:
An optional description for the project.
Parameter placementTemplate
:
The schema defining the placement to be created. A placement template
defines placement default attributes and device templates. You cannot add
or remove device templates after the project has been created. However,
you can update callbackOverrides
for the device templates
using the UpdateProject
API.
Parameter tags
:
Optional tags (metadata key/value pairs) to be associated with the
project. For example, { {"key1": "value1", "key2": "value2"}
}
. For more information, see AWS
Tagging Strategies.
Implementation
Future<void> createProject({
required String projectName,
String? description,
PlacementTemplate? placementTemplate,
Map<String, String>? tags,
}) async {
ArgumentError.checkNotNull(projectName, 'projectName');
_s.validateStringLength(
'projectName',
projectName,
1,
128,
isRequired: true,
);
_s.validateStringLength(
'description',
description,
0,
500,
);
final $payload = <String, dynamic>{
'projectName': projectName,
if (description != null) 'description': description,
if (placementTemplate != null) 'placementTemplate': placementTemplate,
if (tags != null) 'tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/projects',
exceptionFnMap: _exceptionFns,
);
}