Skip to content
Open
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
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,3 @@ hs_err_pid*
target
.gradle
build

.env
gpg-key.b64
5 changes: 4 additions & 1 deletion api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -170,21 +170,24 @@ components:
type: string
required:
- body
- to
sms_send_200_response:
example:
organizationId: organizationId
idempotencyKey: idempotencyKey
accepted: ""
messageId: messageId
properties:
accepted: {}
messageId:
type: string
idempotencyKey:
type: string
organizationId:
type: string
required:
- accepted
- idempotencyKey
- messageId
- organizationId
sms_get_200_response:
example:
Expand Down
1 change: 1 addition & 0 deletions docs/SmsSend200Response.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**accepted** | **Object** | | |
|**messageId** | **String** | | |
|**idempotencyKey** | **String** | | |
|**organizationId** | **String** | | |

Expand Down
2 changes: 1 addition & 1 deletion docs/SmsSendRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**to** | **String** | | |
|**to** | **String** | | [optional] |
|**from** | **String** | | [optional] |
|**body** | **String** | | |
|**idempotencyKey** | **String** | | [optional] |
Expand Down
33 changes: 32 additions & 1 deletion src/main/java/com/moorsyl/model/SmsSend200Response.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ public class SmsSend200Response {
@javax.annotation.Nullable
private Object accepted = null;

public static final String SERIALIZED_NAME_MESSAGE_ID = "messageId";
@SerializedName(SERIALIZED_NAME_MESSAGE_ID)
@javax.annotation.Nonnull
private String messageId;

public static final String SERIALIZED_NAME_IDEMPOTENCY_KEY = "idempotencyKey";
@SerializedName(SERIALIZED_NAME_IDEMPOTENCY_KEY)
@javax.annotation.Nonnull
Expand Down Expand Up @@ -87,6 +92,25 @@ public void setAccepted(@javax.annotation.Nullable Object accepted) {
}


public SmsSend200Response messageId(@javax.annotation.Nonnull String messageId) {
this.messageId = messageId;
return this;
}

/**
* Get messageId
* @return messageId
*/
@javax.annotation.Nonnull
public String getMessageId() {
return messageId;
}

public void setMessageId(@javax.annotation.Nonnull String messageId) {
this.messageId = messageId;
}


public SmsSend200Response idempotencyKey(@javax.annotation.Nonnull String idempotencyKey) {
this.idempotencyKey = idempotencyKey;
return this;
Expand Down Expand Up @@ -136,20 +160,22 @@ public boolean equals(Object o) {
}
SmsSend200Response smsSend200Response = (SmsSend200Response) o;
return Objects.equals(this.accepted, smsSend200Response.accepted) &&
Objects.equals(this.messageId, smsSend200Response.messageId) &&
Objects.equals(this.idempotencyKey, smsSend200Response.idempotencyKey) &&
Objects.equals(this.organizationId, smsSend200Response.organizationId);
}

@Override
public int hashCode() {
return Objects.hash(accepted, idempotencyKey, organizationId);
return Objects.hash(accepted, messageId, idempotencyKey, organizationId);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class SmsSend200Response {\n");
sb.append(" accepted: ").append(toIndentedString(accepted)).append("\n");
sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n");
sb.append(" idempotencyKey: ").append(toIndentedString(idempotencyKey)).append("\n");
sb.append(" organizationId: ").append(toIndentedString(organizationId)).append("\n");
sb.append("}");
Expand All @@ -175,12 +201,14 @@ private String toIndentedString(Object o) {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("accepted");
openapiFields.add("messageId");
openapiFields.add("idempotencyKey");
openapiFields.add("organizationId");

// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("accepted");
openapiRequiredFields.add("messageId");
openapiRequiredFields.add("idempotencyKey");
openapiRequiredFields.add("organizationId");
}
Expand Down Expand Up @@ -213,6 +241,9 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
if (!jsonObj.get("messageId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `messageId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageId").toString()));
}
if (!jsonObj.get("idempotencyKey").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `idempotencyKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("idempotencyKey").toString()));
}
Expand Down
11 changes: 5 additions & 6 deletions src/main/java/com/moorsyl/model/SmsSendRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
public class SmsSendRequest {
public static final String SERIALIZED_NAME_TO = "to";
@SerializedName(SERIALIZED_NAME_TO)
@javax.annotation.Nonnull
@javax.annotation.Nullable
private String to;

public static final String SERIALIZED_NAME_FROM = "from";
Expand All @@ -73,7 +73,7 @@ public class SmsSendRequest {
public SmsSendRequest() {
}

public SmsSendRequest to(@javax.annotation.Nonnull String to) {
public SmsSendRequest to(@javax.annotation.Nullable String to) {
this.to = to;
return this;
}
Expand All @@ -82,12 +82,12 @@ public SmsSendRequest to(@javax.annotation.Nonnull String to) {
* Get to
* @return to
*/
@javax.annotation.Nonnull
@javax.annotation.Nullable
public String getTo() {
return to;
}

public void setTo(@javax.annotation.Nonnull String to) {
public void setTo(@javax.annotation.Nullable String to) {
this.to = to;
}

Expand Down Expand Up @@ -207,7 +207,6 @@ private String toIndentedString(Object o) {

// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("to");
openapiRequiredFields.add("body");
}

Expand Down Expand Up @@ -239,7 +238,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
if (!jsonObj.get("to").isJsonPrimitive()) {
if ((jsonObj.get("to") != null && !jsonObj.get("to").isJsonNull()) && !jsonObj.get("to").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `to` to be a primitive type in the JSON string but got `%s`", jsonObj.get("to").toString()));
}
if ((jsonObj.get("from") != null && !jsonObj.get("from").isJsonNull()) && !jsonObj.get("from").isJsonPrimitive()) {
Expand Down
8 changes: 8 additions & 0 deletions src/test/java/com/moorsyl/model/SmsSend200ResponseTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ public void acceptedTest() {
// TODO: test accepted
}

/**
* Test the property 'messageId'
*/
@Test
public void messageIdTest() {
// TODO: test messageId
}

/**
* Test the property 'idempotencyKey'
*/
Expand Down