static class API.Post
extends java.lang.Object
Constructor and Description |
---|
Post() |
Modifier and Type | Method and Description |
---|---|
(package private) static void |
event(RequestQueue queue,
com.culturemesh.android.models.Event event,
android.content.SharedPreferences settings,
<any> listener)
POST to the server a request, via
/event/new , to create a new
Event . |
(package private) static void |
joinEvent(RequestQueue queue,
long eventId,
android.content.SharedPreferences settings,
<any> listener)
Add a user to an existing event.
|
(package private) static void |
joinNetwork(RequestQueue queue,
long networkId,
android.content.SharedPreferences settings,
<any> listener)
Add the current user to an existing network.
|
(package private) static void |
leaveEvent(RequestQueue queue,
long eventId,
android.content.SharedPreferences settings,
<any> listener)
Removes user from event subscription listing.
|
(package private) static void |
leaveNetwork(RequestQueue queue,
long networkId,
android.content.SharedPreferences settings,
<any> listener)
Remove the current user from a network.
|
private static void |
model(RequestQueue queue,
com.culturemesh.android.models.Postable toPost,
java.lang.String url,
java.lang.String logTag,
android.content.SharedPreferences settings,
<any> listener)
POST to the server a request to create a new
Postable model. |
(package private) static void |
post(RequestQueue queue,
com.culturemesh.android.models.Post post,
android.content.SharedPreferences settings,
<any> listener)
POST to the server a request, via
/post/new , to create a new
Post . |
(package private) static void |
reply(RequestQueue queue,
com.culturemesh.android.models.PostReply comment,
android.content.SharedPreferences settings,
<any> listener)
POST to the server a request, via
/post/{postId}/reply , to create a new
PostReply . |
(package private) static void |
user(RequestQueue queue,
com.culturemesh.android.models.User user,
java.lang.String email,
java.lang.String password,
<any> listener)
POST to the server a request, via
/user/users , to create a new user. |
static void joinEvent(RequestQueue queue, long eventId, android.content.SharedPreferences settings, <any> listener)
queue
- Queue to which the asynchronous task will be addedsettings
- SharedPreferences
instance so we can get the token.eventId
- ID of the event to add the user tolistener
- Listener whose onResponse method will be called when the operation completesstatic void joinNetwork(RequestQueue queue, long networkId, android.content.SharedPreferences settings, <any> listener)
queue
- Queue to which the asynchronous task will be addednetworkId
- ID of the network to add the user tolistener
- Listener whose onResponse method will be called when the operation completesstatic void leaveEvent(RequestQueue queue, long eventId, android.content.SharedPreferences settings, <any> listener)
queue
- Queue to which network request will be added.eventId
- id of event to remove user from.settings
- SharedPreferences
instance that stores token.listener
- Listener whose onResponse will be called when the operation completes.static void leaveNetwork(RequestQueue queue, long networkId, android.content.SharedPreferences settings, <any> listener)
queue
- Asynchronous task to which the request will be addednetworkId
- ID of the network to remove the user fromsettings
- Reference to the SharedPreferences
storing the user's login tokenlistener
- Listener whose onResponse
method will be called when the operation
completesstatic void user(RequestQueue queue, com.culturemesh.android.models.User user, java.lang.String email, java.lang.String password, <any> listener)
/user/users
, to create a new user. Note that
Success or failure status will be passed via a NetworkResponse
to the
listener.queue
- Queue to which the asynchronous task will be addeduser
- User to create. Must have password set.email
- User's email addresslistener
- Listener whose onResponse method will be called when task completesstatic void post(RequestQueue queue, com.culturemesh.android.models.Post post, android.content.SharedPreferences settings, <any> listener)
/post/new
, to create a new
Post
. Success or failure status will be
passed via a NetworkResponse
to the listener.queue
- Queue to which the asynchronous task will be addedpost
- Post
to create.listener
- Listener whose onResponse method will be called when task completesstatic void reply(RequestQueue queue, com.culturemesh.android.models.PostReply comment, android.content.SharedPreferences settings, <any> listener)
/post/{postId}/reply
, to create a new
PostReply
. Success or failure status will be
passed via a NetworkResponse
to the listener.queue
- Queue to which the asynchronous task will be addedcomment
- PostReply
to create.listener
- Listener whose onResponse method will be called when task completesstatic void event(RequestQueue queue, com.culturemesh.android.models.Event event, android.content.SharedPreferences settings, <any> listener)
/event/new
, to create a new
Event
. Success or failure status will be
passed via a NetworkResponse
to the listener.queue
- Queue to which the asynchronous task will be addedevent
- Event
to create.listener
- Listener whose onResponse method will be called when task completesprivate static void model(RequestQueue queue, com.culturemesh.android.models.Postable toPost, java.lang.String url, java.lang.String logTag, android.content.SharedPreferences settings, <any> listener)
Postable
model. Success
or failure status will be passed via a NetworkResponse
to the listener.queue
- Queue to which the asynchronous task will be addedtoPost
- Model to createurl
- Full URL to send the POST request tologTag
- Tag (no more than 23 characters long) to be added to log entrieslistener
- Listener whose onResponse method will be called when task completes