deleteRoute method

Future<DeleteRouteOutput> deleteRoute({
  1. required String meshName,
  2. required String routeName,
  3. required String virtualRouterName,
  4. String? meshOwner,
})

Deletes an existing route.

May throw NotFoundException. May throw BadRequestException. May throw TooManyRequestsException. May throw ForbiddenException. May throw ResourceInUseException. May throw ServiceUnavailableException. May throw InternalServerErrorException.

Parameter meshName : The name of the service mesh to delete the route in.

Parameter routeName : The name of the route to delete.

Parameter virtualRouterName : The name of the virtual router to delete the route in.

Parameter meshOwner : The AWS IAM account ID of the service mesh owner. If the account ID is not your own, then it's the ID of the account that shared the mesh with your account. For more information about mesh sharing, see Working with shared meshes.

Implementation

Future<DeleteRouteOutput> deleteRoute({
  required String meshName,
  required String routeName,
  required String virtualRouterName,
  String? meshOwner,
}) async {
  ArgumentError.checkNotNull(meshName, 'meshName');
  _s.validateStringLength(
    'meshName',
    meshName,
    1,
    255,
    isRequired: true,
  );
  ArgumentError.checkNotNull(routeName, 'routeName');
  _s.validateStringLength(
    'routeName',
    routeName,
    1,
    255,
    isRequired: true,
  );
  ArgumentError.checkNotNull(virtualRouterName, 'virtualRouterName');
  _s.validateStringLength(
    'virtualRouterName',
    virtualRouterName,
    1,
    255,
    isRequired: true,
  );
  _s.validateStringLength(
    'meshOwner',
    meshOwner,
    12,
    12,
  );
  final $query = <String, List<String>>{
    if (meshOwner != null) 'meshOwner': [meshOwner],
  };
  final response = await _protocol.sendRaw(
    payload: null,
    method: 'DELETE',
    requestUri:
        '/v20190125/meshes/${Uri.encodeComponent(meshName)}/virtualRouter/${Uri.encodeComponent(virtualRouterName)}/routes/${Uri.encodeComponent(routeName)}',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  final $json = await _s.jsonFromResponse(response);
  return DeleteRouteOutput(
    route: RouteData.fromJson($json),
  );
}