createDocumentationPart method

Future<DocumentationPart> createDocumentationPart({
  1. required DocumentationPartLocation location,
  2. required String properties,
  3. required String restApiId,
})

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

Parameter location : Required The location of the targeted API entity of the to-be-created documentation part.

Parameter properties : Required The new documentation content map of the targeted API entity. Enclosed key-value pairs are API-specific, but only OpenAPI-compliant key-value pairs can be exported and, hence, published.

Parameter restApiId : Required The string identifier of the associated RestApi.

Implementation

Future<DocumentationPart> createDocumentationPart({
  required DocumentationPartLocation location,
  required String properties,
  required String restApiId,
}) async {
  ArgumentError.checkNotNull(location, 'location');
  ArgumentError.checkNotNull(properties, 'properties');
  ArgumentError.checkNotNull(restApiId, 'restApiId');
  final $payload = <String, dynamic>{
    'location': location,
    'properties': properties,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/restapis/${Uri.encodeComponent(restApiId)}/documentation/parts',
    exceptionFnMap: _exceptionFns,
  );
  return DocumentationPart.fromJson(response);
}