createUseCase method
Future<CreateUseCaseResponse>
createUseCase({
- required String instanceId,
- required String integrationAssociationId,
- required UseCaseType useCaseType,
This API is in preview release for Amazon Connect and is subject to change.
Creates a use case for an AppIntegration association.
May throw DuplicateResourceException. May throw ResourceNotFoundException. May throw InternalServiceException. May throw InvalidRequestException. May throw ThrottlingException.
Parameter instanceId
:
The identifier of the Amazon Connect instance.
Parameter integrationAssociationId
:
The identifier for the AppIntegration association.
Parameter useCaseType
:
The type of use case to associate to the AppIntegration association. Each
AppIntegration association can have only one of each use case type.
Implementation
Future<CreateUseCaseResponse> createUseCase({
required String instanceId,
required String integrationAssociationId,
required UseCaseType useCaseType,
}) async {
ArgumentError.checkNotNull(instanceId, 'instanceId');
_s.validateStringLength(
'instanceId',
instanceId,
1,
100,
isRequired: true,
);
ArgumentError.checkNotNull(
integrationAssociationId, 'integrationAssociationId');
_s.validateStringLength(
'integrationAssociationId',
integrationAssociationId,
1,
200,
isRequired: true,
);
ArgumentError.checkNotNull(useCaseType, 'useCaseType');
final $payload = <String, dynamic>{
'UseCaseType': useCaseType.toValue(),
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri:
'/instance/${Uri.encodeComponent(instanceId)}/integration-associations/${Uri.encodeComponent(integrationAssociationId)}/use-cases',
exceptionFnMap: _exceptionFns,
);
return CreateUseCaseResponse.fromJson(response);
}