// Path: github-api/src/main/java/com/dmitrymalkovich/android/githubapi/core/time/TimeConverter.java
// public class TimeConverter {
//     private static final String LOG_TAG = TimeConverter.class.getSimpleName();
// 
//     public static long iso8601ToMilliseconds(String date) {
//         SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.US);
//         long timeInMilliseconds = 0;
//         try {
//             Date parsedDate = df.parse(date);
//             timeInMilliseconds = parsedDate.getTime();
//         } catch (ParseException e) {
//             Log.e(LOG_TAG, e.getMessage(), e);
//         }
//         return timeInMilliseconds;
//     }
// 
//     public static TimeZone getGitHubDefaultTimeZone() {
//         return TimeZone.getTimeZone("GMT");
//     }
// }
// 
// Path: github-api/src/main/java/com/dmitrymalkovich/android/githubapi/core/data/Clones.java
// @SuppressWarnings("all")
// public class Clones {
//     @SerializedName("count")
//     private String mCount;
// 
//     @SerializedName("uniques")
//     private String mUniques;
// 
//     @SerializedName("clones")
//     private List<Clone> mClones;
// 
//     public List<Clone> asList() {
//         return mClones;
//     }
// 
//     public static class Clone {
//         @SerializedName("timestamp")
//         private String mTimestamp;
// 
//         @SerializedName("count")
//         private String mCount;
// 
//         @SerializedName("uniques")
//         private String mUniques;
// 
//         public String getTimestamp() {
//             return mTimestamp;
//         }
// 
//         public String getCount() {
//             return mCount;
//         }
// 
//         public String getUniques() {
//             return mUniques;
//         }
//     }
// }


import android.content.ContentResolver;
import android.content.ContentUris;
import android.content.ContentValues;
import android.net.Uri;
import android.provider.BaseColumns;
import com.dmitrymalkovich.android.githubapi.core.time.TimeConverter;
import com.dmitrymalkovich.android.githubapi.core.data.Clones;

        public static final String CONTENT_TYPE =
                ContentResolver.CURSOR_DIR_BASE_TYPE + "/" + CONTENT_AUTHORITY + "/" + PATH_CLONES;

        public static final String TABLE_NAME = "traffic_clones";
        public static final String COLUMN_REPOSITORY_KEY = "repository_id";
        public static final String COLUMN_CLONES_COUNT = "count";
        public static final String COLUMN_CLONES_UNIQUES = "uniques";
        public static final String COLUMN_CLONES_TIMESTAMP = "timestamp";

        public static final String[] CLONES_COLUMNS = {
                _ID,
                COLUMN_REPOSITORY_KEY,
                COLUMN_CLONES_COUNT,
                COLUMN_CLONES_UNIQUES,
                COLUMN_CLONES_TIMESTAMP
        };

        public static final int COL_ID = 0;
        public static final int COL_REPOSITORY_KEY = 1;
        public static final int COL_CLONES_COUNT = 2;
        public static final int COL_CLONES_UNIQUES = 3;
        public static final int COL_CLONES_TIMESTAMP = 4;

        public static Uri buildUri(long id) {
            return ContentUris.withAppendedId(CONTENT_URI, id);
        }

        public static ContentValues buildContentValues(long repositoryId, Clones.Clone clone) {
            String timestamp = clone.getTimestamp();
// Path: github-api/src/main/java/com/dmitrymalkovich/android/githubapi/core/time/TimeConverter.java
// public class TimeConverter {
//     private static final String LOG_TAG = TimeConverter.class.getSimpleName();
// 
//     public static long iso8601ToMilliseconds(String date) {
//         SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.US);
//         long timeInMilliseconds = 0;
//         try {
//             Date parsedDate = df.parse(date);
//             timeInMilliseconds = parsedDate.getTime();
//         } catch (ParseException e) {
//             Log.e(LOG_TAG, e.getMessage(), e);
//         }
//         return timeInMilliseconds;
//     }
// 
//     public static TimeZone getGitHubDefaultTimeZone() {
//         return TimeZone.getTimeZone("GMT");
//     }
// }
// 
// Path: github-api/src/main/java/com/dmitrymalkovich/android/githubapi/core/data/Clones.java
// @SuppressWarnings("all")
// public class Clones {
//     @SerializedName("count")
//     private String mCount;
// 
//     @SerializedName("uniques")
//     private String mUniques;
// 
//     @SerializedName("clones")
//     private List<Clone> mClones;
// 
//     public List<Clone> asList() {
//         return mClones;
//     }
// 
//     public static class Clone {
//         @SerializedName("timestamp")
//         private String mTimestamp;
// 
//         @SerializedName("count")
//         private String mCount;
// 
//         @SerializedName("uniques")
//         private String mUniques;
// 
//         public String getTimestamp() {
//             return mTimestamp;
//         }
// 
//         public String getCount() {
//             return mCount;
//         }
// 
//         public String getUniques() {
//             return mUniques;
//         }
//     }
// }


// Path: app/src/main/java/com/dmitrymalkovich/android/githubanalytics/data/source/local/contract/ClonesContract.java
import android.content.ContentResolver;
import android.content.ContentUris;
import android.content.ContentValues;
import android.net.Uri;
import android.provider.BaseColumns;
import com.dmitrymalkovich.android.githubapi.core.time.TimeConverter;
import com.dmitrymalkovich.android.githubapi.core.data.Clones;


        public static final String CONTENT_TYPE =
                ContentResolver.CURSOR_DIR_BASE_TYPE + "/" + CONTENT_AUTHORITY + "/" + PATH_CLONES;

        public static final String TABLE_NAME = "traffic_clones";
        public static final String COLUMN_REPOSITORY_KEY = "repository_id";
        public static final String COLUMN_CLONES_COUNT = "count";
        public static final String COLUMN_CLONES_UNIQUES = "uniques";
        public static final String COLUMN_CLONES_TIMESTAMP = "timestamp";

        public static final String[] CLONES_COLUMNS = {
                _ID,
                COLUMN_REPOSITORY_KEY,
                COLUMN_CLONES_COUNT,
                COLUMN_CLONES_UNIQUES,
                COLUMN_CLONES_TIMESTAMP
        };

        public static final int COL_ID = 0;
        public static final int COL_REPOSITORY_KEY = 1;
        public static final int COL_CLONES_COUNT = 2;
        public static final int COL_CLONES_UNIQUES = 3;
        public static final int COL_CLONES_TIMESTAMP = 4;

        public static Uri buildUri(long id) {
            return ContentUris.withAppendedId(CONTENT_URI, id);
        }

        public static ContentValues buildContentValues(long repositoryId, Clones.Clone clone) {
            String timestamp = clone.getTimestamp();
            long timeInMilliseconds = TimeConverter.iso8601ToMilliseconds(timestamp);