createHarnessEndpoint method
Operation to create a harness endpoint.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter endpointName :
The name of the endpoint. Must start with a letter and contain only
alphanumeric characters and underscores.
Parameter harnessId :
The ID of the harness to create an endpoint for.
Parameter clientToken :
A unique, case-sensitive identifier to ensure idempotency of the request.
Parameter description :
A description of the endpoint.
Parameter tags :
Tags to apply to the endpoint resource.
Parameter targetVersion :
The harness version that the endpoint points to and serves invocations
from.
Implementation
Future<CreateHarnessEndpointResponse> createHarnessEndpoint({
required String endpointName,
required String harnessId,
String? clientToken,
String? description,
Map<String, String>? tags,
String? targetVersion,
}) async {
final $payload = <String, dynamic>{
'endpointName': endpointName,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
if (description != null) 'description': description,
if (tags != null) 'tags': tags,
if (targetVersion != null) 'targetVersion': targetVersion,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/harnesses/${Uri.encodeComponent(harnessId)}/endpoints',
exceptionFnMap: _exceptionFns,
);
return CreateHarnessEndpointResponse.fromJson(response);
}