package com.cloudmine.api.rest;

import com.android.volley.NetworkResponse;
import com.android.volley.Response;
import com.cloudmine.api.CMSessionToken;
import com.cloudmine.api.rest.options.CMServerFunction;
import com.cloudmine.api.rest.response.CreationResponse;
import me.cloudmine.annotations.Expand;
import me.cloudmine.annotations.Optional;

/**
 * <br>
 * Copyright CloudMine LLC. All rights reserved<br>
 * See LICENSE file included with SDK for details.
 */
public class BaseProfileUpdateRequest extends CloudMineRequest<CreationResponse> {
    public static final int REQUEST_TYPE = 405;

    @Expand
    public BaseProfileUpdateRequest(String userProfile, CMSessionToken sessionToken, @Optional CMServerFunction serverFunction, @Optional Response.Listener<CreationResponse> successListener, @Optional Response.ErrorListener errorListener) {
        super(Method.POST, "/account", userProfile, sessionToken, serverFunction, successListener,  errorListener);
    }

    @Override
    protected Response<CreationResponse> parseNetworkResponse(NetworkResponse networkResponse) {
        return Response.success(new CreationResponse(new String(networkResponse.data), networkResponse.statusCode), getCacheEntry());
    }

    @Override
    public int getRequestType() {
        return REQUEST_TYPE;
    }
}

@@ -146,16 +146,49 @@
 nToken;%0A
+import com.cloudmine.api.CMUser;%0A
 import c
@@ -235,16 +235,16 @@
 nction;%0A
-
 import c
@@ -379,16 +379,69 @@
 l;%0A%0A/**%0A
+ * A Request for updating a logged in user's profile%0A
  * %3Cbr%3E%0A
@@ -679,16 +679,975 @@
 = 405;%0A%0A
+    /**%0A     * Create a new Request for updating a user's profile. The user must be logged in%0A     * @param user a logged in user%0A     * @param serverFunction%0A     * @param successListener%0A     * @param errorListener%0A     */%0A    @Expand%0A    public BaseProfileUpdateRequest(CMUser user, @Optional CMServerFunction serverFunction, @Optional Response.Listener%3CCreationResponse%3E successListener, @Optional Response.ErrorListener errorListener) %7B%0A        this(user.profileTransportRepresentation(), user.getSessionToken(), serverFunction, successListener,  errorListener);%0A    %7D%0A%0A    /**%0A     * Create a new Request for updating a user's profile. The user must be logged in%0A     * @param userProfile obtained by calling %7B@link com.cloudmine.api.CMUser#profileTransportRepresentation()%7D%0A     * @param sessionToken a valid session token for the user who is to be updated%0A     * @param serverFunction%0A     * @param successListener%0A     * @param errorListener%0A     */%0A
     @Exp

Comment profile update request and add a convenience method for creating one from a user