createTopicV2 method
Creates a new Q topic.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalFailureException.
May throw InvalidParameterValueException.
May throw LimitExceededException.
May throw ResourceExistsException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
Parameter awsAccountId :
The ID of the Amazon Web Services account that you want to create a topic
in.
Parameter topic :
The definition of a topic to create.
Parameter topicId :
The ID for the topic that you want to create. This ID is unique per Amazon
Web Services Region for each Amazon Web Services account.
Parameter folderArns :
The Amazon Resource Names (ARNs) of the folders that you want the topic to
reside in.
Parameter tags :
Contains a map of the key-value pairs for the resource tag or tags that
are assigned to the topic.
Implementation
Future<CreateTopicV2Response> createTopicV2({
required String awsAccountId,
required TopicV2Details topic,
required String topicId,
CustomInstructions? customInstructions,
List<String>? folderArns,
List<Tag>? tags,
}) async {
final $payload = <String, dynamic>{
'Topic': topic,
'TopicId': topicId,
if (customInstructions != null) 'CustomInstructions': customInstructions,
if (folderArns != null) 'FolderArns': folderArns,
if (tags != null) 'Tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/accounts/${Uri.encodeComponent(awsAccountId)}/topicsV2',
exceptionFnMap: _exceptionFns,
);
return CreateTopicV2Response.fromJson(response);
}