updatePlacement method

Future<void> updatePlacement({
  1. required String placementName,
  2. required String projectName,
  3. Map<String, String>? attributes,
})

Updates a placement with the given attributes. To clear an attribute, pass an empty value (i.e., "").

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

Parameter placementName : The name of the placement to update.

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

Parameter attributes : The user-defined object of attributes used to update the placement. The maximum number of key/value pairs is 50.

Implementation

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