importDocumentationParts method

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

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

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

Parameter restApiId : Required 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 {
  ArgumentError.checkNotNull(body, 'body');
  ArgumentError.checkNotNull(restApiId, 'restApiId');
  final $query = <String, List<String>>{
    if (failOnWarnings != null) 'failonwarnings': [failOnWarnings.toString()],
    if (mode != null) 'mode': [mode.toValue()],
  };
  final response = await _protocol.send(
    payload: body,
    method: 'PUT',
    requestUri:
        '/restapis/${Uri.encodeComponent(restApiId)}/documentation/parts',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return DocumentationPartIds.fromJson(response);
}