createDocumentationVersion method

Future<DocumentationVersion> createDocumentationVersion({
  1. required String documentationVersion,
  2. required String restApiId,
  3. String? description,
  4. String? stageName,
})

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

Parameter documentationVersion : Required The version identifier of the new snapshot.

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

Parameter description : A description about the new documentation snapshot.

Parameter stageName : The stage name to be associated with the new documentation snapshot.

Implementation

Future<DocumentationVersion> createDocumentationVersion({
  required String documentationVersion,
  required String restApiId,
  String? description,
  String? stageName,
}) async {
  ArgumentError.checkNotNull(documentationVersion, 'documentationVersion');
  ArgumentError.checkNotNull(restApiId, 'restApiId');
  final $payload = <String, dynamic>{
    'documentationVersion': documentationVersion,
    if (description != null) 'description': description,
    if (stageName != null) 'stageName': stageName,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/restapis/${Uri.encodeComponent(restApiId)}/documentation/versions',
    exceptionFnMap: _exceptionFns,
  );
  return DocumentationVersion.fromJson(response);
}