Skip to content

Commit

Permalink
refactor (SMS/Batches): Generated files update
Browse files Browse the repository at this point in the history
  • Loading branch information
JPPortier committed Dec 17, 2024
1 parent 79fa747 commit 0a20f75
Show file tree
Hide file tree
Showing 17 changed files with 229 additions and 228 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -761,8 +761,8 @@ private HttpRequest sendSMSRequestBuilder(
}

/**
* Update a Batch message This operation updates all specified parameters of a batch that matches
* the provided batch ID.
* Update a BatchResponse message This operation updates all specified parameters of a batch that
* matches the provided batch ID.
*
* @param servicePlanId Your service plan ID. You can find this on your
* [Dashboard](https://dashboard.sinch.com/sms/api/rest). (required)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import com.sinch.sdk.domains.sms.models.v1.batches.request.BatchRequest;
import com.sinch.sdk.domains.sms.models.v1.batches.request.SendDeliveryFeedbackRequest;
import com.sinch.sdk.domains.sms.models.v1.batches.request.UpdateBatchRequest;
import com.sinch.sdk.domains.sms.models.v1.batches.response.Batch;
import com.sinch.sdk.domains.sms.models.v1.batches.response.BatchResponse;
import com.sinch.sdk.domains.sms.models.v1.batches.response.DryRunResponse;
import com.sinch.sdk.domains.sms.models.v1.batches.response.internal.ApiBatchList;
import java.util.ArrayList;
Expand Down Expand Up @@ -69,10 +69,10 @@ public BatchesApi(
* report.
*
* @param batchId The batch ID you received from sending a message. (required)
* @return Batch
* @return BatchResponse
* @throws ApiException if fails to make API call
*/
public Batch cancel(String batchId) throws ApiException {
public BatchResponse cancel(String batchId) throws ApiException {

LOGGER.finest(
"[cancel]"
Expand All @@ -89,7 +89,7 @@ public Batch cancel(String batchId) throws ApiException {
this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest);

if (HttpStatus.isSuccessfulStatus(response.getCode())) {
TypeReference<Batch> localVarReturnType = new TypeReference<Batch>() {};
TypeReference<BatchResponse> localVarReturnType = new TypeReference<BatchResponse>() {};
return mapper.deserialize(response, localVarReturnType);
}
// fallback to default errors handling:
Expand Down Expand Up @@ -247,10 +247,10 @@ private HttpRequest dryRunRequestBuilder(
* Get a batch message This operation returns a specific batch that matches the provided batch ID.
*
* @param batchId The batch ID you received from sending a message. (required)
* @return Batch
* @return BatchResponse
* @throws ApiException if fails to make API call
*/
public Batch get(String batchId) throws ApiException {
public BatchResponse get(String batchId) throws ApiException {

LOGGER.finest(
"[get]" + " " + "this.servicePlanId: " + this.servicePlanId + ", " + "batchId: " + batchId);
Expand All @@ -261,7 +261,7 @@ public Batch get(String batchId) throws ApiException {
this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest);

if (HttpStatus.isSuccessfulStatus(response.getCode())) {
TypeReference<Batch> localVarReturnType = new TypeReference<Batch>() {};
TypeReference<BatchResponse> localVarReturnType = new TypeReference<BatchResponse>() {};
return mapper.deserialize(response, localVarReturnType);
}
// fallback to default errors handling:
Expand Down Expand Up @@ -463,10 +463,10 @@ private HttpRequest listRequestBuilder(
*
* @param batchId The batch ID you received from sending a message. (required)
* @param sendRequest (optional)
* @return Batch
* @return BatchResponse
* @throws ApiException if fails to make API call
*/
public Batch replace(String batchId, BatchRequest sendRequest) throws ApiException {
public BatchResponse replace(String batchId, BatchRequest sendRequest) throws ApiException {

LOGGER.finest(
"[replace]"
Expand All @@ -486,7 +486,7 @@ public Batch replace(String batchId, BatchRequest sendRequest) throws ApiExcepti
this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest);

if (HttpStatus.isSuccessfulStatus(response.getCode())) {
TypeReference<Batch> localVarReturnType = new TypeReference<Batch>() {};
TypeReference<BatchResponse> localVarReturnType = new TypeReference<BatchResponse>() {};
return mapper.deserialize(response, localVarReturnType);
}
// fallback to default errors handling:
Expand Down Expand Up @@ -648,10 +648,10 @@ private HttpRequest sendDeliveryFeedbackRequestBuilder(
* [region](/docs/sms/api-reference/#base-url) in the server URL.
*
* @param sendRequest Default schema is Text if type is not specified. (optional)
* @return Batch
* @return BatchResponse
* @throws ApiException if fails to make API call
*/
public Batch send(BatchRequest sendRequest) throws ApiException {
public BatchResponse send(BatchRequest sendRequest) throws ApiException {

LOGGER.finest(
"[send]"
Expand All @@ -668,7 +668,7 @@ public Batch send(BatchRequest sendRequest) throws ApiException {
this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest);

if (HttpStatus.isSuccessfulStatus(response.getCode())) {
TypeReference<Batch> localVarReturnType = new TypeReference<Batch>() {};
TypeReference<BatchResponse> localVarReturnType = new TypeReference<BatchResponse>() {};
return mapper.deserialize(response, localVarReturnType);
}
// fallback to default errors handling:
Expand Down Expand Up @@ -721,10 +721,11 @@ private HttpRequest sendRequestBuilder(BatchRequest sendRequest) throws ApiExcep
*
* @param batchId The batch ID you received from sending a message. (required)
* @param updateBatchRequest (optional)
* @return Batch
* @return BatchResponse
* @throws ApiException if fails to make API call
*/
public Batch update(String batchId, UpdateBatchRequest updateBatchRequest) throws ApiException {
public BatchResponse update(String batchId, UpdateBatchRequest updateBatchRequest)
throws ApiException {

LOGGER.finest(
"[update]"
Expand All @@ -744,7 +745,7 @@ public Batch update(String batchId, UpdateBatchRequest updateBatchRequest) throw
this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest);

if (HttpStatus.isSuccessfulStatus(response.getCode())) {
TypeReference<Batch> localVarReturnType = new TypeReference<Batch>() {};
TypeReference<BatchResponse> localVarReturnType = new TypeReference<BatchResponse>() {};
return mapper.deserialize(response, localVarReturnType);
}
// fallback to default errors handling:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

/** Update binary message */
@JsonDeserialize(builder = UpdateBinaryRequestImpl.Builder.class)
public interface UpdateBinaryRequest extends UpdateBatchRequest, BatchRequest {
public interface UpdateBinaryRequest extends UpdateBatchRequest {

/**
* Sender number. Must be valid phone number, short code or alphanumeric.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@
})
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class UpdateBinaryRequestImpl
implements UpdateBinaryRequest, UpdateBatchRequest, BatchRequest {
public class UpdateBinaryRequestImpl implements UpdateBinaryRequest, UpdateBatchRequest {
private static final long serialVersionUID = 1L;

public static final String JSON_PROPERTY_FROM = "from";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

/** Update media message */
@JsonDeserialize(builder = UpdateMediaRequestImpl.Builder.class)
public interface UpdateMediaRequest extends UpdateBatchRequest, BatchRequest {
public interface UpdateMediaRequest extends UpdateBatchRequest {

/**
* Sender number. Must be valid phone number, short code or alphanumeric.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
})
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class UpdateMediaRequestImpl
implements UpdateMediaRequest, UpdateBatchRequest, BatchRequest {
public class UpdateMediaRequestImpl implements UpdateMediaRequest, UpdateBatchRequest {
private static final long serialVersionUID = 1L;

public static final String JSON_PROPERTY_FROM = "from";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

/** Update text message */
@JsonDeserialize(builder = UpdateTextRequestImpl.Builder.class)
public interface UpdateTextRequest extends UpdateBatchRequest, BatchRequest {
public interface UpdateTextRequest extends UpdateBatchRequest {

/**
* Sender number. Must be valid phone number, short code or alphanumeric.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
})
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class UpdateTextRequestImpl implements UpdateTextRequest, UpdateBatchRequest, BatchRequest {
public class UpdateTextRequestImpl implements UpdateTextRequest, UpdateBatchRequest {
private static final long serialVersionUID = 1L;

public static final String JSON_PROPERTY_FROM = "from";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
import java.util.List;
import java.util.stream.Stream;

/** BatchBinary */
@JsonDeserialize(builder = BatchBinaryImpl.Builder.class)
public interface BatchBinary extends Batch {
/** BinaryResponse */
@JsonDeserialize(builder = BinaryResponseImpl.Builder.class)
public interface BinaryResponse extends BatchResponse {

/**
* Unique identifier for batch.
Expand Down Expand Up @@ -190,7 +190,7 @@ public static String valueOf(TypeEnum e) {
* @return New Builder instance
*/
static Builder builder() {
return new BatchBinaryImpl.Builder();
return new BinaryResponseImpl.Builder();
}

/** Dedicated Builder */
Expand Down Expand Up @@ -349,6 +349,6 @@ interface Builder {
*
* @return The instance build with current builder values
*/
BatchBinary build();
BinaryResponse build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,27 @@
import java.util.Objects;

@JsonPropertyOrder({
BatchBinaryImpl.JSON_PROPERTY_ID,
BatchBinaryImpl.JSON_PROPERTY_TO,
BatchBinaryImpl.JSON_PROPERTY_FROM,
BatchBinaryImpl.JSON_PROPERTY_CANCELED,
BatchBinaryImpl.JSON_PROPERTY_BODY,
BatchBinaryImpl.JSON_PROPERTY_UDH,
BatchBinaryImpl.JSON_PROPERTY_TYPE,
BatchBinaryImpl.JSON_PROPERTY_CREATED_AT,
BatchBinaryImpl.JSON_PROPERTY_MODIFIED_AT,
BatchBinaryImpl.JSON_PROPERTY_DELIVERY_REPORT,
BatchBinaryImpl.JSON_PROPERTY_SEND_AT,
BatchBinaryImpl.JSON_PROPERTY_EXPIRE_AT,
BatchBinaryImpl.JSON_PROPERTY_CALLBACK_URL,
BatchBinaryImpl.JSON_PROPERTY_CLIENT_REFERENCE,
BatchBinaryImpl.JSON_PROPERTY_FEEDBACK_ENABLED,
BatchBinaryImpl.JSON_PROPERTY_FROM_TON,
BatchBinaryImpl.JSON_PROPERTY_FROM_NPI
BinaryResponseImpl.JSON_PROPERTY_ID,
BinaryResponseImpl.JSON_PROPERTY_TO,
BinaryResponseImpl.JSON_PROPERTY_FROM,
BinaryResponseImpl.JSON_PROPERTY_CANCELED,
BinaryResponseImpl.JSON_PROPERTY_BODY,
BinaryResponseImpl.JSON_PROPERTY_UDH,
BinaryResponseImpl.JSON_PROPERTY_TYPE,
BinaryResponseImpl.JSON_PROPERTY_CREATED_AT,
BinaryResponseImpl.JSON_PROPERTY_MODIFIED_AT,
BinaryResponseImpl.JSON_PROPERTY_DELIVERY_REPORT,
BinaryResponseImpl.JSON_PROPERTY_SEND_AT,
BinaryResponseImpl.JSON_PROPERTY_EXPIRE_AT,
BinaryResponseImpl.JSON_PROPERTY_CALLBACK_URL,
BinaryResponseImpl.JSON_PROPERTY_CLIENT_REFERENCE,
BinaryResponseImpl.JSON_PROPERTY_FEEDBACK_ENABLED,
BinaryResponseImpl.JSON_PROPERTY_FROM_TON,
BinaryResponseImpl.JSON_PROPERTY_FROM_NPI
})
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class BatchBinaryImpl implements BatchBinary, Batch {
public class BinaryResponseImpl implements BinaryResponse, BatchResponse {
private static final long serialVersionUID = 1L;

public static final String JSON_PROPERTY_ID = "id";
Expand Down Expand Up @@ -104,9 +104,9 @@ public class BatchBinaryImpl implements BatchBinary, Batch {

private OptionalValue<Integer> fromNpi;

public BatchBinaryImpl() {}
public BinaryResponseImpl() {}

protected BatchBinaryImpl(
protected BinaryResponseImpl(
OptionalValue<String> id,
OptionalValue<List<String>> to,
OptionalValue<String> from,
Expand Down Expand Up @@ -335,7 +335,7 @@ public boolean equals(Object o) {
if (o == null || getClass() != o.getClass()) {
return false;
}
BatchBinaryImpl binaryResponse = (BatchBinaryImpl) o;
BinaryResponseImpl binaryResponse = (BinaryResponseImpl) o;
return Objects.equals(this.id, binaryResponse.id)
&& Objects.equals(this.to, binaryResponse.to)
&& Objects.equals(this.from, binaryResponse.from)
Expand Down Expand Up @@ -380,7 +380,7 @@ public int hashCode() {
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class BatchBinaryImpl {\n");
sb.append("class BinaryResponseImpl {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" to: ").append(toIndentedString(to)).append("\n");
sb.append(" from: ").append(toIndentedString(from)).append("\n");
Expand Down Expand Up @@ -413,7 +413,7 @@ private String toIndentedString(Object o) {
}

@JsonPOJOBuilder(withPrefix = "set")
static class Builder implements BatchBinary.Builder {
static class Builder implements BinaryResponse.Builder {
OptionalValue<String> id = OptionalValue.empty();
OptionalValue<List<String>> to = OptionalValue.empty();
OptionalValue<String> from = OptionalValue.empty();
Expand Down Expand Up @@ -528,8 +528,8 @@ public Builder setFromNpi(Integer fromNpi) {
return this;
}

public BatchBinary build() {
return new BatchBinaryImpl(
public BinaryResponse build() {
return new BinaryResponseImpl(
id,
to,
from,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
import java.util.Map;
import java.util.stream.Stream;

/** BatchMedia */
@JsonDeserialize(builder = BatchMediaImpl.Builder.class)
public interface BatchMedia extends Batch {
/** MediaResponse */
@JsonDeserialize(builder = MediaResponseImpl.Builder.class)
public interface MediaResponse extends BatchResponse {

/**
* Unique identifier for batch
Expand Down Expand Up @@ -176,7 +176,7 @@ public static String valueOf(TypeEnum e) {
* @return New Builder instance
*/
static Builder builder() {
return new BatchMediaImpl.Builder();
return new MediaResponseImpl.Builder();
}

/** Dedicated Builder */
Expand Down Expand Up @@ -326,6 +326,6 @@ interface Builder {
*
* @return The instance build with current builder values
*/
BatchMedia build();
MediaResponse build();
}
}
Loading

0 comments on commit 0a20f75

Please sign in to comment.