Skip to content

Commit

Permalink
feat (SMS/Batches): Generated files
Browse files Browse the repository at this point in the history
  • Loading branch information
JPPortier committed Dec 16, 2024
1 parent 858ea5e commit 59753f2
Show file tree
Hide file tree
Showing 32 changed files with 9,897 additions and 0 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
package com.sinch.sdk.domains.sms.models.v1.batches;

import com.sinch.sdk.core.utils.EnumDynamic;
import com.sinch.sdk.core.utils.EnumSupportDynamic;
import java.util.Arrays;
import java.util.stream.Stream;

/** Kind of delivery report */
public class DeliveryReportType extends EnumDynamic<String, DeliveryReportType> {

/** No delivery report callback will be sent. */
public static final DeliveryReportType NONE = new DeliveryReportType("none");

/** A single delivery report callback will be sent. */
public static final DeliveryReportType SUMMARY = new DeliveryReportType("summary");

/**
* A single delivery report callback will be sent which includes a list of recipients per delivery
* status.
*/
public static final DeliveryReportType FULL = new DeliveryReportType("full");

/**
* A delivery report callback will be sent for each status change of a message. This could result
* in a lot of callbacks and should be <strong>used with caution for larger batches</strong>.
* These delivery reports also include a timestamp of when the Delivery Report originated from the
* SMSC.
*/
public static final DeliveryReportType PER_RECIPIENT = new DeliveryReportType("per_recipient");

/**
* A delivery report callback representing the final status of a message will be sent for each
* recipient. This will send only one callback per recipient, compared to the multiple callbacks
* sent when using <code>per_recipient</code>. The delivery report will also include a timestamp
* of when it originated from the SMSC.
*/
public static final DeliveryReportType PER_RECIPIENT_FINAL =
new DeliveryReportType("per_recipient_final");

private static final EnumSupportDynamic<String, DeliveryReportType> ENUM_SUPPORT =
new EnumSupportDynamic<>(
DeliveryReportType.class,
DeliveryReportType::new,
Arrays.asList(NONE, SUMMARY, FULL, PER_RECIPIENT, PER_RECIPIENT_FINAL));

private DeliveryReportType(String value) {
super(value);
}

public static Stream<DeliveryReportType> values() {
return ENUM_SUPPORT.values();
}

public static DeliveryReportType from(String value) {
return ENUM_SUPPORT.from(value);
}

public static String valueOf(DeliveryReportType e) {
return ENUM_SUPPORT.valueOf(e);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/*
* API Overview | Sinch
*
* OpenAPI document version: v1
* Contact: Support@sinch.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit the class manually.
*/

package com.sinch.sdk.domains.sms.models.v1.batches;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;

/** The message content, including a URL to the media file */
@JsonDeserialize(builder = MediaBodyImpl.Builder.class)
public interface MediaBody {

/**
* The subject text
*
* @return subject
*/
String getSubject();

/**
* The message text. Text only media messages will be rejected, please use SMS instead.
*
* @return message
*/
String getMessage();

/**
* URL to the media file
*
* @return url
*/
String getUrl();

/**
* Getting builder
*
* @return New Builder instance
*/
static Builder builder() {
return new MediaBodyImpl.Builder();
}

/** Dedicated Builder */
interface Builder {

/**
* see getter
*
* @param subject see getter
* @return Current builder
* @see #getSubject
*/
Builder setSubject(String subject);

/**
* see getter
*
* @param message see getter
* @return Current builder
* @see #getMessage
*/
Builder setMessage(String message);

/**
* see getter
*
* @param url see getter
* @return Current builder
* @see #getUrl
*/
Builder setUrl(String url);

/**
* Create instance
*
* @return The instance build with current builder values
*/
MediaBody build();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
package com.sinch.sdk.domains.sms.models.v1.batches;

import com.fasterxml.jackson.annotation.JsonFilter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
import com.sinch.sdk.core.models.OptionalValue;
import java.util.Objects;

@JsonPropertyOrder({
MediaBodyImpl.JSON_PROPERTY_SUBJECT,
MediaBodyImpl.JSON_PROPERTY_MESSAGE,
MediaBodyImpl.JSON_PROPERTY_URL
})
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class MediaBodyImpl implements MediaBody {
private static final long serialVersionUID = 1L;

public static final String JSON_PROPERTY_SUBJECT = "subject";

private OptionalValue<String> subject;

public static final String JSON_PROPERTY_MESSAGE = "message";

private OptionalValue<String> message;

public static final String JSON_PROPERTY_URL = "url";

private OptionalValue<String> url;

public MediaBodyImpl() {}

protected MediaBodyImpl(
OptionalValue<String> subject, OptionalValue<String> message, OptionalValue<String> url) {
this.subject = subject;
this.message = message;
this.url = url;
}

@JsonIgnore
public String getSubject() {
return subject.orElse(null);
}

@JsonProperty(JSON_PROPERTY_SUBJECT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public OptionalValue<String> subject() {
return subject;
}

@JsonIgnore
public String getMessage() {
return message.orElse(null);
}

@JsonProperty(JSON_PROPERTY_MESSAGE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public OptionalValue<String> message() {
return message;
}

@JsonIgnore
public String getUrl() {
return url.orElse(null);
}

@JsonProperty(JSON_PROPERTY_URL)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public OptionalValue<String> url() {
return url;
}

/** Return true if this MediaBody object is equal to o. */
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
MediaBodyImpl mediaBody = (MediaBodyImpl) o;
return Objects.equals(this.subject, mediaBody.subject)
&& Objects.equals(this.message, mediaBody.message)
&& Objects.equals(this.url, mediaBody.url);
}

@Override
public int hashCode() {
return Objects.hash(subject, message, url);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class MediaBodyImpl {\n");
sb.append(" subject: ").append(toIndentedString(subject)).append("\n");
sb.append(" message: ").append(toIndentedString(message)).append("\n");
sb.append(" url: ").append(toIndentedString(url)).append("\n");
sb.append("}");
return sb.toString();
}

/**
* Convert the given object to string with each line indented by 4 spaces (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}

@JsonPOJOBuilder(withPrefix = "set")
static class Builder implements MediaBody.Builder {
OptionalValue<String> subject = OptionalValue.empty();
OptionalValue<String> message = OptionalValue.empty();
OptionalValue<String> url = OptionalValue.empty();

@JsonProperty(JSON_PROPERTY_SUBJECT)
public Builder setSubject(String subject) {
this.subject = OptionalValue.of(subject);
return this;
}

@JsonProperty(JSON_PROPERTY_MESSAGE)
public Builder setMessage(String message) {
this.message = OptionalValue.of(message);
return this;
}

@JsonProperty(JSON_PROPERTY_URL)
public Builder setUrl(String url) {
this.url = OptionalValue.of(url);
return this;
}

public MediaBody build() {
return new MediaBodyImpl(subject, message, url);
}
}
}
Loading

0 comments on commit 59753f2

Please sign in to comment.