code: @Override
      public ExternalServiceAlertCondition deserialize(JsonElement element, Type type, JsonDeserializationContext context)
          throws JsonParseException
      {
          JsonObject obj = element.getAsJsonObject();
          JsonElement condition = obj.get("external_service_condition");
          if(condition != null && condition.isJsonObject())
          {
              JsonElement conditionType = condition.getAsJsonObject().get("type");
              if(conditionType != null)
              {
                  switch(ExternalServiceAlertCondition.ConditionType.fromValue(conditionType.getAsString()))
                  {
                      case APM:
                          return gson.fromJson(condition, ApmExternalServiceAlertCondition.class);
                      case MOBILE:
                          return gson.fromJson(condition, MobileExternalServiceAlertCondition.class);
                  }
              }
          }
          return null;
      }
docs: Gson invokes this call-back method during deserialization when it encounters a field of the specified type.
  @param element The Json data being deserialized
  @param type The type of the Object to deserialize to
  @param context The JSON deserialization context
  @return The alert condition