reimportApi method

Future<ReimportApiResponse> reimportApi({
  1. required String apiId,
  2. required String body,
  3. String? basepath,
  4. bool? failOnWarnings,
})

Puts an Api resource.

May throw NotFoundException. May throw TooManyRequestsException. May throw BadRequestException. May throw ConflictException.

Parameter apiId : The API identifier.

Parameter body : The OpenAPI definition. Supported only for HTTP APIs.

Parameter basepath : Specifies how to interpret the base path of the API during import. Valid values are ignore, prepend, and split. The default value is ignore. To learn more, see Set the OpenAPI basePath Property. Supported only for HTTP APIs.

Parameter failOnWarnings : Specifies whether to rollback the API creation when a warning is encountered. By default, API creation continues if a warning is encountered.

Implementation

Future<ReimportApiResponse> reimportApi({
  required String apiId,
  required String body,
  String? basepath,
  bool? failOnWarnings,
}) async {
  ArgumentError.checkNotNull(apiId, 'apiId');
  ArgumentError.checkNotNull(body, 'body');
  final $query = <String, List<String>>{
    if (basepath != null) 'basepath': [basepath],
    if (failOnWarnings != null) 'failOnWarnings': [failOnWarnings.toString()],
  };
  final $payload = <String, dynamic>{
    'body': body,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/v2/apis/${Uri.encodeComponent(apiId)}',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ReimportApiResponse.fromJson(response);
}