deleteVirtualRouter method

Future<DeleteVirtualRouterOutput> deleteVirtualRouter({
  1. required String meshName,
  2. required String virtualRouterName,
})

Deletes an existing virtual router.

You must delete any routes associated with the virtual router before you can delete the router itself.

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

Parameter meshName : The name of the service mesh in which to delete the virtual router.

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

Implementation

Future<DeleteVirtualRouterOutput> deleteVirtualRouter({
  required String meshName,
  required String virtualRouterName,
}) async {
  ArgumentError.checkNotNull(meshName, 'meshName');
  _s.validateStringLength(
    'meshName',
    meshName,
    1,
    255,
    isRequired: true,
  );
  ArgumentError.checkNotNull(virtualRouterName, 'virtualRouterName');
  _s.validateStringLength(
    'virtualRouterName',
    virtualRouterName,
    1,
    255,
    isRequired: true,
  );
  final response = await _protocol.sendRaw(
    payload: null,
    method: 'DELETE',
    requestUri:
        '/meshes/${Uri.encodeComponent(meshName)}/virtualRouters/${Uri.encodeComponent(virtualRouterName)}',
    exceptionFnMap: _exceptionFns,
  );
  final $json = await _s.jsonFromResponse(response);
  return DeleteVirtualRouterOutput(
    virtualRouter: VirtualRouterData.fromJson($json),
  );
}