private async Task UpdateNameRequest()

in certified-connectors/Airmeet/script.csx [12:47]


  private async Task UpdateNameRequest() {
    var contentAsString = await this.Context.Request.Content.ReadAsStringAsync().ConfigureAwait(false);
    var contentAsJson = JObject.Parse(contentAsString);
    var triggerMetaInfoId = (string) contentAsJson["triggerMetaInfoId"];

    if (triggerMetaInfoId == "trigger.airmeet.attendee.added") {
      contentAsJson["name"] = "ZAPIER_AIRMEET_CREATED";
      contentAsJson["description"] = "Airmeet Created trigger subscription for MICROSOFT_DYNAMICS";
    }
    if (triggerMetaInfoId == "trigger.airmeet.created") {
      contentAsJson["name"] = "ZAPIER_AIRMEET_CREATED";
      contentAsJson["description"] = "Airmeet Created trigger subscription for MICROSOFT_DYNAMICS";
    }
    if (triggerMetaInfoId == "trigger.airmeet.registrant.added") {
      contentAsJson["name"] = "ZAPIER_REGISTRANT_ADDED";
      contentAsJson["description"] = "Registrant Created trigger subscription for MICROSOFT_DYNAMICS";
    }
    if (triggerMetaInfoId == "trigger.airmeet.started") {
      contentAsJson["name"] = "ZAPIER_AIRMEET_STARTED";
      contentAsJson["description"] = "Airmeet started trigger subscription for MICROSOFT_DYNAMICS";
    }
    if (triggerMetaInfoId == "trigger.airmeet.finished") {
      contentAsJson["name"] = "ZAPIER_AIRMEET_FINISHED";
      contentAsJson["description"] = "Airmeet finished trigger subscription for MICROSOFT_DYNAMICS";
    }
    if (triggerMetaInfoId == "trigger.airmeet.reminder") {
      contentAsJson["name"] = "ZAPIER_AIRMEET_REMINDER";
      contentAsJson["description"] = "Airmeet reminder trigger subscription for MICROSOFT_DYNAMICS";
    }
    if (triggerMetaInfoId == "trigger.airmeet.attendee.joined") {
      contentAsJson["name"] = "ZAPIER_REGISTRANT_JOINED";
      contentAsJson["description"] = "Attendee Joined trigger subscription for MICROSOFT_DYNAMICS";
    }
    this.Context.Request.Headers.TryAddWithoutValidation("Content-Type", "application/json");
    this.Context.Request.Content = CreateJsonContent(contentAsJson.ToString());
  }