// Path: androidsdk/src/main/java/com/wootric/androidsdk/Constants.java
// public class Constants {
// 
//     public static final long DAY_IN_MILLIS = 1000L *60L *60L *24L;
// 
//     public static final int NOT_SET = -1;
// 
//     public static final long DEFAULT_RESURVEY_DAYS = 90L;
// 
//     public static final long DEFAULT_DECLINE_RESURVEY_DAYS = 30L;
// 
//     public static final String TAG = "WOOTRIC_SDK";
// 
//     public static final String CES = "CES";
// 
//     public static final String CSAT = "CSAT";
// }
// 
// Path: androidsdk/src/main/java/com/wootric/androidsdk/network/responses/RegisteredEventsResponse.java
// public class RegisteredEventsResponse {
//     private final ArrayList<String> registeredEvents;
// 
//     public RegisteredEventsResponse(ArrayList<String> registeredEvents) {
//         this.registeredEvents = registeredEvents;
//     }
// 
//     public ArrayList<String> getRegisteredEvents() {
//         return registeredEvents;
//     }
// }
// 
// Path: androidsdk/src/main/java/com/wootric/androidsdk/objects/User.java
// public class User implements Parcelable {
//     private String clientId;
//     private String accountToken;
// 
//     public User(User user) {
//         this.clientId = user.clientId;
//         this.accountToken = user.accountToken;
//     }
// 
//     public User(String clientId, String clientSecret, String accountToken) {
//         this.clientId = clientId;
//         this.accountToken = accountToken;
//     }
// 
//     public User(String clientId, String accountToken) {
//         this.clientId = clientId;
//         this.accountToken = accountToken;
//     }
// 
//     public User(String accountToken) {
//         this.accountToken = accountToken;
//     }
// 
//     public String getClientId() {
//         return clientId;
//     }
// 
//     public String getAccountToken() {
//         return accountToken;
//     }
// 
//     public void setClientId(String clientId) {
//         this.clientId = clientId;
//     }
// 
//     public void setAccountToken(String accountToken) {
//         this.accountToken = accountToken;
//     }
// 
//     @Override
//     public int describeContents() {
//         return 0;
//     }
// 
//     @Override
//     public void writeToParcel(Parcel dest, int flags) {
//         dest.writeString(this.clientId);
//         dest.writeString(this.accountToken);
//     }
// 
//     private User(Parcel in) {
//         this.clientId = in.readString();
//         this.accountToken = in.readString();
//     }
// 
//     public static final Parcelable.Creator<User> CREATOR = new Parcelable.Creator<User>() {
//         public User createFromParcel(Parcel source) {
//             return new User(source);
//         }
//         public User[] newArray(int size) {
//             return new User[size];
//         }
//     };
// }


