code: @Override
      public Collection<ExternalServiceAlertCondition> deserialize(JsonElement element, Type type, JsonDeserializationContext context)
          throws JsonParseException
      {
          JsonObject obj = element.getAsJsonObject();
          JsonArray conditions = obj.getAsJsonArray("external_service_conditions");
          List<ExternalServiceAlertCondition> values = new ArrayList<ExternalServiceAlertCondition>();
          if(conditions != null && conditions.isJsonArray())
          {
              for(JsonElement condition : conditions)
              {
                  if(condition.isJsonObject())
                  {
                      JsonElement conditionType = condition.getAsJsonObject().get("type");
                      if(conditionType != null)
                      {
                          switch(ExternalServiceAlertCondition.ConditionType.fromValue(conditionType.getAsString()))
                          {
                              case APM:
                                  values.add(gson.fromJson(condition, ApmExternalServiceAlertCondition.class));
                                  break;
                              case MOBILE:
                                  values.add(gson.fromJson(condition, MobileExternalServiceAlertCondition.class));
                                  break;
                          }
                      }
                  }
              }
          }
          return values;
      }
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 conditions