summaryrefslogtreecommitdiff
path: root/src/com/p4square/f1oauth/F1API.java
diff options
context:
space:
mode:
authorJesse Morgan <jesse@jesterpm.net>2014-09-22 06:40:21 -0700
committerJesse Morgan <jesse@jesterpm.net>2014-09-22 06:40:21 -0700
commitdd4f34e216132e3a066566daf30a6f1fc1e1b872 (patch)
tree8c9e2ac3b30f207e7945dfe5f885101a6dcee995 /src/com/p4square/f1oauth/F1API.java
parent6eba410e5eb53ee887e430f4f98ba03ffaa2a474 (diff)
parent3e703186928c5bd8f2c31f90b1c6e262c4080328 (diff)
Merge branch 'f1-attributes'
Diffstat (limited to 'src/com/p4square/f1oauth/F1API.java')
-rw-r--r--src/com/p4square/f1oauth/F1API.java44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/com/p4square/f1oauth/F1API.java b/src/com/p4square/f1oauth/F1API.java
new file mode 100644
index 0000000..88801db
--- /dev/null
+++ b/src/com/p4square/f1oauth/F1API.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2014 Jesse Morgan
+ */
+
+package com.p4square.f1oauth;
+
+import java.io.IOException;
+import java.util.Map;
+
+import com.p4square.restlet.oauth.OAuthException;
+import com.p4square.restlet.oauth.OAuthUser;
+
+/**
+ * F1 API methods which require an authenticated user.
+ *
+ * @author Jesse Morgan <jesse@jesterpm.net>
+ */
+public interface F1API {
+ /**
+ * Fetch information about a user.
+ *
+ * @param user The user to fetch information about.
+ * @return An F1User object.
+ */
+ F1User getF1User(OAuthUser user) throws OAuthException, IOException;
+
+ /**
+ * Fetch a list of all attributes ids and names.
+ *
+ * @return A Map of attribute name to attribute id.
+ */
+ Map<String, String> getAttributeList() throws F1Exception;
+
+ /**
+ * Add an attribute to the user.
+ *
+ * @param user The user to add the attribute to.
+ * @param attributeName The attribute to add.
+ * @param attribute The attribute to add.
+ */
+ boolean addAttribute(String userId, String attributeName, Attribute attribute)
+ throws F1Exception;
+
+}