Merge pull request #443 from gotify/openapi-gen

Update openapi gen
This commit is contained in:
Jannis Mattheis
2026-03-28 18:01:02 +01:00
committed by GitHub
86 changed files with 1446 additions and 4368 deletions

View File

@@ -62,11 +62,7 @@ $ ./gradlew build
## Update client
* Run `./gradlew generateSwaggerCode`
* Delete `client/settings.gradle` (client is a gradle sub project and must not have a settings.gradle)
* Delete `repositories` block from `client/build.gradle`
* Delete `implementation "com.sun.xml.ws:jaxws-rt:x.x.x“` from `client/build.gradle`
* Insert missing bracket in `retryingIntercept` method of class `src/main/java/com/github/gotify/client/auth/OAuth`
* Run `./gradlew openApiGenerate`
* Commit changes
## Versioning

View File

@@ -13,7 +13,7 @@ android {
compileSdk = 36
defaultConfig {
applicationId = "com.github.gotify"
minSdk = 23
minSdk = 26
targetSdk = 36
versionCode = 34
versionName = "2.9.0"
@@ -101,7 +101,7 @@ dependencies {
implementation("com.google.code.gson:gson:2.13.1")
implementation("com.squareup.retrofit2:retrofit:3.0.0")
implementation("org.threeten:threetenbp:1.7.1")
}
configurations {

View File

@@ -16,12 +16,12 @@ import java.net.MalformedURLException
import java.net.URI
import java.net.URISyntaxException
import java.net.URL
import java.time.OffsetDateTime
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import okhttp3.HttpUrl.Companion.toHttpUrlOrNull
import org.threeten.bp.OffsetDateTime
import org.tinylog.kotlin.Logger
internal object Utils {

View File

@@ -138,7 +138,7 @@ internal class InitializationActivity : AppCompatActivity() {
private fun authenticated(user: User) {
Logger.info("Authenticated as ${user.name}")
settings.setUser(user.name, user.isAdmin)
settings.setUser(user.name, user.admin)
requestVersion {
splashScreenActive = false
startActivity(Intent(this, MessagesActivity::class.java))

View File

@@ -30,8 +30,8 @@ import com.github.gotify.databinding.MessageItemCompactBinding
import com.github.gotify.messages.provider.MessageWithImage
import io.noties.markwon.Markwon
import java.text.DateFormat
import java.time.OffsetDateTime
import java.util.Date
import org.threeten.bp.OffsetDateTime
internal class ListMessageAdapter(
private val context: Context,

View File

@@ -235,7 +235,7 @@ internal class WebSocketService : Service() {
messages.forEach { message ->
if (lastReceivedMessage.get() < message.id) {
lastReceivedMessage.set(message.id)
highestPriority = highestPriority.coerceAtLeast(message.priority)
highestPriority = highestPriority.coerceAtLeast(message.priority ?: 0L)
}
broadcast(message)
}
@@ -256,9 +256,9 @@ internal class WebSocketService : Service() {
broadcast(message)
showNotification(
message.id,
message.title,
message.title ?: "",
message.message,
message.priority,
message.priority ?: 0L,
message.extras,
message.appid
)

View File

@@ -1,11 +1,10 @@
import com.android.build.gradle.internal.tasks.factory.dependsOn
import java.io.File
import java.net.URI
plugins {
id("com.android.application") version "8.11.0" apply false
id("org.jetbrains.kotlin.android") version "2.2.0" apply false
id("org.hidetake.swagger.generator") version "2.19.2"
id("org.openapi.generator") version "7.19.0"
}
fun download(url: String, filename: String) {
@@ -29,19 +28,23 @@ tasks.register("downloadSpec") {
}
}
swaggerSources {
create("swagger") {
setInputFile(file("$projectDir/build/gotify.spec.json"))
code.apply {
language = "java"
configFile = file("$projectDir/swagger.config.json")
outputDir = file("$projectDir/client")
}
}
openApiGenerate {
generatorName.set("java")
inputSpec.set("$projectDir/build/gotify.spec.json")
outputDir.set("$projectDir/client")
apiPackage.set("com.github.gotify.client.api")
modelPackage.set("com.github.gotify.client.model")
configOptions.set(mapOf(
"library" to "retrofit2",
"hideGenerationTimestamp" to "true",
"dateLibrary" to "java8"
))
generateApiTests.set(false)
generateModelTests.set(false)
generateApiDocumentation.set(false)
generateModelDocumentation.set(false)
}
dependencies {
"swaggerCodegen"("io.swagger.codegen.v3:swagger-codegen-cli:3.0.63")
tasks.named("openApiGenerate").configure {
dependsOn("downloadSpec")
}
tasks.named("generateSwaggerCode").dependsOn("downloadSpec")

View File

@@ -1,12 +1,22 @@
# Swagger Codegen Ignore
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs
build.gradle
build.sbt
gradle/**
gradlew
gradlew.bat
pom.xml
settings.gradle
.github/**
.travis.yml
api/openapi.yaml
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux

View File

@@ -0,0 +1,37 @@
.gitignore
README.md
git_push.sh
gradle.properties
src/main/AndroidManifest.xml
src/main/java/com/github/gotify/client/ApiClient.java
src/main/java/com/github/gotify/client/CollectionFormats.java
src/main/java/com/github/gotify/client/JSON.java
src/main/java/com/github/gotify/client/ServerConfiguration.java
src/main/java/com/github/gotify/client/ServerVariable.java
src/main/java/com/github/gotify/client/StringUtil.java
src/main/java/com/github/gotify/client/api/ApplicationApi.java
src/main/java/com/github/gotify/client/api/ClientApi.java
src/main/java/com/github/gotify/client/api/HealthApi.java
src/main/java/com/github/gotify/client/api/MessageApi.java
src/main/java/com/github/gotify/client/api/PluginApi.java
src/main/java/com/github/gotify/client/api/UserApi.java
src/main/java/com/github/gotify/client/api/VersionApi.java
src/main/java/com/github/gotify/client/auth/ApiKeyAuth.java
src/main/java/com/github/gotify/client/auth/HttpBasicAuth.java
src/main/java/com/github/gotify/client/auth/HttpBearerAuth.java
src/main/java/com/github/gotify/client/auth/OAuthOkHttpClient.java
src/main/java/com/github/gotify/client/model/Application.java
src/main/java/com/github/gotify/client/model/ApplicationParams.java
src/main/java/com/github/gotify/client/model/Client.java
src/main/java/com/github/gotify/client/model/ClientParams.java
src/main/java/com/github/gotify/client/model/CreateUserExternal.java
src/main/java/com/github/gotify/client/model/Error.java
src/main/java/com/github/gotify/client/model/Health.java
src/main/java/com/github/gotify/client/model/Message.java
src/main/java/com/github/gotify/client/model/PagedMessages.java
src/main/java/com/github/gotify/client/model/Paging.java
src/main/java/com/github/gotify/client/model/PluginConf.java
src/main/java/com/github/gotify/client/model/UpdateUserExternal.java
src/main/java/com/github/gotify/client/model/User.java
src/main/java/com/github/gotify/client/model/UserPass.java
src/main/java/com/github/gotify/client/model/VersionInfo.java

View File

@@ -0,0 +1 @@
7.19.0

View File

@@ -1 +0,0 @@
3.0.63

View File

@@ -1,17 +0,0 @@
#
# 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

View File

@@ -1,4 +1,4 @@
# swagger-java-client
# openapi-java-client
## Requirements
@@ -24,9 +24,9 @@ After the client library is installed/deployed, you can use it in your Maven pro
```xml
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-java-client</artifactId>
<version>1.0.0</version>
<groupId>org.openapitools</groupId>
<artifactId>openapi-java-client</artifactId>
<version>2.0.2</version>
<scope>compile</scope>
</dependency>

View File

@@ -4,12 +4,12 @@ plugins {
}
ext {
oltu_version = "1.0.2"
retrofit_version = "2.7.1"
swagger_annotations_version = "2.0.0"
junit_version = "4.12"
threetenbp_version = "1.4.1"
json_fire_version = "1.8.3"
oltu_version = "1.0.1"
retrofit_version = "2.11.0"
jakarta_annotation_version = "1.3.5"
swagger_annotations_version = "2.2.28"
junit_version = "5.10.3"
json_fire_version = "1.9.0"
}
dependencies {
@@ -17,39 +17,26 @@ dependencies {
implementation "com.squareup.retrofit2:converter-scalars:$retrofit_version"
implementation "com.squareup.retrofit2:converter-gson:$retrofit_version"
implementation "io.swagger.core.v3:swagger-annotations:$swagger_annotations_version"
implementation "com.google.code.findbugs:jsr305:3.0.2"
implementation ("org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version"){
exclude group:'org.apache.oltu.oauth2' , module: 'org.apache.oltu.oauth2.common'
exclude group: 'org.json', module: 'json'
}
implementation "org.json:json:20180130"
implementation "io.gsonfire:gson-fire:$json_fire_version"
implementation "org.threeten:threetenbp:$threetenbp_version"
testImplementation "junit:junit:$junit_version"
implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version"
testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version"
}
group = 'io.swagger'
version = '1.0.0'
description = 'Swagger Java'
group = 'org.openapitools'
version = '2.0.2'
java.sourceCompatibility = 11
java.targetCompatibility = 11
tasks.register('testsJar', Jar) {
archiveClassifier = 'tests'
from(sourceSets.test.output)
}
java {
withSourcesJar()
withJavadocJar()
}
java.sourceCompatibility = JavaVersion.VERSION_11
java.targetCompatibility = JavaVersion.VERSION_11
publishing {
publications {
maven(MavenPublication) {
from(components.java)
artifact(testsJar)
artifactId = 'openapi-java-client'
from components.java
}
}
}

View File

@@ -1,22 +0,0 @@
lazy val root = (project in file(".")).
settings(
organization := "io.swagger",
name := "swagger-java-client",
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(
"com.squareup.retrofit2" % "retrofit" % "2.3.0" % "compile",
"com.squareup.retrofit2" % "converter-scalars" % "2.3.0" % "compile",
"com.squareup.retrofit2" % "converter-gson" % "2.3.0" % "compile",
"io.swagger.core.v3" % "swagger-annotations" % "2.0.0" % "compile",
"org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.2" % "compile",
"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.11" % "test"
)
)

View File

@@ -1,13 +0,0 @@
# Application
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**defaultPriority** | **Long** | The default priority of messages sent by this application. Defaults to 0. | [optional]
**description** | **String** | The description of the application. |
**id** | **Long** | The application id. |
**image** | **String** | The image of the application. |
**internal** | **Boolean** | Whether the application is an internal application. Internal applications should not be deleted. |
**lastUsed** | [**OffsetDateTime**](OffsetDateTime.md) | The last time the application token was used. | [optional]
**name** | **String** | The application name. This is how the application should be displayed to the user. |
**token** | **String** | The application token. Can be used as &#x60;appToken&#x60;. See Authentication. |

View File

@@ -1,427 +0,0 @@
# ApplicationApi
All URIs are relative to *http://localhost/*
Method | HTTP request | Description
------------- | ------------- | -------------
[**createApp**](ApplicationApi.md#createApp) | **POST** application | Create an application.
[**deleteApp**](ApplicationApi.md#deleteApp) | **DELETE** application/{id} | Delete an application.
[**getApps**](ApplicationApi.md#getApps) | **GET** application | Return all applications.
[**removeAppImage**](ApplicationApi.md#removeAppImage) | **DELETE** application/{id}/image | Deletes an image of an application.
[**updateApplication**](ApplicationApi.md#updateApplication) | **PUT** application/{id} | Update an application.
[**uploadAppImage**](ApplicationApi.md#uploadAppImage) | **POST** application/{id}/image | Upload an image for an application.
<a name="createApp"></a>
# **createApp**
> Application createApp(body)
Create an application.
### Example
```java
// Import classes:
//import com.github.gotify.client.ApiClient;
//import com.github.gotify.client.ApiException;
//import com.github.gotify.client.Configuration;
//import com.github.gotify.client.auth.*;
//import com.github.gotify.client.api.ApplicationApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
// Configure API key authorization: clientTokenAuthorizationHeader
ApiKeyAuth clientTokenAuthorizationHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenAuthorizationHeader");
clientTokenAuthorizationHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenAuthorizationHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenHeader
ApiKeyAuth clientTokenHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenHeader");
clientTokenHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenQuery
ApiKeyAuth clientTokenQuery = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenQuery");
clientTokenQuery.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenQuery.setApiKeyPrefix("Token");
ApplicationApi apiInstance = new ApplicationApi();
ApplicationParams body = new ApplicationParams(); // ApplicationParams | the application to add
try {
Application result = apiInstance.createApp(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ApplicationApi#createApp");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**ApplicationParams**](ApplicationParams.md)| the application to add |
### Return type
[**Application**](Application.md)
### Authorization
[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
<a name="deleteApp"></a>
# **deleteApp**
> Void deleteApp(id)
Delete an application.
### Example
```java
// Import classes:
//import com.github.gotify.client.ApiClient;
//import com.github.gotify.client.ApiException;
//import com.github.gotify.client.Configuration;
//import com.github.gotify.client.auth.*;
//import com.github.gotify.client.api.ApplicationApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
// Configure API key authorization: clientTokenAuthorizationHeader
ApiKeyAuth clientTokenAuthorizationHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenAuthorizationHeader");
clientTokenAuthorizationHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenAuthorizationHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenHeader
ApiKeyAuth clientTokenHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenHeader");
clientTokenHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenQuery
ApiKeyAuth clientTokenQuery = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenQuery");
clientTokenQuery.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenQuery.setApiKeyPrefix("Token");
ApplicationApi apiInstance = new ApplicationApi();
Long id = 789L; // Long | the application id
try {
Void result = apiInstance.deleteApp(id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ApplicationApi#deleteApp");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **Long**| the application id |
### Return type
[**Void**](.md)
### Authorization
[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
<a name="getApps"></a>
# **getApps**
> List&lt;Application&gt; getApps()
Return all applications.
### Example
```java
// Import classes:
//import com.github.gotify.client.ApiClient;
//import com.github.gotify.client.ApiException;
//import com.github.gotify.client.Configuration;
//import com.github.gotify.client.auth.*;
//import com.github.gotify.client.api.ApplicationApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
// Configure API key authorization: clientTokenAuthorizationHeader
ApiKeyAuth clientTokenAuthorizationHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenAuthorizationHeader");
clientTokenAuthorizationHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenAuthorizationHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenHeader
ApiKeyAuth clientTokenHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenHeader");
clientTokenHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenQuery
ApiKeyAuth clientTokenQuery = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenQuery");
clientTokenQuery.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenQuery.setApiKeyPrefix("Token");
ApplicationApi apiInstance = new ApplicationApi();
try {
List<Application> result = apiInstance.getApps();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ApplicationApi#getApps");
e.printStackTrace();
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**List&lt;Application&gt;**](Application.md)
### Authorization
[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
<a name="removeAppImage"></a>
# **removeAppImage**
> Void removeAppImage(id)
Deletes an image of an application.
### Example
```java
// Import classes:
//import com.github.gotify.client.ApiClient;
//import com.github.gotify.client.ApiException;
//import com.github.gotify.client.Configuration;
//import com.github.gotify.client.auth.*;
//import com.github.gotify.client.api.ApplicationApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
// Configure API key authorization: clientTokenAuthorizationHeader
ApiKeyAuth clientTokenAuthorizationHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenAuthorizationHeader");
clientTokenAuthorizationHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenAuthorizationHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenHeader
ApiKeyAuth clientTokenHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenHeader");
clientTokenHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenQuery
ApiKeyAuth clientTokenQuery = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenQuery");
clientTokenQuery.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenQuery.setApiKeyPrefix("Token");
ApplicationApi apiInstance = new ApplicationApi();
Long id = 789L; // Long | the application id
try {
Void result = apiInstance.removeAppImage(id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ApplicationApi#removeAppImage");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **Long**| the application id |
### Return type
[**Void**](.md)
### Authorization
[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
<a name="updateApplication"></a>
# **updateApplication**
> Application updateApplication(body, id)
Update an application.
### Example
```java
// Import classes:
//import com.github.gotify.client.ApiClient;
//import com.github.gotify.client.ApiException;
//import com.github.gotify.client.Configuration;
//import com.github.gotify.client.auth.*;
//import com.github.gotify.client.api.ApplicationApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
// Configure API key authorization: clientTokenAuthorizationHeader
ApiKeyAuth clientTokenAuthorizationHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenAuthorizationHeader");
clientTokenAuthorizationHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenAuthorizationHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenHeader
ApiKeyAuth clientTokenHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenHeader");
clientTokenHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenQuery
ApiKeyAuth clientTokenQuery = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenQuery");
clientTokenQuery.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenQuery.setApiKeyPrefix("Token");
ApplicationApi apiInstance = new ApplicationApi();
ApplicationParams body = new ApplicationParams(); // ApplicationParams | the application to update
Long id = 789L; // Long | the application id
try {
Application result = apiInstance.updateApplication(body, id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ApplicationApi#updateApplication");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**ApplicationParams**](ApplicationParams.md)| the application to update |
**id** | **Long**| the application id |
### Return type
[**Application**](Application.md)
### Authorization
[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
<a name="uploadAppImage"></a>
# **uploadAppImage**
> Application uploadAppImage(file, id)
Upload an image for an application.
### Example
```java
// Import classes:
//import com.github.gotify.client.ApiClient;
//import com.github.gotify.client.ApiException;
//import com.github.gotify.client.Configuration;
//import com.github.gotify.client.auth.*;
//import com.github.gotify.client.api.ApplicationApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
// Configure API key authorization: clientTokenAuthorizationHeader
ApiKeyAuth clientTokenAuthorizationHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenAuthorizationHeader");
clientTokenAuthorizationHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenAuthorizationHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenHeader
ApiKeyAuth clientTokenHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenHeader");
clientTokenHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenQuery
ApiKeyAuth clientTokenQuery = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenQuery");
clientTokenQuery.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenQuery.setApiKeyPrefix("Token");
ApplicationApi apiInstance = new ApplicationApi();
File file = new File("file_example"); // File |
Long id = 789L; // Long | the application id
try {
Application result = apiInstance.uploadAppImage(file, id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ApplicationApi#uploadAppImage");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**file** | **File**| |
**id** | **Long**| the application id |
### Return type
[**Application**](Application.md)
### Authorization
[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery)
### HTTP request headers
- **Content-Type**: multipart/form-data
- **Accept**: application/json

View File

@@ -1,8 +0,0 @@
# ApplicationParams
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**defaultPriority** | **Long** | The default priority of messages sent by this application. Defaults to 0. | [optional]
**description** | **String** | The description of the application. | [optional]
**name** | **String** | The application name. This is how the application should be displayed to the user. |

View File

@@ -1,9 +0,0 @@
# Client
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **Long** | The client id. |
**lastUsed** | [**OffsetDateTime**](OffsetDateTime.md) | The last time the client token was used. | [optional]
**name** | **String** | The client name. This is how the client should be displayed to the user. |
**token** | **String** | The client token. Can be used as &#x60;clientToken&#x60;. See Authentication. |

View File

@@ -1,285 +0,0 @@
# ClientApi
All URIs are relative to *http://localhost/*
Method | HTTP request | Description
------------- | ------------- | -------------
[**createClient**](ClientApi.md#createClient) | **POST** client | Create a client.
[**deleteClient**](ClientApi.md#deleteClient) | **DELETE** client/{id} | Delete a client.
[**getClients**](ClientApi.md#getClients) | **GET** client | Return all clients.
[**updateClient**](ClientApi.md#updateClient) | **PUT** client/{id} | Update a client.
<a name="createClient"></a>
# **createClient**
> Client createClient(body)
Create a client.
### Example
```java
// Import classes:
//import com.github.gotify.client.ApiClient;
//import com.github.gotify.client.ApiException;
//import com.github.gotify.client.Configuration;
//import com.github.gotify.client.auth.*;
//import com.github.gotify.client.api.ClientApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
// Configure API key authorization: clientTokenAuthorizationHeader
ApiKeyAuth clientTokenAuthorizationHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenAuthorizationHeader");
clientTokenAuthorizationHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenAuthorizationHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenHeader
ApiKeyAuth clientTokenHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenHeader");
clientTokenHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenQuery
ApiKeyAuth clientTokenQuery = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenQuery");
clientTokenQuery.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenQuery.setApiKeyPrefix("Token");
ClientApi apiInstance = new ClientApi();
ClientParams body = new ClientParams(); // ClientParams | the client to add
try {
Client result = apiInstance.createClient(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ClientApi#createClient");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**ClientParams**](ClientParams.md)| the client to add |
### Return type
[**Client**](Client.md)
### Authorization
[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
<a name="deleteClient"></a>
# **deleteClient**
> Void deleteClient(id)
Delete a client.
### Example
```java
// Import classes:
//import com.github.gotify.client.ApiClient;
//import com.github.gotify.client.ApiException;
//import com.github.gotify.client.Configuration;
//import com.github.gotify.client.auth.*;
//import com.github.gotify.client.api.ClientApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
// Configure API key authorization: clientTokenAuthorizationHeader
ApiKeyAuth clientTokenAuthorizationHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenAuthorizationHeader");
clientTokenAuthorizationHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenAuthorizationHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenHeader
ApiKeyAuth clientTokenHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenHeader");
clientTokenHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenQuery
ApiKeyAuth clientTokenQuery = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenQuery");
clientTokenQuery.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenQuery.setApiKeyPrefix("Token");
ClientApi apiInstance = new ClientApi();
Long id = 789L; // Long | the client id
try {
Void result = apiInstance.deleteClient(id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ClientApi#deleteClient");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **Long**| the client id |
### Return type
[**Void**](.md)
### Authorization
[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
<a name="getClients"></a>
# **getClients**
> List&lt;Client&gt; getClients()
Return all clients.
### Example
```java
// Import classes:
//import com.github.gotify.client.ApiClient;
//import com.github.gotify.client.ApiException;
//import com.github.gotify.client.Configuration;
//import com.github.gotify.client.auth.*;
//import com.github.gotify.client.api.ClientApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
// Configure API key authorization: clientTokenAuthorizationHeader
ApiKeyAuth clientTokenAuthorizationHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenAuthorizationHeader");
clientTokenAuthorizationHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenAuthorizationHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenHeader
ApiKeyAuth clientTokenHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenHeader");
clientTokenHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenQuery
ApiKeyAuth clientTokenQuery = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenQuery");
clientTokenQuery.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenQuery.setApiKeyPrefix("Token");
ClientApi apiInstance = new ClientApi();
try {
List<Client> result = apiInstance.getClients();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ClientApi#getClients");
e.printStackTrace();
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**List&lt;Client&gt;**](Client.md)
### Authorization
[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
<a name="updateClient"></a>
# **updateClient**
> Client updateClient(body, id)
Update a client.
### Example
```java
// Import classes:
//import com.github.gotify.client.ApiClient;
//import com.github.gotify.client.ApiException;
//import com.github.gotify.client.Configuration;
//import com.github.gotify.client.auth.*;
//import com.github.gotify.client.api.ClientApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
// Configure API key authorization: clientTokenAuthorizationHeader
ApiKeyAuth clientTokenAuthorizationHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenAuthorizationHeader");
clientTokenAuthorizationHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenAuthorizationHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenHeader
ApiKeyAuth clientTokenHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenHeader");
clientTokenHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenQuery
ApiKeyAuth clientTokenQuery = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenQuery");
clientTokenQuery.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenQuery.setApiKeyPrefix("Token");
ClientApi apiInstance = new ClientApi();
ClientParams body = new ClientParams(); // ClientParams | the client to update
Long id = 789L; // Long | the client id
try {
Client result = apiInstance.updateClient(body, id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ClientApi#updateClient");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**ClientParams**](ClientParams.md)| the client to update |
**id** | **Long**| the client id |
### Return type
[**Client**](Client.md)
### Authorization
[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json

View File

@@ -1,6 +0,0 @@
# ClientParams
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **String** | The client name |

View File

@@ -1,8 +0,0 @@
# CreateUserExternal
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**admin** | **Boolean** | If the user is an administrator. |
**name** | **String** | The user name. For login. |
**pass** | **String** | The user password. For login. |

View File

@@ -1,8 +0,0 @@
# Error
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**error** | **String** | The general error message |
**errorCode** | **Long** | The http error code. |
**errorDescription** | **String** | The http error code. |

View File

@@ -1,7 +0,0 @@
# Health
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**database** | **String** | The health of the database connection. |
**health** | **String** | The health of the overall application. |

View File

@@ -1,47 +0,0 @@
# HealthApi
All URIs are relative to *http://localhost/*
Method | HTTP request | Description
------------- | ------------- | -------------
[**getHealth**](HealthApi.md#getHealth) | **GET** health | Get health information.
<a name="getHealth"></a>
# **getHealth**
> Health getHealth()
Get health information.
### Example
```java
// Import classes:
//import com.github.gotify.client.ApiException;
//import com.github.gotify.client.api.HealthApi;
HealthApi apiInstance = new HealthApi();
try {
Health result = apiInstance.getHealth();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling HealthApi#getHealth");
e.printStackTrace();
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**Health**](Health.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json

View File

@@ -1,6 +0,0 @@
# IdImageBody
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**file** | [**File**](File.md) | the application image |

View File

@@ -1,12 +0,0 @@
# Message
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**appid** | **Long** | The application id that send this message. |
**date** | [**OffsetDateTime**](OffsetDateTime.md) | The date the message was created. |
**extras** | **Map&lt;String, Object&gt;** | The extra data sent along the message. The extra fields are stored in a key-value scheme. Only accepted in CreateMessage requests with application/json content-type. The keys should be in the following format: &amp;lt;top-namespace&amp;gt;::[&amp;lt;sub-namespace&amp;gt;::]&amp;lt;action&amp;gt; These namespaces are reserved and might be used in the official clients: gotify android ios web server client. Do not use them for other purposes. | [optional]
**id** | **Long** | The message id. |
**message** | **String** | The message. Markdown (excluding html) is allowed. |
**priority** | **Long** | The priority of the message. If unset, then the default priority of the application will be used. | [optional]
**title** | **String** | The title of the message. | [optional]

View File

@@ -1,493 +0,0 @@
# MessageApi
All URIs are relative to *http://localhost/*
Method | HTTP request | Description
------------- | ------------- | -------------
[**createMessage**](MessageApi.md#createMessage) | **POST** message | Create a message.
[**deleteAppMessages**](MessageApi.md#deleteAppMessages) | **DELETE** application/{id}/message | Delete all messages from a specific application.
[**deleteMessage**](MessageApi.md#deleteMessage) | **DELETE** message/{id} | Deletes a message with an id.
[**deleteMessages**](MessageApi.md#deleteMessages) | **DELETE** message | Delete all messages.
[**getAppMessages**](MessageApi.md#getAppMessages) | **GET** application/{id}/message | Return all messages from a specific application.
[**getMessages**](MessageApi.md#getMessages) | **GET** message | Return all messages.
[**streamMessages**](MessageApi.md#streamMessages) | **GET** stream | Websocket, return newly created messages.
<a name="createMessage"></a>
# **createMessage**
> Message createMessage(body)
Create a message.
__NOTE__: This API ONLY accepts an application token as authentication.
### Example
```java
// Import classes:
//import com.github.gotify.client.ApiClient;
//import com.github.gotify.client.ApiException;
//import com.github.gotify.client.Configuration;
//import com.github.gotify.client.auth.*;
//import com.github.gotify.client.api.MessageApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: appTokenAuthorizationHeader
ApiKeyAuth appTokenAuthorizationHeader = (ApiKeyAuth) defaultClient.getAuthentication("appTokenAuthorizationHeader");
appTokenAuthorizationHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//appTokenAuthorizationHeader.setApiKeyPrefix("Token");
// Configure API key authorization: appTokenHeader
ApiKeyAuth appTokenHeader = (ApiKeyAuth) defaultClient.getAuthentication("appTokenHeader");
appTokenHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//appTokenHeader.setApiKeyPrefix("Token");
// Configure API key authorization: appTokenQuery
ApiKeyAuth appTokenQuery = (ApiKeyAuth) defaultClient.getAuthentication("appTokenQuery");
appTokenQuery.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//appTokenQuery.setApiKeyPrefix("Token");
MessageApi apiInstance = new MessageApi();
Message body = new Message(); // Message | the message to add
try {
Message result = apiInstance.createMessage(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling MessageApi#createMessage");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Message**](Message.md)| the message to add |
### Return type
[**Message**](Message.md)
### Authorization
[appTokenAuthorizationHeader](../README.md#appTokenAuthorizationHeader)[appTokenHeader](../README.md#appTokenHeader)[appTokenQuery](../README.md#appTokenQuery)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
<a name="deleteAppMessages"></a>
# **deleteAppMessages**
> Void deleteAppMessages(id)
Delete all messages from a specific application.
### Example
```java
// Import classes:
//import com.github.gotify.client.ApiClient;
//import com.github.gotify.client.ApiException;
//import com.github.gotify.client.Configuration;
//import com.github.gotify.client.auth.*;
//import com.github.gotify.client.api.MessageApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
// Configure API key authorization: clientTokenAuthorizationHeader
ApiKeyAuth clientTokenAuthorizationHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenAuthorizationHeader");
clientTokenAuthorizationHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenAuthorizationHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenHeader
ApiKeyAuth clientTokenHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenHeader");
clientTokenHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenQuery
ApiKeyAuth clientTokenQuery = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenQuery");
clientTokenQuery.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenQuery.setApiKeyPrefix("Token");
MessageApi apiInstance = new MessageApi();
Long id = 789L; // Long | the application id
try {
Void result = apiInstance.deleteAppMessages(id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling MessageApi#deleteAppMessages");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **Long**| the application id |
### Return type
[**Void**](.md)
### Authorization
[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
<a name="deleteMessage"></a>
# **deleteMessage**
> Void deleteMessage(id)
Deletes a message with an id.
### Example
```java
// Import classes:
//import com.github.gotify.client.ApiClient;
//import com.github.gotify.client.ApiException;
//import com.github.gotify.client.Configuration;
//import com.github.gotify.client.auth.*;
//import com.github.gotify.client.api.MessageApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
// Configure API key authorization: clientTokenAuthorizationHeader
ApiKeyAuth clientTokenAuthorizationHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenAuthorizationHeader");
clientTokenAuthorizationHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenAuthorizationHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenHeader
ApiKeyAuth clientTokenHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenHeader");
clientTokenHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenQuery
ApiKeyAuth clientTokenQuery = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenQuery");
clientTokenQuery.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenQuery.setApiKeyPrefix("Token");
MessageApi apiInstance = new MessageApi();
Long id = 789L; // Long | the message id
try {
Void result = apiInstance.deleteMessage(id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling MessageApi#deleteMessage");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **Long**| the message id |
### Return type
[**Void**](.md)
### Authorization
[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
<a name="deleteMessages"></a>
# **deleteMessages**
> Void deleteMessages()
Delete all messages.
### Example
```java
// Import classes:
//import com.github.gotify.client.ApiClient;
//import com.github.gotify.client.ApiException;
//import com.github.gotify.client.Configuration;
//import com.github.gotify.client.auth.*;
//import com.github.gotify.client.api.MessageApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
// Configure API key authorization: clientTokenAuthorizationHeader
ApiKeyAuth clientTokenAuthorizationHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenAuthorizationHeader");
clientTokenAuthorizationHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenAuthorizationHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenHeader
ApiKeyAuth clientTokenHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenHeader");
clientTokenHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenQuery
ApiKeyAuth clientTokenQuery = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenQuery");
clientTokenQuery.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenQuery.setApiKeyPrefix("Token");
MessageApi apiInstance = new MessageApi();
try {
Void result = apiInstance.deleteMessages();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling MessageApi#deleteMessages");
e.printStackTrace();
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**Void**](.md)
### Authorization
[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
<a name="getAppMessages"></a>
# **getAppMessages**
> PagedMessages getAppMessages(id, limit, since)
Return all messages from a specific application.
### Example
```java
// Import classes:
//import com.github.gotify.client.ApiClient;
//import com.github.gotify.client.ApiException;
//import com.github.gotify.client.Configuration;
//import com.github.gotify.client.auth.*;
//import com.github.gotify.client.api.MessageApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
// Configure API key authorization: clientTokenAuthorizationHeader
ApiKeyAuth clientTokenAuthorizationHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenAuthorizationHeader");
clientTokenAuthorizationHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenAuthorizationHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenHeader
ApiKeyAuth clientTokenHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenHeader");
clientTokenHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenQuery
ApiKeyAuth clientTokenQuery = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenQuery");
clientTokenQuery.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenQuery.setApiKeyPrefix("Token");
MessageApi apiInstance = new MessageApi();
Long id = 789L; // Long | the application id
Integer limit = 100; // Integer | the maximal amount of messages to return
Long since = 789L; // Long | return all messages with an ID less than this value
try {
PagedMessages result = apiInstance.getAppMessages(id, limit, since);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling MessageApi#getAppMessages");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **Long**| the application id |
**limit** | **Integer**| the maximal amount of messages to return | [optional] [default to 100] [enum: 1, 200]
**since** | **Long**| return all messages with an ID less than this value | [optional] [enum: 0]
### Return type
[**PagedMessages**](PagedMessages.md)
### Authorization
[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
<a name="getMessages"></a>
# **getMessages**
> PagedMessages getMessages(limit, since)
Return all messages.
### Example
```java
// Import classes:
//import com.github.gotify.client.ApiClient;
//import com.github.gotify.client.ApiException;
//import com.github.gotify.client.Configuration;
//import com.github.gotify.client.auth.*;
//import com.github.gotify.client.api.MessageApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
// Configure API key authorization: clientTokenAuthorizationHeader
ApiKeyAuth clientTokenAuthorizationHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenAuthorizationHeader");
clientTokenAuthorizationHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenAuthorizationHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenHeader
ApiKeyAuth clientTokenHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenHeader");
clientTokenHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenQuery
ApiKeyAuth clientTokenQuery = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenQuery");
clientTokenQuery.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenQuery.setApiKeyPrefix("Token");
MessageApi apiInstance = new MessageApi();
Integer limit = 100; // Integer | the maximal amount of messages to return
Long since = 789L; // Long | return all messages with an ID less than this value
try {
PagedMessages result = apiInstance.getMessages(limit, since);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling MessageApi#getMessages");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**limit** | **Integer**| the maximal amount of messages to return | [optional] [default to 100] [enum: 1, 200]
**since** | **Long**| return all messages with an ID less than this value | [optional] [enum: 0]
### Return type
[**PagedMessages**](PagedMessages.md)
### Authorization
[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
<a name="streamMessages"></a>
# **streamMessages**
> Message streamMessages()
Websocket, return newly created messages.
### Example
```java
// Import classes:
//import com.github.gotify.client.ApiClient;
//import com.github.gotify.client.ApiException;
//import com.github.gotify.client.Configuration;
//import com.github.gotify.client.auth.*;
//import com.github.gotify.client.api.MessageApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
// Configure API key authorization: clientTokenAuthorizationHeader
ApiKeyAuth clientTokenAuthorizationHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenAuthorizationHeader");
clientTokenAuthorizationHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenAuthorizationHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenHeader
ApiKeyAuth clientTokenHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenHeader");
clientTokenHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenQuery
ApiKeyAuth clientTokenQuery = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenQuery");
clientTokenQuery.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenQuery.setApiKeyPrefix("Token");
MessageApi apiInstance = new MessageApi();
try {
Message result = apiInstance.streamMessages();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling MessageApi#streamMessages");
e.printStackTrace();
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**Message**](Message.md)
### Authorization
[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json

View File

@@ -1,7 +0,0 @@
# PagedMessages
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**messages** | [**List&lt;Message&gt;**](Message.md) | The messages. |
**paging** | [**Paging**](Paging.md) | |

View File

@@ -1,9 +0,0 @@
# Paging
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**limit** | **Long** | The limit of the messages for the current request. |
**next** | **String** | The request url for the next page. Empty/Null when no next page is available. | [optional]
**since** | **Long** | The ID of the last message returned in the current request. Use this as alternative to the next link. |
**size** | **Long** | The amount of messages that got returned in the current request. |

View File

@@ -1,423 +0,0 @@
# PluginApi
All URIs are relative to *http://localhost/*
Method | HTTP request | Description
------------- | ------------- | -------------
[**disablePlugin**](PluginApi.md#disablePlugin) | **POST** plugin/{id}/disable | Disable a plugin.
[**enablePlugin**](PluginApi.md#enablePlugin) | **POST** plugin/{id}/enable | Enable a plugin.
[**getPluginConfig**](PluginApi.md#getPluginConfig) | **GET** plugin/{id}/config | Get YAML configuration for Configurer plugin.
[**getPluginDisplay**](PluginApi.md#getPluginDisplay) | **GET** plugin/{id}/display | Get display info for a Displayer plugin.
[**getPlugins**](PluginApi.md#getPlugins) | **GET** plugin | Return all plugins.
[**updatePluginConfig**](PluginApi.md#updatePluginConfig) | **POST** plugin/{id}/config | Update YAML configuration for Configurer plugin.
<a name="disablePlugin"></a>
# **disablePlugin**
> Void disablePlugin(id)
Disable a plugin.
### Example
```java
// Import classes:
//import com.github.gotify.client.ApiClient;
//import com.github.gotify.client.ApiException;
//import com.github.gotify.client.Configuration;
//import com.github.gotify.client.auth.*;
//import com.github.gotify.client.api.PluginApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
// Configure API key authorization: clientTokenAuthorizationHeader
ApiKeyAuth clientTokenAuthorizationHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenAuthorizationHeader");
clientTokenAuthorizationHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenAuthorizationHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenHeader
ApiKeyAuth clientTokenHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenHeader");
clientTokenHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenQuery
ApiKeyAuth clientTokenQuery = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenQuery");
clientTokenQuery.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenQuery.setApiKeyPrefix("Token");
PluginApi apiInstance = new PluginApi();
Long id = 789L; // Long | the plugin id
try {
Void result = apiInstance.disablePlugin(id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PluginApi#disablePlugin");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **Long**| the plugin id |
### Return type
[**Void**](.md)
### Authorization
[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
<a name="enablePlugin"></a>
# **enablePlugin**
> Void enablePlugin(id)
Enable a plugin.
### Example
```java
// Import classes:
//import com.github.gotify.client.ApiClient;
//import com.github.gotify.client.ApiException;
//import com.github.gotify.client.Configuration;
//import com.github.gotify.client.auth.*;
//import com.github.gotify.client.api.PluginApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
// Configure API key authorization: clientTokenAuthorizationHeader
ApiKeyAuth clientTokenAuthorizationHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenAuthorizationHeader");
clientTokenAuthorizationHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenAuthorizationHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenHeader
ApiKeyAuth clientTokenHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenHeader");
clientTokenHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenQuery
ApiKeyAuth clientTokenQuery = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenQuery");
clientTokenQuery.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenQuery.setApiKeyPrefix("Token");
PluginApi apiInstance = new PluginApi();
Long id = 789L; // Long | the plugin id
try {
Void result = apiInstance.enablePlugin(id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PluginApi#enablePlugin");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **Long**| the plugin id |
### Return type
[**Void**](.md)
### Authorization
[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
<a name="getPluginConfig"></a>
# **getPluginConfig**
> Object getPluginConfig(id)
Get YAML configuration for Configurer plugin.
### Example
```java
// Import classes:
//import com.github.gotify.client.ApiClient;
//import com.github.gotify.client.ApiException;
//import com.github.gotify.client.Configuration;
//import com.github.gotify.client.auth.*;
//import com.github.gotify.client.api.PluginApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
// Configure API key authorization: clientTokenAuthorizationHeader
ApiKeyAuth clientTokenAuthorizationHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenAuthorizationHeader");
clientTokenAuthorizationHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenAuthorizationHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenHeader
ApiKeyAuth clientTokenHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenHeader");
clientTokenHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenQuery
ApiKeyAuth clientTokenQuery = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenQuery");
clientTokenQuery.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenQuery.setApiKeyPrefix("Token");
PluginApi apiInstance = new PluginApi();
Long id = 789L; // Long | the plugin id
try {
Object result = apiInstance.getPluginConfig(id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PluginApi#getPluginConfig");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **Long**| the plugin id |
### Return type
**Object**
### Authorization
[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/x-yaml
<a name="getPluginDisplay"></a>
# **getPluginDisplay**
> String getPluginDisplay(id)
Get display info for a Displayer plugin.
### Example
```java
// Import classes:
//import com.github.gotify.client.ApiClient;
//import com.github.gotify.client.ApiException;
//import com.github.gotify.client.Configuration;
//import com.github.gotify.client.auth.*;
//import com.github.gotify.client.api.PluginApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
// Configure API key authorization: clientTokenAuthorizationHeader
ApiKeyAuth clientTokenAuthorizationHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenAuthorizationHeader");
clientTokenAuthorizationHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenAuthorizationHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenHeader
ApiKeyAuth clientTokenHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenHeader");
clientTokenHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenQuery
ApiKeyAuth clientTokenQuery = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenQuery");
clientTokenQuery.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenQuery.setApiKeyPrefix("Token");
PluginApi apiInstance = new PluginApi();
Long id = 789L; // Long | the plugin id
try {
String result = apiInstance.getPluginDisplay(id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PluginApi#getPluginDisplay");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **Long**| the plugin id |
### Return type
**String**
### Authorization
[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
<a name="getPlugins"></a>
# **getPlugins**
> List&lt;PluginConf&gt; getPlugins()
Return all plugins.
### Example
```java
// Import classes:
//import com.github.gotify.client.ApiClient;
//import com.github.gotify.client.ApiException;
//import com.github.gotify.client.Configuration;
//import com.github.gotify.client.auth.*;
//import com.github.gotify.client.api.PluginApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
// Configure API key authorization: clientTokenAuthorizationHeader
ApiKeyAuth clientTokenAuthorizationHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenAuthorizationHeader");
clientTokenAuthorizationHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenAuthorizationHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenHeader
ApiKeyAuth clientTokenHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenHeader");
clientTokenHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenQuery
ApiKeyAuth clientTokenQuery = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenQuery");
clientTokenQuery.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenQuery.setApiKeyPrefix("Token");
PluginApi apiInstance = new PluginApi();
try {
List<PluginConf> result = apiInstance.getPlugins();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PluginApi#getPlugins");
e.printStackTrace();
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**List&lt;PluginConf&gt;**](PluginConf.md)
### Authorization
[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
<a name="updatePluginConfig"></a>
# **updatePluginConfig**
> Void updatePluginConfig(id)
Update YAML configuration for Configurer plugin.
### Example
```java
// Import classes:
//import com.github.gotify.client.ApiClient;
//import com.github.gotify.client.ApiException;
//import com.github.gotify.client.Configuration;
//import com.github.gotify.client.auth.*;
//import com.github.gotify.client.api.PluginApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
// Configure API key authorization: clientTokenAuthorizationHeader
ApiKeyAuth clientTokenAuthorizationHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenAuthorizationHeader");
clientTokenAuthorizationHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenAuthorizationHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenHeader
ApiKeyAuth clientTokenHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenHeader");
clientTokenHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenQuery
ApiKeyAuth clientTokenQuery = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenQuery");
clientTokenQuery.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenQuery.setApiKeyPrefix("Token");
PluginApi apiInstance = new PluginApi();
Long id = 789L; // Long | the plugin id
try {
Void result = apiInstance.updatePluginConfig(id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PluginApi#updatePluginConfig");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **Long**| the plugin id |
### Return type
[**Void**](.md)
### Authorization
[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json

View File

@@ -1,14 +0,0 @@
# PluginConf
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**author** | **String** | The author of the plugin. | [optional]
**capabilities** | **List&lt;String&gt;** | Capabilities the plugin provides |
**enabled** | **Boolean** | Whether the plugin instance is enabled. |
**id** | **Long** | The plugin id. |
**license** | **String** | The license of the plugin. | [optional]
**modulePath** | **String** | The module path of the plugin. |
**name** | **String** | The plugin name. |
**token** | **String** | The user name. For login. |
**website** | **String** | The website of the plugin. | [optional]

View File

@@ -1,8 +0,0 @@
# UpdateUserExternal
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**admin** | **Boolean** | If the user is an administrator. |
**name** | **String** | The user name. For login. |
**pass** | **String** | The user password. For login. Empty for using old password | [optional]

View File

@@ -1,8 +0,0 @@
# User
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**admin** | **Boolean** | If the user is an administrator. |
**id** | **Long** | The user id. |
**name** | **String** | The user name. For login. |

View File

@@ -1,493 +0,0 @@
# UserApi
All URIs are relative to *http://localhost/*
Method | HTTP request | Description
------------- | ------------- | -------------
[**createUser**](UserApi.md#createUser) | **POST** user | Create a user.
[**currentUser**](UserApi.md#currentUser) | **GET** current/user | Return the current user.
[**deleteUser**](UserApi.md#deleteUser) | **DELETE** user/{id} | Deletes a user.
[**getUser**](UserApi.md#getUser) | **GET** user/{id} | Get a user.
[**getUsers**](UserApi.md#getUsers) | **GET** user | Return all users.
[**updateCurrentUser**](UserApi.md#updateCurrentUser) | **POST** current/user/password | Update the password of the current user.
[**updateUser**](UserApi.md#updateUser) | **POST** user/{id} | Update a user.
<a name="createUser"></a>
# **createUser**
> User createUser(body)
Create a user.
With enabled registration: non admin users can be created without authentication. With disabled registrations: users can only be created by admin users.
### Example
```java
// Import classes:
//import com.github.gotify.client.ApiClient;
//import com.github.gotify.client.ApiException;
//import com.github.gotify.client.Configuration;
//import com.github.gotify.client.auth.*;
//import com.github.gotify.client.api.UserApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
// Configure API key authorization: clientTokenAuthorizationHeader
ApiKeyAuth clientTokenAuthorizationHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenAuthorizationHeader");
clientTokenAuthorizationHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenAuthorizationHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenHeader
ApiKeyAuth clientTokenHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenHeader");
clientTokenHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenQuery
ApiKeyAuth clientTokenQuery = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenQuery");
clientTokenQuery.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenQuery.setApiKeyPrefix("Token");
UserApi apiInstance = new UserApi();
CreateUserExternal body = new CreateUserExternal(); // CreateUserExternal | the user to add
try {
User result = apiInstance.createUser(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling UserApi#createUser");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**CreateUserExternal**](CreateUserExternal.md)| the user to add |
### Return type
[**User**](User.md)
### Authorization
[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
<a name="currentUser"></a>
# **currentUser**
> User currentUser()
Return the current user.
### Example
```java
// Import classes:
//import com.github.gotify.client.ApiClient;
//import com.github.gotify.client.ApiException;
//import com.github.gotify.client.Configuration;
//import com.github.gotify.client.auth.*;
//import com.github.gotify.client.api.UserApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
// Configure API key authorization: clientTokenAuthorizationHeader
ApiKeyAuth clientTokenAuthorizationHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenAuthorizationHeader");
clientTokenAuthorizationHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenAuthorizationHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenHeader
ApiKeyAuth clientTokenHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenHeader");
clientTokenHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenQuery
ApiKeyAuth clientTokenQuery = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenQuery");
clientTokenQuery.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenQuery.setApiKeyPrefix("Token");
UserApi apiInstance = new UserApi();
try {
User result = apiInstance.currentUser();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling UserApi#currentUser");
e.printStackTrace();
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**User**](User.md)
### Authorization
[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
<a name="deleteUser"></a>
# **deleteUser**
> Void deleteUser(id)
Deletes a user.
### Example
```java
// Import classes:
//import com.github.gotify.client.ApiClient;
//import com.github.gotify.client.ApiException;
//import com.github.gotify.client.Configuration;
//import com.github.gotify.client.auth.*;
//import com.github.gotify.client.api.UserApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
// Configure API key authorization: clientTokenAuthorizationHeader
ApiKeyAuth clientTokenAuthorizationHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenAuthorizationHeader");
clientTokenAuthorizationHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenAuthorizationHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenHeader
ApiKeyAuth clientTokenHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenHeader");
clientTokenHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenQuery
ApiKeyAuth clientTokenQuery = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenQuery");
clientTokenQuery.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenQuery.setApiKeyPrefix("Token");
UserApi apiInstance = new UserApi();
Long id = 789L; // Long | the user id
try {
Void result = apiInstance.deleteUser(id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling UserApi#deleteUser");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **Long**| the user id |
### Return type
[**Void**](.md)
### Authorization
[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
<a name="getUser"></a>
# **getUser**
> User getUser(id)
Get a user.
### Example
```java
// Import classes:
//import com.github.gotify.client.ApiClient;
//import com.github.gotify.client.ApiException;
//import com.github.gotify.client.Configuration;
//import com.github.gotify.client.auth.*;
//import com.github.gotify.client.api.UserApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
// Configure API key authorization: clientTokenAuthorizationHeader
ApiKeyAuth clientTokenAuthorizationHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenAuthorizationHeader");
clientTokenAuthorizationHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenAuthorizationHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenHeader
ApiKeyAuth clientTokenHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenHeader");
clientTokenHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenQuery
ApiKeyAuth clientTokenQuery = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenQuery");
clientTokenQuery.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenQuery.setApiKeyPrefix("Token");
UserApi apiInstance = new UserApi();
Long id = 789L; // Long | the user id
try {
User result = apiInstance.getUser(id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling UserApi#getUser");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **Long**| the user id |
### Return type
[**User**](User.md)
### Authorization
[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
<a name="getUsers"></a>
# **getUsers**
> List&lt;User&gt; getUsers()
Return all users.
### Example
```java
// Import classes:
//import com.github.gotify.client.ApiClient;
//import com.github.gotify.client.ApiException;
//import com.github.gotify.client.Configuration;
//import com.github.gotify.client.auth.*;
//import com.github.gotify.client.api.UserApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
// Configure API key authorization: clientTokenAuthorizationHeader
ApiKeyAuth clientTokenAuthorizationHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenAuthorizationHeader");
clientTokenAuthorizationHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenAuthorizationHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenHeader
ApiKeyAuth clientTokenHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenHeader");
clientTokenHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenQuery
ApiKeyAuth clientTokenQuery = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenQuery");
clientTokenQuery.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenQuery.setApiKeyPrefix("Token");
UserApi apiInstance = new UserApi();
try {
List<User> result = apiInstance.getUsers();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling UserApi#getUsers");
e.printStackTrace();
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**List&lt;User&gt;**](User.md)
### Authorization
[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
<a name="updateCurrentUser"></a>
# **updateCurrentUser**
> Void updateCurrentUser(body)
Update the password of the current user.
### Example
```java
// Import classes:
//import com.github.gotify.client.ApiClient;
//import com.github.gotify.client.ApiException;
//import com.github.gotify.client.Configuration;
//import com.github.gotify.client.auth.*;
//import com.github.gotify.client.api.UserApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
// Configure API key authorization: clientTokenAuthorizationHeader
ApiKeyAuth clientTokenAuthorizationHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenAuthorizationHeader");
clientTokenAuthorizationHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenAuthorizationHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenHeader
ApiKeyAuth clientTokenHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenHeader");
clientTokenHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenQuery
ApiKeyAuth clientTokenQuery = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenQuery");
clientTokenQuery.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenQuery.setApiKeyPrefix("Token");
UserApi apiInstance = new UserApi();
UserPass body = new UserPass(); // UserPass | the user
try {
Void result = apiInstance.updateCurrentUser(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling UserApi#updateCurrentUser");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**UserPass**](UserPass.md)| the user |
### Return type
[**Void**](.md)
### Authorization
[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
<a name="updateUser"></a>
# **updateUser**
> User updateUser(body, id)
Update a user.
### Example
```java
// Import classes:
//import com.github.gotify.client.ApiClient;
//import com.github.gotify.client.ApiException;
//import com.github.gotify.client.Configuration;
//import com.github.gotify.client.auth.*;
//import com.github.gotify.client.api.UserApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
// Configure API key authorization: clientTokenAuthorizationHeader
ApiKeyAuth clientTokenAuthorizationHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenAuthorizationHeader");
clientTokenAuthorizationHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenAuthorizationHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenHeader
ApiKeyAuth clientTokenHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenHeader");
clientTokenHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenHeader.setApiKeyPrefix("Token");
// Configure API key authorization: clientTokenQuery
ApiKeyAuth clientTokenQuery = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenQuery");
clientTokenQuery.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//clientTokenQuery.setApiKeyPrefix("Token");
UserApi apiInstance = new UserApi();
UpdateUserExternal body = new UpdateUserExternal(); // UpdateUserExternal | the updated user
Long id = 789L; // Long | the user id
try {
User result = apiInstance.updateUser(body, id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling UserApi#updateUser");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**UpdateUserExternal**](UpdateUserExternal.md)| the updated user |
**id** | **Long**| the user id |
### Return type
[**User**](User.md)
### Authorization
[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json

View File

@@ -1,6 +0,0 @@
# UserPass
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**pass** | **String** | The user password. For login. |

View File

@@ -1,47 +0,0 @@
# VersionApi
All URIs are relative to *http://localhost/*
Method | HTTP request | Description
------------- | ------------- | -------------
[**getVersion**](VersionApi.md#getVersion) | **GET** version | Get version information.
<a name="getVersion"></a>
# **getVersion**
> VersionInfo getVersion()
Get version information.
### Example
```java
// Import classes:
//import com.github.gotify.client.ApiException;
//import com.github.gotify.client.api.VersionApi;
VersionApi apiInstance = new VersionApi();
try {
VersionInfo result = apiInstance.getVersion();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling VersionApi#getVersion");
e.printStackTrace();
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**VersionInfo**](VersionInfo.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json

View File

@@ -1,8 +0,0 @@
# VersionInfo
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**buildDate** | **String** | The date on which this binary was built. |
**commit** | **String** | The git commit hash on which this binary was built. |
**version** | **String** | The current version. |

View File

@@ -1,11 +1,17 @@
#!/bin/sh
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
#
# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
git_user_id=$1
git_repo_id=$2
release_note=$3
git_host=$4
if [ "$git_host" = "" ]; then
git_host="github.com"
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
fi
if [ "$git_user_id" = "" ]; then
git_user_id="GIT_USER_ID"
@@ -28,18 +34,18 @@ git init
# Adds the files in the local repository and stages them for commit.
git add .
# Commits the tracked changes and prepares them to be pushed to a remote repository.
# Commits the tracked changes and prepares them to be pushed to a remote repository.
git commit -m "$release_note"
# Sets the new remote
git_remote=`git remote`
git_remote=$(git remote)
if [ "$git_remote" = "" ]; then # git remote not defined
if [ "$GIT_TOKEN" = "" ]; then
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment."
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
else
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
fi
fi
@@ -47,6 +53,5 @@ fi
git pull origin master
# Pushes (Forces) the changes in the local repository up to the remote repository
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
git push origin master 2>&1 | grep -v 'To https'

View File

@@ -1,2 +1,6 @@
# Uncomment to build for Android
#target = android
# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator).
# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option.
#
# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties
# For example, uncomment below to build for Android
#target = android

Binary file not shown.

View File

@@ -1,7 +0,0 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

160
client/gradlew vendored
View File

@@ -1,160 +0,0 @@
#!/usr/bin/env bash
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"

90
client/gradlew.bat vendored
View File

@@ -1,90 +0,0 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

View File

@@ -1,244 +0,0 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.swagger</groupId>
<artifactId>swagger-java-client</artifactId>
<packaging>jar</packaging>
<name>swagger-java-client</name>
<version>1.0.0</version>
<url>https://github.com/swagger-api/swagger-codegen</url>
<description>Swagger Java</description>
<scm>
<connection>scm:git:git@github.com:swagger-api/swagger-codegen.git</connection>
<developerConnection>scm:git:git@github.com:swagger-api/swagger-codegen.git</developerConnection>
<url>https://github.com/swagger-api/swagger-codegen</url>
</scm>
<prerequisites>
<maven>2.2.0</maven>
</prerequisites>
<licenses>
<license>
<name>Unlicense</name>
<url>https://github.com/gotify/server/blob/master/LICENSE</url>
<distribution>repo</distribution>
</license>
</licenses>
<developers>
<developer>
<name>Swagger</name>
<email>apiteam@swagger.io</email>
<organization>Swagger</organization>
<organizationUrl>http://swagger.io</organizationUrl>
</developer>
</developers>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12</version>
<configuration>
<systemProperties>
<property>
<name>loggerPath</name>
<value>conf/log4j.properties</value>
</property>
</systemProperties>
<argLine>-Xms512m -Xmx1500m</argLine>
<parallel>methods</parallel>
<forkMode>pertest</forkMode>
</configuration>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<!-- attach test jar -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<goals>
<goal>jar</goal>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
<configuration>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.10</version>
<executions>
<execution>
<id>add_sources</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>src/main/java</source>
</sources>
</configuration>
</execution>
<execution>
<id>add_test_sources</id>
<phase>generate-test-sources</phase>
<goals>
<goal>add-test-source</goal>
</goals>
<configuration>
<sources>
<source>src/test/java</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>sign-artifacts</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>jdk11</id>
<activation>
<jdk>[11,)</jdk>
</activation>
<dependencies>
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-rt</artifactId>
<version>2.3.3</version>
<type>pom</type>
</dependency>
</dependencies>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId>
<version>${swagger-core-version}</version>
</dependency>
<dependency>
<groupId>com.squareup.retrofit2</groupId>
<artifactId>converter-gson</artifactId>
<version>${retrofit-version}</version>
</dependency>
<dependency>
<groupId>com.squareup.retrofit2</groupId>
<artifactId>retrofit</artifactId>
<version>${retrofit-version}</version>
</dependency>
<dependency>
<groupId>com.squareup.retrofit2</groupId>
<artifactId>converter-scalars</artifactId>
<version>${retrofit-version}</version>
</dependency>
<dependency>
<groupId>org.apache.oltu.oauth2</groupId>
<artifactId>org.apache.oltu.oauth2.client</artifactId>
<version>${oltu-version}</version>
</dependency>
<dependency>
<groupId>io.gsonfire</groupId>
<artifactId>gson-fire</artifactId>
<version>${gson-fire-version}</version>
</dependency>
<dependency>
<groupId>org.threeten</groupId>
<artifactId>threetenbp</artifactId>
<version>${threetenbp-version}</version>
</dependency>
<!-- test dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit-version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>11</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<gson-fire-version>1.8.0</gson-fire-version>
<swagger-core-version>2.0.0</swagger-core-version>
<retrofit-version>2.3.0</retrofit-version>
<threetenbp-version>1.3.5</threetenbp-version>
<oltu-version>1.0.2</oltu-version>
<junit-version>4.13.1</junit-version>
</properties>
</project>

View File

@@ -1,3 +1,16 @@
/*
* Gotify REST-API.
* This is the documentation of the Gotify REST-API. # Authentication In Gotify there are two token types: __clientToken__: a client is something that receives message and manages stuff like creating new tokens or delete messages. (f.ex this token should be used for an android app) __appToken__: an application is something that sends messages (f.ex. this token should be used for a shell script) The token can be transmitted in a header named `X-Gotify-Key`, in a query parameter named `token` or through a header named `Authorization` with the value prefixed with `Bearer` (Ex. `Bearer randomtoken`). There is also the possibility to authenticate through basic auth, this should only be used for creating a clientToken. \\--- Found a bug or have some questions? [Create an issue on GitHub](https://github.com/gotify/server/issues)
*
* The version of the OpenAPI document: 2.0.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.github.gotify.client;
import com.google.gson.Gson;
@@ -7,37 +20,41 @@ import okhttp3.Interceptor;
import okhttp3.OkHttpClient;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder;
import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder;
import org.threeten.bp.format.DateTimeFormatter;
import retrofit2.Converter;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
import retrofit2.converter.scalars.ScalarsConverterFactory;
import com.github.gotify.client.auth.HttpBasicAuth;
import com.github.gotify.client.auth.HttpBearerAuth;
import com.github.gotify.client.auth.ApiKeyAuth;
import com.github.gotify.client.auth.OAuth;
import com.github.gotify.client.auth.OAuth.AccessTokenListener;
import com.github.gotify.client.auth.OAuthFlow;
import java.io.IOException;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import java.text.DateFormat;
import java.time.format.DateTimeFormatter;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.HashMap;
public class ApiClient {
private Map<String, Interceptor> apiAuthorizations;
private OkHttpClient.Builder okBuilder;
private Retrofit.Builder adapterBuilder;
private JSON json;
protected Map<String, Interceptor> apiAuthorizations;
protected OkHttpClient.Builder okBuilder;
protected Retrofit.Builder adapterBuilder;
protected JSON json;
protected OkHttpClient okHttpClient;
public ApiClient() {
apiAuthorizations = new LinkedHashMap<String, Interceptor>();
createDefaultAdapter();
okBuilder = new OkHttpClient.Builder();
}
public ApiClient(OkHttpClient client){
apiAuthorizations = new LinkedHashMap<String, Interceptor>();
createDefaultAdapter();
okHttpClient = client;
}
public ApiClient(String[] authNames) {
@@ -52,7 +69,7 @@ public class ApiClient {
auth = new ApiKeyAuth("query", "token");
} else if ("basicAuth".equals(authName)) {
auth = new HttpBasicAuth();
} else if ("clientTokenAuthorizationHeader".equals(authName)) {
} else if ("clientTokenAuthorizationHeader".equals(authName)) {
auth = new ApiKeyAuth("header", "Authorization");
} else if ("clientTokenHeader".equals(authName)) {
auth = new ApiKeyAuth("header", "X-Gotify-Key");
@@ -61,8 +78,9 @@ public class ApiClient {
} else {
throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names");
}
addAuthorization(authName, auth);
if (auth != null) {
addAuthorization(authName, auth);
}
}
}
@@ -95,28 +113,10 @@ public class ApiClient {
this.setCredentials(username, password);
}
/**
* Helper constructor for single password oauth2
* @param authName Authentication name
* @param clientId Client ID
* @param secret Client Secret
* @param username Username
* @param password Password
*/
public ApiClient(String authName, String clientId, String secret, String username, String password) {
this(authName);
this.getTokenEndPoint()
.setClientId(clientId)
.setClientSecret(secret)
.setUsername(username)
.setPassword(password);
}
public void createDefaultAdapter() {
json = new JSON();
okBuilder = new OkHttpClient.Builder();
String baseUrl = "http://localhost/";
String baseUrl = "http://localhost";
if (!baseUrl.endsWith("/"))
baseUrl = baseUrl + "/";
@@ -128,10 +128,11 @@ public class ApiClient {
}
public <S> S createService(Class<S> serviceClass) {
return adapterBuilder
.client(okBuilder.build())
.build()
.create(serviceClass);
if (okHttpClient != null) {
return adapterBuilder.client(okHttpClient).build().create(serviceClass);
} else {
return adapterBuilder.client(okBuilder.build()).build().create(serviceClass);
}
}
public ApiClient setDateFormat(DateFormat dateFormat) {
@@ -171,6 +172,21 @@ public class ApiClient {
return this;
}
/**
* Helper method to set token for the first Http Bearer authentication found.
* @param bearerToken Bearer token
* @return ApiClient
*/
public ApiClient setBearerToken(String bearerToken) {
for (Interceptor apiAuthorization : apiAuthorizations.values()) {
if (apiAuthorization instanceof HttpBearerAuth) {
((HttpBearerAuth) apiAuthorization).setBearerToken(bearerToken);
return this;
}
}
return this;
}
/**
* Helper method to configure the username/password for basic auth or password oauth
* @param username Username
@@ -184,98 +200,10 @@ public class ApiClient {
basicAuth.setCredentials(username, password);
return this;
}
if (apiAuthorization instanceof OAuth) {
OAuth oauth = (OAuth) apiAuthorization;
oauth.getTokenRequestBuilder().setUsername(username).setPassword(password);
return this;
}
}
return this;
}
/**
* Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one)
* @return Token request builder
*/
public TokenRequestBuilder getTokenEndPoint() {
for(Interceptor apiAuthorization : apiAuthorizations.values()) {
if (apiAuthorization instanceof OAuth) {
OAuth oauth = (OAuth) apiAuthorization;
return oauth.getTokenRequestBuilder();
}
}
return null;
}
/**
* Helper method to configure authorization endpoint of the first oauth found in the apiAuthorizations (there should be only one)
* @return Authentication request builder
*/
public AuthenticationRequestBuilder getAuthorizationEndPoint() {
for(Interceptor apiAuthorization : apiAuthorizations.values()) {
if (apiAuthorization instanceof OAuth) {
OAuth oauth = (OAuth) apiAuthorization;
return oauth.getAuthenticationRequestBuilder();
}
}
return null;
}
/**
* Helper method to pre-set the oauth access token of the first oauth found in the apiAuthorizations (there should be only one)
* @param accessToken Access token
* @return ApiClient
*/
public ApiClient setAccessToken(String accessToken) {
for(Interceptor apiAuthorization : apiAuthorizations.values()) {
if (apiAuthorization instanceof OAuth) {
OAuth oauth = (OAuth) apiAuthorization;
oauth.setAccessToken(accessToken);
return this;
}
}
return this;
}
/**
* Helper method to configure the oauth accessCode/implicit flow parameters
* @param clientId Client ID
* @param clientSecret Client secret
* @param redirectURI Redirect URI
* @return ApiClient
*/
public ApiClient configureAuthorizationFlow(String clientId, String clientSecret, String redirectURI) {
for(Interceptor apiAuthorization : apiAuthorizations.values()) {
if (apiAuthorization instanceof OAuth) {
OAuth oauth = (OAuth) apiAuthorization;
oauth.getTokenRequestBuilder()
.setClientId(clientId)
.setClientSecret(clientSecret)
.setRedirectURI(redirectURI);
oauth.getAuthenticationRequestBuilder()
.setClientId(clientId)
.setRedirectURI(redirectURI);
return this;
}
}
return this;
}
/**
* Configures a listener which is notified when a new access token is received.
* @param accessTokenListener Access token listener
* @return ApiClient
*/
public ApiClient registerAccessTokenListener(AccessTokenListener accessTokenListener) {
for(Interceptor apiAuthorization : apiAuthorizations.values()) {
if (apiAuthorization instanceof OAuth) {
OAuth oauth = (OAuth) apiAuthorization;
oauth.registerAccessTokenListener(accessTokenListener);
return this;
}
}
return this;
}
/**
* Adds an authorization to be used by the client
@@ -288,7 +216,11 @@ public class ApiClient {
throw new RuntimeException("auth name \"" + authName + "\" already in api authorizations");
}
apiAuthorizations.put(authName, authorization);
if(okBuilder == null){
throw new RuntimeException("The ApiClient was created with a built OkHttpClient so it's not possible to add an authorization interceptor to it");
}
okBuilder.addInterceptor(authorization);
return this;
}
@@ -336,8 +268,8 @@ public class ApiClient {
* expected type is String, then just return the body string.
*/
class GsonResponseBodyConverterToString<T> implements Converter<ResponseBody, T> {
private final Gson gson;
private final Type type;
protected final Gson gson;
protected final Type type;
GsonResponseBodyConverterToString(Gson gson, Type type) {
this.gson = gson;
@@ -357,14 +289,14 @@ class GsonResponseBodyConverterToString<T> implements Converter<ResponseBody, T>
class GsonCustomConverterFactory extends Converter.Factory
{
private final Gson gson;
private final GsonConverterFactory gsonConverterFactory;
protected final Gson gson;
protected final GsonConverterFactory gsonConverterFactory;
public static GsonCustomConverterFactory create(Gson gson) {
return new GsonCustomConverterFactory(gson);
}
private GsonCustomConverterFactory(Gson gson) {
protected GsonCustomConverterFactory(Gson gson) {
if (gson == null)
throw new NullPointerException("gson == null");
this.gson = gson;

View File

@@ -1,3 +1,16 @@
/*
* Gotify REST-API.
* This is the documentation of the Gotify REST-API. # Authentication In Gotify there are two token types: __clientToken__: a client is something that receives message and manages stuff like creating new tokens or delete messages. (f.ex this token should be used for an android app) __appToken__: an application is something that sends messages (f.ex. this token should be used for a shell script) The token can be transmitted in a header named `X-Gotify-Key`, in a query parameter named `token` or through a header named `Authorization` with the value prefixed with `Bearer` (Ex. `Bearer randomtoken`). There is also the possibility to authenticate through basic auth, this should only be used for creating a clientToken. \\--- Found a bug or have some questions? [Create an issue on GitHub](https://github.com/gotify/server/issues)
*
* The version of the OpenAPI document: 2.0.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.github.gotify.client;
import java.util.Arrays;
@@ -35,6 +48,10 @@ public class CollectionFormats {
}
public static class SPACEParams extends SSVParams {
}
public static class SSVParams extends CSVParams {
public SSVParams() {

View File

@@ -2,14 +2,15 @@
* Gotify REST-API.
* This is the documentation of the Gotify REST-API. # Authentication In Gotify there are two token types: __clientToken__: a client is something that receives message and manages stuff like creating new tokens or delete messages. (f.ex this token should be used for an android app) __appToken__: an application is something that sends messages (f.ex. this token should be used for a shell script) The token can be transmitted in a header named `X-Gotify-Key`, in a query parameter named `token` or through a header named `Authorization` with the value prefixed with `Bearer` (Ex. `Bearer randomtoken`). There is also the possibility to authenticate through basic auth, this should only be used for creating a clientToken. \\--- Found a bug or have some questions? [Create an issue on GitHub](https://github.com/gotify/server/issues)
*
* OpenAPI spec version: 2.0.2
* The version of the OpenAPI document: 2.0.2
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.github.gotify.client;
import com.google.gson.Gson;
@@ -22,9 +23,6 @@ import com.google.gson.stream.JsonWriter;
import com.google.gson.JsonElement;
import io.gsonfire.GsonFireBuilder;
import io.gsonfire.TypeSelector;
import org.threeten.bp.LocalDate;
import org.threeten.bp.OffsetDateTime;
import org.threeten.bp.format.DateTimeFormatter;
import com.github.gotify.client.model.*;
@@ -34,7 +32,11 @@ import java.lang.reflect.Type;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.ParsePosition;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.Locale;
import java.util.Map;
import java.util.HashMap;
@@ -47,6 +49,7 @@ public class JSON {
public static GsonBuilder createGson() {
GsonFireBuilder fireBuilder = new GsonFireBuilder()
;
return fireBuilder.createGsonBuilder();
}
@@ -60,7 +63,7 @@ public class JSON {
}
private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) {
Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue.toUpperCase());
Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue.toUpperCase(Locale.ROOT));
if(null == clazz) {
throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">");
}

View File

@@ -0,0 +1,72 @@
/*
* Gotify REST-API.
* This is the documentation of the Gotify REST-API. # Authentication In Gotify there are two token types: __clientToken__: a client is something that receives message and manages stuff like creating new tokens or delete messages. (f.ex this token should be used for an android app) __appToken__: an application is something that sends messages (f.ex. this token should be used for a shell script) The token can be transmitted in a header named `X-Gotify-Key`, in a query parameter named `token` or through a header named `Authorization` with the value prefixed with `Bearer` (Ex. `Bearer randomtoken`). There is also the possibility to authenticate through basic auth, this should only be used for creating a clientToken. \\--- Found a bug or have some questions? [Create an issue on GitHub](https://github.com/gotify/server/issues)
*
* The version of the OpenAPI document: 2.0.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.github.gotify.client;
import java.util.Map;
/**
* Representing a Server configuration.
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.19.0")
public class ServerConfiguration {
public String URL;
public String description;
public Map<String, ServerVariable> variables;
/**
* @param URL A URL to the target host.
* @param description A description of the host designated by the URL.
* @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template.
*/
public ServerConfiguration(String URL, String description, Map<String, ServerVariable> variables) {
this.URL = URL;
this.description = description;
this.variables = variables;
}
/**
* Format URL template using given variables.
*
* @param variables A map between a variable name and its value.
* @return Formatted URL.
*/
public String URL(Map<String, String> variables) {
String url = this.URL;
// go through variables and replace placeholders
for (Map.Entry<String, ServerVariable> variable: this.variables.entrySet()) {
String name = variable.getKey();
ServerVariable serverVariable = variable.getValue();
String value = serverVariable.defaultValue;
if (variables != null && variables.containsKey(name)) {
value = variables.get(name);
if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) {
throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + ".");
}
}
url = url.replace("{" + name + "}", value);
}
return url;
}
/**
* Format URL template using default server variables.
*
* @return Formatted URL.
*/
public String URL() {
return URL(null);
}
}

View File

@@ -0,0 +1,37 @@
/*
* Gotify REST-API.
* This is the documentation of the Gotify REST-API. # Authentication In Gotify there are two token types: __clientToken__: a client is something that receives message and manages stuff like creating new tokens or delete messages. (f.ex this token should be used for an android app) __appToken__: an application is something that sends messages (f.ex. this token should be used for a shell script) The token can be transmitted in a header named `X-Gotify-Key`, in a query parameter named `token` or through a header named `Authorization` with the value prefixed with `Bearer` (Ex. `Bearer randomtoken`). There is also the possibility to authenticate through basic auth, this should only be used for creating a clientToken. \\--- Found a bug or have some questions? [Create an issue on GitHub](https://github.com/gotify/server/issues)
*
* The version of the OpenAPI document: 2.0.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.github.gotify.client;
import java.util.HashSet;
/**
* Representing a Server Variable for server URL template substitution.
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.19.0")
public class ServerVariable {
public String description;
public String defaultValue;
public HashSet<String> enumValues = null;
/**
* @param description A description for the server variable.
* @param defaultValue The default value to use for substitution.
* @param enumValues An enumeration of string values to be used if the substitution options are from a limited set.
*/
public ServerVariable(String description, String defaultValue, HashSet<String> enumValues) {
this.description = description;
this.defaultValue = defaultValue;
this.enumValues = enumValues;
}
}

View File

@@ -2,17 +2,21 @@
* Gotify REST-API.
* This is the documentation of the Gotify REST-API. # Authentication In Gotify there are two token types: __clientToken__: a client is something that receives message and manages stuff like creating new tokens or delete messages. (f.ex this token should be used for an android app) __appToken__: an application is something that sends messages (f.ex. this token should be used for a shell script) The token can be transmitted in a header named `X-Gotify-Key`, in a query parameter named `token` or through a header named `Authorization` with the value prefixed with `Bearer` (Ex. `Bearer randomtoken`). There is also the possibility to authenticate through basic auth, this should only be used for creating a clientToken. \\--- Found a bug or have some questions? [Create an issue on GitHub](https://github.com/gotify/server/issues)
*
* OpenAPI spec version: 2.0.2
* The version of the OpenAPI document: 2.0.2
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.github.gotify.client;
import java.util.Collection;
import java.util.Iterator;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.19.0")
public class StringUtil {
/**
* Check if the given array contains the given value (with case-insensitive comparison).
@@ -23,8 +27,12 @@ public class StringUtil {
*/
public static boolean containsIgnoreCase(String[] array, String value) {
for (String str : array) {
if (value == null && str == null) return true;
if (value != null && value.equalsIgnoreCase(str)) return true;
if (value == null && str == null) {
return true;
}
if (value != null && value.equalsIgnoreCase(str)) {
return true;
}
}
return false;
}
@@ -42,7 +50,9 @@ public class StringUtil {
*/
public static String join(String[] array, String separator) {
int len = array.length;
if (len == 0) return "";
if (len == 0) {
return "";
}
StringBuilder out = new StringBuilder();
out.append(array[0]);
@@ -51,4 +61,23 @@ public class StringUtil {
}
return out.toString();
}
/**
* Join a list of strings with the given separator.
*
* @param list The list of strings
* @param separator The separator
* @return the resulting string
*/
public static String join(Collection<String> list, String separator) {
Iterator<String> iterator = list.iterator();
StringBuilder out = new StringBuilder();
if (iterator.hasNext()) {
out.append(iterator.next());
}
while (iterator.hasNext()) {
out.append(separator).append(iterator.next());
}
return out.toString();
}
}

View File

@@ -7,6 +7,7 @@ import retrofit2.http.*;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import okhttp3.MultipartBody;
import com.github.gotify.client.model.Application;
import com.github.gotify.client.model.ApplicationParams;
@@ -17,6 +18,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
public interface ApplicationApi {
/**
@@ -67,8 +69,8 @@ public interface ApplicationApi {
/**
* Update an application.
*
* @param body the application to update (required)
* @param id the application id (required)
* @param body the application to update (required)
* @return Call&lt;Application&gt;
*/
@Headers({
@@ -76,20 +78,20 @@ public interface ApplicationApi {
})
@PUT("application/{id}")
Call<Application> updateApplication(
@retrofit2.http.Body ApplicationParams body, @retrofit2.http.Path("id") Long id
@retrofit2.http.Path("id") Long id, @retrofit2.http.Body ApplicationParams body
);
/**
* Upload an image for an application.
*
* @param file (required)
* @param id the application id (required)
* @param _file the application image (required)
* @return Call&lt;Application&gt;
*/
@retrofit2.http.Multipart
@POST("application/{id}/image")
Call<Application> uploadAppImage(
@retrofit2.http.Part("file\"; filename=\"file") RequestBody file, @retrofit2.http.Path("id") Long id
@retrofit2.http.Path("id") Long id, @retrofit2.http.Part MultipartBody.Part _file
);
}

View File

@@ -7,6 +7,7 @@ import retrofit2.http.*;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import okhttp3.MultipartBody;
import com.github.gotify.client.model.Client;
import com.github.gotify.client.model.ClientParams;
@@ -16,6 +17,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
public interface ClientApi {
/**
@@ -55,8 +57,8 @@ public interface ClientApi {
/**
* Update a client.
*
* @param body the client to update (required)
* @param id the client id (required)
* @param body the client to update (required)
* @return Call&lt;Client&gt;
*/
@Headers({
@@ -64,7 +66,7 @@ public interface ClientApi {
})
@PUT("client/{id}")
Call<Client> updateClient(
@retrofit2.http.Body ClientParams body, @retrofit2.http.Path("id") Long id
@retrofit2.http.Path("id") Long id, @retrofit2.http.Body ClientParams body
);
}

View File

@@ -7,6 +7,7 @@ import retrofit2.http.*;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import okhttp3.MultipartBody;
import com.github.gotify.client.model.Health;
@@ -14,6 +15,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
public interface HealthApi {
/**

View File

@@ -7,6 +7,7 @@ import retrofit2.http.*;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import okhttp3.MultipartBody;
import com.github.gotify.client.model.Error;
import com.github.gotify.client.model.Message;
@@ -16,6 +17,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
public interface MessageApi {
/**

View File

@@ -7,6 +7,7 @@ import retrofit2.http.*;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import okhttp3.MultipartBody;
import com.github.gotify.client.model.Error;
import com.github.gotify.client.model.PluginConf;
@@ -15,6 +16,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
public interface PluginApi {
/**

View File

@@ -7,6 +7,7 @@ import retrofit2.http.*;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import okhttp3.MultipartBody;
import com.github.gotify.client.model.CreateUserExternal;
import com.github.gotify.client.model.Error;
@@ -18,6 +19,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
public interface UserApi {
/**
@@ -91,8 +93,8 @@ public interface UserApi {
/**
* Update a user.
*
* @param body the updated user (required)
* @param id the user id (required)
* @param body the updated user (required)
* @return Call&lt;User&gt;
*/
@Headers({
@@ -100,7 +102,7 @@ public interface UserApi {
})
@POST("user/{id}")
Call<User> updateUser(
@retrofit2.http.Body UpdateUserExternal body, @retrofit2.http.Path("id") Long id
@retrofit2.http.Path("id") Long id, @retrofit2.http.Body UpdateUserExternal body
);
}

View File

@@ -7,6 +7,7 @@ import retrofit2.http.*;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import okhttp3.MultipartBody;
import com.github.gotify.client.model.VersionInfo;
@@ -14,6 +15,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
public interface VersionApi {
/**

View File

@@ -1,3 +1,16 @@
/*
* Gotify REST-API.
* This is the documentation of the Gotify REST-API. # Authentication In Gotify there are two token types: __clientToken__: a client is something that receives message and manages stuff like creating new tokens or delete messages. (f.ex this token should be used for an android app) __appToken__: an application is something that sends messages (f.ex. this token should be used for a shell script) The token can be transmitted in a header named `X-Gotify-Key`, in a query parameter named `token` or through a header named `Authorization` with the value prefixed with `Bearer` (Ex. `Bearer randomtoken`). There is also the possibility to authenticate through basic auth, this should only be used for creating a clientToken. \\--- Found a bug or have some questions? [Create an issue on GitHub](https://github.com/gotify/server/issues)
*
* The version of the OpenAPI document: 2.0.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.github.gotify.client.auth;
import java.io.IOException;
@@ -62,6 +75,10 @@ public class ApiKeyAuth implements Interceptor {
request = request.newBuilder()
.addHeader(paramName, apiKey)
.build();
} else if ("cookie".equals(location)) {
request = request.newBuilder()
.addHeader("Cookie", String.format(java.util.Locale.ROOT, "%s=%s", paramName, apiKey))
.build();
}
return chain.proceed(request);
}

View File

@@ -1,3 +1,16 @@
/*
* Gotify REST-API.
* This is the documentation of the Gotify REST-API. # Authentication In Gotify there are two token types: __clientToken__: a client is something that receives message and manages stuff like creating new tokens or delete messages. (f.ex this token should be used for an android app) __appToken__: an application is something that sends messages (f.ex. this token should be used for a shell script) The token can be transmitted in a header named `X-Gotify-Key`, in a query parameter named `token` or through a header named `Authorization` with the value prefixed with `Bearer` (Ex. `Bearer randomtoken`). There is also the possibility to authenticate through basic auth, this should only be used for creating a clientToken. \\--- Found a bug or have some questions? [Create an issue on GitHub](https://github.com/gotify/server/issues)
*
* The version of the OpenAPI document: 2.0.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.github.gotify.client.auth;
import java.io.IOException;
@@ -12,7 +25,7 @@ public class HttpBasicAuth implements Interceptor {
private String username;
private String password;
public String getUsername() {
return username;
}

View File

@@ -0,0 +1,55 @@
/*
* Gotify REST-API.
* This is the documentation of the Gotify REST-API. # Authentication In Gotify there are two token types: __clientToken__: a client is something that receives message and manages stuff like creating new tokens or delete messages. (f.ex this token should be used for an android app) __appToken__: an application is something that sends messages (f.ex. this token should be used for a shell script) The token can be transmitted in a header named `X-Gotify-Key`, in a query parameter named `token` or through a header named `Authorization` with the value prefixed with `Bearer` (Ex. `Bearer randomtoken`). There is also the possibility to authenticate through basic auth, this should only be used for creating a clientToken. \\--- Found a bug or have some questions? [Create an issue on GitHub](https://github.com/gotify/server/issues)
*
* The version of the OpenAPI document: 2.0.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.github.gotify.client.auth;
import java.io.IOException;
import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;
public class HttpBearerAuth implements Interceptor {
private final String scheme;
private String bearerToken;
public HttpBearerAuth(String scheme) {
this.scheme = scheme;
}
public String getBearerToken() {
return bearerToken;
}
public void setBearerToken(String bearerToken) {
this.bearerToken = bearerToken;
}
@Override
public Response intercept(Chain chain) throws IOException {
Request request = chain.request();
// If the request already have an authorization (eg. Basic auth), do nothing
if (request.header("Authorization") == null && bearerToken != null) {
request = request.newBuilder()
.addHeader("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken)
.build();
}
return chain.proceed(request);
}
private static String upperCaseBearer(String scheme) {
return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme;
}
}

View File

@@ -1,3 +1,16 @@
/*
* Gotify REST-API.
* This is the documentation of the Gotify REST-API. # Authentication In Gotify there are two token types: __clientToken__: a client is something that receives message and manages stuff like creating new tokens or delete messages. (f.ex this token should be used for an android app) __appToken__: an application is something that sends messages (f.ex. this token should be used for a shell script) The token can be transmitted in a header named `X-Gotify-Key`, in a query parameter named `token` or through a header named `Authorization` with the value prefixed with `Bearer` (Ex. `Bearer randomtoken`). There is also the possibility to authenticate through basic auth, this should only be used for creating a clientToken. \\--- Found a bug or have some questions? [Create an issue on GitHub](https://github.com/gotify/server/issues)
*
* The version of the OpenAPI document: 2.0.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.github.gotify.client.auth;
import java.io.IOException;
@@ -56,10 +69,9 @@ public class OAuthOkHttpClient implements HttpClient {
try {
Response response = client.newCall(requestBuilder.build()).execute();
return OAuthClientResponseFactory.createCustomResponse(
response.body().string(),
response.body().string(),
response.body().contentType().toString(),
response.code(),
response.headers().toMultimap(),
responseClass);
} catch (IOException e) {
throw new OAuthSystemException(e);

View File

@@ -2,14 +2,15 @@
* Gotify REST-API.
* This is the documentation of the Gotify REST-API. # Authentication In Gotify there are two token types: __clientToken__: a client is something that receives message and manages stuff like creating new tokens or delete messages. (f.ex this token should be used for an android app) __appToken__: an application is something that sends messages (f.ex. this token should be used for a shell script) The token can be transmitted in a header named `X-Gotify-Key`, in a query parameter named `token` or through a header named `Authorization` with the value prefixed with `Bearer` (Ex. `Bearer randomtoken`). There is also the possibility to authenticate through basic auth, this should only be used for creating a clientToken. \\--- Found a bug or have some questions? [Create an issue on GitHub](https://github.com/gotify/server/issues)
*
* OpenAPI spec version: 2.0.2
* The version of the OpenAPI document: 2.0.2
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.github.gotify.client.model;
import java.util.Objects;
@@ -19,142 +20,226 @@ import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.v3.oas.annotations.media.Schema;
import java.io.IOException;
import org.threeten.bp.OffsetDateTime;
import java.time.OffsetDateTime;
/**
* The Application holds information about an app which can send notifications.
*/
@Schema(description = "The Application holds information about an app which can send notifications.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.19.0")
public class Application {
@SerializedName("defaultPriority")
private Long defaultPriority = null;
public static final String SERIALIZED_NAME_DEFAULT_PRIORITY = "defaultPriority";
@SerializedName(SERIALIZED_NAME_DEFAULT_PRIORITY)
@javax.annotation.Nullable
private Long defaultPriority;
@SerializedName("description")
private String description = null;
public static final String SERIALIZED_NAME_DESCRIPTION = "description";
@SerializedName(SERIALIZED_NAME_DESCRIPTION)
@javax.annotation.Nonnull
private String description;
@SerializedName("id")
private Long id = null;
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
@javax.annotation.Nonnull
private Long id;
@SerializedName("image")
private String image = null;
public static final String SERIALIZED_NAME_IMAGE = "image";
@SerializedName(SERIALIZED_NAME_IMAGE)
@javax.annotation.Nonnull
private String image;
@SerializedName("internal")
private Boolean internal = null;
public static final String SERIALIZED_NAME_INTERNAL = "internal";
@SerializedName(SERIALIZED_NAME_INTERNAL)
@javax.annotation.Nonnull
private Boolean internal;
@SerializedName("lastUsed")
private OffsetDateTime lastUsed = null;
public static final String SERIALIZED_NAME_LAST_USED = "lastUsed";
@SerializedName(SERIALIZED_NAME_LAST_USED)
@javax.annotation.Nullable
private OffsetDateTime lastUsed;
@SerializedName("name")
private String name = null;
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
@javax.annotation.Nonnull
private String name;
@SerializedName("token")
private String token = null;
public static final String SERIALIZED_NAME_SORT_KEY = "sortKey";
@SerializedName(SERIALIZED_NAME_SORT_KEY)
@javax.annotation.Nonnull
private String sortKey;
public Application defaultPriority(Long defaultPriority) {
public static final String SERIALIZED_NAME_TOKEN = "token";
@SerializedName(SERIALIZED_NAME_TOKEN)
@javax.annotation.Nonnull
private String token;
public Application() {
}
/**
* Constructor with only readonly parameters
*/
public Application(
Long id,
String image,
Boolean internal,
OffsetDateTime lastUsed,
String token
) {
this();
this.id = id;
this.image = image;
this.internal = internal;
this.lastUsed = lastUsed;
this.token = token;
}
public Application defaultPriority(@javax.annotation.Nullable Long defaultPriority) {
this.defaultPriority = defaultPriority;
return this;
}
/**
/**
* The default priority of messages sent by this application. Defaults to 0.
* @return defaultPriority
**/
@Schema(example = "4", description = "The default priority of messages sent by this application. Defaults to 0.")
*/
@javax.annotation.Nullable
public Long getDefaultPriority() {
return defaultPriority;
}
public void setDefaultPriority(Long defaultPriority) {
public void setDefaultPriority(@javax.annotation.Nullable Long defaultPriority) {
this.defaultPriority = defaultPriority;
}
public Application description(String description) {
public Application description(@javax.annotation.Nonnull String description) {
this.description = description;
return this;
}
/**
/**
* The description of the application.
* @return description
**/
@Schema(example = "Backup server for the interwebs", required = true, description = "The description of the application.")
*/
@javax.annotation.Nonnull
public String getDescription() {
return description;
}
public void setDescription(String description) {
public void setDescription(@javax.annotation.Nonnull String description) {
this.description = description;
}
/**
/**
* The application id.
* @return id
**/
@Schema(example = "5", required = true, description = "The application id.")
*/
@javax.annotation.Nonnull
public Long getId() {
return id;
}
/**
/**
* The image of the application.
* @return image
**/
@Schema(example = "image/image.jpeg", required = true, description = "The image of the application.")
*/
@javax.annotation.Nonnull
public String getImage() {
return image;
}
/**
/**
* Whether the application is an internal application. Internal applications should not be deleted.
* @return internal
**/
@Schema(example = "false", required = true, description = "Whether the application is an internal application. Internal applications should not be deleted.")
public Boolean isInternal() {
*/
@javax.annotation.Nonnull
public Boolean getInternal() {
return internal;
}
/**
/**
* The last time the application token was used.
* @return lastUsed
**/
@Schema(example = "2019-01-01T00:00Z", description = "The last time the application token was used.")
*/
@javax.annotation.Nullable
public OffsetDateTime getLastUsed() {
return lastUsed;
}
public Application name(String name) {
public Application name(@javax.annotation.Nonnull String name) {
this.name = name;
return this;
}
/**
/**
* The application name. This is how the application should be displayed to the user.
* @return name
**/
@Schema(example = "Backup Server", required = true, description = "The application name. This is how the application should be displayed to the user.")
*/
@javax.annotation.Nonnull
public String getName() {
return name;
}
public void setName(String name) {
public void setName(@javax.annotation.Nonnull String name) {
this.name = name;
}
/**
public Application sortKey(@javax.annotation.Nonnull String sortKey) {
this.sortKey = sortKey;
return this;
}
/**
* The sort key of this application. Uses fractional indexing.
* @return sortKey
*/
@javax.annotation.Nonnull
public String getSortKey() {
return sortKey;
}
public void setSortKey(@javax.annotation.Nonnull String sortKey) {
this.sortKey = sortKey;
}
/**
* The application token. Can be used as &#x60;appToken&#x60;. See Authentication.
* @return token
**/
@Schema(example = "AWH0wZ5r0Mbac.r", required = true, description = "The application token. Can be used as `appToken`. See Authentication.")
*/
@javax.annotation.Nonnull
public String getToken() {
return token;
}
@Override
public boolean equals(java.lang.Object o) {
public boolean equals(Object o) {
if (this == o) {
return true;
}
@@ -169,20 +254,19 @@ public class Application {
Objects.equals(this.internal, application.internal) &&
Objects.equals(this.lastUsed, application.lastUsed) &&
Objects.equals(this.name, application.name) &&
Objects.equals(this.sortKey, application.sortKey) &&
Objects.equals(this.token, application.token);
}
@Override
public int hashCode() {
return Objects.hash(defaultPriority, description, id, image, internal, lastUsed, name, token);
return Objects.hash(defaultPriority, description, id, image, internal, lastUsed, name, sortKey, token);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Application {\n");
sb.append(" defaultPriority: ").append(toIndentedString(defaultPriority)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
@@ -190,6 +274,7 @@ public class Application {
sb.append(" internal: ").append(toIndentedString(internal)).append("\n");
sb.append(" lastUsed: ").append(toIndentedString(lastUsed)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" sortKey: ").append(toIndentedString(sortKey)).append("\n");
sb.append(" token: ").append(toIndentedString(token)).append("\n");
sb.append("}");
return sb.toString();
@@ -199,7 +284,7 @@ public class Application {
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
@@ -207,3 +292,4 @@ public class Application {
}
}

View File

@@ -2,14 +2,15 @@
* Gotify REST-API.
* This is the documentation of the Gotify REST-API. # Authentication In Gotify there are two token types: __clientToken__: a client is something that receives message and manages stuff like creating new tokens or delete messages. (f.ex this token should be used for an android app) __appToken__: an application is something that sends messages (f.ex. this token should be used for a shell script) The token can be transmitted in a header named `X-Gotify-Key`, in a query parameter named `token` or through a header named `Authorization` with the value prefixed with `Bearer` (Ex. `Bearer randomtoken`). There is also the possibility to authenticate through basic auth, this should only be used for creating a clientToken. \\--- Found a bug or have some questions? [Create an issue on GitHub](https://github.com/gotify/server/issues)
*
* OpenAPI spec version: 2.0.2
* The version of the OpenAPI document: 2.0.2
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.github.gotify.client.model;
import java.util.Objects;
@@ -19,81 +20,122 @@ import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.v3.oas.annotations.media.Schema;
import java.io.IOException;
/**
* Params allowed to create or update Applications.
*/
@Schema(description = "Params allowed to create or update Applications.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.19.0")
public class ApplicationParams {
@SerializedName("defaultPriority")
private Long defaultPriority = null;
public static final String SERIALIZED_NAME_DEFAULT_PRIORITY = "defaultPriority";
@SerializedName(SERIALIZED_NAME_DEFAULT_PRIORITY)
@javax.annotation.Nullable
private Long defaultPriority;
@SerializedName("description")
private String description = null;
public static final String SERIALIZED_NAME_DESCRIPTION = "description";
@SerializedName(SERIALIZED_NAME_DESCRIPTION)
@javax.annotation.Nullable
private String description;
@SerializedName("name")
private String name = null;
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
@javax.annotation.Nonnull
private String name;
public ApplicationParams defaultPriority(Long defaultPriority) {
public static final String SERIALIZED_NAME_SORT_KEY = "sortKey";
@SerializedName(SERIALIZED_NAME_SORT_KEY)
@javax.annotation.Nullable
private String sortKey;
public ApplicationParams() {
}
public ApplicationParams defaultPriority(@javax.annotation.Nullable Long defaultPriority) {
this.defaultPriority = defaultPriority;
return this;
}
/**
/**
* The default priority of messages sent by this application. Defaults to 0.
* @return defaultPriority
**/
@Schema(example = "5", description = "The default priority of messages sent by this application. Defaults to 0.")
*/
@javax.annotation.Nullable
public Long getDefaultPriority() {
return defaultPriority;
}
public void setDefaultPriority(Long defaultPriority) {
public void setDefaultPriority(@javax.annotation.Nullable Long defaultPriority) {
this.defaultPriority = defaultPriority;
}
public ApplicationParams description(String description) {
public ApplicationParams description(@javax.annotation.Nullable String description) {
this.description = description;
return this;
}
/**
/**
* The description of the application.
* @return description
**/
@Schema(example = "Backup server for the interwebs", description = "The description of the application.")
*/
@javax.annotation.Nullable
public String getDescription() {
return description;
}
public void setDescription(String description) {
public void setDescription(@javax.annotation.Nullable String description) {
this.description = description;
}
public ApplicationParams name(String name) {
public ApplicationParams name(@javax.annotation.Nonnull String name) {
this.name = name;
return this;
}
/**
/**
* The application name. This is how the application should be displayed to the user.
* @return name
**/
@Schema(example = "Backup Server", required = true, description = "The application name. This is how the application should be displayed to the user.")
*/
@javax.annotation.Nonnull
public String getName() {
return name;
}
public void setName(String name) {
public void setName(@javax.annotation.Nonnull String name) {
this.name = name;
}
public ApplicationParams sortKey(@javax.annotation.Nullable String sortKey) {
this.sortKey = sortKey;
return this;
}
/**
* The sortKey for the application. Uses fractional indexing.
* @return sortKey
*/
@javax.annotation.Nullable
public String getSortKey() {
return sortKey;
}
public void setSortKey(@javax.annotation.Nullable String sortKey) {
this.sortKey = sortKey;
}
@Override
public boolean equals(java.lang.Object o) {
public boolean equals(Object o) {
if (this == o) {
return true;
}
@@ -103,23 +145,23 @@ public class ApplicationParams {
ApplicationParams applicationParams = (ApplicationParams) o;
return Objects.equals(this.defaultPriority, applicationParams.defaultPriority) &&
Objects.equals(this.description, applicationParams.description) &&
Objects.equals(this.name, applicationParams.name);
Objects.equals(this.name, applicationParams.name) &&
Objects.equals(this.sortKey, applicationParams.sortKey);
}
@Override
public int hashCode() {
return Objects.hash(defaultPriority, description, name);
return Objects.hash(defaultPriority, description, name, sortKey);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ApplicationParams {\n");
sb.append(" defaultPriority: ").append(toIndentedString(defaultPriority)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" sortKey: ").append(toIndentedString(sortKey)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -128,7 +170,7 @@ public class ApplicationParams {
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
@@ -136,3 +178,4 @@ public class ApplicationParams {
}
}

View File

@@ -2,14 +2,15 @@
* Gotify REST-API.
* This is the documentation of the Gotify REST-API. # Authentication In Gotify there are two token types: __clientToken__: a client is something that receives message and manages stuff like creating new tokens or delete messages. (f.ex this token should be used for an android app) __appToken__: an application is something that sends messages (f.ex. this token should be used for a shell script) The token can be transmitted in a header named `X-Gotify-Key`, in a query parameter named `token` or through a header named `Authorization` with the value prefixed with `Bearer` (Ex. `Bearer randomtoken`). There is also the possibility to authenticate through basic auth, this should only be used for creating a clientToken. \\--- Found a bug or have some questions? [Create an issue on GitHub](https://github.com/gotify/server/issues)
*
* OpenAPI spec version: 2.0.2
* The version of the OpenAPI document: 2.0.2
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.github.gotify.client.model;
import java.util.Objects;
@@ -19,76 +20,110 @@ import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.v3.oas.annotations.media.Schema;
import java.io.IOException;
import org.threeten.bp.OffsetDateTime;
import java.time.OffsetDateTime;
/**
* The Client holds information about a device which can receive notifications (and other stuff).
*/
@Schema(description = "The Client holds information about a device which can receive notifications (and other stuff).")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.19.0")
public class Client {
@SerializedName("id")
private Long id = null;
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
@javax.annotation.Nonnull
private Long id;
@SerializedName("lastUsed")
private OffsetDateTime lastUsed = null;
public static final String SERIALIZED_NAME_LAST_USED = "lastUsed";
@SerializedName(SERIALIZED_NAME_LAST_USED)
@javax.annotation.Nullable
private OffsetDateTime lastUsed;
@SerializedName("name")
private String name = null;
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
@javax.annotation.Nonnull
private String name;
@SerializedName("token")
private String token = null;
public static final String SERIALIZED_NAME_TOKEN = "token";
@SerializedName(SERIALIZED_NAME_TOKEN)
@javax.annotation.Nonnull
private String token;
/**
public Client() {
}
/**
* Constructor with only readonly parameters
*/
public Client(
Long id,
OffsetDateTime lastUsed,
String token
) {
this();
this.id = id;
this.lastUsed = lastUsed;
this.token = token;
}
/**
* The client id.
* @return id
**/
@Schema(example = "5", required = true, description = "The client id.")
*/
@javax.annotation.Nonnull
public Long getId() {
return id;
}
/**
/**
* The last time the client token was used.
* @return lastUsed
**/
@Schema(example = "2019-01-01T00:00Z", description = "The last time the client token was used.")
*/
@javax.annotation.Nullable
public OffsetDateTime getLastUsed() {
return lastUsed;
}
public Client name(String name) {
public Client name(@javax.annotation.Nonnull String name) {
this.name = name;
return this;
}
/**
/**
* The client name. This is how the client should be displayed to the user.
* @return name
**/
@Schema(example = "Android Phone", required = true, description = "The client name. This is how the client should be displayed to the user.")
*/
@javax.annotation.Nonnull
public String getName() {
return name;
}
public void setName(String name) {
public void setName(@javax.annotation.Nonnull String name) {
this.name = name;
}
/**
/**
* The client token. Can be used as &#x60;clientToken&#x60;. See Authentication.
* @return token
**/
@Schema(example = "CWH0wZ5r0Mbac.r", required = true, description = "The client token. Can be used as `clientToken`. See Authentication.")
*/
@javax.annotation.Nonnull
public String getToken() {
return token;
}
@Override
public boolean equals(java.lang.Object o) {
public boolean equals(Object o) {
if (this == o) {
return true;
}
@@ -107,12 +142,10 @@ public class Client {
return Objects.hash(id, lastUsed, name, token);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Client {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" lastUsed: ").append(toIndentedString(lastUsed)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
@@ -125,7 +158,7 @@ public class Client {
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
@@ -133,3 +166,4 @@ public class Client {
}
}

View File

@@ -2,14 +2,15 @@
* Gotify REST-API.
* This is the documentation of the Gotify REST-API. # Authentication In Gotify there are two token types: __clientToken__: a client is something that receives message and manages stuff like creating new tokens or delete messages. (f.ex this token should be used for an android app) __appToken__: an application is something that sends messages (f.ex. this token should be used for a shell script) The token can be transmitted in a header named `X-Gotify-Key`, in a query parameter named `token` or through a header named `Authorization` with the value prefixed with `Bearer` (Ex. `Bearer randomtoken`). There is also the possibility to authenticate through basic auth, this should only be used for creating a clientToken. \\--- Found a bug or have some questions? [Create an issue on GitHub](https://github.com/gotify/server/issues)
*
* OpenAPI spec version: 2.0.2
* The version of the OpenAPI document: 2.0.2
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.github.gotify.client.model;
import java.util.Objects;
@@ -19,39 +20,44 @@ import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.v3.oas.annotations.media.Schema;
import java.io.IOException;
/**
* Params allowed to create or update Clients.
*/
@Schema(description = "Params allowed to create or update Clients.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.19.0")
public class ClientParams {
@SerializedName("name")
private String name = null;
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
@javax.annotation.Nonnull
private String name;
public ClientParams name(String name) {
public ClientParams() {
}
public ClientParams name(@javax.annotation.Nonnull String name) {
this.name = name;
return this;
}
/**
/**
* The client name
* @return name
**/
@Schema(example = "My Client", required = true, description = "The client name")
*/
@javax.annotation.Nonnull
public String getName() {
return name;
}
public void setName(String name) {
public void setName(@javax.annotation.Nonnull String name) {
this.name = name;
}
@Override
public boolean equals(java.lang.Object o) {
public boolean equals(Object o) {
if (this == o) {
return true;
}
@@ -67,12 +73,10 @@ public class ClientParams {
return Objects.hash(name);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ClientParams {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append("}");
return sb.toString();
@@ -82,7 +86,7 @@ public class ClientParams {
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
@@ -90,3 +94,4 @@ public class ClientParams {
}
}

View File

@@ -2,14 +2,15 @@
* Gotify REST-API.
* This is the documentation of the Gotify REST-API. # Authentication In Gotify there are two token types: __clientToken__: a client is something that receives message and manages stuff like creating new tokens or delete messages. (f.ex this token should be used for an android app) __appToken__: an application is something that sends messages (f.ex. this token should be used for a shell script) The token can be transmitted in a header named `X-Gotify-Key`, in a query parameter named `token` or through a header named `Authorization` with the value prefixed with `Bearer` (Ex. `Bearer randomtoken`). There is also the possibility to authenticate through basic auth, this should only be used for creating a clientToken. \\--- Found a bug or have some questions? [Create an issue on GitHub](https://github.com/gotify/server/issues)
*
* OpenAPI spec version: 2.0.2
* The version of the OpenAPI document: 2.0.2
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.github.gotify.client.model;
import java.util.Objects;
@@ -19,81 +20,96 @@ import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.v3.oas.annotations.media.Schema;
import java.io.IOException;
/**
* Used for user creation.
*/
@Schema(description = "Used for user creation.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.19.0")
public class CreateUserExternal {
@SerializedName("admin")
private Boolean admin = null;
public static final String SERIALIZED_NAME_ADMIN = "admin";
@SerializedName(SERIALIZED_NAME_ADMIN)
@javax.annotation.Nonnull
private Boolean admin;
@SerializedName("name")
private String name = null;
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
@javax.annotation.Nonnull
private String name;
@SerializedName("pass")
private String pass = null;
public static final String SERIALIZED_NAME_PASS = "pass";
@SerializedName(SERIALIZED_NAME_PASS)
@javax.annotation.Nonnull
private String pass;
public CreateUserExternal admin(Boolean admin) {
public CreateUserExternal() {
}
public CreateUserExternal admin(@javax.annotation.Nonnull Boolean admin) {
this.admin = admin;
return this;
}
/**
/**
* If the user is an administrator.
* @return admin
**/
@Schema(example = "true", required = true, description = "If the user is an administrator.")
public Boolean isAdmin() {
*/
@javax.annotation.Nonnull
public Boolean getAdmin() {
return admin;
}
public void setAdmin(Boolean admin) {
public void setAdmin(@javax.annotation.Nonnull Boolean admin) {
this.admin = admin;
}
public CreateUserExternal name(String name) {
public CreateUserExternal name(@javax.annotation.Nonnull String name) {
this.name = name;
return this;
}
/**
/**
* The user name. For login.
* @return name
**/
@Schema(example = "unicorn", required = true, description = "The user name. For login.")
*/
@javax.annotation.Nonnull
public String getName() {
return name;
}
public void setName(String name) {
public void setName(@javax.annotation.Nonnull String name) {
this.name = name;
}
public CreateUserExternal pass(String pass) {
public CreateUserExternal pass(@javax.annotation.Nonnull String pass) {
this.pass = pass;
return this;
}
/**
/**
* The user password. For login.
* @return pass
**/
@Schema(example = "nrocinu", required = true, description = "The user password. For login.")
*/
@javax.annotation.Nonnull
public String getPass() {
return pass;
}
public void setPass(String pass) {
public void setPass(@javax.annotation.Nonnull String pass) {
this.pass = pass;
}
@Override
public boolean equals(java.lang.Object o) {
public boolean equals(Object o) {
if (this == o) {
return true;
}
@@ -111,12 +127,10 @@ public class CreateUserExternal {
return Objects.hash(admin, name, pass);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CreateUserExternal {\n");
sb.append(" admin: ").append(toIndentedString(admin)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" pass: ").append(toIndentedString(pass)).append("\n");
@@ -128,7 +142,7 @@ public class CreateUserExternal {
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
@@ -136,3 +150,4 @@ public class CreateUserExternal {
}
}

View File

@@ -2,14 +2,15 @@
* Gotify REST-API.
* This is the documentation of the Gotify REST-API. # Authentication In Gotify there are two token types: __clientToken__: a client is something that receives message and manages stuff like creating new tokens or delete messages. (f.ex this token should be used for an android app) __appToken__: an application is something that sends messages (f.ex. this token should be used for a shell script) The token can be transmitted in a header named `X-Gotify-Key`, in a query parameter named `token` or through a header named `Authorization` with the value prefixed with `Bearer` (Ex. `Bearer randomtoken`). There is also the possibility to authenticate through basic auth, this should only be used for creating a clientToken. \\--- Found a bug or have some questions? [Create an issue on GitHub](https://github.com/gotify/server/issues)
*
* OpenAPI spec version: 2.0.2
* The version of the OpenAPI document: 2.0.2
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.github.gotify.client.model;
import java.util.Objects;
@@ -19,81 +20,96 @@ import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.v3.oas.annotations.media.Schema;
import java.io.IOException;
/**
* The Error contains error relevant information.
*/
@Schema(description = "The Error contains error relevant information.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.19.0")
public class Error {
@SerializedName("error")
private String error = null;
public static final String SERIALIZED_NAME_ERROR = "error";
@SerializedName(SERIALIZED_NAME_ERROR)
@javax.annotation.Nonnull
private String error;
@SerializedName("errorCode")
private Long errorCode = null;
public static final String SERIALIZED_NAME_ERROR_CODE = "errorCode";
@SerializedName(SERIALIZED_NAME_ERROR_CODE)
@javax.annotation.Nonnull
private Long errorCode;
@SerializedName("errorDescription")
private String errorDescription = null;
public static final String SERIALIZED_NAME_ERROR_DESCRIPTION = "errorDescription";
@SerializedName(SERIALIZED_NAME_ERROR_DESCRIPTION)
@javax.annotation.Nonnull
private String errorDescription;
public Error error(String error) {
public Error() {
}
public Error error(@javax.annotation.Nonnull String error) {
this.error = error;
return this;
}
/**
/**
* The general error message
* @return error
**/
@Schema(example = "Unauthorized", required = true, description = "The general error message")
*/
@javax.annotation.Nonnull
public String getError() {
return error;
}
public void setError(String error) {
public void setError(@javax.annotation.Nonnull String error) {
this.error = error;
}
public Error errorCode(Long errorCode) {
public Error errorCode(@javax.annotation.Nonnull Long errorCode) {
this.errorCode = errorCode;
return this;
}
/**
/**
* The http error code.
* @return errorCode
**/
@Schema(example = "401", required = true, description = "The http error code.")
*/
@javax.annotation.Nonnull
public Long getErrorCode() {
return errorCode;
}
public void setErrorCode(Long errorCode) {
public void setErrorCode(@javax.annotation.Nonnull Long errorCode) {
this.errorCode = errorCode;
}
public Error errorDescription(String errorDescription) {
public Error errorDescription(@javax.annotation.Nonnull String errorDescription) {
this.errorDescription = errorDescription;
return this;
}
/**
/**
* The http error code.
* @return errorDescription
**/
@Schema(example = "you need to provide a valid access token or user credentials to access this api", required = true, description = "The http error code.")
*/
@javax.annotation.Nonnull
public String getErrorDescription() {
return errorDescription;
}
public void setErrorDescription(String errorDescription) {
public void setErrorDescription(@javax.annotation.Nonnull String errorDescription) {
this.errorDescription = errorDescription;
}
@Override
public boolean equals(java.lang.Object o) {
public boolean equals(Object o) {
if (this == o) {
return true;
}
@@ -111,12 +127,10 @@ public class Error {
return Objects.hash(error, errorCode, errorDescription);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Error {\n");
sb.append(" error: ").append(toIndentedString(error)).append("\n");
sb.append(" errorCode: ").append(toIndentedString(errorCode)).append("\n");
sb.append(" errorDescription: ").append(toIndentedString(errorDescription)).append("\n");
@@ -128,7 +142,7 @@ public class Error {
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
@@ -136,3 +150,4 @@ public class Error {
}
}

View File

@@ -2,14 +2,15 @@
* Gotify REST-API.
* This is the documentation of the Gotify REST-API. # Authentication In Gotify there are two token types: __clientToken__: a client is something that receives message and manages stuff like creating new tokens or delete messages. (f.ex this token should be used for an android app) __appToken__: an application is something that sends messages (f.ex. this token should be used for a shell script) The token can be transmitted in a header named `X-Gotify-Key`, in a query parameter named `token` or through a header named `Authorization` with the value prefixed with `Bearer` (Ex. `Bearer randomtoken`). There is also the possibility to authenticate through basic auth, this should only be used for creating a clientToken. \\--- Found a bug or have some questions? [Create an issue on GitHub](https://github.com/gotify/server/issues)
*
* OpenAPI spec version: 2.0.2
* The version of the OpenAPI document: 2.0.2
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.github.gotify.client.model;
import java.util.Objects;
@@ -19,60 +20,70 @@ import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.v3.oas.annotations.media.Schema;
import java.io.IOException;
/**
* Health represents how healthy the application is.
*/
@Schema(description = "Health represents how healthy the application is.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.19.0")
public class Health {
@SerializedName("database")
private String database = null;
public static final String SERIALIZED_NAME_DATABASE = "database";
@SerializedName(SERIALIZED_NAME_DATABASE)
@javax.annotation.Nonnull
private String database;
@SerializedName("health")
private String health = null;
public static final String SERIALIZED_NAME_HEALTH = "health";
@SerializedName(SERIALIZED_NAME_HEALTH)
@javax.annotation.Nonnull
private String health;
public Health database(String database) {
public Health() {
}
public Health database(@javax.annotation.Nonnull String database) {
this.database = database;
return this;
}
/**
/**
* The health of the database connection.
* @return database
**/
@Schema(example = "green", required = true, description = "The health of the database connection.")
*/
@javax.annotation.Nonnull
public String getDatabase() {
return database;
}
public void setDatabase(String database) {
public void setDatabase(@javax.annotation.Nonnull String database) {
this.database = database;
}
public Health health(String health) {
public Health health(@javax.annotation.Nonnull String health) {
this.health = health;
return this;
}
/**
/**
* The health of the overall application.
* @return health
**/
@Schema(example = "green", required = true, description = "The health of the overall application.")
*/
@javax.annotation.Nonnull
public String getHealth() {
return health;
}
public void setHealth(String health) {
public void setHealth(@javax.annotation.Nonnull String health) {
this.health = health;
}
@Override
public boolean equals(java.lang.Object o) {
public boolean equals(Object o) {
if (this == o) {
return true;
}
@@ -89,12 +100,10 @@ public class Health {
return Objects.hash(database, health);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Health {\n");
sb.append(" database: ").append(toIndentedString(database)).append("\n");
sb.append(" health: ").append(toIndentedString(health)).append("\n");
sb.append("}");
@@ -105,7 +114,7 @@ public class Health {
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
@@ -113,3 +122,4 @@ public class Health {
}
}

View File

@@ -1,93 +0,0 @@
/*
* Gotify REST-API.
* This is the documentation of the Gotify REST-API. # Authentication In Gotify there are two token types: __clientToken__: a client is something that receives message and manages stuff like creating new tokens or delete messages. (f.ex this token should be used for an android app) __appToken__: an application is something that sends messages (f.ex. this token should be used for a shell script) The token can be transmitted in a header named `X-Gotify-Key`, in a query parameter named `token` or through a header named `Authorization` with the value prefixed with `Bearer` (Ex. `Bearer randomtoken`). There is also the possibility to authenticate through basic auth, this should only be used for creating a clientToken. \\--- Found a bug or have some questions? [Create an issue on GitHub](https://github.com/gotify/server/issues)
*
* OpenAPI spec version: 2.0.2
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package com.github.gotify.client.model;
import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.v3.oas.annotations.media.Schema;
import java.io.File;
import java.io.IOException;
/**
* IdImageBody
*/
public class IdImageBody {
@SerializedName("file")
private File file = null;
public IdImageBody file(File file) {
this.file = file;
return this;
}
/**
* the application image
* @return file
**/
@Schema(required = true, description = "the application image")
public File getFile() {
return file;
}
public void setFile(File file) {
this.file = file;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
IdImageBody idImageBody = (IdImageBody) o;
return Objects.equals(this.file, idImageBody.file);
}
@Override
public int hashCode() {
return Objects.hash(Objects.hashCode(file));
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class IdImageBody {\n");
sb.append(" file: ").append(toIndentedString(file)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -2,14 +2,15 @@
* Gotify REST-API.
* This is the documentation of the Gotify REST-API. # Authentication In Gotify there are two token types: __clientToken__: a client is something that receives message and manages stuff like creating new tokens or delete messages. (f.ex this token should be used for an android app) __appToken__: an application is something that sends messages (f.ex. this token should be used for a shell script) The token can be transmitted in a header named `X-Gotify-Key`, in a query parameter named `token` or through a header named `Authorization` with the value prefixed with `Bearer` (Ex. `Bearer randomtoken`). There is also the possibility to authenticate through basic auth, this should only be used for creating a clientToken. \\--- Found a bug or have some questions? [Create an issue on GitHub](https://github.com/gotify/server/issues)
*
* OpenAPI spec version: 2.0.2
* The version of the OpenAPI document: 2.0.2
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.github.gotify.client.model;
import java.util.Objects;
@@ -19,150 +20,198 @@ import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.v3.oas.annotations.media.Schema;
import java.io.IOException;
import java.time.OffsetDateTime;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.threeten.bp.OffsetDateTime;
/**
* The MessageExternal holds information about a message which was sent by an Application.
*/
@Schema(description = "The MessageExternal holds information about a message which was sent by an Application.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.19.0")
public class Message {
@SerializedName("appid")
private Long appid = null;
public static final String SERIALIZED_NAME_APPID = "appid";
@SerializedName(SERIALIZED_NAME_APPID)
@javax.annotation.Nonnull
private Long appid;
@SerializedName("date")
private OffsetDateTime date = null;
public static final String SERIALIZED_NAME_DATE = "date";
@SerializedName(SERIALIZED_NAME_DATE)
@javax.annotation.Nonnull
private OffsetDateTime date;
@SerializedName("extras")
private Map<String, Object> extras = null;
public static final String SERIALIZED_NAME_EXTRAS = "extras";
@SerializedName(SERIALIZED_NAME_EXTRAS)
@javax.annotation.Nullable
private Map<String, Object> extras = new HashMap<>();
@SerializedName("id")
private Long id = null;
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
@javax.annotation.Nonnull
private Long id;
@SerializedName("message")
private String message = null;
public static final String SERIALIZED_NAME_MESSAGE = "message";
@SerializedName(SERIALIZED_NAME_MESSAGE)
@javax.annotation.Nonnull
private String message;
@SerializedName("priority")
private Long priority = null;
public static final String SERIALIZED_NAME_PRIORITY = "priority";
@SerializedName(SERIALIZED_NAME_PRIORITY)
@javax.annotation.Nullable
private Long priority;
@SerializedName("title")
private String title = null;
public static final String SERIALIZED_NAME_TITLE = "title";
@SerializedName(SERIALIZED_NAME_TITLE)
@javax.annotation.Nullable
private String title;
/**
public Message() {
}
/**
* Constructor with only readonly parameters
*/
public Message(
Long appid,
OffsetDateTime date,
Long id
) {
this();
this.appid = appid;
this.date = date;
this.id = id;
}
/**
* The application id that send this message.
* @return appid
**/
@Schema(example = "5", required = true, description = "The application id that send this message.")
*/
@javax.annotation.Nonnull
public Long getAppid() {
return appid;
}
/**
/**
* The date the message was created.
* @return date
**/
@Schema(example = "2018-02-27T19:36:10.504504400+01:00", required = true, description = "The date the message was created.")
*/
@javax.annotation.Nonnull
public OffsetDateTime getDate() {
return date;
}
public Message extras(Map<String, Object> extras) {
public Message extras(@javax.annotation.Nullable Map<String, Object> extras) {
this.extras = extras;
return this;
}
public Message putExtrasItem(String key, Object extrasItem) {
if (this.extras == null) {
this.extras = new HashMap<String, Object>();
this.extras = new HashMap<>();
}
this.extras.put(key, extrasItem);
return this;
}
/**
/**
* The extra data sent along the message. The extra fields are stored in a key-value scheme. Only accepted in CreateMessage requests with application/json content-type. The keys should be in the following format: &amp;lt;top-namespace&amp;gt;::[&amp;lt;sub-namespace&amp;gt;::]&amp;lt;action&amp;gt; These namespaces are reserved and might be used in the official clients: gotify android ios web server client. Do not use them for other purposes.
* @return extras
**/
@Schema(example = "{\"home::appliances::lighting::on\":{\"brightness\":15},\"home::appliances::thermostat::change_temperature\":{\"temperature\":23}}", description = "The extra data sent along the message. The extra fields are stored in a key-value scheme. Only accepted in CreateMessage requests with application/json content-type. The keys should be in the following format: &lt;top-namespace&gt;::[&lt;sub-namespace&gt;::]&lt;action&gt; These namespaces are reserved and might be used in the official clients: gotify android ios web server client. Do not use them for other purposes.")
*/
@javax.annotation.Nullable
public Map<String, Object> getExtras() {
return extras;
}
public void setExtras(Map<String, Object> extras) {
public void setExtras(@javax.annotation.Nullable Map<String, Object> extras) {
this.extras = extras;
}
/**
/**
* The message id.
* @return id
**/
@Schema(example = "25", required = true, description = "The message id.")
*/
@javax.annotation.Nonnull
public Long getId() {
return id;
}
public Message message(String message) {
public Message message(@javax.annotation.Nonnull String message) {
this.message = message;
return this;
}
/**
/**
* The message. Markdown (excluding html) is allowed.
* @return message
**/
@Schema(example = "**Backup** was successfully finished.", required = true, description = "The message. Markdown (excluding html) is allowed.")
*/
@javax.annotation.Nonnull
public String getMessage() {
return message;
}
public void setMessage(String message) {
public void setMessage(@javax.annotation.Nonnull String message) {
this.message = message;
}
public Message priority(Long priority) {
public Message priority(@javax.annotation.Nullable Long priority) {
this.priority = priority;
return this;
}
/**
/**
* The priority of the message. If unset, then the default priority of the application will be used.
* @return priority
**/
@Schema(example = "2", description = "The priority of the message. If unset, then the default priority of the application will be used.")
*/
@javax.annotation.Nullable
public Long getPriority() {
return priority;
}
public void setPriority(Long priority) {
public void setPriority(@javax.annotation.Nullable Long priority) {
this.priority = priority;
}
public Message title(String title) {
public Message title(@javax.annotation.Nullable String title) {
this.title = title;
return this;
}
/**
/**
* The title of the message.
* @return title
**/
@Schema(example = "Backup", description = "The title of the message.")
*/
@javax.annotation.Nullable
public String getTitle() {
return title;
}
public void setTitle(String title) {
public void setTitle(@javax.annotation.Nullable String title) {
this.title = title;
}
@Override
public boolean equals(java.lang.Object o) {
public boolean equals(Object o) {
if (this == o) {
return true;
}
@@ -184,12 +233,10 @@ public class Message {
return Objects.hash(appid, date, extras, id, message, priority, title);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Message {\n");
sb.append(" appid: ").append(toIndentedString(appid)).append("\n");
sb.append(" date: ").append(toIndentedString(date)).append("\n");
sb.append(" extras: ").append(toIndentedString(extras)).append("\n");
@@ -205,7 +252,7 @@ public class Message {
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
@@ -213,3 +260,4 @@ public class Message {
}
}

View File

@@ -2,14 +2,15 @@
* Gotify REST-API.
* This is the documentation of the Gotify REST-API. # Authentication In Gotify there are two token types: __clientToken__: a client is something that receives message and manages stuff like creating new tokens or delete messages. (f.ex this token should be used for an android app) __appToken__: an application is something that sends messages (f.ex. this token should be used for a shell script) The token can be transmitted in a header named `X-Gotify-Key`, in a query parameter named `token` or through a header named `Authorization` with the value prefixed with `Bearer` (Ex. `Bearer randomtoken`). There is also the possibility to authenticate through basic auth, this should only be used for creating a clientToken. \\--- Found a bug or have some questions? [Create an issue on GitHub](https://github.com/gotify/server/issues)
*
* OpenAPI spec version: 2.0.2
* The version of the OpenAPI document: 2.0.2
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.github.gotify.client.model;
import java.util.Objects;
@@ -21,53 +22,74 @@ import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.v3.oas.annotations.media.Schema;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* Wrapper for the paging and the messages.
*/
@Schema(description = "Wrapper for the paging and the messages.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.19.0")
public class PagedMessages {
@SerializedName("messages")
private List<Message> messages = new ArrayList<Message>();
public static final String SERIALIZED_NAME_MESSAGES = "messages";
@SerializedName(SERIALIZED_NAME_MESSAGES)
@javax.annotation.Nonnull
private List<Message> messages = new ArrayList<>();
@SerializedName("paging")
private Paging paging = null;
public static final String SERIALIZED_NAME_PAGING = "paging";
@SerializedName(SERIALIZED_NAME_PAGING)
@javax.annotation.Nonnull
private Paging paging;
/**
public PagedMessages() {
}
/**
* Constructor with only readonly parameters
*/
public PagedMessages(
List<Message> messages
) {
this();
this.messages = messages;
}
/**
* The messages.
* @return messages
**/
@Schema(required = true, description = "The messages.")
*/
@javax.annotation.Nonnull
public List<Message> getMessages() {
return messages;
}
public PagedMessages paging(Paging paging) {
public PagedMessages paging(@javax.annotation.Nonnull Paging paging) {
this.paging = paging;
return this;
}
/**
/**
* Get paging
* @return paging
**/
@Schema(required = true, description = "")
*/
@javax.annotation.Nonnull
public Paging getPaging() {
return paging;
}
public void setPaging(Paging paging) {
public void setPaging(@javax.annotation.Nonnull Paging paging) {
this.paging = paging;
}
@Override
public boolean equals(java.lang.Object o) {
public boolean equals(Object o) {
if (this == o) {
return true;
}
@@ -84,12 +106,10 @@ public class PagedMessages {
return Objects.hash(messages, paging);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PagedMessages {\n");
sb.append(" messages: ").append(toIndentedString(messages)).append("\n");
sb.append(" paging: ").append(toIndentedString(paging)).append("\n");
sb.append("}");
@@ -100,7 +120,7 @@ public class PagedMessages {
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
@@ -108,3 +128,4 @@ public class PagedMessages {
}
}

View File

@@ -2,14 +2,15 @@
* Gotify REST-API.
* This is the documentation of the Gotify REST-API. # Authentication In Gotify there are two token types: __clientToken__: a client is something that receives message and manages stuff like creating new tokens or delete messages. (f.ex this token should be used for an android app) __appToken__: an application is something that sends messages (f.ex. this token should be used for a shell script) The token can be transmitted in a header named `X-Gotify-Key`, in a query parameter named `token` or through a header named `Authorization` with the value prefixed with `Bearer` (Ex. `Bearer randomtoken`). There is also the possibility to authenticate through basic auth, this should only be used for creating a clientToken. \\--- Found a bug or have some questions? [Create an issue on GitHub](https://github.com/gotify/server/issues)
*
* OpenAPI spec version: 2.0.2
* The version of the OpenAPI document: 2.0.2
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.github.gotify.client.model;
import java.util.Objects;
@@ -19,69 +20,105 @@ import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.v3.oas.annotations.media.Schema;
import java.io.IOException;
/**
* The Paging holds information about the limit and making requests to the next page.
*/
@Schema(description = "The Paging holds information about the limit and making requests to the next page.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.19.0")
public class Paging {
@SerializedName("limit")
private Long limit = null;
public static final String SERIALIZED_NAME_LIMIT = "limit";
@SerializedName(SERIALIZED_NAME_LIMIT)
@javax.annotation.Nonnull
private Long limit;
@SerializedName("next")
private String next = null;
public static final String SERIALIZED_NAME_NEXT = "next";
@SerializedName(SERIALIZED_NAME_NEXT)
@javax.annotation.Nullable
private String next;
@SerializedName("since")
private Long since = null;
public static final String SERIALIZED_NAME_SINCE = "since";
@SerializedName(SERIALIZED_NAME_SINCE)
@javax.annotation.Nonnull
private Long since;
@SerializedName("size")
private Long size = null;
public static final String SERIALIZED_NAME_SIZE = "size";
@SerializedName(SERIALIZED_NAME_SIZE)
@javax.annotation.Nonnull
private Long size;
/**
public Paging() {
}
/**
* Constructor with only readonly parameters
*/
public Paging(
Long limit,
String next,
Long since,
Long size
) {
this();
this.limit = limit;
this.next = next;
this.since = since;
this.size = size;
}
/**
* The limit of the messages for the current request.
* minimum: 1
* maximum: 200
* @return limit
**/
@Schema(example = "123", required = true, description = "The limit of the messages for the current request.")
*/
@javax.annotation.Nonnull
public Long getLimit() {
return limit;
}
/**
/**
* The request url for the next page. Empty/Null when no next page is available.
* @return next
**/
@Schema(example = "http://example.com/message?limit=50&since=123456", description = "The request url for the next page. Empty/Null when no next page is available.")
*/
@javax.annotation.Nullable
public String getNext() {
return next;
}
/**
/**
* The ID of the last message returned in the current request. Use this as alternative to the next link.
* minimum: 0
* @return since
**/
@Schema(example = "5", required = true, description = "The ID of the last message returned in the current request. Use this as alternative to the next link.")
*/
@javax.annotation.Nonnull
public Long getSince() {
return since;
}
/**
/**
* The amount of messages that got returned in the current request.
* @return size
**/
@Schema(example = "5", required = true, description = "The amount of messages that got returned in the current request.")
*/
@javax.annotation.Nonnull
public Long getSize() {
return size;
}
@Override
public boolean equals(java.lang.Object o) {
public boolean equals(Object o) {
if (this == o) {
return true;
}
@@ -100,12 +137,10 @@ public class Paging {
return Objects.hash(limit, next, since, size);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Paging {\n");
sb.append(" limit: ").append(toIndentedString(limit)).append("\n");
sb.append(" next: ").append(toIndentedString(next)).append("\n");
sb.append(" since: ").append(toIndentedString(since)).append("\n");
@@ -118,7 +153,7 @@ public class Paging {
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
@@ -126,3 +161,4 @@ public class Paging {
}
}

View File

@@ -2,14 +2,15 @@
* Gotify REST-API.
* This is the documentation of the Gotify REST-API. # Authentication In Gotify there are two token types: __clientToken__: a client is something that receives message and manages stuff like creating new tokens or delete messages. (f.ex this token should be used for an android app) __appToken__: an application is something that sends messages (f.ex. this token should be used for a shell script) The token can be transmitted in a header named `X-Gotify-Key`, in a query parameter named `token` or through a header named `Authorization` with the value prefixed with `Bearer` (Ex. `Bearer randomtoken`). There is also the possibility to authenticate through basic auth, this should only be used for creating a clientToken. \\--- Found a bug or have some questions? [Create an issue on GitHub](https://github.com/gotify/server/issues)
*
* OpenAPI spec version: 2.0.2
* The version of the OpenAPI document: 2.0.2
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.github.gotify.client.model;
import java.util.Objects;
@@ -19,160 +20,229 @@ import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.v3.oas.annotations.media.Schema;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* Holds information about a plugin instance for one user.
*/
@Schema(description = "Holds information about a plugin instance for one user.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.19.0")
public class PluginConf {
@SerializedName("author")
private String author = null;
public static final String SERIALIZED_NAME_AUTHOR = "author";
@SerializedName(SERIALIZED_NAME_AUTHOR)
@javax.annotation.Nullable
private String author;
@SerializedName("capabilities")
private List<String> capabilities = new ArrayList<String>();
public static final String SERIALIZED_NAME_CAPABILITIES = "capabilities";
@SerializedName(SERIALIZED_NAME_CAPABILITIES)
@javax.annotation.Nonnull
private List<String> capabilities = new ArrayList<>();
@SerializedName("enabled")
private Boolean enabled = null;
public static final String SERIALIZED_NAME_ENABLED = "enabled";
@SerializedName(SERIALIZED_NAME_ENABLED)
@javax.annotation.Nonnull
private Boolean enabled;
@SerializedName("id")
private Long id = null;
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
@javax.annotation.Nonnull
private Long id;
@SerializedName("license")
private String license = null;
public static final String SERIALIZED_NAME_LICENSE = "license";
@SerializedName(SERIALIZED_NAME_LICENSE)
@javax.annotation.Nullable
private String license;
@SerializedName("modulePath")
private String modulePath = null;
public static final String SERIALIZED_NAME_MODULE_PATH = "modulePath";
@SerializedName(SERIALIZED_NAME_MODULE_PATH)
@javax.annotation.Nonnull
private String modulePath;
@SerializedName("name")
private String name = null;
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
@javax.annotation.Nonnull
private String name;
@SerializedName("token")
private String token = null;
public static final String SERIALIZED_NAME_TOKEN = "token";
@SerializedName(SERIALIZED_NAME_TOKEN)
@javax.annotation.Nonnull
private String token;
@SerializedName("website")
private String website = null;
public static final String SERIALIZED_NAME_WEBSITE = "website";
@SerializedName(SERIALIZED_NAME_WEBSITE)
@javax.annotation.Nullable
private String website;
/**
public PluginConf() {
}
/**
* Constructor with only readonly parameters
*/
public PluginConf(
String author,
Long id,
String license,
String modulePath,
String name,
String website
) {
this();
this.author = author;
this.id = id;
this.license = license;
this.modulePath = modulePath;
this.name = name;
this.website = website;
}
/**
* The author of the plugin.
* @return author
**/
@Schema(example = "jmattheis", description = "The author of the plugin.")
*/
@javax.annotation.Nullable
public String getAuthor() {
return author;
}
public PluginConf capabilities(List<String> capabilities) {
public PluginConf capabilities(@javax.annotation.Nonnull List<String> capabilities) {
this.capabilities = capabilities;
return this;
}
public PluginConf addCapabilitiesItem(String capabilitiesItem) {
if (this.capabilities == null) {
this.capabilities = new ArrayList<>();
}
this.capabilities.add(capabilitiesItem);
return this;
}
/**
/**
* Capabilities the plugin provides
* @return capabilities
**/
@Schema(example = "[\"webhook\",\"display\"]", required = true, description = "Capabilities the plugin provides")
*/
@javax.annotation.Nonnull
public List<String> getCapabilities() {
return capabilities;
}
public void setCapabilities(List<String> capabilities) {
public void setCapabilities(@javax.annotation.Nonnull List<String> capabilities) {
this.capabilities = capabilities;
}
public PluginConf enabled(Boolean enabled) {
public PluginConf enabled(@javax.annotation.Nonnull Boolean enabled) {
this.enabled = enabled;
return this;
}
/**
/**
* Whether the plugin instance is enabled.
* @return enabled
**/
@Schema(example = "true", required = true, description = "Whether the plugin instance is enabled.")
public Boolean isEnabled() {
*/
@javax.annotation.Nonnull
public Boolean getEnabled() {
return enabled;
}
public void setEnabled(Boolean enabled) {
public void setEnabled(@javax.annotation.Nonnull Boolean enabled) {
this.enabled = enabled;
}
/**
/**
* The plugin id.
* @return id
**/
@Schema(example = "25", required = true, description = "The plugin id.")
*/
@javax.annotation.Nonnull
public Long getId() {
return id;
}
/**
/**
* The license of the plugin.
* @return license
**/
@Schema(example = "MIT", description = "The license of the plugin.")
*/
@javax.annotation.Nullable
public String getLicense() {
return license;
}
/**
/**
* The module path of the plugin.
* @return modulePath
**/
@Schema(example = "github.com/gotify/server/plugin/example/echo", required = true, description = "The module path of the plugin.")
*/
@javax.annotation.Nonnull
public String getModulePath() {
return modulePath;
}
/**
/**
* The plugin name.
* @return name
**/
@Schema(example = "RSS poller", required = true, description = "The plugin name.")
*/
@javax.annotation.Nonnull
public String getName() {
return name;
}
public PluginConf token(String token) {
public PluginConf token(@javax.annotation.Nonnull String token) {
this.token = token;
return this;
}
/**
/**
* The user name. For login.
* @return token
**/
@Schema(example = "P1234", required = true, description = "The user name. For login.")
*/
@javax.annotation.Nonnull
public String getToken() {
return token;
}
public void setToken(String token) {
public void setToken(@javax.annotation.Nonnull String token) {
this.token = token;
}
/**
/**
* The website of the plugin.
* @return website
**/
@Schema(example = "gotify.net", description = "The website of the plugin.")
*/
@javax.annotation.Nullable
public String getWebsite() {
return website;
}
@Override
public boolean equals(java.lang.Object o) {
public boolean equals(Object o) {
if (this == o) {
return true;
}
@@ -196,12 +266,10 @@ public class PluginConf {
return Objects.hash(author, capabilities, enabled, id, license, modulePath, name, token, website);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PluginConf {\n");
sb.append(" author: ").append(toIndentedString(author)).append("\n");
sb.append(" capabilities: ").append(toIndentedString(capabilities)).append("\n");
sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n");
@@ -219,7 +287,7 @@ public class PluginConf {
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
@@ -227,3 +295,4 @@ public class PluginConf {
}
}

View File

@@ -2,14 +2,15 @@
* Gotify REST-API.
* This is the documentation of the Gotify REST-API. # Authentication In Gotify there are two token types: __clientToken__: a client is something that receives message and manages stuff like creating new tokens or delete messages. (f.ex this token should be used for an android app) __appToken__: an application is something that sends messages (f.ex. this token should be used for a shell script) The token can be transmitted in a header named `X-Gotify-Key`, in a query parameter named `token` or through a header named `Authorization` with the value prefixed with `Bearer` (Ex. `Bearer randomtoken`). There is also the possibility to authenticate through basic auth, this should only be used for creating a clientToken. \\--- Found a bug or have some questions? [Create an issue on GitHub](https://github.com/gotify/server/issues)
*
* OpenAPI spec version: 2.0.2
* The version of the OpenAPI document: 2.0.2
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.github.gotify.client.model;
import java.util.Objects;
@@ -19,81 +20,96 @@ import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.v3.oas.annotations.media.Schema;
import java.io.IOException;
/**
* Used for updating a user.
*/
@Schema(description = "Used for updating a user.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.19.0")
public class UpdateUserExternal {
@SerializedName("admin")
private Boolean admin = null;
public static final String SERIALIZED_NAME_ADMIN = "admin";
@SerializedName(SERIALIZED_NAME_ADMIN)
@javax.annotation.Nonnull
private Boolean admin;
@SerializedName("name")
private String name = null;
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
@javax.annotation.Nonnull
private String name;
@SerializedName("pass")
private String pass = null;
public static final String SERIALIZED_NAME_PASS = "pass";
@SerializedName(SERIALIZED_NAME_PASS)
@javax.annotation.Nullable
private String pass;
public UpdateUserExternal admin(Boolean admin) {
public UpdateUserExternal() {
}
public UpdateUserExternal admin(@javax.annotation.Nonnull Boolean admin) {
this.admin = admin;
return this;
}
/**
/**
* If the user is an administrator.
* @return admin
**/
@Schema(example = "true", required = true, description = "If the user is an administrator.")
public Boolean isAdmin() {
*/
@javax.annotation.Nonnull
public Boolean getAdmin() {
return admin;
}
public void setAdmin(Boolean admin) {
public void setAdmin(@javax.annotation.Nonnull Boolean admin) {
this.admin = admin;
}
public UpdateUserExternal name(String name) {
public UpdateUserExternal name(@javax.annotation.Nonnull String name) {
this.name = name;
return this;
}
/**
/**
* The user name. For login.
* @return name
**/
@Schema(example = "unicorn", required = true, description = "The user name. For login.")
*/
@javax.annotation.Nonnull
public String getName() {
return name;
}
public void setName(String name) {
public void setName(@javax.annotation.Nonnull String name) {
this.name = name;
}
public UpdateUserExternal pass(String pass) {
public UpdateUserExternal pass(@javax.annotation.Nullable String pass) {
this.pass = pass;
return this;
}
/**
/**
* The user password. For login. Empty for using old password
* @return pass
**/
@Schema(example = "nrocinu", description = "The user password. For login. Empty for using old password")
*/
@javax.annotation.Nullable
public String getPass() {
return pass;
}
public void setPass(String pass) {
public void setPass(@javax.annotation.Nullable String pass) {
this.pass = pass;
}
@Override
public boolean equals(java.lang.Object o) {
public boolean equals(Object o) {
if (this == o) {
return true;
}
@@ -111,12 +127,10 @@ public class UpdateUserExternal {
return Objects.hash(admin, name, pass);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class UpdateUserExternal {\n");
sb.append(" admin: ").append(toIndentedString(admin)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" pass: ").append(toIndentedString(pass)).append("\n");
@@ -128,7 +142,7 @@ public class UpdateUserExternal {
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
@@ -136,3 +150,4 @@ public class UpdateUserExternal {
}
}

View File

@@ -2,14 +2,15 @@
* Gotify REST-API.
* This is the documentation of the Gotify REST-API. # Authentication In Gotify there are two token types: __clientToken__: a client is something that receives message and manages stuff like creating new tokens or delete messages. (f.ex this token should be used for an android app) __appToken__: an application is something that sends messages (f.ex. this token should be used for a shell script) The token can be transmitted in a header named `X-Gotify-Key`, in a query parameter named `token` or through a header named `Authorization` with the value prefixed with `Bearer` (Ex. `Bearer randomtoken`). There is also the possibility to authenticate through basic auth, this should only be used for creating a clientToken. \\--- Found a bug or have some questions? [Create an issue on GitHub](https://github.com/gotify/server/issues)
*
* OpenAPI spec version: 2.0.2
* The version of the OpenAPI document: 2.0.2
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.github.gotify.client.model;
import java.util.Objects;
@@ -19,72 +20,97 @@ import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.v3.oas.annotations.media.Schema;
import java.io.IOException;
/**
* The User holds information about permission and other stuff.
*/
@Schema(description = "The User holds information about permission and other stuff.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.19.0")
public class User {
@SerializedName("admin")
private Boolean admin = null;
public static final String SERIALIZED_NAME_ADMIN = "admin";
@SerializedName(SERIALIZED_NAME_ADMIN)
@javax.annotation.Nonnull
private Boolean admin;
@SerializedName("id")
private Long id = null;
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
@javax.annotation.Nonnull
private Long id;
@SerializedName("name")
private String name = null;
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
@javax.annotation.Nonnull
private String name;
public User admin(Boolean admin) {
public User() {
}
/**
* Constructor with only readonly parameters
*/
public User(
Long id
) {
this();
this.id = id;
}
public User admin(@javax.annotation.Nonnull Boolean admin) {
this.admin = admin;
return this;
}
/**
/**
* If the user is an administrator.
* @return admin
**/
@Schema(example = "true", required = true, description = "If the user is an administrator.")
public Boolean isAdmin() {
*/
@javax.annotation.Nonnull
public Boolean getAdmin() {
return admin;
}
public void setAdmin(Boolean admin) {
public void setAdmin(@javax.annotation.Nonnull Boolean admin) {
this.admin = admin;
}
/**
/**
* The user id.
* @return id
**/
@Schema(example = "25", required = true, description = "The user id.")
*/
@javax.annotation.Nonnull
public Long getId() {
return id;
}
public User name(String name) {
public User name(@javax.annotation.Nonnull String name) {
this.name = name;
return this;
}
/**
/**
* The user name. For login.
* @return name
**/
@Schema(example = "unicorn", required = true, description = "The user name. For login.")
*/
@javax.annotation.Nonnull
public String getName() {
return name;
}
public void setName(String name) {
public void setName(@javax.annotation.Nonnull String name) {
this.name = name;
}
@Override
public boolean equals(java.lang.Object o) {
public boolean equals(Object o) {
if (this == o) {
return true;
}
@@ -102,12 +128,10 @@ public class User {
return Objects.hash(admin, id, name);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class User {\n");
sb.append(" admin: ").append(toIndentedString(admin)).append("\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
@@ -119,7 +143,7 @@ public class User {
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
@@ -127,3 +151,4 @@ public class User {
}
}

View File

@@ -2,14 +2,15 @@
* Gotify REST-API.
* This is the documentation of the Gotify REST-API. # Authentication In Gotify there are two token types: __clientToken__: a client is something that receives message and manages stuff like creating new tokens or delete messages. (f.ex this token should be used for an android app) __appToken__: an application is something that sends messages (f.ex. this token should be used for a shell script) The token can be transmitted in a header named `X-Gotify-Key`, in a query parameter named `token` or through a header named `Authorization` with the value prefixed with `Bearer` (Ex. `Bearer randomtoken`). There is also the possibility to authenticate through basic auth, this should only be used for creating a clientToken. \\--- Found a bug or have some questions? [Create an issue on GitHub](https://github.com/gotify/server/issues)
*
* OpenAPI spec version: 2.0.2
* The version of the OpenAPI document: 2.0.2
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.github.gotify.client.model;
import java.util.Objects;
@@ -19,39 +20,44 @@ import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.v3.oas.annotations.media.Schema;
import java.io.IOException;
/**
* The Password for updating the user.
*/
@Schema(description = "The Password for updating the user.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.19.0")
public class UserPass {
@SerializedName("pass")
private String pass = null;
public static final String SERIALIZED_NAME_PASS = "pass";
@SerializedName(SERIALIZED_NAME_PASS)
@javax.annotation.Nonnull
private String pass;
public UserPass pass(String pass) {
public UserPass() {
}
public UserPass pass(@javax.annotation.Nonnull String pass) {
this.pass = pass;
return this;
}
/**
/**
* The user password. For login.
* @return pass
**/
@Schema(example = "nrocinu", required = true, description = "The user password. For login.")
*/
@javax.annotation.Nonnull
public String getPass() {
return pass;
}
public void setPass(String pass) {
public void setPass(@javax.annotation.Nonnull String pass) {
this.pass = pass;
}
@Override
public boolean equals(java.lang.Object o) {
public boolean equals(Object o) {
if (this == o) {
return true;
}
@@ -67,12 +73,10 @@ public class UserPass {
return Objects.hash(pass);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class UserPass {\n");
sb.append(" pass: ").append(toIndentedString(pass)).append("\n");
sb.append("}");
return sb.toString();
@@ -82,7 +86,7 @@ public class UserPass {
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
@@ -90,3 +94,4 @@ public class UserPass {
}
}

View File

@@ -2,14 +2,15 @@
* Gotify REST-API.
* This is the documentation of the Gotify REST-API. # Authentication In Gotify there are two token types: __clientToken__: a client is something that receives message and manages stuff like creating new tokens or delete messages. (f.ex this token should be used for an android app) __appToken__: an application is something that sends messages (f.ex. this token should be used for a shell script) The token can be transmitted in a header named `X-Gotify-Key`, in a query parameter named `token` or through a header named `Authorization` with the value prefixed with `Bearer` (Ex. `Bearer randomtoken`). There is also the possibility to authenticate through basic auth, this should only be used for creating a clientToken. \\--- Found a bug or have some questions? [Create an issue on GitHub](https://github.com/gotify/server/issues)
*
* OpenAPI spec version: 2.0.2
* The version of the OpenAPI document: 2.0.2
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.github.gotify.client.model;
import java.util.Objects;
@@ -19,81 +20,96 @@ import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.v3.oas.annotations.media.Schema;
import java.io.IOException;
/**
* VersionInfo Model
*/
@Schema(description = "VersionInfo Model")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.19.0")
public class VersionInfo {
@SerializedName("buildDate")
private String buildDate = null;
public static final String SERIALIZED_NAME_BUILD_DATE = "buildDate";
@SerializedName(SERIALIZED_NAME_BUILD_DATE)
@javax.annotation.Nonnull
private String buildDate;
@SerializedName("commit")
private String commit = null;
public static final String SERIALIZED_NAME_COMMIT = "commit";
@SerializedName(SERIALIZED_NAME_COMMIT)
@javax.annotation.Nonnull
private String commit;
@SerializedName("version")
private String version = null;
public static final String SERIALIZED_NAME_VERSION = "version";
@SerializedName(SERIALIZED_NAME_VERSION)
@javax.annotation.Nonnull
private String version;
public VersionInfo buildDate(String buildDate) {
public VersionInfo() {
}
public VersionInfo buildDate(@javax.annotation.Nonnull String buildDate) {
this.buildDate = buildDate;
return this;
}
/**
/**
* The date on which this binary was built.
* @return buildDate
**/
@Schema(example = "2018-02-27T19:36:10.5045044+01:00", required = true, description = "The date on which this binary was built.")
*/
@javax.annotation.Nonnull
public String getBuildDate() {
return buildDate;
}
public void setBuildDate(String buildDate) {
public void setBuildDate(@javax.annotation.Nonnull String buildDate) {
this.buildDate = buildDate;
}
public VersionInfo commit(String commit) {
public VersionInfo commit(@javax.annotation.Nonnull String commit) {
this.commit = commit;
return this;
}
/**
/**
* The git commit hash on which this binary was built.
* @return commit
**/
@Schema(example = "ae9512b6b6feea56a110d59a3353ea3b9c293864", required = true, description = "The git commit hash on which this binary was built.")
*/
@javax.annotation.Nonnull
public String getCommit() {
return commit;
}
public void setCommit(String commit) {
public void setCommit(@javax.annotation.Nonnull String commit) {
this.commit = commit;
}
public VersionInfo version(String version) {
public VersionInfo version(@javax.annotation.Nonnull String version) {
this.version = version;
return this;
}
/**
/**
* The current version.
* @return version
**/
@Schema(example = "5.2.6", required = true, description = "The current version.")
*/
@javax.annotation.Nonnull
public String getVersion() {
return version;
}
public void setVersion(String version) {
public void setVersion(@javax.annotation.Nonnull String version) {
this.version = version;
}
@Override
public boolean equals(java.lang.Object o) {
public boolean equals(Object o) {
if (this == o) {
return true;
}
@@ -111,12 +127,10 @@ public class VersionInfo {
return Objects.hash(buildDate, commit, version);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class VersionInfo {\n");
sb.append(" buildDate: ").append(toIndentedString(buildDate)).append("\n");
sb.append(" commit: ").append(toIndentedString(commit)).append("\n");
sb.append(" version: ").append(toIndentedString(version)).append("\n");
@@ -128,7 +142,7 @@ public class VersionInfo {
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
@@ -136,3 +150,4 @@ public class VersionInfo {
}
}

View File

@@ -1,109 +0,0 @@
package com.github.gotify.client.api;
import com.github.gotify.client.ApiClient;
import com.github.gotify.client.model.Application;
import com.github.gotify.client.model.ApplicationParams;
import com.github.gotify.client.model.Error;
import java.io.File;
import org.junit.Before;
import org.junit.Test;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* API tests for ApplicationApi
*/
public class ApplicationApiTest {
private ApplicationApi api;
@Before
public void setup() {
api = new ApiClient().createService(ApplicationApi.class);
}
/**
* Create an application.
*
*
*/
@Test
public void createAppTest() {
ApplicationParams body = null;
// Application response = api.createApp(body);
// TODO: test validations
}
/**
* Delete an application.
*
*
*/
@Test
public void deleteAppTest() {
Long id = null;
// Void response = api.deleteApp(id);
// TODO: test validations
}
/**
* Return all applications.
*
*
*/
@Test
public void getAppsTest() {
// List<Application> response = api.getApps();
// TODO: test validations
}
/**
* Deletes an image of an application.
*
*
*/
@Test
public void removeAppImageTest() {
Long id = null;
// Void response = api.removeAppImage(id);
// TODO: test validations
}
/**
* Update an application.
*
*
*/
@Test
public void updateApplicationTest() {
ApplicationParams body = null;
Long id = null;
// Application response = api.updateApplication(body, id);
// TODO: test validations
}
/**
* Upload an image for an application.
*
*
*/
@Test
public void uploadAppImageTest() {
File file = null;
Long id = null;
// Application response = api.uploadAppImage(file, id);
// TODO: test validations
}
}

View File

@@ -1,81 +0,0 @@
package com.github.gotify.client.api;
import com.github.gotify.client.ApiClient;
import com.github.gotify.client.model.Client;
import com.github.gotify.client.model.ClientParams;
import com.github.gotify.client.model.Error;
import org.junit.Before;
import org.junit.Test;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* API tests for ClientApi
*/
public class ClientApiTest {
private ClientApi api;
@Before
public void setup() {
api = new ApiClient().createService(ClientApi.class);
}
/**
* Create a client.
*
*
*/
@Test
public void createClientTest() {
ClientParams body = null;
// Client response = api.createClient(body);
// TODO: test validations
}
/**
* Delete a client.
*
*
*/
@Test
public void deleteClientTest() {
Long id = null;
// Void response = api.deleteClient(id);
// TODO: test validations
}
/**
* Return all clients.
*
*
*/
@Test
public void getClientsTest() {
// List<Client> response = api.getClients();
// TODO: test validations
}
/**
* Update a client.
*
*
*/
@Test
public void updateClientTest() {
ClientParams body = null;
Long id = null;
// Client response = api.updateClient(body, id);
// TODO: test validations
}
}

View File

@@ -1,39 +0,0 @@
package com.github.gotify.client.api;
import com.github.gotify.client.ApiClient;
import com.github.gotify.client.model.Health;
import org.junit.Before;
import org.junit.Test;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* API tests for HealthApi
*/
public class HealthApiTest {
private HealthApi api;
@Before
public void setup() {
api = new ApiClient().createService(HealthApi.class);
}
/**
* Get health information.
*
*
*/
@Test
public void getHealthTest() {
// Health response = api.getHealth();
// TODO: test validations
}
}

View File

@@ -1,121 +0,0 @@
package com.github.gotify.client.api;
import com.github.gotify.client.ApiClient;
import com.github.gotify.client.model.Error;
import com.github.gotify.client.model.Message;
import com.github.gotify.client.model.PagedMessages;
import org.junit.Before;
import org.junit.Test;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* API tests for MessageApi
*/
public class MessageApiTest {
private MessageApi api;
@Before
public void setup() {
api = new ApiClient().createService(MessageApi.class);
}
/**
* Create a message.
*
* __NOTE__: This API ONLY accepts an application token as authentication.
*/
@Test
public void createMessageTest() {
Message body = null;
// Message response = api.createMessage(body);
// TODO: test validations
}
/**
* Delete all messages from a specific application.
*
*
*/
@Test
public void deleteAppMessagesTest() {
Long id = null;
// Void response = api.deleteAppMessages(id);
// TODO: test validations
}
/**
* Deletes a message with an id.
*
*
*/
@Test
public void deleteMessageTest() {
Long id = null;
// Void response = api.deleteMessage(id);
// TODO: test validations
}
/**
* Delete all messages.
*
*
*/
@Test
public void deleteMessagesTest() {
// Void response = api.deleteMessages();
// TODO: test validations
}
/**
* Return all messages from a specific application.
*
*
*/
@Test
public void getAppMessagesTest() {
Long id = null;
Integer limit = null;
Long since = null;
// PagedMessages response = api.getAppMessages(id, limit, since);
// TODO: test validations
}
/**
* Return all messages.
*
*
*/
@Test
public void getMessagesTest() {
Integer limit = null;
Long since = null;
// PagedMessages response = api.getMessages(limit, since);
// TODO: test validations
}
/**
* Websocket, return newly created messages.
*
*
*/
@Test
public void streamMessagesTest() {
// Message response = api.streamMessages();
// TODO: test validations
}
}

View File

@@ -1,105 +0,0 @@
package com.github.gotify.client.api;
import com.github.gotify.client.ApiClient;
import com.github.gotify.client.model.Error;
import com.github.gotify.client.model.PluginConf;
import org.junit.Before;
import org.junit.Test;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* API tests for PluginApi
*/
public class PluginApiTest {
private PluginApi api;
@Before
public void setup() {
api = new ApiClient().createService(PluginApi.class);
}
/**
* Disable a plugin.
*
*
*/
@Test
public void disablePluginTest() {
Long id = null;
// Void response = api.disablePlugin(id);
// TODO: test validations
}
/**
* Enable a plugin.
*
*
*/
@Test
public void enablePluginTest() {
Long id = null;
// Void response = api.enablePlugin(id);
// TODO: test validations
}
/**
* Get YAML configuration for Configurer plugin.
*
*
*/
@Test
public void getPluginConfigTest() {
Long id = null;
// Object response = api.getPluginConfig(id);
// TODO: test validations
}
/**
* Get display info for a Displayer plugin.
*
*
*/
@Test
public void getPluginDisplayTest() {
Long id = null;
// String response = api.getPluginDisplay(id);
// TODO: test validations
}
/**
* Return all plugins.
*
*
*/
@Test
public void getPluginsTest() {
// List<PluginConf> response = api.getPlugins();
// TODO: test validations
}
/**
* Update YAML configuration for Configurer plugin.
*
*
*/
@Test
public void updatePluginConfigTest() {
Long id = null;
// Void response = api.updatePluginConfig(id);
// TODO: test validations
}
}

View File

@@ -1,121 +0,0 @@
package com.github.gotify.client.api;
import com.github.gotify.client.ApiClient;
import com.github.gotify.client.model.CreateUserExternal;
import com.github.gotify.client.model.Error;
import com.github.gotify.client.model.UpdateUserExternal;
import com.github.gotify.client.model.User;
import com.github.gotify.client.model.UserPass;
import org.junit.Before;
import org.junit.Test;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* API tests for UserApi
*/
public class UserApiTest {
private UserApi api;
@Before
public void setup() {
api = new ApiClient().createService(UserApi.class);
}
/**
* Create a user.
*
* With enabled registration: non admin users can be created without authentication. With disabled registrations: users can only be created by admin users.
*/
@Test
public void createUserTest() {
CreateUserExternal body = null;
// User response = api.createUser(body);
// TODO: test validations
}
/**
* Return the current user.
*
*
*/
@Test
public void currentUserTest() {
// User response = api.currentUser();
// TODO: test validations
}
/**
* Deletes a user.
*
*
*/
@Test
public void deleteUserTest() {
Long id = null;
// Void response = api.deleteUser(id);
// TODO: test validations
}
/**
* Get a user.
*
*
*/
@Test
public void getUserTest() {
Long id = null;
// User response = api.getUser(id);
// TODO: test validations
}
/**
* Return all users.
*
*
*/
@Test
public void getUsersTest() {
// List<User> response = api.getUsers();
// TODO: test validations
}
/**
* Update the password of the current user.
*
*
*/
@Test
public void updateCurrentUserTest() {
UserPass body = null;
// Void response = api.updateCurrentUser(body);
// TODO: test validations
}
/**
* Update a user.
*
*
*/
@Test
public void updateUserTest() {
UpdateUserExternal body = null;
Long id = null;
// User response = api.updateUser(body, id);
// TODO: test validations
}
}

View File

@@ -1,39 +0,0 @@
package com.github.gotify.client.api;
import com.github.gotify.client.ApiClient;
import com.github.gotify.client.model.VersionInfo;
import org.junit.Before;
import org.junit.Test;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* API tests for VersionApi
*/
public class VersionApiTest {
private VersionApi api;
@Before
public void setup() {
api = new ApiClient().createService(VersionApi.class);
}
/**
* Get version information.
*
*
*/
@Test
public void getVersionTest() {
// VersionInfo response = api.getVersion();
// TODO: test validations
}
}

View File

@@ -1,7 +0,0 @@
{
"apiPackage": "com.github.gotify.client.api",
"modelPackage": "com.github.gotify.client.model",
"library": "retrofit2",
"java11": true,
"hideGenerationTimestamp": true
}