HandleServiceResponseObject method

Future<void> HandleServiceResponseObject(
  1. Object response
)
Handles the service response object. The response.

Implementation

/* private */
Future<void> HandleServiceResponseObject(Object response) async {
  GetStreamingEventsResponse gseResponse =
      response as GetStreamingEventsResponse;

  // if (gseResponse == null)
  // {
  //     throw new ArgumentException("gseResponse == null");
  // }
  // else
  // {
  if (gseResponse.Result == ServiceResult.Success ||
      gseResponse.Result == ServiceResult.Warning) {
    if (gseResponse.Results.Notifications.length > 0) {
      // We got notifications; dole them out.
      await this.IssueNotificationEvents(gseResponse);
    } else {
      //// This was just a heartbeat, nothing to do here.
    }
  } else if (gseResponse.Result == ServiceResult.Error) {
    if (gseResponse.ErrorSubscriptionIds == null ||
        gseResponse.ErrorSubscriptionIds.length == 0) {
      // General error
      this.IssueGeneralFailure(gseResponse);
    } else {
      // subscription-specific errors
      this.IssueSubscriptionFailures(gseResponse);
    }
  }
  // }
}