createTicketV2 method
Grants permission to create a ticket in the chosen ITSM based on finding information for the provided finding metadata UID.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter connectorId :
The UUID of the connectorV2 to identify connectorV2 resource.
Parameter findingMetadataUid :
The the unique ID for the finding.
Parameter clientToken :
The client idempotency token.
Parameter mode :
The mode for ticket creation. When set to DRYRUN, the ticket is created
using a Security Hub owned template test finding to verify the integration
is working correctly.
Implementation
Future<CreateTicketV2Response> createTicketV2({
required String connectorId,
required String findingMetadataUid,
String? clientToken,
TicketCreationMode? mode,
}) async {
final $payload = <String, dynamic>{
'ConnectorId': connectorId,
'FindingMetadataUid': findingMetadataUid,
'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
if (mode != null) 'Mode': mode.value,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/ticketsv2',
exceptionFnMap: _exceptionFns,
);
return CreateTicketV2Response.fromJson(response);
}