package pro.beam.api.services.impl;

import com.google.common.collect.ImmutableMap;
import com.google.common.util.concurrent.ListenableFuture;
import pro.beam.api.BeamAPI;
import pro.beam.api.response.channels.ShowSlugsRepsonse;
import pro.beam.api.services.AbstractHTTPService;

public class TypesService extends AbstractHTTPService {
    public TypesService(BeamAPI beam) {
        super(beam, "types");
    }

    public ListenableFuture<ShowSlugsRepsonse> all() {
        return this.all(null);
    }

    public ListenableFuture<ShowSlugsRepsonse> all(ShowSlugsRepsonse.OnlineRestriction onlineRestriction) {
        if (onlineRestriction == null) onlineRestriction = ShowSlugsRepsonse.OnlineRestriction.NONE;

        ImmutableMap.Builder<String, Object> params = ImmutableMap.builder();
        switch (onlineRestriction) {
            case ONLINE:
                params.put("where", "online.eq.1");
                break;
            case OFFLINE:
                params.put("where", "online.eq.0");
                break;
            case NONE:
                break;
        }

        return this.get("", ShowSlugsRepsonse.class, params.build());
    }
}

@@ -165,16 +165,76 @@
 eamAPI;%0A
+import pro.beam.api.response.channels.ShowChannelsResponse;%0A
 import p
@@ -331,16 +331,71 @@
 Service;
+%0Aimport pro.beam.api.util.Enums;%0A%0Aimport java.util.Map;
 %0A%0Apublic
@@ -1273,10 +1273,1032 @@
 ;%0A    %7D%0A
+%0A%0A%0A    public ListenableFuture%3CShowChannelsResponse%3E channels(int id) %7B%0A        return this.channels(id, 0, 50, null, null, null);%0A    %7D%0A%0A    public ListenableFuture%3CShowChannelsResponse%3E channels(int id,%0A                                                           int page, int limit,%0A                                                           ShowChannelsResponse.Attributes orderAttribute, ShowChannelsResponse.Ordering ordering,%0A                                                           ShowChannelsResponse.Attributes only) %7B%0A%0A        ImmutableMap.Builder%3CString, Object%3E arguments = ImmutableMap.builder();%0A%0A        if (orderAttribute != null) arguments.put(%22order%22, Enums.serializedName(orderAttribute)+%22:%22+Enums.serializedName(ordering));%0A        if (only != null) arguments.put(%22only%22, Enums.serializedName(only));%0A        arguments.put(%22page%22, Math.max(0, page));%0A        arguments.put(%22limit%22, Math.min(50, limit));%0A%0A        return this.get(id+%22/channels%22, ShowChannelsResponse.class, arguments.build());%0A    %7D%0A
 %7D%0A

Add some service methods to fetch channels by type ID