com.sinch.sdk.domains.conversation.templates.models.v2.TemplateTranslationImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sinch-sdk-java Show documentation
Show all versions of sinch-sdk-java Show documentation
SDK providing a Java API for the Sinch REST APIs.
package com.sinch.sdk.domains.conversation.templates.models.v2;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.sinch.sdk.core.models.OptionalValue;
import com.sinch.sdk.domains.conversation.models.v1.ConversationChannel;
import com.sinch.sdk.domains.conversation.models.v1.messages.AppMessageBody;
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.choice.ChoiceMessage;
import com.sinch.sdk.domains.conversation.models.v1.messages.types.contactinfo.ContactInfoMessage;
import com.sinch.sdk.domains.conversation.models.v1.messages.types.list.ListMessage;
import com.sinch.sdk.domains.conversation.models.v1.messages.types.location.LocationMessage;
import com.sinch.sdk.domains.conversation.models.v1.messages.types.media.MediaMessage;
import com.sinch.sdk.domains.conversation.models.v1.messages.types.template.TemplateMessage;
import com.sinch.sdk.domains.conversation.models.v1.messages.types.text.TextMessage;
import com.sinch.sdk.domains.conversation.templates.models.TemplateVariable;
import java.time.Instant;
import java.util.List;
import java.util.Map;
import java.util.logging.Logger;
public class TemplateTranslationImpl extends TemplateTranslationBaseImpl
implements TemplateTranslation {
private static final Logger LOGGER = Logger.getLogger(TemplateTranslationImpl.class.getName());
TemplateTranslationImpl(TemplateTranslationBase _from) {
super(
((TemplateTranslationBaseImpl) _from).languageCode(),
((TemplateTranslationBaseImpl) _from).version(),
((TemplateTranslationBaseImpl) _from).channelTemplateOverrides(),
((TemplateTranslationBaseImpl) _from).variables(),
((TemplateTranslationBaseImpl) _from).createTime(),
((TemplateTranslationBaseImpl) _from).updateTime(),
((TemplateTranslationBaseImpl) _from).cardMessage(),
((TemplateTranslationBaseImpl) _from).carouselMessage(),
((TemplateTranslationBaseImpl) _from).choiceMessage(),
((TemplateTranslationBaseImpl) _from).locationMessage(),
((TemplateTranslationBaseImpl) _from).mediaMessage(),
((TemplateTranslationBaseImpl) _from).templateMessage(),
((TemplateTranslationBaseImpl) _from).textMessage(),
((TemplateTranslationBaseImpl) _from).listMessage(),
((TemplateTranslationBaseImpl) _from).contactInfoMessage());
}
@JsonIgnore
public AppMessageBody getMessage() {
if (cardMessage().isPresent()) {
return cardMessage().get();
} else if (carouselMessage().isPresent()) {
return carouselMessage().get();
} else if (choiceMessage().isPresent()) {
return choiceMessage().get();
} else if (contactInfoMessage().isPresent()) {
return contactInfoMessage().get();
} else if (listMessage().isPresent()) {
return listMessage().get();
} else if (locationMessage().isPresent()) {
return locationMessage().get();
} else if (mediaMessage().isPresent()) {
return mediaMessage().get();
} else if (templateMessage().isPresent()) {
return templateMessage().get();
} else if (textMessage().isPresent()) {
return textMessage().get();
}
return null;
}
protected TemplateTranslationImpl(
OptionalValue languageCode,
OptionalValue version,
OptionalValue
© 2015 - 2024 Weber Informatics LLC | Privacy Policy