code: @Override
      public Collection<AlertChannel> deserialize(JsonElement element, Type type, JsonDeserializationContext context)
          throws JsonParseException
      {
          JsonObject obj = element.getAsJsonObject();
          JsonArray channels = obj.getAsJsonArray("channels");
          List<AlertChannel> values = new ArrayList<AlertChannel>();
          if(channels != null && channels.isJsonArray())
          {
              for(JsonElement channel : channels)
              {
                  if(channel.isJsonObject())
                  {
                      JsonElement channelType = channel.getAsJsonObject().get("type");
                      if(channelType != null)
                      {
                          switch(ChannelType.fromValue(channelType.getAsString()))
                          {
                              case USER:
                                  values.add(gson.fromJson(channel, UserChannel.class));
                                  break;
                              case EMAIL:
                                  values.add(gson.fromJson(channel, EmailChannel.class));
                                  break;
                              case SLACK:
                                  values.add(gson.fromJson(channel, SlackChannel.class));
                                  break;
                              case HIPCHAT:
                                  values.add(gson.fromJson(channel, HipChatChannel.class));
                                  break;
                              case OPSGENIE:
                                  values.add(gson.fromJson(channel, OpsGenieChannel.class));
                                  break;
                              case VICTOROPS:
                                  values.add(gson.fromJson(channel, VictorOpsChannel.class));
                                  break;
                              case PAGERDUTY:
                                  values.add(gson.fromJson(channel, PagerDutyChannel.class));
                                  break;
                              case CAMPFIRE:
                                  values.add(gson.fromJson(channel, CampfireChannel.class));
                                  break;
                              case XMATTERS:
                                  values.add(gson.fromJson(channel, xMattersChannel.class));
                                  break;
                              case WEBHOOK:
                                  values.add(gson.fromJson(channel, WebhookChannel.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 channels