Skip to content

Commit 5358265

Browse files
author
Erik Räni
authored
1.0.0 (#1)
1 parent feceeee commit 5358265

File tree

150 files changed

+15367
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+15367
-2
lines changed

Diff for: .gitignore

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
*.class
2+
3+
# Mobile Tools for Java (J2ME)
4+
.mtj.tmp/
5+
6+
# Package Files #
7+
*.jar
8+
*.war
9+
*.ear
10+
11+
# exclude jar for gradle wrapper
12+
!gradle/wrapper/*.jar
13+
14+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
15+
hs_err_pid*
16+
17+
# build files
18+
**/target
19+
target
20+
.gradle
21+
build

Diff for: .openapi-generator-ignore

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# OpenAPI Generator Ignore
2+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md

Diff for: .openapi-generator/VERSION

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.3.4

Diff for: .travis.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#
2+
# Generated by: https://openapi-generator.tech
3+
#
4+
language: java
5+
jdk:
6+
- oraclejdk8
7+
- oraclejdk7
8+
before_install:
9+
# ensure gradlew has proper permission
10+
- chmod a+x ./gradlew
11+
script:
12+
# test using maven
13+
- mvn test
14+
# uncomment below to test using gradle
15+
# - gradle test
16+
# uncomment below to test using sbt
17+
# - sbt test

Diff for: README.md

+147-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,147 @@
1-
# messente-api-java
2-
Messente public API libraries merged into one Java library
1+
# Messente API Library
2+
3+
- Messente API version: 1.0.0
4+
- Java artifact version: 1.0.0
5+
6+
[Messente](https://messente.com) is a global provider of messaging and user verification services. Use Messente API library to send and receive SMS, Viber and WhatsApp messages, blacklist phone numbers to make sure you're not sending any unwanted messages, manage contacts and groups. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world.
7+
8+
## Installation
9+
10+
Install Messente API library via Maven, Gradle, Ivy or manual build.
11+
12+
### Gradle
13+
14+
```groovy
15+
compile "com.messente.api:messente-api:1.0.0"
16+
```
17+
18+
### Maven
19+
20+
```xml
21+
<dependency>
22+
<groupId>com.messente.api</groupId>
23+
<artifactId>messente-api</artifactId>
24+
<version>1.0.0</version>
25+
<type>pom</type>
26+
</dependency>
27+
```
28+
29+
### Ivy
30+
31+
```xml
32+
<dependency org='com.messente.api' name='messente-api' rev='1.0.0'>
33+
<artifact name='messente-api' ext='pom' ></artifact>
34+
</dependency>
35+
```
36+
37+
### Manual Build
38+
39+
Generate
40+
41+
```shell
42+
mvn clean package
43+
```
44+
45+
Install
46+
47+
- `target/messente-api-1.0.0.jar`
48+
- `target/lib/*.jar`
49+
50+
## Features
51+
52+
Messente API has the following features:
53+
54+
- Omnichannel ([external docs](https://messente.com/documentation/omnichannel-api)),
55+
- Phonebook ([external docs](https://messente.com/documentation/phonebook-api)).
56+
57+
Messente API Library provides the operations described below to access the features.
58+
59+
### BlacklistApi
60+
61+
1. Adds a phone number to the blacklist. [`addToBlacklist`](docs/BlacklistApi.md#addtoblacklist)
62+
1. Deletes a phone number from the blacklist. [`deleteFromBlacklist`](docs/BlacklistApi.md#deletefromblacklist)
63+
1. Returns all blacklisted phone numbers. [`fetchBlacklist`](docs/BlacklistApi.md#fetchblacklist)
64+
1. Checks if a phone number is blacklisted. [`isBlacklisted`](docs/BlacklistApi.md#isblacklisted)
65+
66+
### ContactsApi
67+
68+
1. Adds a contact to a group. [`addContactToGroup`](docs/ContactsApi.md#addcontacttogroup)
69+
1. Creates a new contact. [`createContact`](docs/ContactsApi.md#createcontact)
70+
1. Deletes a contact. [`deleteContact`](docs/ContactsApi.md#deletecontact)
71+
1. Lists a contact. [`fetchContact`](docs/ContactsApi.md#fetchcontact)
72+
1. Lists groups of a contact. [`fetchContactGroups`](docs/ContactsApi.md#fetchcontactgroups)
73+
1. Returns all contacts. [`fetchContacts`](docs/ContactsApi.md#fetchcontacts)
74+
1. Removes a contact from a group. [`removeContactFromGroup`](docs/ContactsApi.md#removecontactfromgroup)
75+
1. Updates a contact. [`updateContact`](docs/ContactsApi.md#updatecontact)
76+
77+
### DeliveryReportApi
78+
79+
1. Retrieves the delivery report for the Omnimessage. [`retrieveDeliveryReport`](docs/DeliveryReportApi.md#retrievedeliveryreport)
80+
81+
### GroupsApi
82+
83+
1. Creates a new group with the provided name. [`createGroup`](docs/GroupsApi.md#creategroup)
84+
1. Deletes a group. [`deleteGroup`](docs/GroupsApi.md#deletegroup)
85+
1. Lists a group. [`fetchGroup`](docs/GroupsApi.md#fetchgroup)
86+
1. Returns all groups. [`fetchGroups`](docs/GroupsApi.md#fetchgroups)
87+
1. Updates a group with the provided name. [`updateGroup`](docs/GroupsApi.md#updategroup)
88+
89+
### OmnimessageApi
90+
91+
1. Cancels a scheduled Omnimessage. [`cancelScheduledMessage`](docs/OmnimessageApi.md#cancelscheduledmessage)
92+
1. Sends an Omnimessage. [`sendOmnimessage`](docs/OmnimessageApi.md#sendomnimessage)
93+
94+
## Auth
95+
96+
**Type**: HTTP basic authentication
97+
98+
Read the [external getting-started article](https://messente.com/documentation/getting-started) which explains API keys and Sender ID logic.
99+
100+
## Getting started: sending an omnimessage
101+
102+
```java
103+
public class Main {
104+
public static void main(String[] args) {
105+
ApiClient apiClient = new ApiClient();
106+
107+
// Configure HTTP basic authorization: basicAuth
108+
HttpBasicAuth basicAuth = (HttpBasicAuth) apiClient.getAuthentication("basicAuth");
109+
basicAuth.setUsername("<MESSENTE_API_USERNAME>");
110+
basicAuth.setPassword("<MESSENTE_API_PASSWORD>");
111+
112+
OmnimessageApi apiInstance = new OmnimessageApi(apiClient);
113+
Omnimessage omnimessage = new Omnimessage(); // Omnimessage | Omnimessage to be sent
114+
Viber viber = new Viber();
115+
viber.text("Viber text");
116+
viber.sender("Messente");
117+
SMS sms = new SMS();
118+
sms.text("SMS text");
119+
120+
WhatsApp whatsApp = new WhatsApp();
121+
WhatsAppText whatsAppText = new WhatsAppText();
122+
whatsAppText.body("WhatsApp text");
123+
whatsApp.text(whatsAppText);
124+
125+
omnimessage.setMessages(Arrays.<Object>asList(whatsApp, viber, sms));
126+
omnimessage.setTo("<recipient phone number in e.164 format>");
127+
128+
129+
try {
130+
OmniMessageCreateSuccessResponse result = apiInstance.sendOmnimessage(omnimessage);
131+
System.out.println(result);
132+
} catch (ApiException e) {
133+
System.err.println("Exception when calling sendOmnimessage");
134+
e.printStackTrace();
135+
}
136+
}
137+
}
138+
139+
```
140+
141+
## License
142+
143+
[Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.html)
144+
145+
## Terms
146+
147+
[https://messente.com/terms-and-conditions](https://messente.com/terms-and-conditions)

Diff for: build.gradle

+130
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
apply plugin: 'idea'
2+
apply plugin: 'eclipse'
3+
4+
group = 'com.messente.api'
5+
version = '1.0.0'
6+
7+
buildscript {
8+
repositories {
9+
jcenter()
10+
}
11+
dependencies {
12+
classpath 'com.android.tools.build:gradle:2.3.+'
13+
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
14+
}
15+
}
16+
17+
repositories {
18+
jcenter()
19+
}
20+
21+
22+
if(hasProperty('target') && target == 'android') {
23+
24+
apply plugin: 'com.android.library'
25+
apply plugin: 'com.github.dcendents.android-maven'
26+
27+
android {
28+
compileSdkVersion 25
29+
buildToolsVersion '25.0.2'
30+
defaultConfig {
31+
minSdkVersion 14
32+
targetSdkVersion 25
33+
}
34+
compileOptions {
35+
sourceCompatibility JavaVersion.VERSION_1_7
36+
targetCompatibility JavaVersion.VERSION_1_7
37+
}
38+
39+
// Rename the aar correctly
40+
libraryVariants.all { variant ->
41+
variant.outputs.each { output ->
42+
def outputFile = output.outputFile
43+
if (outputFile != null && outputFile.name.endsWith('.aar')) {
44+
def fileName = "${project.name}-${variant.baseName}-${version}.aar"
45+
output.outputFile = new File(outputFile.parent, fileName)
46+
}
47+
}
48+
}
49+
50+
dependencies {
51+
provided 'javax.annotation:jsr250-api:1.0'
52+
}
53+
}
54+
55+
afterEvaluate {
56+
android.libraryVariants.all { variant ->
57+
def task = project.tasks.create "jar${variant.name.capitalize()}", Jar
58+
task.description = "Create jar artifact for ${variant.name}"
59+
task.dependsOn variant.javaCompile
60+
task.from variant.javaCompile.destinationDir
61+
task.destinationDir = project.file("${project.buildDir}/outputs/jar")
62+
task.archiveName = "${project.name}-${variant.baseName}-${version}.jar"
63+
artifacts.add('archives', task);
64+
}
65+
}
66+
67+
task sourcesJar(type: Jar) {
68+
from android.sourceSets.main.java.srcDirs
69+
classifier = 'sources'
70+
}
71+
72+
artifacts {
73+
archives sourcesJar
74+
}
75+
76+
} else {
77+
78+
apply plugin: 'java'
79+
apply plugin: 'maven'
80+
81+
sourceCompatibility = JavaVersion.VERSION_1_7
82+
targetCompatibility = JavaVersion.VERSION_1_7
83+
84+
install {
85+
repositories.mavenInstaller {
86+
pom.artifactId = 'messente-api'
87+
}
88+
}
89+
90+
task execute(type:JavaExec) {
91+
main = System.getProperty('mainClass')
92+
classpath = sourceSets.main.runtimeClasspath
93+
}
94+
}
95+
96+
dependencies {
97+
compile 'io.swagger:swagger-annotations:1.5.17'
98+
compile 'com.squareup.okhttp:okhttp:2.7.5'
99+
compile 'com.squareup.okhttp:logging-interceptor:2.7.5'
100+
compile 'com.google.code.gson:gson:2.8.1'
101+
compile 'io.gsonfire:gson-fire:1.8.0'
102+
compile group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.1'
103+
compile 'org.threeten:threetenbp:1.3.5'
104+
testCompile 'junit:junit:4.12'
105+
}
106+
107+
buildscript {
108+
dependencies {
109+
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4"
110+
}
111+
}
112+
113+
apply plugin: "com.jfrog.bintray"
114+
115+
bintray {
116+
user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
117+
key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
118+
119+
configurations = ['archives']
120+
121+
pkg {
122+
repo = 'messente-api-java'
123+
name = 'messente-api'
124+
userOrg = "messente"
125+
version {
126+
name = version
127+
}
128+
}
129+
}
130+

Diff for: build.sbt

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
lazy val root = (project in file(".")).
2+
settings(
3+
organization := "com.messente.api",
4+
name := "messente-api",
5+
version := "1.0.0",
6+
scalaVersion := "2.11.4",
7+
scalacOptions ++= Seq("-feature"),
8+
javacOptions in compile ++= Seq("-Xlint:deprecation"),
9+
publishArtifact in (Compile, packageDoc) := false,
10+
resolvers += Resolver.mavenLocal,
11+
libraryDependencies ++= Seq(
12+
"io.swagger" % "swagger-annotations" % "1.5.17",
13+
"com.squareup.okhttp" % "okhttp" % "2.7.5",
14+
"com.squareup.okhttp" % "logging-interceptor" % "2.7.5",
15+
"com.google.code.gson" % "gson" % "2.8.1",
16+
"org.threeten" % "threetenbp" % "1.3.5" % "compile",
17+
"io.gsonfire" % "gson-fire" % "1.8.0" % "compile",
18+
"junit" % "junit" % "4.12" % "test",
19+
"com.novocode" % "junit-interface" % "0.10" % "test"
20+
)
21+
)

0 commit comments

Comments
 (0)