com.sinch.sdk.domains.conversation.api.v1.AppService Maven / Gradle / Ivy
Show all versions of sinch-sdk-java Show documentation
package com.sinch.sdk.domains.conversation.api.v1;
import com.sinch.sdk.domains.conversation.models.v1.app.request.AppCreateRequest;
import com.sinch.sdk.domains.conversation.models.v1.app.request.AppUpdateRequest;
import com.sinch.sdk.domains.conversation.models.v1.app.response.AppResponse;
import com.sinch.sdk.models.ConversationRegion;
import java.util.Collection;
/**
* Applications related service
*
* Apps are created and configured through the Sinch Dashboard, are tied to the API user and come
* with a set of channel credentials for each underlying connected channel.
*
*
The app has a list of conversations between itself and different contacts which share the same
* project.
*
*
Webhooks, which the app is attached to, defines the destination for various events coming from
* the Conversation API. An app has the following configurable properties:
*
* @see https://developers.sinch.com/docs/conversation/api-reference/conversation/tag/App/
* @since 1.3
*/
public interface AppService {
/**
* List all apps
*
*
Get a list of all apps in the specified project
*
* @return List of apps related to configured region (from {@link
* com.sinch.sdk.models.Configuration.Builder#setConversationRegion(ConversationRegion)})
* @since 1.3
*/
Collection list();
/**
* Get an app
*
* Returns a particular app as specified by the App ID.
*
* @param appId The application identifier
* @return App information details
* @since 1.3
*/
AppResponse get(String appId);
/**
* Delete an app
*
*
Deletes the app specified by the App ID
*
*
Note that this operation will not delete contacts (which are stored at the project level)
* nor any channel-specific resources (for example, WhatsApp Sender Identities will not be
* deleted).
*
* @param appId The application identifier
* @since 1.3
*/
void delete(String appId);
/**
* Create a Conversation application
*
*
You can create a new Conversation API app using the API.
*
*
You can create an app for one or more channels at once.
*
* @param parameters Creation parameters
* @return Created application
* @since 1.3
*/
AppResponse create(AppCreateRequest parameters);
/**
* Update a Conversation application
*
*
Updates a particular app as specified by the App ID.
*
*
Any specified field values will replace existing values.
*
*
Therefore, if you'd like to add additional configurations to an existing Conversation API
* app, ensure that you include existing values AND new values in the call.
* For example, if you'd like to add new channel_credentials
, you can get your
* existing Conversation API app, extract the existing channel_credentials
list,
* append your new configuration to that list, and include the updated channel_credentials
*
list in this update call.
*
* @param appId The unique ID of the app to be updated
* @param parameters Fields to be updated. Only fields filled within the parameters will be
* updated
* @return Updated application
* @since 1.3
*/
AppResponse update(String appId, AppUpdateRequest parameters);
}