createProject method

Future<CreateProjectResult> createProject({
  1. Uint8List? contents,
  2. String? name,
  3. String? region,
  4. String? snapshotId,
})

Creates an AWS Mobile Hub project.

May throw InternalFailureException. May throw ServiceUnavailableException. May throw UnauthorizedException. May throw TooManyRequestsException. May throw BadRequestException. May throw NotFoundException. May throw LimitExceededException.

Parameter contents : ZIP or YAML file which contains configuration settings to be used when creating the project. This may be the contents of the file downloaded from the URL provided in an export project operation.

Parameter name : Name of the project.

Parameter region : Default region where project resources should be created.

Parameter snapshotId : Unique identifier for an exported snapshot of project configuration. This snapshot identifier is included in the share URL when a project is exported.

Implementation

Future<CreateProjectResult> createProject({
  Uint8List? contents,
  String? name,
  String? region,
  String? snapshotId,
}) async {
  final $query = <String, List<String>>{
    if (name != null) 'name': [name],
    if (region != null) 'region': [region],
    if (snapshotId != null) 'snapshotId': [snapshotId],
  };
  final response = await _protocol.send(
    payload: contents,
    method: 'POST',
    requestUri: '/projects',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return CreateProjectResult.fromJson(response);
}