createTelesignProvider method

Future<Provider> createTelesignProvider({
  1. required String providerId,
  2. required String name,
  3. String? from,
  4. String? customerId,
  5. String? apiKey,
  6. bool? enabled,
})

Create Telesign provider

Create a new Telesign provider.

Implementation

Future<models.Provider> createTelesignProvider(
    {required String providerId,
    required String name,
    String? from,
    String? customerId,
    String? apiKey,
    bool? enabled}) async {
  final String apiPath = '/messaging/providers/telesign';

  final Map<String, dynamic> apiParams = {
    'providerId': providerId,
    'name': name,
    'from': from,
    'customerId': customerId,
    'apiKey': apiKey,
    'enabled': enabled,
  };

  final Map<String, String> apiHeaders = {
    'content-type': 'application/json',
  };

  final res = await client.call(HttpMethod.post,
      path: apiPath, params: apiParams, headers: apiHeaders);

  return models.Provider.fromMap(res.data);
}