Commit 22f5cc14 authored by Matija Obreza's avatar Matija Obreza

Organization methods

parent bf8830f6
......@@ -435,4 +435,38 @@ public class GenesysClient {
public String rebuildCropTaxa() throws OAuthAuthenticationException, PleaseRetryException, GenesysApiException {
return query(Verb.POST, "/crops/rebuild", null, null);
}
public String listOrganizations(int page) throws OAuthAuthenticationException, PleaseRetryException, GenesysApiException {
Map<String, String> qs = new HashMap<String, String>();
qs.put("page", String.valueOf(page));
return query(Verb.GET, "/org", qs, null);
}
public String getOrganization(String slug) throws OAuthAuthenticationException, PleaseRetryException, GenesysApiException {
return query("/org/" + slug);
}
public String updateOrganization(ObjectNode org) throws OAuthAuthenticationException, PleaseRetryException, GenesysApiException {
return query(Verb.POST, "/org", null, org.toString());
}
public String deleteOrganization(String slug) throws OAuthAuthenticationException, PleaseRetryException, GenesysApiException {
return query(Verb.DELETE, "/org/" + slug, null, null);
}
public String getOrganizationMembers(String slug) throws OAuthAuthenticationException, PleaseRetryException, GenesysApiException {
return query("/org/" + slug + "/institutes");
}
public String putOrganizationMembers(String slug, ArrayNode currentMembers) throws OAuthAuthenticationException, PleaseRetryException, GenesysApiException {
return query(Verb.PUT, "/org/" + slug + "/set-institutes", null, currentMembers.toString());
}
public String getOrganizationBlurp(String slug, String language) throws OAuthAuthenticationException, PleaseRetryException, GenesysApiException {
return query("/org/" + slug + "/blurp/" + language);
}
public String updateOrganizationBlurp(String slug, ObjectNode blurp) throws OAuthAuthenticationException, PleaseRetryException, GenesysApiException {
return query(Verb.PUT, "/org/"+ slug+"/blurp", null, blurp.toString());
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment