com.symphony.api.pod.ConnectionApi Maven / Gradle / Ivy
package com.symphony.api.pod;
import com.symphony.api.model.Error;
import com.symphony.api.model.SuccessResponse;
import com.symphony.api.model.UserConnection;
import com.symphony.api.model.UserConnectionList;
import com.symphony.api.model.UserConnectionRequest;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.List;
import java.util.Map;
import javax.ws.rs.*;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.MediaType;
import org.apache.cxf.jaxrs.ext.multipart.*;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
/**
* Pod API
*
* This document refers to Symphony API calls that do not need encryption or decryption of content. - sessionToken can be obtained by calling the authenticationAPI on the symphony back end and the key manager respectively. Refer to the methods described in authenticatorAPI.yaml. - Actions are defined to be atomic, ie will succeed in their entirety or fail and have changed nothing. - If it returns a 40X status then it will have made no change to the system even if ome subset of the request would have succeeded. - If this contract cannot be met for any reason then this is an error and the response code will be 50X.
*
*/
@Path("/")
public interface ConnectionApi {
/**
* Accept the connection request for the requesting user
*
*/
@POST
@Path("/v1/connection/accept")
@Consumes({ "application/json" })
@Produces({ "application/json" })
@Operation(summary = "Accept the connection request for the requesting user", tags={ })
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "Success", content = @Content(schema = @Schema(implementation = UserConnection.class))),
@ApiResponse(responseCode = "400", description = "Client error, see response body for further details.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "401", description = "Unauthorized: Session tokens invalid.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "403", description = "Forbidden: Caller lacks necessary entitlement.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "404", description = "Not Found: Connection cannot be found.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "500", description = "Server error, see response body for further details.", content = @Content(schema = @Schema(implementation = Error.class))) })
public UserConnection v1ConnectionAcceptPost(UserConnectionRequest body, @HeaderParam("sessionToken") String sessionToken);
/**
* Sends an invitation to connect with another user
*
*/
@POST
@Path("/v1/connection/create")
@Consumes({ "application/json" })
@Produces({ "application/json" })
@Operation(summary = "Sends an invitation to connect with another user", tags={ })
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = UserConnection.class))),
@ApiResponse(responseCode = "400", description = "Client error, see response body for further details.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "401", description = "Unauthorized: Session tokens invalid.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "403", description = "Forbidden: Caller lacks necessary entitlement.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "404", description = "Not Found: User cannot be found.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "500", description = "Server error, see response body for further details.", content = @Content(schema = @Schema(implementation = Error.class))) })
public UserConnection v1ConnectionCreatePost(UserConnectionRequest body, @HeaderParam("sessionToken") String sessionToken);
/**
* List of requesting user's connection
*
* This retrieves all connections of the requesting user. (i.e. both connections in which the requesting user is the sender and those in which the requesting user is the inivtee) By default, if you haven't specified the connection status to filter on, this call will only return results for both \"pending_incoming\" and \"pending_outgoing\". You can optionally filter by userIds to further restrict the results of a specific connection status. If the users are in the same private pod, the users have an implicit connection status of \"accepted\". Those users will not be returned in the response if you don't specify the connection status as \"accepted\" (default is \"pending\") and the explicit userIds in the request.
*
*/
@GET
@Path("/v1/connection/list")
@Produces({ "application/json" })
@Operation(summary = "List of requesting user's connection", tags={ })
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = UserConnectionList.class))),
@ApiResponse(responseCode = "400", description = "Client error, see response body for further details.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "401", description = "Unauthorized: Session tokens invalid.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "403", description = "Forbidden: Caller lacks necessary entitlement.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "404", description = "Not Found: Connection cannot be found.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "500", description = "Server error, see response body for further details.", content = @Content(schema = @Schema(implementation = Error.class))) })
public UserConnectionList v1ConnectionListGet(@HeaderParam("sessionToken") String sessionToken, @QueryParam("status")String status, @QueryParam("userIds")String userIds);
/**
* Reject the connection request for the requesting user.
*
* Reject the connection between the requesting user and request sender. If both users are in the same private pod, an error will be returned because both users have an implicit connection which cannot be rejected.
*
*/
@POST
@Path("/v1/connection/reject")
@Consumes({ "application/json" })
@Produces({ "application/json" })
@Operation(summary = "Reject the connection request for the requesting user.", tags={ })
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "Success", content = @Content(schema = @Schema(implementation = UserConnection.class))),
@ApiResponse(responseCode = "400", description = "Client error, see response body for further details.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "401", description = "Unauthorized: Session tokens invalid.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "403", description = "Forbidden: Caller lacks necessary entitlement.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "404", description = "Not Found: Connection cannot be found.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "500", description = "Server error, see response body for further details.", content = @Content(schema = @Schema(implementation = Error.class))) })
public UserConnection v1ConnectionRejectPost(UserConnectionRequest body, @HeaderParam("sessionToken") String sessionToken);
/**
* Removes a connection with a user.
*
*/
@POST
@Path("/v1/connection/user/{uid}/remove")
@Produces({ "application/json" })
@Operation(summary = "Removes a connection with a user.", tags={ })
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SuccessResponse.class))),
@ApiResponse(responseCode = "400", description = "Client error, see response body for further details.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "401", description = "Unauthorized: Session tokens invalid.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "403", description = "Forbidden: Caller lacks necessary entitlement.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "404", description = "Not Found: Connection cannot be found.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "500", description = "Server error, see response body for further details.", content = @Content(schema = @Schema(implementation = Error.class))) })
public SuccessResponse v1ConnectionUserUidRemovePost(@HeaderParam("sessionToken") String sessionToken, @PathParam("uid") Long uid);
/**
* The status of the connection invitation to another user.
*
*/
@GET
@Path("/v1/connection/user/{userId}/info")
@Produces({ "application/json" })
@Operation(summary = "The status of the connection invitation to another user.", tags={ })
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = UserConnection.class))),
@ApiResponse(responseCode = "400", description = "Client error, see response body for further details.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "401", description = "Unauthorized: Session tokens invalid.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "403", description = "Forbidden: Caller lacks necessary entitlement.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "404", description = "Not Found: Connection cannot be found.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "500", description = "Server error, see response body for further details.", content = @Content(schema = @Schema(implementation = Error.class))) })
public UserConnection v1ConnectionUserUserIdInfoGet(@HeaderParam("sessionToken") String sessionToken, @PathParam("userId") String userId);
}