summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Sawicki2011-04-10 13:54:15 (EDT)
committer Chris Aniszczyk2011-04-10 13:57:55 (EDT)
commitdec33a839f902d712036073329f71722a3247e5b (patch)
tree4de05f056fd71501948237f931c2f4d1917dcbc9
parent386e70bf56d43792be79eb5ea3b43117854b6610 (diff)
downloadegit-github-dec33a839f902d712036073329f71722a3247e5b.zip
egit-github-dec33a839f902d712036073329f71722a3247e5b.tar.gz
egit-github-dec33a839f902d712036073329f71722a3247e5b.tar.bz2
Add user and request error model supportrefs/changes/38/3038/2
Change-Id: Ic2ddda0eada498ebbabb9aefdd741ce5bd595c34 Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
-rw-r--r--org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/RequestError.java42
-rw-r--r--org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/RequestException.java47
-rw-r--r--org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/User.java101
3 files changed, 190 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/RequestError.java b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/RequestError.java
new file mode 100644
index 0000000..0ba922c
--- /dev/null
+++ b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/RequestError.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * 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.List;
+
+/**
+ * GitHub request error class
+ *
+ * @author Kevin Sawicki (kevin@github.com)
+ */
+public class RequestError {
+
+ private String message;
+
+ private List<String> errors;
+
+ /**
+ * @return message
+ */
+ public String getMessage() {
+ return this.message;
+ }
+
+ /**
+ * Get errors
+ *
+ * @return list of errors
+ */
+ public List<String> getErrors() {
+ return this.errors;
+ }
+
+}
diff --git a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/RequestException.java b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/RequestException.java
new file mode 100644
index 0000000..add4156
--- /dev/null
+++ b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/RequestException.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * 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.io.IOException;
+
+/**
+ * Request exception class that wraps an {@link RequestError} object.
+ *
+ * @author Kevin Sawicki (kevin@github.com)
+ */
+public class RequestException extends IOException {
+
+ /**
+ * serialVersionUID
+ */
+ private static final long serialVersionUID = 1197051396535284852L;
+
+ private RequestError error;
+
+ /**
+ * Create request exception
+ *
+ * @param error
+ */
+ public RequestException(RequestError error) {
+ super(error.getMessage());
+ }
+
+ /**
+ * Get error
+ *
+ * @return error
+ */
+ public RequestError getError() {
+ return this.error;
+ }
+
+}
diff --git a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/User.java b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/User.java
new file mode 100644
index 0000000..ae00a90
--- /dev/null
+++ b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/User.java
@@ -0,0 +1,101 @@
+/*******************************************************************************
+ * 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;
+
+/**
+ * GitHub user class.
+ *
+ * @author Kevin Sawicki (kevin@github.com)
+ */
+public class User {
+
+ private String blob;
+
+ private String company;
+
+ private String email;
+
+ private String gravatarUrl;
+
+ private String location;
+
+ private String login;
+
+ private String name;
+
+ private String type;
+
+ private String url;
+
+ /**
+ * @return blob
+ */
+ public String getBlob() {
+ return this.blob;
+ }
+
+ /**
+ * @return company
+ */
+ public String getCompany() {
+ return this.company;
+ }
+
+ /**
+ * @return email
+ */
+ public String getEmail() {
+ return this.email;
+ }
+
+ /**
+ * @return gravatarUrl
+ */
+ public String getGravatarUrl() {
+ return this.gravatarUrl;
+ }
+
+ /**
+ * @return location
+ */
+ public String getLocation() {
+ return this.location;
+ }
+
+ /**
+ * @return login
+ */
+ public String getLogin() {
+ return this.login;
+ }
+
+ /**
+ * @return name
+ */
+ public String getName() {
+ return this.name;
+ }
+
+ /**
+ * @return type
+ */
+ public String getType() {
+ return this.type;
+ }
+
+ /**
+ * @return url
+ */
+ public String getUrl() {
+ return this.url;
+ }
+
+}