summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Sawicki2011-04-13 13:06:10 (EDT)
committer Chris Aniszczyk2011-04-14 10:50:23 (EDT)
commit02c60b82615110aeada76e9446cfb3f10d38df96 (patch)
tree480c0b7b05edaffaaeb549944eb8d5b0f68e3bfb
parent8f7221c3d29ed844278b879935a03ec4efbe9fad (diff)
downloadegit-github-02c60b82615110aeada76e9446cfb3f10d38df96.zip
egit-github-02c60b82615110aeada76e9446cfb3f10d38df96.tar.gz
egit-github-02c60b82615110aeada76e9446cfb3f10d38df96.tar.bz2
Add model classes for gist and gist filerefs/changes/95/3095/3
Change-Id: I9b4754c34f77fe2859c87fd2f9df98926c3ec310 Signed-off-by: Kevin Sawicki <kevin@github.com> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
-rw-r--r--org.eclipse.mylyn.github.core/META-INF/MANIFEST.MF1
-rw-r--r--org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/Gist.java123
-rw-r--r--org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/GistFile.java45
-rw-r--r--org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/IGitHubConstants.java10
4 files changed, 179 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.github.core/META-INF/MANIFEST.MF b/org.eclipse.mylyn.github.core/META-INF/MANIFEST.MF
index 2494f24..c6eab62 100644
--- a/org.eclipse.mylyn.github.core/META-INF/MANIFEST.MF
+++ b/org.eclipse.mylyn.github.core/META-INF/MANIFEST.MF
@@ -10,5 +10,6 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="3.5.0",
org.eclipse.mylyn.tasks.core;bundle-version="3.2.0",
org.eclipse.mylyn.commons.net;bundle-version="3.2.0"
Import-Package: com.google.gson;version="1.6.0",
+ com.google.gson.annotations;version="1.6.0",
com.google.gson.reflect;version="1.6.0",
org.apache.commons.logging
diff --git a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/Gist.java b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/Gist.java
new file mode 100644
index 0000000..56e1690
--- /dev/null
+++ b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/Gist.java
@@ -0,0 +1,123 @@
+/*******************************************************************************
+ * Copyright (c) 2011 GitHub Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Kevin Sawicki (GitHub Inc.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.mylyn.github.internal;
+
+import java.util.Date;
+import java.util.Map;
+
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * GitHub gist class.
+ */
+public class Gist {
+
+ @SerializedName("public")
+ private boolean isPublic;
+
+ private Date createdAt;
+
+ private int comments;
+
+ private Map<String, GistFile> files;
+
+ private String description;
+
+ private String gitPullUrl;
+
+ private String gitPushUrl;
+
+ private String id;
+
+ private String repo;
+
+ private String url;
+
+ private User author;
+
+ /**
+ * @return isPublic
+ */
+ public boolean isPublic() {
+ return this.isPublic;
+ }
+
+ /**
+ * @return createdAt
+ */
+ public Date getCreatedAt() {
+ return this.createdAt;
+ }
+
+ /**
+ * @return comments
+ */
+ public int getComments() {
+ return this.comments;
+ }
+
+ /**
+ * @return files
+ */
+ public Map<String, GistFile> getFiles() {
+ return this.files;
+ }
+
+ /**
+ * @return description
+ */
+ public String getDescription() {
+ return this.description;
+ }
+
+ /**
+ * @return gitPullUrl
+ */
+ public String getGitPullUrl() {
+ return this.gitPullUrl;
+ }
+
+ /**
+ * @return gitPushUrl
+ */
+ public String getGitPushUrl() {
+ return this.gitPushUrl;
+ }
+
+ /**
+ * @return id
+ */
+ public String getId() {
+ return this.id;
+ }
+
+ /**
+ * @return repo
+ */
+ public String getRepo() {
+ return this.repo;
+ }
+
+ /**
+ * @return url
+ */
+ public String getUrl() {
+ return this.url;
+ }
+
+ /**
+ * @return author
+ */
+ public User getAuthor() {
+ return this.author;
+ }
+
+}
diff --git a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/GistFile.java b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/GistFile.java
new file mode 100644
index 0000000..10f022a
--- /dev/null
+++ b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/GistFile.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2011 GitHub Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Kevin Sawicki (GitHub Inc.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.mylyn.github.internal;
+
+/**
+ * Gist file class.
+ */
+public class GistFile {
+
+ private int size;
+
+ private String filename;
+
+ private String rawUrl;
+
+ /**
+ * @return size
+ */
+ public int getSize() {
+ return this.size;
+ }
+
+ /**
+ * @return filename
+ */
+ public String getFilename() {
+ return this.filename;
+ }
+
+ /**
+ * @return rawUrl
+ */
+ public String getRawUrl() {
+ return this.rawUrl;
+ }
+
+}
diff --git a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/IGitHubConstants.java b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/IGitHubConstants.java
index 1d02cc4..8b836a7 100644
--- a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/IGitHubConstants.java
+++ b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/IGitHubConstants.java
@@ -41,6 +41,16 @@ public interface IGitHubConstants {
String SEGMENT_MILESTONES = "/milestones"; //$NON-NLS-1$
/**
+ * SEGMENT_GISTS
+ */
+ String SEGMENT_GISTS = "/gists"; //$NON-NLS-1$
+
+ /**
+ * SEGMENT_USERS
+ */
+ String SEGMENT_USERS = "/users"; //$NON-NLS-1$
+
+ /**
* SUFFIX_JSON
*/
String SUFFIX_JSON = ".json"; //$NON-NLS-1$