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
2 changes: 2 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ docs/OmniMessageCreateSuccessResponse.md
docs/Omnimessage.md
docs/OmnimessageApi.md
docs/OmnimessageMessagesInner.md
docs/PriceInfo.md
docs/Priority.md
docs/SMS.md
docs/StatisticsApi.md
Expand Down Expand Up @@ -139,6 +140,7 @@ src/main/java/com/messente/api/OmniMessageCreateSuccessResponse.java
src/main/java/com/messente/api/Omnimessage.java
src/main/java/com/messente/api/OmnimessageApi.java
src/main/java/com/messente/api/OmnimessageMessagesInner.java
src/main/java/com/messente/api/PriceInfo.java
src/main/java/com/messente/api/Priority.java
src/main/java/com/messente/api/SMS.java
src/main/java/com/messente/api/StatisticsApi.java
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Messente API Library

- Messente API version: 2.0.0
- Java artifact version: 4.0.0
- Java artifact version: 4.1.0

[Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world.

Expand All @@ -12,7 +12,7 @@ Install Messente API library via Maven, Gradle, Ivy or manual build.
### Gradle

```groovy
compile "com.messente.api:messente-api:4.0.0"
compile "com.messente.api:messente-api:4.1.0"
```

### Maven
Expand All @@ -21,15 +21,15 @@ compile "com.messente.api:messente-api:4.0.0"
<dependency>
<groupId>com.messente.api</groupId>
<artifactId>messente-api</artifactId>
<version>4.0.0</version>
<version>4.1.0</version>
<type>pom</type>
</dependency>
```

### Ivy

```xml
<dependency org='com.messente.api' name='messente-api' rev='4.0.0'>
<dependency org='com.messente.api' name='messente-api' rev='4.1.0'>
<artifact name='messente-api' ext='pom' ></artifact>
</dependency>
```
Expand All @@ -44,7 +44,7 @@ mvn clean package

Install

- `target/messente-api-4.0.0.jar`
- `target/messente-api-4.1.0.jar`
- `target/lib/*.jar`

## Features
Expand Down
46 changes: 44 additions & 2 deletions api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2459,13 +2459,23 @@ components:
description: A container for successful delivery report response
example:
statuses:
- err: 0
- price_info:
parts_count: 6
total_price: total_price
part_price: part_price
err: 0
sender: sender
channel: sms
message_id: message_id
error: error
status: ACK
timestamp: 2000-01-23T04:56:07.000+00:00
- err: 0
- price_info:
parts_count: 6
total_price: total_price
part_price: part_price
err: 0
sender: sender
channel: sms
message_id: message_id
error: error
Expand Down Expand Up @@ -2495,7 +2505,12 @@ components:
DeliveryResult:
description: A delivery report
example:
price_info:
parts_count: 6
total_price: total_price
part_price: part_price
err: 0
sender: sender
channel: sms
message_id: message_id
error: error
Expand All @@ -2521,6 +2536,33 @@ components:
description: When this status was received by Omnichannel API
format: date-time
type: string
price_info:
$ref: '#/components/schemas/PriceInfo'
sender:
description: the sender of the message
type: string
type: object
PriceInfo:
description: Contains price information for the message. This value is *null*
if the message is still being processed
example:
parts_count: 6
total_price: total_price
part_price: part_price
properties:
part_price:
description: price per message part - relevant mostly for SMS
type: string
parts_count:
description: the number of parts the message consists of
type: integer
total_price:
description: total price for the message
type: string
required:
- part_price
- parts_count
- total_price
type: object
Status:
description: |-
Expand Down
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ apply plugin: 'java'
apply plugin: 'com.diffplug.spotless'

group = 'com.messente.api'
version = '4.0.0'
version = '4.1.0'

ext {
jakarta_annotation_version = "1.3.5"
Expand Down Expand Up @@ -113,6 +113,7 @@ java {

javadoc {
options.tags = [ "http.response.details:a:Http Response Details" ]
options.addStringOption('Xdoclint:none', '-quiet')
}

// Use spotless plugin to automatically format code, remove unused import, etc
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ lazy val root = (project in file(".")).
settings(
organization := "com.messente.api",
name := "messente-api",
version := "4.0.0",
version := "4.1.0",
scalaVersion := "2.11.4",
scalacOptions ++= Seq("-feature"),
javacOptions in compile ++= Seq("-Xlint:deprecation"),
Expand Down
2 changes: 2 additions & 0 deletions docs/DeliveryResult.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ A delivery report
|**error** | **String** | Human-readable description of what went wrong, *null* in case of success or if the message has not been processed yet | [optional] |
|**err** | **ErrorCodeOmnichannelMachine** | | [optional] |
|**timestamp** | **OffsetDateTime** | When this status was received by Omnichannel API | [optional] |
|**priceInfo** | [**PriceInfo**](PriceInfo.md) | | [optional] |
|**sender** | **String** | the sender of the message | [optional] |



16 changes: 16 additions & 0 deletions docs/PriceInfo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@


# PriceInfo

Contains price information for the message. This value is *null* if the message is still being processed

## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**partPrice** | **String** | price per message part - relevant mostly for SMS | |
|**partsCount** | **Integer** | the number of parts the message consists of | |
|**totalPrice** | **String** | total price for the message | |



2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<artifactId>messente-api</artifactId>
<packaging>jar</packaging>
<name>messente-api</name>
<version>4.0.0</version>
<version>4.1.0</version>
<url>https://github.com/messente/messente-api-java</url>
<description>Java library for Messente API</description>
<scm>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/messente/ApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ private void init() {
json = new JSON();

// Set default User-Agent.
setUserAgent("OpenAPI-Generator/4.0.0/java");
setUserAgent("OpenAPI-Generator/4.1.0/java");

authentications = new HashMap<String, Authentication>();
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/messente/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0")
public class Configuration {
public static final String VERSION = "4.0.0";
public static final String VERSION = "4.1.0";

private static ApiClient defaultApiClient = new ApiClient();

Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/messente/JSON.java
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri
gsonBuilder.registerTypeAdapterFactory(new com.messente.api.OmniMessageCreateSuccessResponse.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.messente.api.Omnimessage.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.messente.api.OmnimessageMessagesInner.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.messente.api.PriceInfo.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.messente.api.SMS.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.messente.api.StatisticsReport.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.messente.api.StatisticsReportSettings.CustomTypeAdapterFactory());
Expand Down
64 changes: 62 additions & 2 deletions src/main/java/com/messente/api/DeliveryResult.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.google.gson.stream.JsonWriter;
import com.messente.api.Channel;
import com.messente.api.ErrorCodeOmnichannelMachine;
import com.messente.api.PriceInfo;
import com.messente.api.Status;
import java.io.IOException;
import java.time.OffsetDateTime;
Expand Down Expand Up @@ -81,6 +82,14 @@ public class DeliveryResult {
@SerializedName(SERIALIZED_NAME_TIMESTAMP)
private OffsetDateTime timestamp;

public static final String SERIALIZED_NAME_PRICE_INFO = "price_info";
@SerializedName(SERIALIZED_NAME_PRICE_INFO)
private PriceInfo priceInfo;

public static final String SERIALIZED_NAME_SENDER = "sender";
@SerializedName(SERIALIZED_NAME_SENDER)
private String sender;

public DeliveryResult() {
}

Expand Down Expand Up @@ -198,6 +207,44 @@ public void setTimestamp(OffsetDateTime timestamp) {
}


public DeliveryResult priceInfo(PriceInfo priceInfo) {
this.priceInfo = priceInfo;
return this;
}

/**
* Get priceInfo
* @return priceInfo
**/
@javax.annotation.Nullable
public PriceInfo getPriceInfo() {
return priceInfo;
}

public void setPriceInfo(PriceInfo priceInfo) {
this.priceInfo = priceInfo;
}


public DeliveryResult sender(String sender) {
this.sender = sender;
return this;
}

/**
* the sender of the message
* @return sender
**/
@javax.annotation.Nullable
public String getSender() {
return sender;
}

public void setSender(String sender) {
this.sender = sender;
}



@Override
public boolean equals(Object o) {
Expand All @@ -213,7 +260,9 @@ public boolean equals(Object o) {
Objects.equals(this.messageId, deliveryResult.messageId) &&
Objects.equals(this.error, deliveryResult.error) &&
Objects.equals(this.err, deliveryResult.err) &&
Objects.equals(this.timestamp, deliveryResult.timestamp);
Objects.equals(this.timestamp, deliveryResult.timestamp) &&
Objects.equals(this.priceInfo, deliveryResult.priceInfo) &&
Objects.equals(this.sender, deliveryResult.sender);
}

private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
Expand All @@ -222,7 +271,7 @@ private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b)

@Override
public int hashCode() {
return Objects.hash(status, channel, messageId, error, err, timestamp);
return Objects.hash(status, channel, messageId, error, err, timestamp, priceInfo, sender);
}

private static <T> int hashCodeNullable(JsonNullable<T> a) {
Expand All @@ -242,6 +291,8 @@ public String toString() {
sb.append(" error: ").append(toIndentedString(error)).append("\n");
sb.append(" err: ").append(toIndentedString(err)).append("\n");
sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n");
sb.append(" priceInfo: ").append(toIndentedString(priceInfo)).append("\n");
sb.append(" sender: ").append(toIndentedString(sender)).append("\n");
sb.append("}");
return sb.toString();
}
Expand Down Expand Up @@ -270,6 +321,8 @@ private String toIndentedString(Object o) {
openapiFields.add("error");
openapiFields.add("err");
openapiFields.add("timestamp");
openapiFields.add("price_info");
openapiFields.add("sender");

// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
Expand Down Expand Up @@ -314,6 +367,13 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
if (jsonObj.get("err") != null && !jsonObj.get("err").isJsonNull()) {
ErrorCodeOmnichannelMachine.validateJsonElement(jsonObj.get("err"));
}
// validate the optional field `price_info`
if (jsonObj.get("price_info") != null && !jsonObj.get("price_info").isJsonNull()) {
PriceInfo.validateJsonElement(jsonObj.get("price_info"));
}
if ((jsonObj.get("sender") != null && !jsonObj.get("sender").isJsonNull()) && !jsonObj.get("sender").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `sender` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sender").toString()));
}
}

public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
Expand Down
Loading