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
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class TemplatesV2ServiceTest extends TemplatesBaseTest {
@GivenTextResource("/domains/conversation/templates/v2/request/TemplateV2RequestDto.json")
String jsonTemplateV2RequestDto;

@GivenTextResource("/domains/conversation/templates/v2/TemplateV2Dto.json")
@GivenTextResource("/domains/conversation/templates/v2/response/TemplateV2ResponseDto.json")
String jsonTemplateV2Dto;

@GivenTextResource("/domains/conversation/templates/v2/response/TemplatesV2ListResponseDto.json")
Expand Down Expand Up @@ -96,9 +96,9 @@ void create() throws ApiException {
argThat(new HttpRequestMatcher(httpRequest))))
.thenReturn(httpResponse);

TemplateV2 response = service.create(TemplateV2DtoTest.expectedDto);
TemplateV2 response = service.create(TemplateV2DtoTest.expectedRequestDto);

TestHelpers.recursiveEquals(response, TemplateV2DtoTest.expectedDto);
TestHelpers.recursiveEquals(response, TemplateV2DtoTest.expectedResponseDto);
}

@Test
Expand All @@ -109,7 +109,7 @@ void get() throws ApiException {
String.format(
"/v2/projects/%s/templates/%s",
URLPathUtils.encodePathSegment(uriPartID),
URLPathUtils.encodePathSegment(TemplateV2DtoTest.expectedDto.getId())),
URLPathUtils.encodePathSegment(TemplateV2DtoTest.expectedRequestDto.getId())),
HttpMethod.GET,
Collections.emptyList(),
(String) null,
Expand All @@ -126,9 +126,9 @@ void get() throws ApiException {
argThat(new HttpRequestMatcher(httpRequest))))
.thenReturn(httpResponse);

TemplateV2 response = service.get(TemplateV2DtoTest.expectedDto.getId());
TemplateV2 response = service.get(TemplateV2DtoTest.expectedRequestDto.getId());

TestHelpers.recursiveEquals(response, TemplateV2DtoTest.expectedDto);
TestHelpers.recursiveEquals(response, TemplateV2DtoTest.expectedResponseDto);
}

