createResource method
Creates a Resource resource.
May throw BadRequestException.
May throw ConflictException.
May throw LimitExceededException.
May throw NotFoundException.
May throw TooManyRequestsException.
May throw UnauthorizedException.
Parameter parentId :
The parent resource's identifier.
Parameter pathPart :
The last path segment for this resource.
Parameter restApiId :
The string identifier of the associated RestApi.
Implementation
Future<Resource> createResource({
required String parentId,
required String pathPart,
required String restApiId,
}) async {
final $payload = <String, dynamic>{
'pathPart': pathPart,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/restapis/${Uri.encodeComponent(restApiId)}/resources/${Uri.encodeComponent(parentId)}',
exceptionFnMap: _exceptionFns,
);
return Resource.fromJson(response);
}