Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions MIGRATION-GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ This guide lists all removed classes and interfaces from V1 and how to migrate t
- Conversation Template V1 is deprecated. Use Conversation Template V2 instead.

#### Replacement models
| Old const | New const |
|--------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ComposingEndEvent.EMPTY | [ComposingEndEvent.COMPOSING_END_EVENT](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/conversation/models/v1/events/types/ComposingEndEvent.html) |
| ComposingEvent.EMPTY | [ComposingEvent.COMPOSING_EVENT](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/conversation/models/v1/events/types/ComposingEvent.html) |
| ConversationDeletedEvent.EMPTY | [ConversationDeletedEvent.CONVERSATION_DELETED_EVENT](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/conversation/models/v1/events/types/ComposingEvent.html) |

| Old class | New class |
|--------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| models.v1.messages.types.card.CardMessageMedia | [com.sinch.sdk.domains.conversation.models.v1.messages.types.media.MediaMessage](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/conversation/models/v1/messages/types/media/MediaMessage.html) |
Expand Down Expand Up @@ -189,6 +195,14 @@ Use the new versioned API under `sms().v1()` to get access to [SMSService](https

#### Replacement models

| Old const | New const |
|---------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| SvamlActionContinue.DEFAULT | [SvamlActionContinue.SVAML_ACTION_CONTINUE](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/voice/models/v1/svaml/action/SvamlActionContinue.html) |
| SvamlActionHangup.DEFAULT | [SvamlActionHangup.SVAML_ACTION_HANGUP](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/voice/models/v1/svaml/action/SvamlActionHangup.html) |
| SvamlInstructionAnswer.DEFAULT | [SvamlInstructionAnswer.SVAML_INSTRUCTION_ANSWER](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/voice/models/v1/svaml/action/SvamlInstructionAnswer.html) |
| SvamlInstructionStopRecording.DEFAULT | [SvamlInstructionStopRecording.SVAML_INSTRUCTION_STOP_RECORDING](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/voice/models/v1/svaml/action/SvamlInstructionStopRecording.html) |


##### Destination
| Old class | New class |
|------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public void delete() {
public void injectEvent() {
InjectEventRequest request =
InjectEventRequest.builder()
.setAppEvent(ComposingEvent.EMPTY)
.setAppEvent(ComposingEvent.COMPOSING_EVENT)
.setAcceptTime(Instant.now())
.build();
injectEventResponse = service.injectEvent(CONVERSATION_ID, request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public void send() {
SendEventRequest.builder()
.setAppId(AppsSteps.APP_ID)
.setRecipient(ContactId.builder().setContactId(ContactsSteps.CONTACT_ID).build())
.setEvent(ComposingEvent.EMPTY)
.setEvent(ComposingEvent.COMPOSING_EVENT)
.build();

sendResponse = service.send(request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void updateCall() {
.setText("Sorry, the conference has been cancelled. The call will end now.")
.setLocale("en-US")
.build()))
.setAction(SvamlActionHangup.DEFAULT)
.setAction(SvamlActionHangup.SVAML_ACTION_HANGUP)
.build();
service.update("1ce0ffee-ca11-ca11-ca11-abcdef000022", request);
updatePassed = true;
Expand All @@ -71,7 +71,7 @@ public void updateCallNotExits() {
.setText("Sorry, the conference has been cancelled. The call will end now.")
.setLocale("en-US")
.build()))
.setAction(SvamlActionHangup.DEFAULT)
.setAction(SvamlActionHangup.SVAML_ACTION_HANGUP)
.build();
try {
service.update("not-existing-callId", request);
Expand All @@ -92,7 +92,7 @@ public void manageCallWithCallLeg() {
Arrays.asList(
"https://samples-files.com/samples/Audio/mp3/sample-file-4.mp3"))
.build()))
.setAction(SvamlActionContinue.DEFAULT)
.setAction(SvamlActionContinue.SVAML_ACTION_CONTINUE)
.build();
service.manageWithCallLeg("1ce0ffee-ca11-ca11-ca11-abcdef000022", CallLeg.CALLEE, request);
manageWithCallLegPassed = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static void main(String[] args) {

EventsService eventsService = client.conversation().v1().events();

AppEvent event = ComposingEndEvent.EMPTY;
AppEvent event = ComposingEndEvent.COMPOSING_END_EVENT;

SendEventRequest request =
SendEventRequest.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static void main(String[] args) {

LOGGER.info(String.format("Manage call with ID '%s'", callId));

SvamlAction action = SvamlActionHangup.DEFAULT;
SvamlAction action = SvamlActionHangup.SVAML_ACTION_HANGUP;

Collection<SvamlInstruction> instructions =
Collections.singletonList(
Expand Down
2 changes: 1 addition & 1 deletion examples/snippets/src/main/java/voice/calls/Update.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static void main(String[] args) {
// The instruction to be performed
SvamlInstruction instruction = SvamlInstructionSay.builder().setText("Goodbye").build();
// The instruction to add to the call
SvamlAction action = SvamlActionHangup.DEFAULT;
SvamlAction action = SvamlActionHangup.SVAML_ACTION_HANGUP;

Configuration configuration =
Configuration.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
package com.sinch.sdk.domains.conversation.models.v1.events.types;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.sinch.sdk.core.models.OptionalValue;
import java.util.Collections;

/** Composing End Event Type */
Expand All @@ -20,8 +21,8 @@ public interface ComposingEndEvent
com.sinch.sdk.domains.conversation.models.v1.events.AppEvent {

/** Default EMPTY message to be used to send a ComposingEndEvent */
ComposingEndEvent EMPTY =
new ComposingEndEventImpl.Builder().setComposingEndEvent(Collections.EMPTY_MAP).build();
ComposingEndEvent COMPOSING_END_EVENT =
new ComposingEndEventImpl(OptionalValue.of(Collections.emptyMap()));

/**
* Getting builder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
package com.sinch.sdk.domains.conversation.models.v1.events.types;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.sinch.sdk.core.models.OptionalValue;
import java.util.Collections;

/** Composing */
Expand All @@ -20,8 +21,7 @@ public interface ComposingEvent
com.sinch.sdk.domains.conversation.models.v1.events.ContactEvent {

/** Default EMPTY message to be used to send a ComposingEvent */
ComposingEvent EMPTY =
new ComposingEventImpl.Builder().setComposingEvent(Collections.EMPTY_MAP).build();
ComposingEvent COMPOSING_EVENT = new ComposingEventImpl(OptionalValue.of(Collections.emptyMap()));

/**
* Getting builder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
package com.sinch.sdk.domains.conversation.models.v1.events.types;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.sinch.sdk.core.models.OptionalValue;
import java.util.Collections;

/** Conversation Deleted Event Type */
Expand All @@ -19,10 +20,8 @@ public interface ConversationDeletedEvent
extends com.sinch.sdk.domains.conversation.models.v1.events.ContactEvent {

/** Default EMPTY message to be used to send a ConversationDeletedEvent */
ConversationDeletedEvent EMPTY =
new ConversationDeletedEventImpl.Builder()
.setConversationDeletedEvent(Collections.EMPTY_MAP)
.build();
ConversationDeletedEvent CONVERSATION_DELETED_EVENT =
new ConversationDeletedEventImpl(OptionalValue.of(Collections.emptyMap()));

/**
* Getting builder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import com.sinch.sdk.domains.conversation.models.v1.Agent;
import com.sinch.sdk.domains.conversation.models.v1.ConversationChannel;
import com.sinch.sdk.domains.conversation.models.v1.messages.OmniMessageOverride;
import com.sinch.sdk.domains.conversation.models.v1.messages.OmniMessageOverride.ChannelSpecificTemplate;
import com.sinch.sdk.domains.conversation.models.v1.messages.types.card.CardMessage;
import com.sinch.sdk.domains.conversation.models.v1.messages.types.carousel.CarouselMessage;
import com.sinch.sdk.domains.conversation.models.v1.messages.types.channelspecific.ChannelSpecificMessage;
Expand Down Expand Up @@ -117,8 +118,7 @@ public interface AppMessageInternal {
*
* @return explicitChannelOmniMessage
*/
Map<OmniMessageOverride.ChannelSpecificTemplate, OmniMessageOverride>
getExplicitChannelOmniMessage();
Map<ChannelSpecificTemplate, OmniMessageOverride> getExplicitChannelOmniMessage();

/**
* Channel specific messages, overriding any transcoding. The structure of this property is more
Expand Down Expand Up @@ -247,8 +247,7 @@ interface Builder {
* @see #getExplicitChannelOmniMessage
*/
Builder setExplicitChannelOmniMessage(
Map<OmniMessageOverride.ChannelSpecificTemplate, OmniMessageOverride>
explicitChannelOmniMessage);
Map<ChannelSpecificTemplate, OmniMessageOverride> explicitChannelOmniMessage);

/**
* see getter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.sinch.sdk.domains.conversation.models.v1.Agent;
import com.sinch.sdk.domains.conversation.models.v1.ConversationChannel;
import com.sinch.sdk.domains.conversation.models.v1.messages.OmniMessageOverride;
import com.sinch.sdk.domains.conversation.models.v1.messages.OmniMessageOverride.ChannelSpecificTemplate;
import com.sinch.sdk.domains.conversation.models.v1.messages.types.card.CardMessage;
import com.sinch.sdk.domains.conversation.models.v1.messages.types.carousel.CarouselMessage;
import com.sinch.sdk.domains.conversation.models.v1.messages.types.channelspecific.ChannelSpecificMessage;
Expand Down Expand Up @@ -86,7 +87,7 @@ public class AppMessageInternalImpl implements AppMessageInternal {
public static final String JSON_PROPERTY_EXPLICIT_CHANNEL_OMNI_MESSAGE =
"explicit_channel_omni_message";

private OptionalValue<Map<OmniMessageOverride.ChannelSpecificTemplate, OmniMessageOverride>>
private OptionalValue<Map<ChannelSpecificTemplate, OmniMessageOverride>>
explicitChannelOmniMessage;

public static final String JSON_PROPERTY_CHANNEL_SPECIFIC_MESSAGE = "channel_specific_message";
Expand All @@ -110,8 +111,7 @@ protected AppMessageInternalImpl(
OptionalValue<ListMessage> listMessage,
OptionalValue<ContactInfoMessage> contactInfoMessage,
OptionalValue<Map<ConversationChannel, String>> explicitChannelMessage,
OptionalValue<Map<OmniMessageOverride.ChannelSpecificTemplate, OmniMessageOverride>>
explicitChannelOmniMessage,
OptionalValue<Map<ChannelSpecificTemplate, OmniMessageOverride>> explicitChannelOmniMessage,
OptionalValue<Map<ConversationChannel, ChannelSpecificMessage>> channelSpecificMessage,
OptionalValue<Agent> agent) {
this.cardMessage = cardMessage;
Expand Down Expand Up @@ -240,14 +240,13 @@ public OptionalValue<Map<ConversationChannel, String>> explicitChannelMessage()
}

@JsonIgnore
public Map<OmniMessageOverride.ChannelSpecificTemplate, OmniMessageOverride>
getExplicitChannelOmniMessage() {
public Map<ChannelSpecificTemplate, OmniMessageOverride> getExplicitChannelOmniMessage() {
return explicitChannelOmniMessage.orElse(null);
}

@JsonProperty(JSON_PROPERTY_EXPLICIT_CHANNEL_OMNI_MESSAGE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public OptionalValue<Map<OmniMessageOverride.ChannelSpecificTemplate, OmniMessageOverride>>
public OptionalValue<Map<ChannelSpecificTemplate, OmniMessageOverride>>
explicitChannelOmniMessage() {
return explicitChannelOmniMessage;
}
Expand Down Expand Up @@ -366,8 +365,8 @@ static class Builder implements AppMessageInternal.Builder {
OptionalValue<ListMessage> listMessage = OptionalValue.empty();
OptionalValue<ContactInfoMessage> contactInfoMessage = OptionalValue.empty();
OptionalValue<Map<ConversationChannel, String>> explicitChannelMessage = OptionalValue.empty();
OptionalValue<Map<OmniMessageOverride.ChannelSpecificTemplate, OmniMessageOverride>>
explicitChannelOmniMessage = OptionalValue.empty();
OptionalValue<Map<ChannelSpecificTemplate, OmniMessageOverride>> explicitChannelOmniMessage =
OptionalValue.empty();
OptionalValue<Map<ConversationChannel, ChannelSpecificMessage>> channelSpecificMessage =
OptionalValue.empty();
OptionalValue<Agent> agent = OptionalValue.empty();
Expand Down Expand Up @@ -435,8 +434,7 @@ public Builder setExplicitChannelMessage(

@JsonProperty(JSON_PROPERTY_EXPLICIT_CHANNEL_OMNI_MESSAGE)
public Builder setExplicitChannelOmniMessage(
Map<OmniMessageOverride.ChannelSpecificTemplate, OmniMessageOverride>
explicitChannelOmniMessage) {
Map<ChannelSpecificTemplate, OmniMessageOverride> explicitChannelOmniMessage) {
this.explicitChannelOmniMessage = OptionalValue.of(explicitChannelOmniMessage);
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ public interface GroupUpdateRequest {
String getName();

/**
* One time copy of all members from the group referenced by the group ID into this group.
* Copy the members from the another group into this group. Constraints: Must be valid group ID
*
* @return addFromGroup
*/
String getAddFromGroup();

/**
* Remove all members from this group that are currently in the group referenced by the group ID.
* Remove the members in a specified group from this group. Constraints: Must be valid group ID
*
* @return removeFromGroup
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public interface SvamlActionContinue
extends com.sinch.sdk.domains.voice.models.v1.svaml.action.SvamlAction {

/** ready to use action to send a `continue` */
SvamlActionContinue DEFAULT = SvamlActionContinue.builder().build();
SvamlActionContinue SVAML_ACTION_CONTINUE = SvamlActionContinue.builder().build();

/** The name property. Must have the value <code>continue</code>. */
public class NameEnum extends EnumDynamic<String, NameEnum> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public interface SvamlActionHangup
extends com.sinch.sdk.domains.voice.models.v1.svaml.action.SvamlAction {

/** ready to use action to send a `hangup` */
SvamlActionHangup DEFAULT = SvamlActionHangup.builder().build();
SvamlActionHangup SVAML_ACTION_HANGUP = SvamlActionHangup.builder().build();

/** The name property. Must have the value <code>hangup</code>. */
public class NameEnum extends EnumDynamic<String, NameEnum> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public interface SvamlInstructionAnswer
extends com.sinch.sdk.domains.voice.models.v1.svaml.instruction.SvamlInstruction {

/** ready to use instruction to send a `answer` */
SvamlInstructionAnswer DEFAULT = SvamlInstructionAnswer.builder().build();
SvamlInstructionAnswer SVAML_INSTRUCTION_ANSWER = SvamlInstructionAnswer.builder().build();

/** The <code>name</code> property. Must have the value <code>answer</code>. */
public class NameEnum extends EnumDynamic<String, NameEnum> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ public interface SvamlInstructionStopRecording
extends com.sinch.sdk.domains.voice.models.v1.svaml.instruction.SvamlInstruction {

/** ready to use instruction to send a `stop recording` */
SvamlInstructionStopRecording DEFAULT = SvamlInstructionStopRecording.builder().build();
SvamlInstructionStopRecording SVAML_INSTRUCTION_STOP_RECORDING =
SvamlInstructionStopRecording.builder().build();

/** The <code>name</code> property. Must have the value <code>stopRecording</code>. */
public class NameEnum extends EnumDynamic<String, NameEnum> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class SendEventRequestDtoTest extends ConversationBaseTest {
public static SendEventRequest sendEventDto =
SendEventRequest.builder()
.setAppId("an app id")
.setEvent(ComposingEndEvent.EMPTY)
.setEvent(ComposingEndEvent.COMPOSING_END_EVENT)
.setRecipient(
ChannelRecipientIdentities.of(
ChannelRecipientIdentity.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class ComposingEndEventDtoTest extends ConversationBaseTest {
@GivenTextResource("domains/conversation/v1/events/types/ComposingEndEventDto.json")
String json;

public static ComposingEndEvent expectedDto = ComposingEndEvent.EMPTY;
public static ComposingEndEvent expectedDto = ComposingEndEvent.COMPOSING_END_EVENT;

@Test
void serialize() throws JsonProcessingException, JSONException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class ComposingEventDtoTest extends ConversationBaseTest {
@GivenTextResource("domains/conversation/v1/events/types/ComposingEventDto.json")
String json;

public static ComposingEvent expectedDto = ComposingEvent.EMPTY;
public static ComposingEvent expectedDto = ComposingEvent.COMPOSING_EVENT;

@Test
void serialize() throws JsonProcessingException, JSONException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ public class ConversationDeletedEventDtoTest extends ConversationBaseTest {
@GivenTextResource("domains/conversation/v1/events/types/ConversationDeletedEventDto.json")
String json;

public static ConversationDeletedEvent expectedDto = ConversationDeletedEvent.EMPTY;
public static ConversationDeletedEvent expectedDto =
ConversationDeletedEvent.CONVERSATION_DELETED_EVENT;

@Test
void serialize() throws JsonProcessingException, JSONException {
Expand Down
Loading
Loading