-
Notifications
You must be signed in to change notification settings - Fork 511
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add user and request error model support
Change-Id: Ic2ddda0eada498ebbabb9aefdd741ce5bd595c34 Signed-off-by: Chris Aniszczyk <[email protected]>
- Loading branch information
1 parent
386e70b
commit dec33a8
Showing
3 changed files
with
190 additions
and
0 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/RequestError.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ([email protected]) | ||
*/ | ||
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; | ||
} | ||
|
||
} |
47 changes: 47 additions & 0 deletions
47
org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/RequestException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ([email protected]) | ||
*/ | ||
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; | ||
} | ||
|
||
} |
101 changes: 101 additions & 0 deletions
101
org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/User.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ([email protected]) | ||
*/ | ||
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; | ||
} | ||
|
||
} |