-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit ff2d88b
Showing
52 changed files
with
5,697 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
*.class | ||
|
||
# Mobile Tools for Java (J2ME) | ||
.mtj.tmp/ | ||
|
||
# Package Files # | ||
*.jar | ||
*.war | ||
*.ear | ||
|
||
# exclude jar for gradle wrapper | ||
!gradle/wrapper/*.jar | ||
|
||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml | ||
hs_err_pid* | ||
|
||
# build files | ||
**/target | ||
target | ||
.gradle | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# | ||
# Generated by: https://github.com/swagger-api/swagger-codegen.git | ||
# | ||
language: java | ||
jdk: | ||
- oraclejdk8 | ||
- oraclejdk7 | ||
before_install: | ||
# ensure gradlew has proper permission | ||
- chmod a+x ./gradlew | ||
script: | ||
# test using maven | ||
- mvn test | ||
# uncomment below to test using gradle | ||
# - gradle test | ||
# uncomment below to test using sbt | ||
# - sbt test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
# Dyspatch API Client | ||
|
||
## Introduction | ||
|
||
|
||
The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our Implementation Guide for more details on how to implement Dyspatch. | ||
|
||
This Java package is automatically generated by the Swagger Codegen project: | ||
|
||
- API version: 2018.08 | ||
- Package version: 1.0.0 | ||
|
||
For more information, please visit https://docs.dyspatch.io | ||
|
||
## Installation | ||
|
||
via maven (preferred) | ||
Add the following to your pom.xml: | ||
```xml | ||
<!-- in the repositories section --> | ||
<repository> | ||
<id>repo</id> | ||
<url>https://github.com/get-dyspatch/dyspatch-mvn/raw/master/releases</url> | ||
</repository> | ||
|
||
<!-- in the dependencies section --> | ||
<dependency> | ||
<groupId>io.dyspatch</groupId> | ||
<artifactId>dyspatch-java</artifactId> | ||
<version>1.0.0</version> | ||
</dependency> | ||
``` | ||
|
||
via wget: | ||
|
||
|
||
```sh | ||
$ wget https://github.com/sendwithus/sendwithus-mvn-repo/raw/master/releases/com/sendwithus/java-client/2.1.1/java-client-2.1.1.jar | ||
``` | ||
|
||
## Getting Started | ||
|
||
Please follow the [installation](#installation) instruction and execute the following Java code: | ||
|
||
```java | ||
|
||
import io.dyspatch.client.*; | ||
import io.dyspatch.client.auth.*; | ||
import io.dyspatch.client.model.*; | ||
import io.dyspatch.client.api.LocalizationsApi; | ||
|
||
import java.io.File; | ||
import java.util.*; | ||
|
||
public class LocalizationsApiExample { | ||
|
||
public static void main(String[] args) { | ||
ApiClient defaultClient = Configuration.getDefaultApiClient(); | ||
|
||
// Configure API key authorization: Bearer | ||
ApiKeyAuth Bearer = (ApiKeyAuth) defaultClient.getAuthentication("Bearer"); | ||
Bearer.setApiKey("YOUR API KEY"); | ||
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) | ||
//Bearer.setApiKeyPrefix("Token"); | ||
|
||
LocalizationsApi apiInstance = new LocalizationsApi(); | ||
String localizationId = "localizationId_example"; // String | A localization ID | ||
String accept = "accept_example"; // String | A version of the API that should be used for the request. For example, to use version \"2018.08\", set the value to \"application/vnd.dyspatch.2018.08+json\" | ||
try { | ||
LocalizationRead result = apiInstance.localizationsLocalizationIdGet(localizationId, accept); | ||
System.out.println(result); | ||
} catch (ApiException e) { | ||
System.err.println("Exception when calling LocalizationsApi#localizationsLocalizationIdGet"); | ||
e.printStackTrace(); | ||
} | ||
} | ||
} | ||
|
||
``` | ||
|
||
## Documentation for API Endpoints | ||
|
||
All URIs are relative to *https://api.dyspatch.io* | ||
|
||
Class | Method | HTTP request | Description | ||
------------ | ------------- | ------------- | ------------- | ||
*LocalizationsApi* | [**localizationsLocalizationIdGet**](docs/LocalizationsApi.md#localizationsLocalizationIdGet) | **GET** /localizations/{localizationId} | Get Localization Object by ID | ||
*TemplatesApi* | [**templatesGet**](docs/TemplatesApi.md#templatesGet) | **GET** /templates | List Templates | ||
*TemplatesApi* | [**templatesTemplateIdGet**](docs/TemplatesApi.md#templatesTemplateIdGet) | **GET** /templates/{templateId} | Get Template by ID | ||
|
||
|
||
## Documentation for Models | ||
|
||
- [APIError](docs/APIError.md) | ||
- [CompiledRead](docs/CompiledRead.md) | ||
- [Cursor](docs/Cursor.md) | ||
- [LocalizationMetaRead](docs/LocalizationMetaRead.md) | ||
- [LocalizationRead](docs/LocalizationRead.md) | ||
- [TemplateMetaRead](docs/TemplateMetaRead.md) | ||
- [TemplateRead](docs/TemplateRead.md) | ||
- [TemplatesRead](docs/TemplatesRead.md) | ||
|
||
|
||
## Documentation for Authorization | ||
|
||
Authentication schemes defined for the API: | ||
### Bearer | ||
|
||
- **Type**: API key | ||
- **API key parameter name**: Authorization | ||
- **Location**: HTTP header | ||
|
||
|
||
## Recommendation | ||
|
||
It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. | ||
|
||
## Author | ||
|
||
[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
apply plugin: 'idea' | ||
apply plugin: 'eclipse' | ||
|
||
group = 'io.dyspatch' | ||
version = '1.0.0' | ||
|
||
buildscript { | ||
repositories { | ||
jcenter() | ||
} | ||
dependencies { | ||
classpath 'com.android.tools.build:gradle:2.3.+' | ||
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' | ||
} | ||
} | ||
|
||
repositories { | ||
jcenter() | ||
} | ||
|
||
|
||
if(hasProperty('target') && target == 'android') { | ||
|
||
apply plugin: 'com.android.library' | ||
apply plugin: 'com.github.dcendents.android-maven' | ||
|
||
android { | ||
compileSdkVersion 25 | ||
buildToolsVersion '25.0.2' | ||
defaultConfig { | ||
minSdkVersion 14 | ||
targetSdkVersion 25 | ||
} | ||
compileOptions { | ||
sourceCompatibility JavaVersion.VERSION_1_7 | ||
targetCompatibility JavaVersion.VERSION_1_7 | ||
} | ||
|
||
// Rename the aar correctly | ||
libraryVariants.all { variant -> | ||
variant.outputs.each { output -> | ||
def outputFile = output.outputFile | ||
if (outputFile != null && outputFile.name.endsWith('.aar')) { | ||
def fileName = "${project.name}-${variant.baseName}-${version}.aar" | ||
output.outputFile = new File(outputFile.parent, fileName) | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
provided 'javax.annotation:jsr250-api:1.0' | ||
} | ||
} | ||
|
||
afterEvaluate { | ||
android.libraryVariants.all { variant -> | ||
def task = project.tasks.create "jar${variant.name.capitalize()}", Jar | ||
task.description = "Create jar artifact for ${variant.name}" | ||
task.dependsOn variant.javaCompile | ||
task.from variant.javaCompile.destinationDir | ||
task.destinationDir = project.file("${project.buildDir}/outputs/jar") | ||
task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" | ||
artifacts.add('archives', task); | ||
} | ||
} | ||
|
||
task sourcesJar(type: Jar) { | ||
from android.sourceSets.main.java.srcDirs | ||
classifier = 'sources' | ||
} | ||
|
||
artifacts { | ||
archives sourcesJar | ||
} | ||
|
||
} else { | ||
|
||
apply plugin: 'java' | ||
apply plugin: 'maven' | ||
|
||
sourceCompatibility = JavaVersion.VERSION_1_7 | ||
targetCompatibility = JavaVersion.VERSION_1_7 | ||
|
||
install { | ||
repositories.mavenInstaller { | ||
pom.artifactId = 'dyspatch-java' | ||
} | ||
} | ||
|
||
task execute(type:JavaExec) { | ||
main = System.getProperty('mainClass') | ||
classpath = sourceSets.main.runtimeClasspath | ||
} | ||
} | ||
|
||
dependencies { | ||
compile 'io.swagger:swagger-annotations:1.5.15' | ||
compile 'com.squareup.okhttp:okhttp:2.7.5' | ||
compile 'com.squareup.okhttp:logging-interceptor:2.7.5' | ||
compile 'com.google.code.gson:gson:2.8.1' | ||
compile 'io.gsonfire:gson-fire:1.8.0' | ||
compile 'org.threeten:threetenbp:1.3.5' | ||
testCompile 'junit:junit:4.12' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
lazy val root = (project in file(".")). | ||
settings( | ||
organization := "io.dyspatch", | ||
name := "dyspatch-java", | ||
version := "1.0.0", | ||
scalaVersion := "2.11.4", | ||
scalacOptions ++= Seq("-feature"), | ||
javacOptions in compile ++= Seq("-Xlint:deprecation"), | ||
publishArtifact in (Compile, packageDoc) := false, | ||
resolvers += Resolver.mavenLocal, | ||
libraryDependencies ++= Seq( | ||
"io.swagger" % "swagger-annotations" % "1.5.15", | ||
"com.squareup.okhttp" % "okhttp" % "2.7.5", | ||
"com.squareup.okhttp" % "logging-interceptor" % "2.7.5", | ||
"com.google.code.gson" % "gson" % "2.8.1", | ||
"org.threeten" % "threetenbp" % "1.3.5" % "compile", | ||
"io.gsonfire" % "gson-fire" % "1.8.0" % "compile", | ||
"junit" % "junit" % "4.12" % "test", | ||
"com.novocode" % "junit-interface" % "0.10" % "test" | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"apiPackage": "io.dyspatch.client.api", | ||
"artifactId": "dyspatch-java", | ||
"artifactVersion":"1.0.0", | ||
"developerEmail": "[email protected]", | ||
"developerName": "Dyspatch", | ||
"developerOrganization": "io.dyspatch", | ||
"developerOrganizationUrl": "https://www.dyspatch.io", | ||
"groupId": "io.dyspatch", | ||
"licenseName": "Apache-2.0", | ||
"licenseUrl": "https://github.com/getdyspatch/dyspatch-java/blob/master/LICENSE", | ||
"modelPackage": "io.dyspatch.client.model", | ||
"scmConnection": "scm:git:[email protected]:getdyspatch/dyspatch-java.git", | ||
"scmDeveloperConnection": "scm:git:[email protected]:getdyspatch/dyspatch-java.git", | ||
"scmUrl": "[email protected]:getdyspatch/dyspatch-java.git" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
# APIError | ||
|
||
## Properties | ||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**code** | [**CodeEnum**](#CodeEnum) | Error code: * server_error - Internal server error. * invalid_parameter - Validation error, parameter will contain invalid field and message will contain the reason. * invalid_body - Body could not be parsed, message will contain the reason. * invalid_request - Validation error, the protocol used to make the request was not https. * unauthorized - Credentials were found but permissions were not sufficient. * unauthenticated - Credentials were not found or were not valid. * not_found - The requested resource was not found. * rate_limited - The request was refused because a rate limit was exceeded. There is an account wide rate limit of 3600 requests per-minute, although that is subject to change. The current remaining rate limit can be viewed by checking the X-Ratelimit-Remaining header. | [optional] | ||
**message** | **String** | Human readable error message | [optional] | ||
**parameter** | **String** | The invalid parameter, if 'code' is invalid_parameter | [optional] | ||
|
||
|
||
<a name="CodeEnum"></a> | ||
## Enum: CodeEnum | ||
Name | Value | ||
---- | ----- | ||
SERVER_ERROR | "server_error" | ||
INVALID_PARAMETER | "invalid_parameter" | ||
INVALID_BODY | "invalid_body" | ||
INVALID_REQUEST | "invalid_request" | ||
UNAUTHORIZED | "unauthorized" | ||
UNAUTHENTICATED | "unauthenticated" | ||
NOT_FOUND | "not_found" | ||
RATE_LIMITED | "rate_limited" | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
# CompiledRead | ||
|
||
## Properties | ||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**sender** | **String** | Sender address | [optional] | ||
**replyTo** | **String** | Reply-To address | [optional] | ||
**subject** | **byte[]** | Base64 encoded template subject line | [optional] | ||
**html** | **byte[]** | Base64 encoded template HTML body | [optional] | ||
**text** | **byte[]** | Base64 encoded template text body | [optional] | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
# Cursor | ||
|
||
## Properties | ||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**next** | **String** | A cursor to fetch the next page of results | [optional] | ||
**hasMore** | **Boolean** | Whether there is a next page of results | [optional] | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
# LocalizationMetaRead | ||
|
||
## Properties | ||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**id** | **String** | | [optional] | ||
**language** | **String** | | [optional] | ||
**name** | **String** | | [optional] | ||
**url** | **String** | | [optional] | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
# LocalizationRead | ||
|
||
## Properties | ||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**id** | **String** | | [optional] | ||
**language** | **String** | | [optional] | ||
**url** | **String** | | [optional] | ||
**template** | **String** | | [optional] | ||
**compiled** | [**CompiledRead**](CompiledRead.md) | | [optional] | ||
**createdAt** | **String** | | [optional] | ||
**updatedAt** | **String** | | [optional] | ||
**name** | **String** | | [optional] | ||
|
||
|
||
|
Oops, something went wrong.