createSubscriber method
Create subscriber
Create a new subscriber.
Implementation
Future<models.Subscriber> createSubscriber(
{required String topicId,
required String subscriberId,
required String targetId}) async {
final String apiPath = '/messaging/topics/{topicId}/subscribers'
.replaceAll('{topicId}', topicId);
final Map<String, dynamic> apiParams = {
'subscriberId': subscriberId,
'targetId': targetId,
};
final Map<String, String> apiHeaders = {
'content-type': 'application/json',
};
final res = await client.call(HttpMethod.post,
path: apiPath, params: apiParams, headers: apiHeaders);
return models.Subscriber.fromMap(res.data);
}