sendActivate method

Future<int> sendActivate(
  1. Activate activateHit
)

Implementation

Future<int> sendActivate(Activate activateHit) async {
  /// Create url
  String urlString = Endpoints.DECISION_API + Endpoints.ACTIVATION;
  var response = await _service.sendHttpRequest(
      RequestType.Post, urlString, fsHeader, jsonEncode(activateHit.toJson()),
      timeoutMs: TIMEOUT_REQUEST);
  switch (response.statusCode) {
    case 200:
    case 201:
    case 204:
      Flagship.logger(Level.INFO, ACTIVATE_SUCCESS);
      break;
    default:
      Flagship.logger(Level.ERROR, ACTIVATE_FAILED);
  }
  return response.statusCode;
}