updateProject method

Future<void> updateProject({
  1. required String projectName,
  2. String? description,
  3. PlacementTemplate? placementTemplate,
})

Updates a project associated with your AWS account and region. With the exception of device template names, you can pass just the values that need to be updated because the update request will change only the values that are provided. To clear a value, pass the empty string (i.e., "").

May throw InternalFailureException. May throw InvalidRequestException. May throw ResourceNotFoundException. May throw TooManyRequestsException.

Parameter projectName : The name of the project to be updated.

Parameter description : An optional user-defined description for the project.

Parameter placementTemplate : An object defining the project update. Once a project has been created, you cannot add device template names to the project. However, for a given placementTemplate, you can update the associated callbackOverrides for the device definition using this API.

Implementation

Future<void> updateProject({
  required String projectName,
  String? description,
  PlacementTemplate? placementTemplate,
}) async {
  ArgumentError.checkNotNull(projectName, 'projectName');
  _s.validateStringLength(
    'projectName',
    projectName,
    1,
    128,
    isRequired: true,
  );
  _s.validateStringLength(
    'description',
    description,
    0,
    500,
  );
  final $payload = <String, dynamic>{
    if (description != null) 'description': description,
    if (placementTemplate != null) 'placementTemplate': placementTemplate,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/projects/${Uri.encodeComponent(projectName)}',
    exceptionFnMap: _exceptionFns,
  );
}