deleteBackendEnvironment method

Future<DeleteBackendEnvironmentResult> deleteBackendEnvironment({
  1. required String appId,
  2. required String environmentName,
})

Deletes a backend environment for an Amplify app.

This API is available only to Amplify Gen 1 applications where the backend is created using Amplify Studio or the Amplify command line interface (CLI). This API isn’t available to Amplify Gen 2 applications. When you deploy an application with Amplify Gen 2, you provision the app's backend infrastructure using Typescript code.

May throw BadRequestException. May throw DependentServiceFailureException. May throw InternalFailureException. May throw NotFoundException. May throw UnauthorizedException.

Parameter appId : The unique ID of an Amplify app.

Parameter environmentName : The name of a backend environment of an Amplify app.

Implementation

Future<DeleteBackendEnvironmentResult> deleteBackendEnvironment({
  required String appId,
  required String environmentName,
}) async {
  final response = await _protocol.send(
    payload: null,
    method: 'DELETE',
    requestUri:
        '/apps/${Uri.encodeComponent(appId)}/backendenvironments/${Uri.encodeComponent(environmentName)}',
    exceptionFnMap: _exceptionFns,
  );
  return DeleteBackendEnvironmentResult.fromJson(response);
}