updateComponent method

Future<UpdateComponentResponse> updateComponent({
  1. required String appId,
  2. required String environmentName,
  3. required String id,
  4. required UpdateComponentData updatedComponent,
  5. String? clientToken,
})

Updates an existing component.

May throw InternalServerException. May throw InvalidParameterException. May throw ResourceConflictException.

Parameter appId : The unique ID for the Amplify app.

Parameter environmentName : The name of the backend environment that is part of the Amplify app.

Parameter id : The unique ID for the component.

Parameter updatedComponent : The configuration of the updated component.

Parameter clientToken : The unique client token.

Implementation

Future<UpdateComponentResponse> updateComponent({
  required String appId,
  required String environmentName,
  required String id,
  required UpdateComponentData updatedComponent,
  String? clientToken,
}) async {
  final $query = <String, List<String>>{
    if (clientToken != null) 'clientToken': [clientToken],
  };
  final response = await _protocol.sendRaw(
    payload: updatedComponent,
    method: 'PATCH',
    requestUri:
        '/app/${Uri.encodeComponent(appId)}/environment/${Uri.encodeComponent(environmentName)}/components/${Uri.encodeComponent(id)}',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  final $json = await _s.jsonFromResponse(response);
  return UpdateComponentResponse(
    entity: Component.fromJson($json),
  );
}