Skip to content

Commit

Permalink
Add user and request error model support
Browse files Browse the repository at this point in the history
Change-Id: Ic2ddda0eada498ebbabb9aefdd741ce5bd595c34
Signed-off-by: Chris Aniszczyk <[email protected]>
  • Loading branch information
kevinsawicki authored and caniszczyk committed Apr 10, 2011
1 parent 386e70b commit dec33a8
Show file tree
Hide file tree
Showing 3 changed files with 190 additions and 0 deletions.
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;
}

}
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;
}

}
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;
}

}

0 comments on commit dec33a8

Please sign in to comment.