createNotificationSubscription method
Configure Amazon WorkDocs to use Amazon SNS notifications. The endpoint receives a confirmation message, and must confirm the subscription.
For more information, see Setting up notifications for an IAM user or role in the Amazon WorkDocs Developer Guide.
May throw InvalidArgumentException.
May throw ServiceUnavailableException.
May throw TooManySubscriptionsException.
May throw UnauthorizedResourceAccessException.
Parameter endpoint :
The endpoint to receive the notifications. If the protocol is HTTPS, the
endpoint is a URL that begins with https.
Parameter organizationId :
The ID of the organization.
Parameter protocol :
The protocol to use. The supported value is https, which delivers
JSON-encoded messages using HTTPS POST.
Parameter subscriptionType :
The notification type.
Implementation
Future<CreateNotificationSubscriptionResponse>
createNotificationSubscription({
required String endpoint,
required String organizationId,
required SubscriptionProtocolType protocol,
required SubscriptionType subscriptionType,
}) async {
final $payload = <String, dynamic>{
'Endpoint': endpoint,
'Protocol': protocol.value,
'SubscriptionType': subscriptionType.value,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/api/v1/organizations/${Uri.encodeComponent(organizationId)}/subscriptions',
exceptionFnMap: _exceptionFns,
);
return CreateNotificationSubscriptionResponse.fromJson(response);
}