getBackendEnvironment method

Future<GetBackendEnvironmentResult> getBackendEnvironment({
  1. required String appId,
  2. required String environmentName,
})

Returns a backend environment for an Amplify app.

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

Parameter appId : The unique id for an Amplify app.

Parameter environmentName : The name for the backend environment.

Implementation

Future<GetBackendEnvironmentResult> getBackendEnvironment({
  required String appId,
  required String environmentName,
}) async {
  ArgumentError.checkNotNull(appId, 'appId');
  _s.validateStringLength(
    'appId',
    appId,
    1,
    20,
    isRequired: true,
  );
  ArgumentError.checkNotNull(environmentName, 'environmentName');
  _s.validateStringLength(
    'environmentName',
    environmentName,
    1,
    255,
    isRequired: true,
  );
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/apps/${Uri.encodeComponent(appId)}/backendenvironments/${Uri.encodeComponent(environmentName)}',
    exceptionFnMap: _exceptionFns,
  );
  return GetBackendEnvironmentResult.fromJson(response);
}