@Test
Expand Down Expand Up @@ -178,7 +178,7 @@ void listTranslations() throws ApiException {
String.format(
"/v2/projects/%s/templates/%s/translations",
URLPathUtils.encodePathSegment(uriPartID),
URLPathUtils.encodePathSegment(TemplateV2DtoTest.expectedDto.getId())),
URLPathUtils.encodePathSegment(TemplateV2DtoTest.expectedRequestDto.getId())),
HttpMethod.GET,
Collections.emptyList(),
(String) null,
Expand All @@ -197,7 +197,7 @@ void listTranslations() throws ApiException {
.thenReturn(httpResponse);

TranslationsV2ListResponse response =
service.listTranslations(TemplateV2DtoTest.expectedDto.getId());
service.listTranslations(TemplateV2DtoTest.expectedRequestDto.getId());
Iterator<TemplateTranslation> iterator = response.iterator();

TranslationsV2ListResponse expectedListResponse =
Expand All @@ -221,7 +221,7 @@ void listTranslationsWithParameters() throws ApiException {
String.format(
"/v2/projects/%s/templates/%s/translations",
URLPathUtils.encodePathSegment(uriPartID),
URLPathUtils.encodePathSegment(TemplateV2DtoTest.expectedDto.getId())),
URLPathUtils.encodePathSegment(TemplateV2DtoTest.expectedRequestDto.getId())),
HttpMethod.GET,
Arrays.asList(
new URLParameter("language_code", "language code", STYLE.FORM, true),
Expand All @@ -243,7 +243,7 @@ void listTranslationsWithParameters() throws ApiException {

TranslationsV2ListResponse response =
service.listTranslations(
TemplateV2DtoTest.expectedDto.getId(),
TemplateV2DtoTest.expectedRequestDto.getId(),
ListTranslationsQueryParameters.builder()
.setLanguageCode("language code")
.setTranslationVersion("translation version")
Expand Down Expand Up @@ -271,7 +271,7 @@ void update() throws ApiException {
String.format(
"/v2/projects/%s/templates/%s",
URLPathUtils.encodePathSegment(uriPartID),
URLPathUtils.encodePathSegment(TemplateV2DtoTest.expectedDto.getId())),
URLPathUtils.encodePathSegment(TemplateV2DtoTest.expectedRequestDto.getId())),
HttpMethod.PUT,
Collections.emptyList(),
jsonTemplateV2RequestDto,
Expand All @@ -289,9 +289,10 @@ void update() throws ApiException {
.thenReturn(httpResponse);

TemplateV2 response =
service.update(TemplateV2DtoTest.expectedDto.getId(), TemplateV2DtoTest.expectedDto);
service.update(
TemplateV2DtoTest.expectedRequestDto.getId(), TemplateV2DtoTest.expectedRequestDto);

TestHelpers.recursiveEquals(response, TemplateV2DtoTest.expectedDto);
TestHelpers.recursiveEquals(response, TemplateV2DtoTest.expectedResponseDto);
}

@Test
Expand All @@ -302,7 +303,7 @@ void delete() throws ApiException {
String.format(
"/v2/projects/%s/templates/%s",
URLPathUtils.encodePathSegment(uriPartID),
URLPathUtils.encodePathSegment(TemplateV2DtoTest.expectedDto.getId())),
URLPathUtils.encodePathSegment(TemplateV2DtoTest.expectedRequestDto.getId())),
HttpMethod.DELETE,
Collections.emptyList(),
(String) null,
Expand All @@ -318,6 +319,6 @@ void delete() throws ApiException {
argThat(new HttpRequestMatcher(httpRequest))))
.thenReturn(httpResponse);

service.delete(TemplateV2DtoTest.expectedDto.getId());
service.delete(TemplateV2DtoTest.expectedResponseDto.getId());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
/**
* This object contains additional settings related to <a
* href="https://developers.sinch.com/docs/conversation/keyconcepts/#delivery-report-base-message-fallback">delivery
* report based fallback</a>. Note that this <strong>paid</strong> functionality is available for
* open beta testing.
* report based fallback</a>. Note that this is <strong>paid</strong> functionality.
*/
@JsonDeserialize(builder = DeliveryReportBasedFallbackImpl.Builder.class)
public interface DeliveryReportBasedFallback {
Expand All @@ -34,7 +33,11 @@ public interface DeliveryReportBasedFallback {

/**
* Optional. The time, in seconds, after which a message without a positive delivery report will
* fallback to the next channel. The valid values for this field are [60 - 259200].
* fallback to the next channel.
*
* <p><b>Minimum</b>: 10
*
* <p><b>Maximum</b>: 259200
*
* @return deliveryReportWaitingTime
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ public interface AuditRecord {
* an end-user MO).
*/
public class OriginEnum extends EnumDynamic<String, OriginEnum> {
/** The opt-in or opt-out came from the API. */
public static final OriginEnum ORIGIN_API = new OriginEnum("ORIGIN_API");

/** The opt-in or optout came from an MO. */
public static final OriginEnum ORIGIN_MO = new OriginEnum("ORIGIN_MO");

private static final EnumSupportDynamic<String, OriginEnum> ENUM_SUPPORT =
Expand Down Expand Up @@ -63,8 +66,13 @@ public static String valueOf(OriginEnum e) {

/** The operation that the audit record refers to. Can be INSERT, UPDATE or DELETE. */
public class OperationEnum extends EnumDynamic<String, OperationEnum> {
/** The Insert operation */
public static final OperationEnum OPERATION_INSERT = new OperationEnum("OPERATION_INSERT");

/** The Update operation */
public static final OperationEnum OPERATION_UPDATE = new OperationEnum("OPERATION_UPDATE");

/** The Delete operation */
public static final OperationEnum OPERATION_DELETE = new OperationEnum("OPERATION_DELETE");

private static final EnumSupportDynamic<String, OperationEnum> ENUM_SUPPORT =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ public interface RecentConversationsListQueryParameters {

/** Gets or Sets order */
public class OrderEnum extends EnumDynamic<String, OrderEnum> {
/** Ascending order. Oldest first. */
public static final OrderEnum ASC = new OrderEnum("ASC");

/** Descending order. Newest first. */
public static final OrderEnum DESC = new OrderEnum("DESC");

private static final EnumSupportDynamic<String, OrderEnum> ENUM_SUPPORT =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ public interface ConversationChannelCredentials {
* case in which there are multiple credential integrations per channel on a single app, this
* field must have a unique value for each multi-credential channel entry.
*
* <p>minimum: 0 maximum: 255
* <p><b>Minimum</b>: 0
*
* <p><b>Maximum</b>: 255
*
* @return credentialOrdinalNumber
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,16 @@ public interface ClientCredentials {
* <code>BASIC</code> is used by default.
*/
public class TokenRequestTypeEnum extends EnumDynamic<String, TokenRequestTypeEnum> {
/**
* Sent using the HTTP Authorization header (Basic auth). In this case, <code>client_id</code>
* and <code>client_secret</code> are NOT included in the form body.
*/
public static final TokenRequestTypeEnum BASIC = new TokenRequestTypeEnum("BASIC");

/**
* Sent in the form body as <code>client_id</code> and <code>client_secret</code>. No
* Authorization header is added.
*/
public static final TokenRequestTypeEnum FORM = new TokenRequestTypeEnum("FORM");

private static final EnumSupportDynamic<String, TokenRequestTypeEnum> ENUM_SUPPORT =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ public interface CommentEvent

/** Either LIVE or FEED. Indicates the type of media on which the comment was made. */
public class CommentTypeEnum extends EnumDynamic<String, CommentTypeEnum> {
/** A comment was made on a Feed post. */
public static final CommentTypeEnum FEED = new CommentTypeEnum("FEED");

/** A comment was made during a Live. */
public static final CommentTypeEnum LIVE = new CommentTypeEnum("LIVE");

private static final EnumSupportDynamic<String, CommentTypeEnum> ENUM_SUPPORT =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ public interface CommentEventInternal {

/** Either LIVE or FEED. Indicates the type of media on which the comment was made. */
public class CommentTypeEnum extends EnumDynamic<String, CommentTypeEnum> {
/** A comment was made on a Feed post. */
public static final CommentTypeEnum FEED = new CommentTypeEnum("FEED");

/** A comment was made during a Live. */
public static final CommentTypeEnum LIVE = new CommentTypeEnum("LIVE");

private static final EnumSupportDynamic<String, CommentTypeEnum> ENUM_SUPPORT =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,23 @@ public interface ChannelSpecificMessageInternal {

/** The type of the channel specific message. */
public class MessageTypeEnum extends EnumDynamic<String, MessageTypeEnum> {
/** The WhatsApp Flows message type. */
public static final MessageTypeEnum FLOWS = new MessageTypeEnum("FLOWS");

/** The WhatsApp order details message type. */
public static final MessageTypeEnum ORDER_DETAILS = new MessageTypeEnum("ORDER_DETAILS");

/** The WhatsApp order status message type. */
public static final MessageTypeEnum ORDER_STATUS = new MessageTypeEnum("ORDER_STATUS");

/** KakaoTalk commerce channel specific message type */
public static final MessageTypeEnum COMMERCE = new MessageTypeEnum("COMMERCE");

/** KakaoTalk carousel commerce channel specific message type */
public static final MessageTypeEnum CAROUSEL_COMMERCE =
new MessageTypeEnum("CAROUSEL_COMMERCE");

/** LINE notification message template type */
public static final MessageTypeEnum NOTIFICATION_MESSAGE_TEMPLATE =
new MessageTypeEnum("NOTIFICATION_MESSAGE_TEMPLATE");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public interface ChannelSpecificContactMessage

/** The message type. */
public class MessageTypeEnum extends EnumDynamic<String, MessageTypeEnum> {
/** The <code>nfm_reply</code> message type. */
public static final MessageTypeEnum NFM_REPLY = new MessageTypeEnum("nfm_reply");

private static final EnumSupportDynamic<String, MessageTypeEnum> ENUM_SUPPORT =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public interface DiscountFixedCommerce

/** Gets or Sets type */
public class TypeEnum extends EnumDynamic<String, TypeEnum> {
/** Commerce with fixed discount */
public static final TypeEnum FIXED_DISCOUNT_COMMERCE = new TypeEnum("FIXED_DISCOUNT_COMMERCE");

private static final EnumSupportDynamic<String, TypeEnum> ENUM_SUPPORT =
Expand Down Expand Up @@ -59,9 +60,9 @@ public static String valueOf(TypeEnum e) {
/**
* Regular price of the product
*
* <p>minimum: 0 maximum: 99999999
* <p><b>Minimum</b>: 0
*
* <p>Field is required
* <p><b>Maximum</b>: 99999999 Field is required
*
* @return regularPrice
*/
Expand All @@ -70,9 +71,9 @@ public static String valueOf(TypeEnum e) {
/**
* Discounted price of the product
*
* <p>minimum: 0 maximum: 99999999
* <p><b>Minimum</b>: 0
*
* <p>Field is required
* <p><b>Maximum</b>: 99999999 Field is required
*
* @return discountPrice
*/
Expand All @@ -81,9 +82,9 @@ public static String valueOf(TypeEnum e) {
/**
* Fixed discount
*
* <p>minimum: 0 maximum: 999999
* <p><b>Minimum</b>: 0
*
* <p>Field is required
* <p><b>Maximum</b>: 999999 Field is required
*
* @return discountFixed
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public interface DiscountRateCommerce

/** Gets or Sets type */
public class TypeEnum extends EnumDynamic<String, TypeEnum> {
/** Commerce with percentage discount */
public static final TypeEnum PERCENTAGE_DISCOUNT_COMMERCE =
new TypeEnum("PERCENTAGE_DISCOUNT_COMMERCE");

Expand Down Expand Up @@ -60,9 +61,9 @@ public static String valueOf(TypeEnum e) {
/**
* Regular price of the product
*
* <p>minimum: 0 maximum: 99999999
* <p><b>Minimum</b>: 0
*
* <p>Field is required
* <p><b>Maximum</b>: 99999999 Field is required
*
* @return regularPrice
*/
Expand All @@ -71,9 +72,9 @@ public static String valueOf(TypeEnum e) {
/**
* Discounted price of the product
*
* <p>minimum: 0 maximum: 99999999
* <p><b>Minimum</b>: 0
*
* <p>Field is required
* <p><b>Maximum</b>: 99999999 Field is required
*
* @return discountPrice
*/
Expand All @@ -82,9 +83,9 @@ public static String valueOf(TypeEnum e) {
/**
* Discount rate (%)
*
* <p>minimum: 0 maximum: 100
* <p><b>Minimum</b>: 0
*
* <p>Field is required
* <p><b>Maximum</b>: 100 Field is required
*
* @return discountRate
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public interface RegularPriceCommerce

/** Gets or Sets type */
public class TypeEnum extends EnumDynamic<String, TypeEnum> {
/** Commerce with regular price */
public static final TypeEnum REGULAR_PRICE_COMMERCE = new TypeEnum("REGULAR_PRICE_COMMERCE");

private static final EnumSupportDynamic<String, TypeEnum> ENUM_SUPPORT =
Expand Down Expand Up @@ -59,9 +60,9 @@ public static String valueOf(TypeEnum e) {
/**
* Regular price of the product
*
* <p>minimum: 0 maximum: 99999999
* <p><b>Minimum</b>: 0
*
* <p>Field is required
* <p><b>Maximum</b>: 99999999 Field is required
*
* @return regularPrice
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ public static String valueOf(TypeEnum e) {
/**
* Fixed discount
*
* <p>minimum: 0 maximum: 999999
* <p><b>Minimum</b>: 0
*
* <p>Field is required
* <p><b>Maximum</b>: 999999 Field is required
*
* @return discountFixed
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ public static String valueOf(TypeEnum e) {
/**
* Discount rate (%)
*
* <p>minimum: 0 maximum: 100
* <p><b>Minimum</b>: 0
*
* <p>Field is required
* <p><b>Maximum</b>: 100 Field is required
*
* @return discountRate
*/
Expand Down
Loading
Loading