import java.util.ArrayList;
import android.util.Log;
import com.wootric.androidsdk.Constants;
import com.wootric.androidsdk.network.responses.RegisteredEventsResponse;
import com.wootric.androidsdk.objects.User;
import org.json.JSONArray;
import org.json.JSONException;

    @Override
    protected void buildParams() {
        paramsMap.put("account_token", user.getAccountToken());

        Log.d(Constants.TAG, "parameters: " + paramsMap);
    }

    @Override
    protected String requestUrl() {
        return  getSurveyEndpoint() + REGISTERED_EVENTS_PATH;
    }

    @Override
    protected void onSuccess(String response) {
        ArrayList<String> registeredEventsList = new ArrayList<>();

        if (response != null) {
            try {
                JSONArray jsonArray = new JSONArray(response);
                if (jsonArray != null) {
                    for (int i = 0;i < jsonArray.length(); i++){
                        registeredEventsList.add(jsonArray.getString(i));
                    }
                }
            } catch (JSONException e) {
                e.printStackTrace();
            }
        }

// Path: androidsdk/src/main/java/com/wootric/androidsdk/Constants.java
// public class Constants {
// 
//     public static final long DAY_IN_MILLIS = 1000L *60L *60L *24L;
// 
//     public static final int NOT_SET = -1;
// 
//     public static final long DEFAULT_RESURVEY_DAYS = 90L;
// 
//     public static final long DEFAULT_DECLINE_RESURVEY_DAYS = 30L;
// 
//     public static final String TAG = "WOOTRIC_SDK";
// 
//     public static final String CES = "CES";
// 
//     public static final String CSAT = "CSAT";
// }
// 
// Path: androidsdk/src/main/java/com/wootric/androidsdk/network/responses/RegisteredEventsResponse.java
// public class RegisteredEventsResponse {
//     private final ArrayList<String> registeredEvents;
// 
//     public RegisteredEventsResponse(ArrayList<String> registeredEvents) {
//         this.registeredEvents = registeredEvents;
//     }
// 
//     public ArrayList<String> getRegisteredEvents() {
//         return registeredEvents;
//     }
// }
// 
// Path: androidsdk/src/main/java/com/wootric/androidsdk/objects/User.java
// public class User implements Parcelable {
//     private String clientId;
//     private String accountToken;
// 
//     public User(User user) {
//         this.clientId = user.clientId;
//         this.accountToken = user.accountToken;
//     }
// 
//     public User(String clientId, String clientSecret, String accountToken) {
//         this.clientId = clientId;
//         this.accountToken = accountToken;
//     }
// 
//     public User(String clientId, String accountToken) {
//         this.clientId = clientId;
//         this.accountToken = accountToken;
//     }
// 
//     public User(String accountToken) {
//         this.accountToken = accountToken;
//     }
// 
//     public String getClientId() {
//         return clientId;
//     }
// 
//     public String getAccountToken() {
//         return accountToken;
//     }
// 
//     public void setClientId(String clientId) {
//         this.clientId = clientId;
//     }
// 
//     public void setAccountToken(String accountToken) {
//         this.accountToken = accountToken;
//     }
// 
//     @Override
//     public int describeContents() {
//         return 0;
//     }
// 
//     @Override
//     public void writeToParcel(Parcel dest, int flags) {
//         dest.writeString(this.clientId);
//         dest.writeString(this.accountToken);
//     }
// 
//     private User(Parcel in) {
//         this.clientId = in.readString();
//         this.accountToken = in.readString();
//     }
// 
//     public static final Parcelable.Creator<User> CREATOR = new Parcelable.Creator<User>() {
//         public User createFromParcel(Parcel source) {
//             return new User(source);
//         }
//         public User[] newArray(int size) {
//             return new User[size];
//         }
//     };
// }


// Path: androidsdk/src/main/java/com/wootric/androidsdk/network/tasks/GetRegisteredEventsTask.java
import java.util.ArrayList;
import android.util.Log;
import com.wootric.androidsdk.Constants;
import com.wootric.androidsdk.network.responses.RegisteredEventsResponse;
import com.wootric.androidsdk.objects.User;
import org.json.JSONArray;
import org.json.JSONException;


    @Override
    protected void buildParams() {
        paramsMap.put("account_token", user.getAccountToken());

        Log.d(Constants.TAG, "parameters: " + paramsMap);
    }

    @Override
    protected String requestUrl() {
        return  getSurveyEndpoint() + REGISTERED_EVENTS_PATH;
    }

    @Override
    protected void onSuccess(String response) {
        ArrayList<String> registeredEventsList = new ArrayList<>();

        if (response != null) {
            try {
                JSONArray jsonArray = new JSONArray(response);
                if (jsonArray != null) {
                    for (int i = 0;i < jsonArray.length(); i++){
                        registeredEventsList.add(jsonArray.getString(i));
                    }
                }
            } catch (JSONException e) {
                e.printStackTrace();
            }
        }

        RegisteredEventsResponse registeredEventsResponse = new RegisteredEventsResponse(registeredEventsList);