associateService method
Adds a specific service association to an AgentSpace. It overwrites the existing association of the same service. Returns 201 Created on success.
May throw ConflictException.
May throw InternalServerException.
May throw InvalidParameterException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter agentSpaceId :
The unique identifier of the AgentSpace
Parameter configuration :
The configuration that directs how AgentSpace interacts with the given
service.
Parameter serviceId :
The unique identifier of the service.
Implementation
Future<AssociateServiceOutput> associateService({
required String agentSpaceId,
required ServiceConfiguration configuration,
required String serviceId,
}) async {
final $payload = <String, dynamic>{
'configuration': configuration,
'serviceId': serviceId,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/v1/agentspaces/${Uri.encodeComponent(agentSpaceId)}/associations',
hostPrefix: 'cp.',
exceptionFnMap: _exceptionFns,
);
return AssociateServiceOutput.fromJson(response);
}