// Path: app/src/main/java/io/github/droidkaigi/confsched/model/Contributor.java
// @Table
// public class Contributor {
// 
//     @PrimaryKey(auto = false)
//     @Column("name")
//     @SerializedName("login")
//     public String name;
// 
//     @Column("avatar_url")
//     @Nullable
//     @SerializedName("avatar_url")
//     public String avatarUrl;
// 
//     @Column("html_url")
//     @Nullable
//     @SerializedName("html_url")
//     public String htmlUrl;
// 
//     @Column("contributions")
//     @SerializedName("contributions")
//     public int contributions;
// 
// }


import android.support.annotation.NonNull;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import java.util.List;
import javax.inject.Inject;
import javax.inject.Singleton;
import io.github.droidkaigi.confsched.model.Contributor;
import io.github.droidkaigi.confsched.model.Session;
import io.github.droidkaigi.confsched.model.SessionFeedback;
import io.github.droidkaigi.confsched.util.LocaleUtil;
import okhttp3.OkHttpClient;
import retrofit2.Response;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;
import rx.Observable;
                .baseUrl("https://api.github.com")
                .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
                .addConverterFactory(GsonConverterFactory.create(createGson()))
                .build();
        githubService = githubRetrofit.create(GithubService.class);
    }

    public static Gson createGson() {
        return new GsonBuilder().setDateFormat("yyyy-MM-dd HH:mm:ss").create();
    }

    public Observable<List<Session>> getSessions(@NonNull String languageId) {
        switch (languageId) {
            case LocaleUtil.LANG_JA_ID:
                return service.getSessionsJa();
            case LocaleUtil.LANG_AR_ID:
                return service.getSessionsAr();
            case LocaleUtil.LANG_KO_ID:
                return service.getSessionsKo();
            case LocaleUtil.LANG_EN_ID:
                return service.getSessionsEn();
            default:
                return service.getSessionsEn();
        }
    }

    public Observable<Response<Void>> submitSessionFeedback(SessionFeedback f) {
        return googleFormService.submitSessionFeedback(f.sessionId, f.sessionName, f.relevancy, f.asExpected, f.difficulty, f.knowledgeable, f.comment);
    }

// Path: app/src/main/java/io/github/droidkaigi/confsched/model/Contributor.java
// @Table
// public class Contributor {
// 
//     @PrimaryKey(auto = false)
//     @Column("name")
//     @SerializedName("login")
//     public String name;
// 
//     @Column("avatar_url")
//     @Nullable
//     @SerializedName("avatar_url")
//     public String avatarUrl;
// 
//     @Column("html_url")
//     @Nullable
//     @SerializedName("html_url")
//     public String htmlUrl;
// 
//     @Column("contributions")
//     @SerializedName("contributions")
//     public int contributions;
// 
// }


// Path: app/src/main/java/io/github/droidkaigi/confsched/api/DroidKaigiClient.java
import android.support.annotation.NonNull;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import java.util.List;
import javax.inject.Inject;
import javax.inject.Singleton;
import io.github.droidkaigi.confsched.model.Contributor;
import io.github.droidkaigi.confsched.model.Session;
import io.github.droidkaigi.confsched.model.SessionFeedback;
import io.github.droidkaigi.confsched.util.LocaleUtil;
import okhttp3.OkHttpClient;
import retrofit2.Response;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;
import rx.Observable;

                .baseUrl("https://api.github.com")
                .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
                .addConverterFactory(GsonConverterFactory.create(createGson()))
                .build();
        githubService = githubRetrofit.create(GithubService.class);
    }

    public static Gson createGson() {
        return new GsonBuilder().setDateFormat("yyyy-MM-dd HH:mm:ss").create();
    }

    public Observable<List<Session>> getSessions(@NonNull String languageId) {
        switch (languageId) {
            case LocaleUtil.LANG_JA_ID:
                return service.getSessionsJa();
            case LocaleUtil.LANG_AR_ID:
                return service.getSessionsAr();
            case LocaleUtil.LANG_KO_ID:
                return service.getSessionsKo();
            case LocaleUtil.LANG_EN_ID:
                return service.getSessionsEn();
            default:
                return service.getSessionsEn();
        }
    }

    public Observable<Response<Void>> submitSessionFeedback(SessionFeedback f) {
        return googleFormService.submitSessionFeedback(f.sessionId, f.sessionName, f.relevancy, f.asExpected, f.difficulty, f.knowledgeable, f.comment);
    }

    public Observable<List<Contributor>> getContributors() {