/** * Adds a new {@linkplain School school} to the authorizing {@linkplain XingUser user's} education background. * <p> * A simpler implementation of {@link #addSchool(String)}. * * @param school New school to add. <strong>name</strong> must NOT be {@code null}. * @return A {@linkplain CallSpec callSpec object} ready to execute the request. * * @see <a href="https://dev.xing.com/docs/post/users/me/educational_background/schools">'Create a school' * resource page.</a> */ public CallSpec<School, HttpError> addSchool(School school) { return Resource.<School, HttpError>newPostSpec(api, "/v1/users/me/educational_background/schools", false) .responseAs(single(School.class, "school")) .body(School.class, school) .build(); }
/** * Returns the profile picture upload progress with percentage. * <p> * After a photo is uploaded via {@link #updateProfilePicture(PictureUpload)} call, the current upload * progress can be obtained by executing <strong>this</strong> call. Possible values for the status field are: * IN_PROGRESS, DONE, FAILED. * * @return A {@linkplain CallSpec callSpec object} ready to execute the request. * * @see <a href="https://dev.xing.com/docs/get/users/me/photo/progress">'Get profile picture upload progress' * resource page</a> */ @Experimental public CallSpec<UploadProgress, HttpError> getPictureUploadProgress() { return Resource.<UploadProgress, HttpError>newGetSpec(api, "/v1/users/me/photo/progress") .responseAs(single(UploadProgress.class, "progress")) .build(); }
/** * Updates the authorizing {@linkplain XingUser user's} profile picture. * <p> * Uploads a new photo and defines it as the users profile picture. * Pictures have to be less than 20 MB large. The supported image formats are image/jpeg and image/png. * <p> * It is sent as application/json with the image data Base64 encoded in the body: * { "photo": { "file_name": "test.jpg", "mime_type": "image/jpeg", "content": "Base64 encoded image data" } } * <p> * The required PictureUpload Object can be generated by using {@link PictureUpload#pictureUploadJPEG(String, * byte[])} or {@link PictureUpload#pictureUploadPNG(String, byte[])} * * @return A {@linkplain CallSpec callSpec object} ready to execute the request. * * @see <a href="https://dev.xing.com/docs/put/users/me/photo">'Update users profile picture' resource page</a> */ public CallSpec<Void, HttpError> updateProfilePicture(PictureUpload pictureUpload) { return Resource.<Void, HttpError>newPutSpec(api, "v1/users/me/photo", false) .responseAs(Void.class) .body(single(PictureUpload.class, "photo"), pictureUpload) .build(); }
.responseAs(single(School.class, "school")) .formField("name", name) .build();
.responseAs(single(School.class, "school")) .pathParam("id", schoolId) .build();
.responseAs(single(Company.class, "company")) .pathParam("id", companyId) .build();
.responseAs(single(Company.class, "company")) .formField("name", name) .formField("title", title)