com.jelastic.api.users.response.CollaborationRoleResponse Maven / Gradle / Ivy
The newest version!
/*Server class MD5: 85a5ba05d68c1262554a02219be8f996*/
package com.jelastic.api.users.response;
import com.jelastic.api.Response;
import com.jelastic.api.core.persistence.entity.CollaborationRole;
import org.json.JSONException;
import org.json.JSONObject;
/**
* @name Jelastic API Client
* @version 8.11.2
* @copyright Jelastic, Inc.
*/
public class CollaborationRoleResponse extends Response {
private static final String ROLE_KEY = "role";
private CollaborationRole role;
public CollaborationRoleResponse(CollaborationRole role) {
super(Response.OK());
this.role = role;
}
public CollaborationRoleResponse(int result, String error) {
super(result, error);
}
public CollaborationRole getRole() {
return role;
}
public void setRole(CollaborationRole role) {
this.role = role;
}
@Override
public JSONObject _toJSON() throws JSONException {
JSONObject json = super._toJSON();
if (role != null) {
json.put(ROLE_KEY, role.toJSON());
}
return json;
}
@Override
public CollaborationRoleResponse _fromJSON(JSONObject jsonObject) throws JSONException {
super._fromJSON(jsonObject);
if (jsonObject.has(ROLE_KEY)) {
this.role = new CollaborationRole().fromJSON(jsonObject.getJSONObject(ROLE_KEY));
}
return this;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy