importDocumentationParts method

Future<DocumentationPartIds> importDocumentationParts({
  1. required Uint8List body,
  2. required String restApiId,
  3. bool? failOnWarnings,
  4. PutMode? mode,
})

Imports documentation parts

May throw BadRequestException. May throw ConflictException. May throw LimitExceededException. May throw NotFoundException. May throw TooManyRequestsException. May throw UnauthorizedException.

Parameter body : Raw byte array representing the to-be-imported documentation parts. To import from an OpenAPI file, this is a JSON object.

Parameter restApiId : The string identifier of the associated RestApi.

Parameter failOnWarnings : A query parameter to specify whether to rollback the documentation importation (true) or not (false) when a warning is encountered. The default value is false.

Parameter mode : A query parameter to indicate whether to overwrite (overwrite) any existing DocumentationParts definition or to merge (merge) the new definition into the existing one. The default value is merge.

Implementation

Future<DocumentationPartIds> importDocumentationParts({
  required Uint8List body,
  required String restApiId,
  bool? failOnWarnings,
  PutMode? mode,
}) async {
  final $query = <String, List<String>>{
    if (failOnWarnings != null) 'failonwarnings': [failOnWarnings.toString()],
    if (mode != null) 'mode': [mode.value],
  };
  final response = await _protocol.send(
    payload: body,
    method: 'PUT',
    requestUri:
        '/restapis/${Uri.encodeComponent(restApiId)}/documentation/parts',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return DocumentationPartIds.fromJson(response);
}