diff --git a/README.md b/README.md index c2b8b301..fb4be412 100644 --- a/README.md +++ b/README.md @@ -63,9 +63,10 @@ $ ./gradlew build ## Update client * Run `./gradlew generateSwaggerCode` -* Discard changes to `client/build.gradle` (newer versions of dependencies) -* Fix compile error in `client/src/main/java/com/github/gotify/client/auth/OAuthOkHttpClient.java` (caused by an updated dependency) * 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` * Commit changes ## Versioning diff --git a/app/build.gradle b/app/build.gradle index 57f4dc0e..b7a286e3 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -89,11 +89,14 @@ dependencies { implementation "org.tinylog:tinylog-api-kotlin:$tinylog_version" implementation "org.tinylog:tinylog-impl:$tinylog_version" + + implementation 'com.google.code.gson:gson:2.11.0' + implementation 'com.squareup.retrofit2:retrofit:2.11.0' + implementation 'org.threeten:threetenbp:1.7.0' } configurations { configureEach { - exclude group: 'org.json', module: 'json' exclude group: 'androidx.lifecycle', module: 'lifecycle-viewmodel-ktx' } } diff --git a/app/src/main/kotlin/com/github/gotify/login/LoginActivity.kt b/app/src/main/kotlin/com/github/gotify/login/LoginActivity.kt index b9eaa3c3..e874c49c 100644 --- a/app/src/main/kotlin/com/github/gotify/login/LoginActivity.kt +++ b/app/src/main/kotlin/com/github/gotify/login/LoginActivity.kt @@ -25,6 +25,7 @@ import com.github.gotify.client.ApiClient import com.github.gotify.client.api.ClientApi import com.github.gotify.client.api.UserApi import com.github.gotify.client.model.Client +import com.github.gotify.client.model.ClientParams import com.github.gotify.client.model.VersionInfo import com.github.gotify.databinding.ActivityLoginBinding import com.github.gotify.databinding.ClientNameDialogBinding @@ -291,7 +292,7 @@ internal class LoginActivity : AppCompatActivity() { nameProvider: TextInputEditText ): DialogInterface.OnClickListener { return DialogInterface.OnClickListener { _, _ -> - val newClient = Client().name(nameProvider.text.toString()) + val newClient = ClientParams().name(nameProvider.text.toString()) client.createService(ClientApi::class.java) .createClient(newClient) .enqueue( diff --git a/build.gradle b/build.gradle index 99cf0f69..1b5c47b0 100644 --- a/build.gradle +++ b/build.gradle @@ -1,12 +1,7 @@ plugins { id 'com.android.application' version '8.5.0' apply false id 'org.jetbrains.kotlin.android' version '2.0.0' apply false - id 'org.hidetake.swagger.generator' version '2.14.0' -} - -ext { - gotifyVersion = 'master' - specLocation = "$layout.buildDirectory/gotify.spec.json" + id 'org.hidetake.swagger.generator' version '2.19.2' } tasks.register('clean', Delete) { @@ -14,8 +9,8 @@ tasks.register('clean', Delete) { } static def download(String url, String filename ) { - new URL( url ).openConnection().with { conn -> - new File( filename ).withOutputStream { out -> + new URI(url).toURL().openConnection().with { conn -> + new File(filename).withOutputStream { out -> conn.inputStream.with { inp -> out << inp inp.close() @@ -25,16 +20,19 @@ static def download(String url, String filename ) { } tasks.register('downloadSpec') { - inputs.property 'version', gotifyVersion + def gotifyVersion = 'master' + def url = "https://raw.githubusercontent.com/gotify/server/$gotifyVersion/docs/spec.json" + def buildDir = project.layout.buildDirectory.get() + def specLocation = buildDir.file('gotify.spec.json').asFile.absolutePath doFirst { - layout.buildDirectory.mkdirs() - download("https://raw.githubusercontent.com/gotify/server/${gotifyVersion}/docs/spec.json", specLocation) + buildDir.asFile.mkdirs() + download(url, specLocation) } } swaggerSources { gotify { - inputFile = specLocation as File + inputFile = "$projectDir/build/gotify.spec.json" as File code { configFile = "$projectDir/swagger.config.json" as File language = 'java' @@ -44,7 +42,7 @@ swaggerSources { } dependencies { - swaggerCodegen 'io.swagger:swagger-codegen-cli:2.3.1' + swaggerCodegen 'io.swagger.codegen.v3:swagger-codegen-cli:3.0.63' } generateSwaggerCode.dependsOn downloadSpec \ No newline at end of file diff --git a/client/.swagger-codegen/VERSION b/client/.swagger-codegen/VERSION index a6254504..eefcac2b 100644 --- a/client/.swagger-codegen/VERSION +++ b/client/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.1 \ No newline at end of file +3.0.63 \ No newline at end of file diff --git a/client/README.md b/client/README.md index 4a53c014..f280fa71 100644 --- a/client/README.md +++ b/client/README.md @@ -36,4 +36,3 @@ After the client library is installed/deployed, you can use it in your Maven pro - diff --git a/client/build.gradle b/client/build.gradle index 939a9258..78265313 100644 --- a/client/build.gradle +++ b/client/build.gradle @@ -1,32 +1,59 @@ -apply plugin: 'idea' -apply plugin: 'eclipse' - -group = 'io.swagger' -version = '1.0.0' - -apply plugin: 'java-library' - -sourceCompatibility = JavaVersion.VERSION_1_7 -targetCompatibility = JavaVersion.VERSION_1_7 +plugins { + id 'java' + id 'maven-publish' +} ext { oltu_version = "1.0.2" - retrofit_version = "2.5.0" - swagger_annotations_version = "1.5.15" - junit_version = "4.13" - threetenbp_version = "1.4.4" - json_fire_version = "1.8.4" + 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" } dependencies { - api "com.squareup.retrofit2:retrofit:$retrofit_version" - api "com.squareup.retrofit2:converter-scalars:$retrofit_version" - api "com.squareup.retrofit2:converter-gson:$retrofit_version" - api "io.swagger:swagger-annotations:$swagger_annotations_version" - implementation ("org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version") { + implementation "com.squareup.retrofit2:retrofit:$retrofit_version" + 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 ("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' } - api "io.gsonfire:gson-fire:$json_fire_version" - api "org.threeten:threetenbp:$threetenbp_version" + implementation "org.json:json:20180130" + implementation "io.gsonfire:gson-fire:$json_fire_version" + implementation "org.threeten:threetenbp:$threetenbp_version" + testImplementation "junit:junit:$junit_version" } + +group = 'io.swagger' +version = '1.0.0' +description = 'Swagger Java' + +java.sourceCompatibility = 11 +java.targetCompatibility = 11 + +tasks.register('testsJar', Jar) { + archiveClassifier = 'tests' + from(sourceSets.test.output) +} + +java { + withSourcesJar() + withJavadocJar() +} + +publishing { + publications { + maven(MavenPublication) { + from(components.java) + artifact(testsJar) + } + } +} + +tasks.withType(JavaCompile) { + options.encoding = 'UTF-8' +} diff --git a/client/build.sbt b/client/build.sbt index d0d4e265..29ea0f49 100644 --- a/client/build.sbt +++ b/client/build.sbt @@ -12,8 +12,8 @@ lazy val root = (project in file(".")). "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" % "swagger-annotations" % "1.5.15" % "compile", - "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "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", diff --git a/client/docs/Application.md b/client/docs/Application.md index 00abef6a..9a05079d 100644 --- a/client/docs/Application.md +++ b/client/docs/Application.md @@ -1,15 +1,13 @@ - # 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 `appToken`. See Authentication. | - - - diff --git a/client/docs/ApplicationApi.md b/client/docs/ApplicationApi.md index 4ac61b0f..ab81e2f8 100644 --- a/client/docs/ApplicationApi.md +++ b/client/docs/ApplicationApi.md @@ -1,16 +1,16 @@ # ApplicationApi -All URIs are relative to *http://localhost* +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. - # **createApp** > Application createApp(body) @@ -27,12 +27,17 @@ Create an application. //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"); @@ -46,7 +51,7 @@ clientTokenQuery.setApiKey("YOUR API KEY"); //clientTokenQuery.setApiKeyPrefix("Token"); ApplicationApi apiInstance = new ApplicationApi(); -Application body = new Application(); // Application | the application to add +ApplicationParams body = new ApplicationParams(); // ApplicationParams | the application to add try { Application result = apiInstance.createApp(body); System.out.println(result); @@ -60,7 +65,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Application**](Application.md)| the application to add | + **body** | [**ApplicationParams**](ApplicationParams.md)| the application to add | ### Return type @@ -68,7 +73,7 @@ Name | Type | Description | Notes ### Authorization -[basicAuth](../README.md#basicAuth), [clientTokenHeader](../README.md#clientTokenHeader), [clientTokenQuery](../README.md#clientTokenQuery) +[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery) ### HTTP request headers @@ -91,12 +96,17 @@ Delete an application. //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"); @@ -132,11 +142,11 @@ Name | Type | Description | Notes ### Authorization -[basicAuth](../README.md#basicAuth), [clientTokenHeader](../README.md#clientTokenHeader), [clientTokenQuery](../README.md#clientTokenQuery) +[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json @@ -155,12 +165,17 @@ Return all applications. //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"); @@ -192,11 +207,80 @@ This endpoint does not need any parameter. ### Authorization -[basicAuth](../README.md#basicAuth), [clientTokenHeader](../README.md#clientTokenHeader), [clientTokenQuery](../README.md#clientTokenQuery) +[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **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 @@ -215,12 +299,17 @@ Update an application. //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"); @@ -234,7 +323,7 @@ clientTokenQuery.setApiKey("YOUR API KEY"); //clientTokenQuery.setApiKeyPrefix("Token"); ApplicationApi apiInstance = new ApplicationApi(); -Application body = new Application(); // Application | the application to update +ApplicationParams body = new ApplicationParams(); // ApplicationParams | the application to update Long id = 789L; // Long | the application id try { Application result = apiInstance.updateApplication(body, id); @@ -249,7 +338,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Application**](Application.md)| the application to update | + **body** | [**ApplicationParams**](ApplicationParams.md)| the application to update | **id** | **Long**| the application id | ### Return type @@ -258,7 +347,7 @@ Name | Type | Description | Notes ### Authorization -[basicAuth](../README.md#basicAuth), [clientTokenHeader](../README.md#clientTokenHeader), [clientTokenQuery](../README.md#clientTokenQuery) +[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery) ### HTTP request headers @@ -281,12 +370,17 @@ Upload an image for an application. //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"); @@ -300,7 +394,7 @@ clientTokenQuery.setApiKey("YOUR API KEY"); //clientTokenQuery.setApiKeyPrefix("Token"); ApplicationApi apiInstance = new ApplicationApi(); -File file = new File("/path/to/file.txt"); // File | the application image +File file = new File("file_example"); // File | Long id = 789L; // Long | the application id try { Application result = apiInstance.uploadAppImage(file, id); @@ -315,7 +409,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **file** | **File**| the application image | + **file** | **File**| | **id** | **Long**| the application id | ### Return type @@ -324,7 +418,7 @@ Name | Type | Description | Notes ### Authorization -[basicAuth](../README.md#basicAuth), [clientTokenHeader](../README.md#clientTokenHeader), [clientTokenQuery](../README.md#clientTokenQuery) +[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery) ### HTTP request headers diff --git a/client/docs/ApplicationParams.md b/client/docs/ApplicationParams.md new file mode 100644 index 00000000..683a9036 --- /dev/null +++ b/client/docs/ApplicationParams.md @@ -0,0 +1,8 @@ +# 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. | diff --git a/client/docs/Client.md b/client/docs/Client.md index 3de1e6c5..b6b4f9cd 100644 --- a/client/docs/Client.md +++ b/client/docs/Client.md @@ -1,12 +1,9 @@ - # 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 `clientToken`. See Authentication. | - - - diff --git a/client/docs/ClientApi.md b/client/docs/ClientApi.md index aee74ad9..e1628a1e 100644 --- a/client/docs/ClientApi.md +++ b/client/docs/ClientApi.md @@ -1,6 +1,6 @@ # ClientApi -All URIs are relative to *http://localhost* +All URIs are relative to *http://localhost/* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -9,7 +9,6 @@ Method | HTTP request | Description [**getClients**](ClientApi.md#getClients) | **GET** client | Return all clients. [**updateClient**](ClientApi.md#updateClient) | **PUT** client/{id} | Update a client. - # **createClient** > Client createClient(body) @@ -26,12 +25,17 @@ Create a client. //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"); @@ -45,7 +49,7 @@ clientTokenQuery.setApiKey("YOUR API KEY"); //clientTokenQuery.setApiKeyPrefix("Token"); ClientApi apiInstance = new ClientApi(); -Client body = new Client(); // Client | the client to add +ClientParams body = new ClientParams(); // ClientParams | the client to add try { Client result = apiInstance.createClient(body); System.out.println(result); @@ -59,7 +63,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| the client to add | + **body** | [**ClientParams**](ClientParams.md)| the client to add | ### Return type @@ -67,7 +71,7 @@ Name | Type | Description | Notes ### Authorization -[basicAuth](../README.md#basicAuth), [clientTokenHeader](../README.md#clientTokenHeader), [clientTokenQuery](../README.md#clientTokenQuery) +[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery) ### HTTP request headers @@ -90,12 +94,17 @@ Delete a client. //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"); @@ -131,11 +140,11 @@ Name | Type | Description | Notes ### Authorization -[basicAuth](../README.md#basicAuth), [clientTokenHeader](../README.md#clientTokenHeader), [clientTokenQuery](../README.md#clientTokenQuery) +[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json @@ -154,12 +163,17 @@ Return all clients. //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"); @@ -191,11 +205,11 @@ This endpoint does not need any parameter. ### Authorization -[basicAuth](../README.md#basicAuth), [clientTokenHeader](../README.md#clientTokenHeader), [clientTokenQuery](../README.md#clientTokenQuery) +[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json @@ -214,12 +228,17 @@ Update a client. //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"); @@ -233,7 +252,7 @@ clientTokenQuery.setApiKey("YOUR API KEY"); //clientTokenQuery.setApiKeyPrefix("Token"); ClientApi apiInstance = new ClientApi(); -Client body = new Client(); // Client | the client to update +ClientParams body = new ClientParams(); // ClientParams | the client to update Long id = 789L; // Long | the client id try { Client result = apiInstance.updateClient(body, id); @@ -248,7 +267,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| the client to update | + **body** | [**ClientParams**](ClientParams.md)| the client to update | **id** | **Long**| the client id | ### Return type @@ -257,7 +276,7 @@ Name | Type | Description | Notes ### Authorization -[basicAuth](../README.md#basicAuth), [clientTokenHeader](../README.md#clientTokenHeader), [clientTokenQuery](../README.md#clientTokenQuery) +[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery) ### HTTP request headers diff --git a/client/docs/ClientParams.md b/client/docs/ClientParams.md new file mode 100644 index 00000000..cb1370fe --- /dev/null +++ b/client/docs/ClientParams.md @@ -0,0 +1,6 @@ +# ClientParams + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | The client name | diff --git a/client/docs/UserWithPass.md b/client/docs/CreateUserExternal.md similarity index 63% rename from client/docs/UserWithPass.md rename to client/docs/CreateUserExternal.md index 2a249128..22fa5fee 100644 --- a/client/docs/UserWithPass.md +++ b/client/docs/CreateUserExternal.md @@ -1,13 +1,8 @@ - -# UserWithPass +# CreateUserExternal ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**admin** | **Boolean** | If the user is an administrator. | [optional] -**id** | **Long** | The user id. | +**admin** | **Boolean** | If the user is an administrator. | **name** | **String** | The user name. For login. | **pass** | **String** | The user password. For login. | - - - diff --git a/client/docs/Error.md b/client/docs/Error.md index c711a483..8dc3bb2d 100644 --- a/client/docs/Error.md +++ b/client/docs/Error.md @@ -1,4 +1,3 @@ - # Error ## Properties @@ -7,6 +6,3 @@ Name | Type | Description | Notes **error** | **String** | The general error message | **errorCode** | **Long** | The http error code. | **errorDescription** | **String** | The http error code. | - - - diff --git a/client/docs/Health.md b/client/docs/Health.md index e6181a29..a6b7c8af 100644 --- a/client/docs/Health.md +++ b/client/docs/Health.md @@ -1,4 +1,3 @@ - # Health ## Properties @@ -6,6 +5,3 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **database** | **String** | The health of the database connection. | **health** | **String** | The health of the overall application. | - - - diff --git a/client/docs/HealthApi.md b/client/docs/HealthApi.md index 0fbd9e56..4e28101d 100644 --- a/client/docs/HealthApi.md +++ b/client/docs/HealthApi.md @@ -1,12 +1,11 @@ # HealthApi -All URIs are relative to *http://localhost* +All URIs are relative to *http://localhost/* Method | HTTP request | Description ------------- | ------------- | ------------- [**getHealth**](HealthApi.md#getHealth) | **GET** health | Get health information. - # **getHealth** > Health getHealth() @@ -43,6 +42,6 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json diff --git a/client/docs/IdImageBody.md b/client/docs/IdImageBody.md new file mode 100644 index 00000000..813a4b4e --- /dev/null +++ b/client/docs/IdImageBody.md @@ -0,0 +1,6 @@ +# IdImageBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**file** | [**File**](File.md) | the application image | diff --git a/client/docs/Message.md b/client/docs/Message.md index 64caad4d..0822a334 100644 --- a/client/docs/Message.md +++ b/client/docs/Message.md @@ -1,4 +1,3 @@ - # Message ## Properties @@ -9,8 +8,5 @@ Name | Type | Description | Notes **extras** | **Map<String, Object>** | 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. | [optional] **id** | **Long** | The message id. | **message** | **String** | The message. Markdown (excluding html) is allowed. | -**priority** | **Long** | The priority of the message. | [optional] +**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] - - - diff --git a/client/docs/MessageApi.md b/client/docs/MessageApi.md index 5f19cb47..9b42a212 100644 --- a/client/docs/MessageApi.md +++ b/client/docs/MessageApi.md @@ -1,6 +1,6 @@ # MessageApi -All URIs are relative to *http://localhost* +All URIs are relative to *http://localhost/* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -12,7 +12,6 @@ Method | HTTP request | Description [**getMessages**](MessageApi.md#getMessages) | **GET** message | Return all messages. [**streamMessages**](MessageApi.md#streamMessages) | **GET** stream | Websocket, return newly created messages. - # **createMessage** > Message createMessage(body) @@ -32,6 +31,12 @@ __NOTE__: This API ONLY accepts an application token as authentication. 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"); @@ -67,7 +72,7 @@ Name | Type | Description | Notes ### Authorization -[appTokenHeader](../README.md#appTokenHeader), [appTokenQuery](../README.md#appTokenQuery) +[appTokenAuthorizationHeader](../README.md#appTokenAuthorizationHeader)[appTokenHeader](../README.md#appTokenHeader)[appTokenQuery](../README.md#appTokenQuery) ### HTTP request headers @@ -90,12 +95,17 @@ Delete all messages from a specific application. //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"); @@ -131,11 +141,11 @@ Name | Type | Description | Notes ### Authorization -[basicAuth](../README.md#basicAuth), [clientTokenHeader](../README.md#clientTokenHeader), [clientTokenQuery](../README.md#clientTokenQuery) +[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json @@ -154,12 +164,17 @@ Deletes a message with an id. //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"); @@ -195,11 +210,11 @@ Name | Type | Description | Notes ### Authorization -[basicAuth](../README.md#basicAuth), [clientTokenHeader](../README.md#clientTokenHeader), [clientTokenQuery](../README.md#clientTokenQuery) +[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json @@ -218,12 +233,17 @@ Delete all messages. //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"); @@ -255,11 +275,11 @@ This endpoint does not need any parameter. ### Authorization -[basicAuth](../README.md#basicAuth), [clientTokenHeader](../README.md#clientTokenHeader), [clientTokenQuery](../README.md#clientTokenQuery) +[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json @@ -278,12 +298,17 @@ Return all messages from a specific application. //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"); @@ -314,8 +339,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **Long**| the application id | - **limit** | **Integer**| the maximal amount of messages to return | [optional] [default to 100] - **since** | **Long**| return all messages with an ID less than this value | [optional] + **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 @@ -323,11 +348,11 @@ Name | Type | Description | Notes ### Authorization -[basicAuth](../README.md#basicAuth), [clientTokenHeader](../README.md#clientTokenHeader), [clientTokenQuery](../README.md#clientTokenQuery) +[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json @@ -346,12 +371,17 @@ Return all messages. //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"); @@ -380,8 +410,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **limit** | **Integer**| the maximal amount of messages to return | [optional] [default to 100] - **since** | **Long**| return all messages with an ID less than this value | [optional] + **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 @@ -389,11 +419,11 @@ Name | Type | Description | Notes ### Authorization -[basicAuth](../README.md#basicAuth), [clientTokenHeader](../README.md#clientTokenHeader), [clientTokenQuery](../README.md#clientTokenQuery) +[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json @@ -412,12 +442,17 @@ Websocket, return newly created messages. //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"); @@ -449,10 +484,10 @@ This endpoint does not need any parameter. ### Authorization -[basicAuth](../README.md#basicAuth), [clientTokenHeader](../README.md#clientTokenHeader), [clientTokenQuery](../README.md#clientTokenQuery) +[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json diff --git a/client/docs/PagedMessages.md b/client/docs/PagedMessages.md index f8457cee..f3ddffcb 100644 --- a/client/docs/PagedMessages.md +++ b/client/docs/PagedMessages.md @@ -1,4 +1,3 @@ - # PagedMessages ## Properties @@ -6,6 +5,3 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **messages** | [**List<Message>**](Message.md) | The messages. | **paging** | [**Paging**](Paging.md) | | - - - diff --git a/client/docs/Paging.md b/client/docs/Paging.md index ef1a360a..12fbfd31 100644 --- a/client/docs/Paging.md +++ b/client/docs/Paging.md @@ -1,4 +1,3 @@ - # Paging ## Properties @@ -8,6 +7,3 @@ Name | Type | Description | Notes **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. | - - - diff --git a/client/docs/PluginApi.md b/client/docs/PluginApi.md index f52d2351..7b7d870f 100644 --- a/client/docs/PluginApi.md +++ b/client/docs/PluginApi.md @@ -1,6 +1,6 @@ # PluginApi -All URIs are relative to *http://localhost* +All URIs are relative to *http://localhost/* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -11,7 +11,6 @@ Method | HTTP request | Description [**getPlugins**](PluginApi.md#getPlugins) | **GET** plugin | Return all plugins. [**updatePluginConfig**](PluginApi.md#updatePluginConfig) | **POST** plugin/{id}/config | Update YAML configuration for Configurer plugin. - # **disablePlugin** > Void disablePlugin(id) @@ -28,12 +27,17 @@ Disable a plugin. //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"); @@ -69,11 +73,11 @@ Name | Type | Description | Notes ### Authorization -[basicAuth](../README.md#basicAuth), [clientTokenHeader](../README.md#clientTokenHeader), [clientTokenQuery](../README.md#clientTokenQuery) +[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json @@ -92,12 +96,17 @@ Enable a plugin. //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"); @@ -133,11 +142,11 @@ Name | Type | Description | Notes ### Authorization -[basicAuth](../README.md#basicAuth), [clientTokenHeader](../README.md#clientTokenHeader), [clientTokenQuery](../README.md#clientTokenQuery) +[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json @@ -156,12 +165,17 @@ Get YAML configuration for Configurer plugin. //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"); @@ -197,11 +211,11 @@ Name | Type | Description | Notes ### Authorization -[basicAuth](../README.md#basicAuth), [clientTokenHeader](../README.md#clientTokenHeader), [clientTokenQuery](../README.md#clientTokenQuery) +[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/x-yaml @@ -220,12 +234,17 @@ Get display info for a Displayer plugin. //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"); @@ -261,11 +280,11 @@ Name | Type | Description | Notes ### Authorization -[basicAuth](../README.md#basicAuth), [clientTokenHeader](../README.md#clientTokenHeader), [clientTokenQuery](../README.md#clientTokenQuery) +[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json @@ -284,12 +303,17 @@ Return all plugins. //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"); @@ -321,11 +345,11 @@ This endpoint does not need any parameter. ### Authorization -[basicAuth](../README.md#basicAuth), [clientTokenHeader](../README.md#clientTokenHeader), [clientTokenQuery](../README.md#clientTokenQuery) +[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json @@ -344,12 +368,17 @@ Update YAML configuration for Configurer plugin. //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"); @@ -385,10 +414,10 @@ Name | Type | Description | Notes ### Authorization -[basicAuth](../README.md#basicAuth), [clientTokenHeader](../README.md#clientTokenHeader), [clientTokenQuery](../README.md#clientTokenQuery) +[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery) ### HTTP request headers - - **Content-Type**: application/x-yaml + - **Content-Type**: Not defined - **Accept**: application/json diff --git a/client/docs/PluginConf.md b/client/docs/PluginConf.md index daecd726..64a8c1e2 100644 --- a/client/docs/PluginConf.md +++ b/client/docs/PluginConf.md @@ -1,4 +1,3 @@ - # PluginConf ## Properties @@ -13,6 +12,3 @@ Name | Type | Description | Notes **name** | **String** | The plugin name. | **token** | **String** | The user name. For login. | **website** | **String** | The website of the plugin. | [optional] - - - diff --git a/client/docs/UpdateUserExternal.md b/client/docs/UpdateUserExternal.md new file mode 100644 index 00000000..a88d819f --- /dev/null +++ b/client/docs/UpdateUserExternal.md @@ -0,0 +1,8 @@ +# 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] diff --git a/client/docs/User.md b/client/docs/User.md index 34b372cc..3a299613 100644 --- a/client/docs/User.md +++ b/client/docs/User.md @@ -1,12 +1,8 @@ - # User ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**admin** | **Boolean** | If the user is an administrator. | [optional] +**admin** | **Boolean** | If the user is an administrator. | **id** | **Long** | The user id. | **name** | **String** | The user name. For login. | - - - diff --git a/client/docs/UserApi.md b/client/docs/UserApi.md index 2305bba1..9c7ec0a7 100644 --- a/client/docs/UserApi.md +++ b/client/docs/UserApi.md @@ -1,6 +1,6 @@ # UserApi -All URIs are relative to *http://localhost* +All URIs are relative to *http://localhost/* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -12,13 +12,14 @@ Method | HTTP request | Description [**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. - # **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: @@ -29,12 +30,17 @@ Create a user. //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"); @@ -48,7 +54,7 @@ clientTokenQuery.setApiKey("YOUR API KEY"); //clientTokenQuery.setApiKeyPrefix("Token"); UserApi apiInstance = new UserApi(); -UserWithPass body = new UserWithPass(); // UserWithPass | the user to add +CreateUserExternal body = new CreateUserExternal(); // CreateUserExternal | the user to add try { User result = apiInstance.createUser(body); System.out.println(result); @@ -62,7 +68,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**UserWithPass**](UserWithPass.md)| the user to add | + **body** | [**CreateUserExternal**](CreateUserExternal.md)| the user to add | ### Return type @@ -70,7 +76,7 @@ Name | Type | Description | Notes ### Authorization -[basicAuth](../README.md#basicAuth), [clientTokenHeader](../README.md#clientTokenHeader), [clientTokenQuery](../README.md#clientTokenQuery) +[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery) ### HTTP request headers @@ -93,12 +99,17 @@ Return the current user. //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"); @@ -130,11 +141,11 @@ This endpoint does not need any parameter. ### Authorization -[basicAuth](../README.md#basicAuth), [clientTokenHeader](../README.md#clientTokenHeader), [clientTokenQuery](../README.md#clientTokenQuery) +[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json @@ -153,12 +164,17 @@ Deletes a user. //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"); @@ -194,11 +210,11 @@ Name | Type | Description | Notes ### Authorization -[basicAuth](../README.md#basicAuth), [clientTokenHeader](../README.md#clientTokenHeader), [clientTokenQuery](../README.md#clientTokenQuery) +[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json @@ -217,12 +233,17 @@ Get a user. //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"); @@ -258,11 +279,11 @@ Name | Type | Description | Notes ### Authorization -[basicAuth](../README.md#basicAuth), [clientTokenHeader](../README.md#clientTokenHeader), [clientTokenQuery](../README.md#clientTokenQuery) +[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json @@ -281,12 +302,17 @@ Return all users. //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"); @@ -318,11 +344,11 @@ This endpoint does not need any parameter. ### Authorization -[basicAuth](../README.md#basicAuth), [clientTokenHeader](../README.md#clientTokenHeader), [clientTokenQuery](../README.md#clientTokenQuery) +[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json @@ -341,12 +367,17 @@ Update the password of the current user. //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"); @@ -382,7 +413,7 @@ Name | Type | Description | Notes ### Authorization -[basicAuth](../README.md#basicAuth), [clientTokenHeader](../README.md#clientTokenHeader), [clientTokenQuery](../README.md#clientTokenQuery) +[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery) ### HTTP request headers @@ -391,7 +422,7 @@ Name | Type | Description | Notes # **updateUser** -> User updateUser(id, body) +> User updateUser(body, id) Update a user. @@ -405,12 +436,17 @@ Update a user. //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"); @@ -424,10 +460,10 @@ clientTokenQuery.setApiKey("YOUR API KEY"); //clientTokenQuery.setApiKeyPrefix("Token"); UserApi apiInstance = new UserApi(); +UpdateUserExternal body = new UpdateUserExternal(); // UpdateUserExternal | the updated user Long id = 789L; // Long | the user id -UserWithPass body = new UserWithPass(); // UserWithPass | the updated user try { - User result = apiInstance.updateUser(id, body); + User result = apiInstance.updateUser(body, id); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); @@ -439,8 +475,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- + **body** | [**UpdateUserExternal**](UpdateUserExternal.md)| the updated user | **id** | **Long**| the user id | - **body** | [**UserWithPass**](UserWithPass.md)| the updated user | ### Return type @@ -448,7 +484,7 @@ Name | Type | Description | Notes ### Authorization -[basicAuth](../README.md#basicAuth), [clientTokenHeader](../README.md#clientTokenHeader), [clientTokenQuery](../README.md#clientTokenQuery) +[basicAuth](../README.md#basicAuth)[clientTokenAuthorizationHeader](../README.md#clientTokenAuthorizationHeader)[clientTokenHeader](../README.md#clientTokenHeader)[clientTokenQuery](../README.md#clientTokenQuery) ### HTTP request headers diff --git a/client/docs/UserPass.md b/client/docs/UserPass.md index 56eac5fe..1c396acc 100644 --- a/client/docs/UserPass.md +++ b/client/docs/UserPass.md @@ -1,10 +1,6 @@ - # UserPass ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **pass** | **String** | The user password. For login. | - - - diff --git a/client/docs/VersionApi.md b/client/docs/VersionApi.md index 0e175832..9fd3b8d7 100644 --- a/client/docs/VersionApi.md +++ b/client/docs/VersionApi.md @@ -1,12 +1,11 @@ # VersionApi -All URIs are relative to *http://localhost* +All URIs are relative to *http://localhost/* Method | HTTP request | Description ------------- | ------------- | ------------- [**getVersion**](VersionApi.md#getVersion) | **GET** version | Get version information. - # **getVersion** > VersionInfo getVersion() @@ -43,6 +42,6 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json diff --git a/client/docs/VersionInfo.md b/client/docs/VersionInfo.md index 0ac7561c..19e205ac 100644 --- a/client/docs/VersionInfo.md +++ b/client/docs/VersionInfo.md @@ -1,4 +1,3 @@ - # VersionInfo ## Properties @@ -7,6 +6,3 @@ 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. | - - - diff --git a/client/git_push.sh b/client/git_push.sh index ae01b182..ed374619 100644 --- a/client/git_push.sh +++ b/client/git_push.sh @@ -36,7 +36,7 @@ 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 credential in your environment." + 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 else git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git diff --git a/client/gradle/wrapper/gradle-wrapper.jar b/client/gradle/wrapper/gradle-wrapper.jar index 2c6137b8..d64cd491 100644 Binary files a/client/gradle/wrapper/gradle-wrapper.jar and b/client/gradle/wrapper/gradle-wrapper.jar differ diff --git a/client/gradle/wrapper/gradle-wrapper.properties b/client/gradle/wrapper/gradle-wrapper.properties index b7a36473..1af9e093 100644 --- a/client/gradle/wrapper/gradle-wrapper.properties +++ b/client/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ -#Tue May 17 23:08:05 CST 2016 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 -distributionUrl=https\://services.gradle.org/distributions/gradle-2.6-bin.zip diff --git a/client/pom.xml b/client/pom.xml index 448b58d0..ca79f7bc 100644 --- a/client/pom.xml +++ b/client/pom.xml @@ -1,249 +1,244 @@ - 4.0.0 - io.swagger - swagger-java-client - jar - swagger-java-client - 1.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 + io.swagger + swagger-java-client + jar + swagger-java-client + 1.0.0 + https://github.com/swagger-api/swagger-codegen + Swagger Java + + scm:git:git@github.com:swagger-api/swagger-codegen.git + scm:git:git@github.com:swagger-api/swagger-codegen.git https://github.com/swagger-api/swagger-codegen - Swagger Java - - scm:git:git@github.com:swagger-api/swagger-codegen.git - scm:git:git@github.com:swagger-api/swagger-codegen.git - https://github.com/swagger-api/swagger-codegen - + + + 2.2.0 + - - - Unlicense - https://github.com/gotify/server/blob/master/LICENSE - repo - - + + + Unlicense + https://github.com/gotify/server/blob/master/LICENSE + repo + + - - - Swagger - apiteam@swagger.io - Swagger - http://swagger.io - - + + + Swagger + apiteam@swagger.io + Swagger + http://swagger.io + + - - - - org.apache.maven.plugins - maven-enforcer-plugin - 3.0.0-M1 - - - enforce-maven - - enforce - - - - - 2.2.0 - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.12 - - - - loggerPath - conf/log4j.properties - - - -Xms512m -Xmx1500m - methods - pertest - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory}/lib - - - - - - - - org.apache.maven.plugins - maven-jar-plugin - 2.2 - - - - jar - test-jar - - - - - - + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + pertest + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + - - org.codehaus.mojo - build-helper-maven-plugin - 1.10 - - - add_sources - generate-sources - - add-source - - - - - src/main/java - - - - - add_test_sources - generate-test-sources - - add-test-source - - - - - src/test/java - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.10.4 - - - attach-javadocs - - jar - - - - - - org.apache.maven.plugins - maven-source-plugin - 2.2.1 - - - attach-sources - - jar-no-fork - - - - - - + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + jar + test-jar + + + + + + - - - sign-artifacts - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.5 - - - sign-artifacts - verify - - sign - - - - - - - - + + org.codehaus.mojo + build-helper-maven-plugin + 1.10 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 2.2.1 + + + attach-sources + + jar-no-fork + + + + + + - - - io.swagger - swagger-annotations - ${swagger-core-version} - - - com.squareup.retrofit2 - converter-gson - ${retrofit-version} - - - com.squareup.retrofit2 - retrofit - ${retrofit-version} - - - com.squareup.retrofit2 - converter-scalars - ${retrofit-version} - - - org.apache.oltu.oauth2 - org.apache.oltu.oauth2.client - ${oltu-version} - - - io.gsonfire - gson-fire - ${gson-fire-version} - + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + + + + jdk11 + + [11,) + + - org.threeten - threetenbp - ${threetenbp-version} + com.sun.xml.ws + jaxws-rt + 2.3.3 + pom + + + + + + io.swagger.core.v3 + swagger-annotations + ${swagger-core-version} + + + com.squareup.retrofit2 + converter-gson + ${retrofit-version} + + + com.squareup.retrofit2 + retrofit + ${retrofit-version} + + + com.squareup.retrofit2 + converter-scalars + ${retrofit-version} + + + org.apache.oltu.oauth2 + org.apache.oltu.oauth2.client + ${oltu-version} + + + io.gsonfire + gson-fire + ${gson-fire-version} + + + org.threeten + threetenbp + ${threetenbp-version} + + - - - junit - junit - ${junit-version} - test - - - - UTF-8 - 1.7 - ${java.version} - ${java.version} - 1.8.0 - 1.5.15 - 2.3.0 - 1.3.5 - 1.0.1 - 4.12 - + + + junit + junit + ${junit-version} + test + + + + UTF-8 + 11 + ${java.version} + ${java.version} + 1.8.0 + 2.0.0 + 2.3.0 + 1.3.5 + 1.0.2 + 4.13.1 + diff --git a/client/src/main/java/com/github/gotify/client/ApiClient.java b/client/src/main/java/com/github/gotify/client/ApiClient.java index f8466e0a..8f7e13cf 100644 --- a/client/src/main/java/com/github/gotify/client/ApiClient.java +++ b/client/src/main/java/com/github/gotify/client/ApiClient.java @@ -43,13 +43,17 @@ public ApiClient() { public ApiClient(String[] authNames) { this(); for(String authName : authNames) { - Interceptor auth; - if ("appTokenHeader".equals(authName)) { + Interceptor auth = null; + if ("appTokenAuthorizationHeader".equals(authName)) { + auth = new ApiKeyAuth("header", "Authorization"); + } else if ("appTokenHeader".equals(authName)) { auth = new ApiKeyAuth("header", "X-Gotify-Key"); } else if ("appTokenQuery".equals(authName)) { auth = new ApiKeyAuth("query", "token"); } else if ("basicAuth".equals(authName)) { auth = new HttpBasicAuth(); + } else if ("clientTokenAuthorizationHeader".equals(authName)) { + auth = new ApiKeyAuth("header", "Authorization"); } else if ("clientTokenHeader".equals(authName)) { auth = new ApiKeyAuth("header", "X-Gotify-Key"); } else if ("clientTokenQuery".equals(authName)) { @@ -112,7 +116,7 @@ public void createDefaultAdapter() { json = new JSON(); okBuilder = new OkHttpClient.Builder(); - String baseUrl = "http://localhost"; + String baseUrl = "http://localhost/"; if (!baseUrl.endsWith("/")) baseUrl = baseUrl + "/"; diff --git a/client/src/main/java/com/github/gotify/client/JSON.java b/client/src/main/java/com/github/gotify/client/JSON.java index fdd1edbf..40dc7d07 100644 --- a/client/src/main/java/com/github/gotify/client/JSON.java +++ b/client/src/main/java/com/github/gotify/client/JSON.java @@ -1,8 +1,8 @@ /* * 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 either transmitted through a header named `X-Gotify-Key` or a query parameter named `token`. 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) + * 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.1 + * OpenAPI spec version: 2.0.2 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -10,7 +10,6 @@ * Do not edit the class manually. */ - package com.github.gotify.client; import com.google.gson.Gson; diff --git a/client/src/main/java/com/github/gotify/client/StringUtil.java b/client/src/main/java/com/github/gotify/client/StringUtil.java index fcb0212b..4e134639 100644 --- a/client/src/main/java/com/github/gotify/client/StringUtil.java +++ b/client/src/main/java/com/github/gotify/client/StringUtil.java @@ -1,8 +1,8 @@ /* * 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 either transmitted through a header named `X-Gotify-Key` or a query parameter named `token`. 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) + * 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.1 + * OpenAPI spec version: 2.0.2 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -10,9 +10,9 @@ * Do not edit the class manually. */ - package com.github.gotify.client; + public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). diff --git a/client/src/main/java/com/github/gotify/client/api/ApplicationApi.java b/client/src/main/java/com/github/gotify/client/api/ApplicationApi.java index 2a7de1c6..1e983e04 100644 --- a/client/src/main/java/com/github/gotify/client/api/ApplicationApi.java +++ b/client/src/main/java/com/github/gotify/client/api/ApplicationApi.java @@ -9,6 +9,7 @@ import okhttp3.ResponseBody; 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; @@ -29,7 +30,7 @@ public interface ApplicationApi { }) @POST("application") Call createApp( - @retrofit2.http.Body Application body + @retrofit2.http.Body ApplicationParams body ); /** @@ -38,9 +39,6 @@ Call createApp( * @param id the application id (required) * @return Call<Void> */ - @Headers({ - "Content-Type:application/json" - }) @DELETE("application/{id}") Call deleteApp( @retrofit2.http.Path("id") Long id @@ -51,13 +49,21 @@ Call deleteApp( * * @return Call<List<Application>> */ - @Headers({ - "Content-Type:application/json" - }) @GET("application") Call> getApps(); + /** + * Deletes an image of an application. + * + * @param id the application id (required) + * @return Call<Void> + */ + @DELETE("application/{id}/image") + Call removeAppImage( + @retrofit2.http.Path("id") Long id + ); + /** * Update an application. * @@ -70,13 +76,13 @@ Call deleteApp( }) @PUT("application/{id}") Call updateApplication( - @retrofit2.http.Body Application body, @retrofit2.http.Path("id") Long id + @retrofit2.http.Body ApplicationParams body, @retrofit2.http.Path("id") Long id ); /** * Upload an image for an application. * - * @param file the application image (required) + * @param file (required) * @param id the application id (required) * @return Call<Application> */ diff --git a/client/src/main/java/com/github/gotify/client/api/ClientApi.java b/client/src/main/java/com/github/gotify/client/api/ClientApi.java index 3da8dda5..66b12cb4 100644 --- a/client/src/main/java/com/github/gotify/client/api/ClientApi.java +++ b/client/src/main/java/com/github/gotify/client/api/ClientApi.java @@ -9,6 +9,7 @@ import okhttp3.ResponseBody; import com.github.gotify.client.model.Client; +import com.github.gotify.client.model.ClientParams; import com.github.gotify.client.model.Error; import java.util.ArrayList; @@ -28,7 +29,7 @@ public interface ClientApi { }) @POST("client") Call createClient( - @retrofit2.http.Body Client body + @retrofit2.http.Body ClientParams body ); /** @@ -37,9 +38,6 @@ Call createClient( * @param id the client id (required) * @return Call<Void> */ - @Headers({ - "Content-Type:application/json" - }) @DELETE("client/{id}") Call deleteClient( @retrofit2.http.Path("id") Long id @@ -50,9 +48,6 @@ Call deleteClient( * * @return Call<List<Client>> */ - @Headers({ - "Content-Type:application/json" - }) @GET("client") Call> getClients(); @@ -69,7 +64,7 @@ Call deleteClient( }) @PUT("client/{id}") Call updateClient( - @retrofit2.http.Body Client body, @retrofit2.http.Path("id") Long id + @retrofit2.http.Body ClientParams body, @retrofit2.http.Path("id") Long id ); } diff --git a/client/src/main/java/com/github/gotify/client/api/HealthApi.java b/client/src/main/java/com/github/gotify/client/api/HealthApi.java index 38a37a98..8757825f 100644 --- a/client/src/main/java/com/github/gotify/client/api/HealthApi.java +++ b/client/src/main/java/com/github/gotify/client/api/HealthApi.java @@ -21,9 +21,6 @@ public interface HealthApi { * * @return Call<Health> */ - @Headers({ - "Content-Type:application/json" - }) @GET("health") Call getHealth(); diff --git a/client/src/main/java/com/github/gotify/client/api/MessageApi.java b/client/src/main/java/com/github/gotify/client/api/MessageApi.java index 8e54861e..ba567347 100644 --- a/client/src/main/java/com/github/gotify/client/api/MessageApi.java +++ b/client/src/main/java/com/github/gotify/client/api/MessageApi.java @@ -38,9 +38,6 @@ Call createMessage( * @param id the application id (required) * @return Call<Void> */ - @Headers({ - "Content-Type:application/json" - }) @DELETE("application/{id}/message") Call deleteAppMessages( @retrofit2.http.Path("id") Long id @@ -52,9 +49,6 @@ Call deleteAppMessages( * @param id the message id (required) * @return Call<Void> */ - @Headers({ - "Content-Type:application/json" - }) @DELETE("message/{id}") Call deleteMessage( @retrofit2.http.Path("id") Long id @@ -65,9 +59,6 @@ Call deleteMessage( * * @return Call<Void> */ - @Headers({ - "Content-Type:application/json" - }) @DELETE("message") Call deleteMessages(); @@ -80,9 +71,6 @@ Call deleteMessage( * @param since return all messages with an ID less than this value (optional) * @return Call<PagedMessages> */ - @Headers({ - "Content-Type:application/json" - }) @GET("application/{id}/message") Call getAppMessages( @retrofit2.http.Path("id") Long id, @retrofit2.http.Query("limit") Integer limit, @retrofit2.http.Query("since") Long since @@ -95,9 +83,6 @@ Call getAppMessages( * @param since return all messages with an ID less than this value (optional) * @return Call<PagedMessages> */ - @Headers({ - "Content-Type:application/json" - }) @GET("message") Call getMessages( @retrofit2.http.Query("limit") Integer limit, @retrofit2.http.Query("since") Long since @@ -108,9 +93,6 @@ Call getMessages( * * @return Call<Message> */ - @Headers({ - "Content-Type:application/json" - }) @GET("stream") Call streamMessages(); diff --git a/client/src/main/java/com/github/gotify/client/api/PluginApi.java b/client/src/main/java/com/github/gotify/client/api/PluginApi.java index ed549089..94717de5 100644 --- a/client/src/main/java/com/github/gotify/client/api/PluginApi.java +++ b/client/src/main/java/com/github/gotify/client/api/PluginApi.java @@ -23,9 +23,6 @@ public interface PluginApi { * @param id the plugin id (required) * @return Call<Void> */ - @Headers({ - "Content-Type:application/json" - }) @POST("plugin/{id}/disable") Call disablePlugin( @retrofit2.http.Path("id") Long id @@ -37,9 +34,6 @@ Call disablePlugin( * @param id the plugin id (required) * @return Call<Void> */ - @Headers({ - "Content-Type:application/json" - }) @POST("plugin/{id}/enable") Call enablePlugin( @retrofit2.http.Path("id") Long id @@ -51,9 +45,6 @@ Call enablePlugin( * @param id the plugin id (required) * @return Call<Object> */ - @Headers({ - "Content-Type:application/json" - }) @GET("plugin/{id}/config") Call getPluginConfig( @retrofit2.http.Path("id") Long id @@ -65,9 +56,6 @@ Call getPluginConfig( * @param id the plugin id (required) * @return Call<String> */ - @Headers({ - "Content-Type:application/json" - }) @GET("plugin/{id}/display") Call getPluginDisplay( @retrofit2.http.Path("id") Long id @@ -78,9 +66,6 @@ Call getPluginDisplay( * * @return Call<List<PluginConf>> */ - @Headers({ - "Content-Type:application/json" - }) @GET("plugin") Call> getPlugins(); @@ -91,9 +76,6 @@ Call getPluginDisplay( * @param id the plugin id (required) * @return Call<Void> */ - @Headers({ - "Content-Type:application/x-yaml" - }) @POST("plugin/{id}/config") Call updatePluginConfig( @retrofit2.http.Path("id") Long id diff --git a/client/src/main/java/com/github/gotify/client/api/UserApi.java b/client/src/main/java/com/github/gotify/client/api/UserApi.java index 33aae214..5f38b284 100644 --- a/client/src/main/java/com/github/gotify/client/api/UserApi.java +++ b/client/src/main/java/com/github/gotify/client/api/UserApi.java @@ -8,10 +8,11 @@ import okhttp3.RequestBody; import okhttp3.ResponseBody; +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 com.github.gotify.client.model.UserWithPass; import java.util.ArrayList; import java.util.HashMap; @@ -21,7 +22,7 @@ public interface UserApi { /** * 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. * @param body the user to add (required) * @return Call<User> */ @@ -30,7 +31,7 @@ public interface UserApi { }) @POST("user") Call createUser( - @retrofit2.http.Body UserWithPass body + @retrofit2.http.Body CreateUserExternal body ); /** @@ -38,9 +39,6 @@ Call createUser( * * @return Call<User> */ - @Headers({ - "Content-Type:application/json" - }) @GET("current/user") Call currentUser(); @@ -51,9 +49,6 @@ Call createUser( * @param id the user id (required) * @return Call<Void> */ - @Headers({ - "Content-Type:application/json" - }) @DELETE("user/{id}") Call deleteUser( @retrofit2.http.Path("id") Long id @@ -65,9 +60,6 @@ Call deleteUser( * @param id the user id (required) * @return Call<User> */ - @Headers({ - "Content-Type:application/json" - }) @GET("user/{id}") Call getUser( @retrofit2.http.Path("id") Long id @@ -78,9 +70,6 @@ Call getUser( * * @return Call<List<User>> */ - @Headers({ - "Content-Type:application/json" - }) @GET("user") Call> getUsers(); @@ -102,8 +91,8 @@ Call updateCurrentUser( /** * Update a user. * - * @param id the user id (required) * @param body the updated user (required) + * @param id the user id (required) * @return Call<User> */ @Headers({ @@ -111,7 +100,7 @@ Call updateCurrentUser( }) @POST("user/{id}") Call updateUser( - @retrofit2.http.Path("id") Long id, @retrofit2.http.Body UserWithPass body + @retrofit2.http.Body UpdateUserExternal body, @retrofit2.http.Path("id") Long id ); } diff --git a/client/src/main/java/com/github/gotify/client/api/VersionApi.java b/client/src/main/java/com/github/gotify/client/api/VersionApi.java index 3c9d63e8..7fd66aa4 100644 --- a/client/src/main/java/com/github/gotify/client/api/VersionApi.java +++ b/client/src/main/java/com/github/gotify/client/api/VersionApi.java @@ -21,9 +21,6 @@ public interface VersionApi { * * @return Call<VersionInfo> */ - @Headers({ - "Content-Type:application/json" - }) @GET("version") Call getVersion(); diff --git a/client/src/main/java/com/github/gotify/client/auth/OAuth.java b/client/src/main/java/com/github/gotify/client/auth/OAuth.java index 1b95924a..ac1bccda 100644 --- a/client/src/main/java/com/github/gotify/client/auth/OAuth.java +++ b/client/src/main/java/com/github/gotify/client/auth/OAuth.java @@ -113,8 +113,16 @@ private Response retryingIntercept(Chain chain, boolean updateTokenAndRetryOnAut // 401/403 most likely indicates that access token has expired. Unless it happens two times in a row. if ( response != null && (response.code() == HTTP_UNAUTHORIZED || response.code() == HTTP_FORBIDDEN) && updateTokenAndRetryOnAuthorizationFailure ) { - if (updateAccessToken(requestAccessToken)) { - return retryingIntercept( chain, false ); + if (response != null && (response.code() == HTTP_UNAUTHORIZED || response.code() == HTTP_FORBIDDEN) && updateTokenAndRetryOnAuthorizationFailure) { + try { + if (updateAccessToken(requestAccessToken)) { + response.body().close(); + return retryingIntercept(chain, false); + } + } catch (Exception e) { + response.body().close(); + throw e; + } } } return response; diff --git a/client/src/main/java/com/github/gotify/client/auth/OAuthFlow.java b/client/src/main/java/com/github/gotify/client/auth/OAuthFlow.java index 922a9971..cd8b54e4 100644 --- a/client/src/main/java/com/github/gotify/client/auth/OAuthFlow.java +++ b/client/src/main/java/com/github/gotify/client/auth/OAuthFlow.java @@ -1,8 +1,8 @@ /* * 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 either transmitted through a header named `X-Gotify-Key` or a query parameter named `token`. 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) + * 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.1 + * OpenAPI spec version: 2.0.2 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -10,7 +10,6 @@ * Do not edit the class manually. */ - package com.github.gotify.client.auth; public enum OAuthFlow { diff --git a/client/src/main/java/com/github/gotify/client/model/Application.java b/client/src/main/java/com/github/gotify/client/model/Application.java index 37cabe88..13729eb4 100644 --- a/client/src/main/java/com/github/gotify/client/model/Application.java +++ b/client/src/main/java/com/github/gotify/client/model/Application.java @@ -1,8 +1,8 @@ /* * 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 either transmitted through a header named `X-Gotify-Key` or a query parameter named `token`. 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) + * 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.1 + * OpenAPI spec version: 2.0.2 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -10,24 +10,28 @@ * 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.io.IOException; - +import org.threeten.bp.OffsetDateTime; /** * The Application holds information about an app which can send notifications. */ -@ApiModel(description = "The Application holds information about an app which can send notifications.") +@Schema(description = "The Application holds information about an app which can send notifications.") + + public class Application { + @SerializedName("defaultPriority") + private Long defaultPriority = null; + @SerializedName("description") private String description = null; @@ -40,12 +44,33 @@ public class Application { @SerializedName("internal") private Boolean internal = null; + @SerializedName("lastUsed") + private OffsetDateTime lastUsed = null; + @SerializedName("name") private String name = null; @SerializedName("token") private String token = null; + public Application defaultPriority(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.") + public Long getDefaultPriority() { + return defaultPriority; + } + + public void setDefaultPriority(Long defaultPriority) { + this.defaultPriority = defaultPriority; + } + public Application description(String description) { this.description = description; return this; @@ -55,7 +80,7 @@ public Application description(String description) { * The description of the application. * @return description **/ - @ApiModelProperty(example = "Backup server for the interwebs", required = true, value = "The description of the application.") + @Schema(example = "Backup server for the interwebs", required = true, description = "The description of the application.") public String getDescription() { return description; } @@ -68,7 +93,7 @@ public void setDescription(String description) { * The application id. * @return id **/ - @ApiModelProperty(example = "5", required = true, value = "The application id.") + @Schema(example = "5", required = true, description = "The application id.") public Long getId() { return id; } @@ -77,7 +102,7 @@ public Long getId() { * The image of the application. * @return image **/ - @ApiModelProperty(example = "image/image.jpeg", required = true, value = "The image of the application.") + @Schema(example = "image/image.jpeg", required = true, description = "The image of the application.") public String getImage() { return image; } @@ -86,11 +111,20 @@ public String getImage() { * Whether the application is an internal application. Internal applications should not be deleted. * @return internal **/ - @ApiModelProperty(example = "false", required = true, value = "Whether the application is an internal application. Internal applications should not be deleted.") + @Schema(example = "false", required = true, description = "Whether the application is an internal application. Internal applications should not be deleted.") public Boolean isInternal() { 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.") + public OffsetDateTime getLastUsed() { + return lastUsed; + } + public Application name(String name) { this.name = name; return this; @@ -100,7 +134,7 @@ public Application name(String name) { * The application name. This is how the application should be displayed to the user. * @return name **/ - @ApiModelProperty(example = "Backup Server", required = true, value = "The application name. This is how the application should be displayed to the user.") + @Schema(example = "Backup Server", required = true, description = "The application name. This is how the application should be displayed to the user.") public String getName() { return name; } @@ -113,7 +147,7 @@ public void setName(String name) { * The application token. Can be used as `appToken`. See Authentication. * @return token **/ - @ApiModelProperty(example = "AWH0wZ5r0Mbac.r", required = true, value = "The application token. Can be used as `appToken`. See Authentication.") + @Schema(example = "AWH0wZ5r0Mbac.r", required = true, description = "The application token. Can be used as `appToken`. See Authentication.") public String getToken() { return token; } @@ -128,17 +162,19 @@ public boolean equals(java.lang.Object o) { return false; } Application application = (Application) o; - return Objects.equals(this.description, application.description) && + return Objects.equals(this.defaultPriority, application.defaultPriority) && + Objects.equals(this.description, application.description) && Objects.equals(this.id, application.id) && Objects.equals(this.image, application.image) && Objects.equals(this.internal, application.internal) && + Objects.equals(this.lastUsed, application.lastUsed) && Objects.equals(this.name, application.name) && Objects.equals(this.token, application.token); } @Override public int hashCode() { - return Objects.hash(description, id, image, internal, name, token); + return Objects.hash(defaultPriority, description, id, image, internal, lastUsed, name, token); } @@ -147,10 +183,12 @@ 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"); sb.append(" image: ").append(toIndentedString(image)).append("\n"); 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(" token: ").append(toIndentedString(token)).append("\n"); sb.append("}"); @@ -169,4 +207,3 @@ private String toIndentedString(java.lang.Object o) { } } - diff --git a/client/src/main/java/com/github/gotify/client/model/ApplicationParams.java b/client/src/main/java/com/github/gotify/client/model/ApplicationParams.java new file mode 100644 index 00000000..da84f84c --- /dev/null +++ b/client/src/main/java/com/github/gotify/client/model/ApplicationParams.java @@ -0,0 +1,138 @@ +/* + * 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.IOException; +/** + * Params allowed to create or update Applications. + */ +@Schema(description = "Params allowed to create or update Applications.") + + +public class ApplicationParams { + @SerializedName("defaultPriority") + private Long defaultPriority = null; + + @SerializedName("description") + private String description = null; + + @SerializedName("name") + private String name = null; + + public ApplicationParams defaultPriority(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.") + public Long getDefaultPriority() { + return defaultPriority; + } + + public void setDefaultPriority(Long defaultPriority) { + this.defaultPriority = defaultPriority; + } + + public ApplicationParams description(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.") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public ApplicationParams name(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.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ApplicationParams applicationParams = (ApplicationParams) o; + return Objects.equals(this.defaultPriority, applicationParams.defaultPriority) && + Objects.equals(this.description, applicationParams.description) && + Objects.equals(this.name, applicationParams.name); + } + + @Override + public int hashCode() { + return Objects.hash(defaultPriority, description, name); + } + + + @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("}"); + 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 "); + } + +} diff --git a/client/src/main/java/com/github/gotify/client/model/Client.java b/client/src/main/java/com/github/gotify/client/model/Client.java index 66409bab..89d718ef 100644 --- a/client/src/main/java/com/github/gotify/client/model/Client.java +++ b/client/src/main/java/com/github/gotify/client/model/Client.java @@ -1,8 +1,8 @@ /* * 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 either transmitted through a header named `X-Gotify-Key` or a query parameter named `token`. 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) + * 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.1 + * OpenAPI spec version: 2.0.2 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -10,27 +10,31 @@ * 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.io.IOException; - +import org.threeten.bp.OffsetDateTime; /** * The Client holds information about a device which can receive notifications (and other stuff). */ -@ApiModel(description = "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).") + + public class Client { @SerializedName("id") private Long id = null; + @SerializedName("lastUsed") + private OffsetDateTime lastUsed = null; + @SerializedName("name") private String name = null; @@ -41,11 +45,20 @@ public class Client { * The client id. * @return id **/ - @ApiModelProperty(example = "5", required = true, value = "The client id.") + @Schema(example = "5", required = true, description = "The client id.") 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.") + public OffsetDateTime getLastUsed() { + return lastUsed; + } + public Client name(String name) { this.name = name; return this; @@ -55,7 +68,7 @@ public Client name(String name) { * The client name. This is how the client should be displayed to the user. * @return name **/ - @ApiModelProperty(example = "Android Phone", required = true, value = "The client name. This is how the client should be displayed to the user.") + @Schema(example = "Android Phone", required = true, description = "The client name. This is how the client should be displayed to the user.") public String getName() { return name; } @@ -68,7 +81,7 @@ public void setName(String name) { * The client token. Can be used as `clientToken`. See Authentication. * @return token **/ - @ApiModelProperty(example = "CWH0wZ5r0Mbac.r", required = true, value = "The client token. Can be used as `clientToken`. See Authentication.") + @Schema(example = "CWH0wZ5r0Mbac.r", required = true, description = "The client token. Can be used as `clientToken`. See Authentication.") public String getToken() { return token; } @@ -84,13 +97,14 @@ public boolean equals(java.lang.Object o) { } Client client = (Client) o; return Objects.equals(this.id, client.id) && + Objects.equals(this.lastUsed, client.lastUsed) && Objects.equals(this.name, client.name) && Objects.equals(this.token, client.token); } @Override public int hashCode() { - return Objects.hash(id, name, token); + return Objects.hash(id, lastUsed, name, token); } @@ -100,6 +114,7 @@ public String toString() { 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"); sb.append(" token: ").append(toIndentedString(token)).append("\n"); sb.append("}"); @@ -118,4 +133,3 @@ private String toIndentedString(java.lang.Object o) { } } - diff --git a/client/src/main/java/com/github/gotify/client/model/ClientParams.java b/client/src/main/java/com/github/gotify/client/model/ClientParams.java new file mode 100644 index 00000000..f41a6705 --- /dev/null +++ b/client/src/main/java/com/github/gotify/client/model/ClientParams.java @@ -0,0 +1,92 @@ +/* + * 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.IOException; +/** + * Params allowed to create or update Clients. + */ +@Schema(description = "Params allowed to create or update Clients.") + + +public class ClientParams { + @SerializedName("name") + private String name = null; + + public ClientParams name(String name) { + this.name = name; + return this; + } + + /** + * The client name + * @return name + **/ + @Schema(example = "My Client", required = true, description = "The client name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClientParams clientParams = (ClientParams) o; + return Objects.equals(this.name, clientParams.name); + } + + @Override + public int hashCode() { + 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(); + } + + /** + * 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 "); + } + +} diff --git a/client/src/main/java/com/github/gotify/client/model/UserWithPass.java b/client/src/main/java/com/github/gotify/client/model/CreateUserExternal.java similarity index 60% rename from client/src/main/java/com/github/gotify/client/model/UserWithPass.java rename to client/src/main/java/com/github/gotify/client/model/CreateUserExternal.java index 4f9ba0c0..961e5041 100644 --- a/client/src/main/java/com/github/gotify/client/model/UserWithPass.java +++ b/client/src/main/java/com/github/gotify/client/model/CreateUserExternal.java @@ -1,8 +1,8 @@ /* * 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 either transmitted through a header named `X-Gotify-Key` or a query parameter named `token`. 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) + * 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.1 + * OpenAPI spec version: 2.0.2 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -10,37 +10,34 @@ * 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.io.IOException; - /** - * The UserWithPass holds information about the credentials and other stuff. + * Used for user creation. */ -@ApiModel(description = "The UserWithPass holds information about the credentials and other stuff.") -public class UserWithPass { +@Schema(description = "Used for user creation.") + + +public class CreateUserExternal { @SerializedName("admin") private Boolean admin = null; - @SerializedName("id") - private Long id = null; - @SerializedName("name") private String name = null; @SerializedName("pass") private String pass = null; - public UserWithPass admin(Boolean admin) { + public CreateUserExternal admin(Boolean admin) { this.admin = admin; return this; } @@ -49,7 +46,7 @@ public UserWithPass admin(Boolean admin) { * If the user is an administrator. * @return admin **/ - @ApiModelProperty(example = "true", value = "If the user is an administrator.") + @Schema(example = "true", required = true, description = "If the user is an administrator.") public Boolean isAdmin() { return admin; } @@ -58,16 +55,7 @@ public void setAdmin(Boolean admin) { this.admin = admin; } - /** - * The user id. - * @return id - **/ - @ApiModelProperty(example = "25", required = true, value = "The user id.") - public Long getId() { - return id; - } - - public UserWithPass name(String name) { + public CreateUserExternal name(String name) { this.name = name; return this; } @@ -76,7 +64,7 @@ public UserWithPass name(String name) { * The user name. For login. * @return name **/ - @ApiModelProperty(example = "unicorn", required = true, value = "The user name. For login.") + @Schema(example = "unicorn", required = true, description = "The user name. For login.") public String getName() { return name; } @@ -85,7 +73,7 @@ public void setName(String name) { this.name = name; } - public UserWithPass pass(String pass) { + public CreateUserExternal pass(String pass) { this.pass = pass; return this; } @@ -94,7 +82,7 @@ public UserWithPass pass(String pass) { * The user password. For login. * @return pass **/ - @ApiModelProperty(example = "nrocinu", required = true, value = "The user password. For login.") + @Schema(example = "nrocinu", required = true, description = "The user password. For login.") public String getPass() { return pass; } @@ -112,26 +100,24 @@ public boolean equals(java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - UserWithPass userWithPass = (UserWithPass) o; - return Objects.equals(this.admin, userWithPass.admin) && - Objects.equals(this.id, userWithPass.id) && - Objects.equals(this.name, userWithPass.name) && - Objects.equals(this.pass, userWithPass.pass); + CreateUserExternal createUserExternal = (CreateUserExternal) o; + return Objects.equals(this.admin, createUserExternal.admin) && + Objects.equals(this.name, createUserExternal.name) && + Objects.equals(this.pass, createUserExternal.pass); } @Override public int hashCode() { - return Objects.hash(admin, id, name, pass); + return Objects.hash(admin, name, pass); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class UserWithPass {\n"); + sb.append("class CreateUserExternal {\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"); sb.append(" pass: ").append(toIndentedString(pass)).append("\n"); sb.append("}"); @@ -150,4 +136,3 @@ private String toIndentedString(java.lang.Object o) { } } - diff --git a/client/src/main/java/com/github/gotify/client/model/Error.java b/client/src/main/java/com/github/gotify/client/model/Error.java index 8c0d2202..a45e991b 100644 --- a/client/src/main/java/com/github/gotify/client/model/Error.java +++ b/client/src/main/java/com/github/gotify/client/model/Error.java @@ -1,8 +1,8 @@ /* * 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 either transmitted through a header named `X-Gotify-Key` or a query parameter named `token`. 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) + * 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.1 + * OpenAPI spec version: 2.0.2 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -10,23 +10,23 @@ * 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.io.IOException; - /** * The Error contains error relevant information. */ -@ApiModel(description = "The Error contains error relevant information.") +@Schema(description = "The Error contains error relevant information.") + + public class Error { @SerializedName("error") private String error = null; @@ -46,7 +46,7 @@ public Error error(String error) { * The general error message * @return error **/ - @ApiModelProperty(example = "Unauthorized", required = true, value = "The general error message") + @Schema(example = "Unauthorized", required = true, description = "The general error message") public String getError() { return error; } @@ -64,7 +64,7 @@ public Error errorCode(Long errorCode) { * The http error code. * @return errorCode **/ - @ApiModelProperty(example = "401", required = true, value = "The http error code.") + @Schema(example = "401", required = true, description = "The http error code.") public Long getErrorCode() { return errorCode; } @@ -82,7 +82,7 @@ public Error errorDescription(String errorDescription) { * The http error code. * @return errorDescription **/ - @ApiModelProperty(example = "you need to provide a valid access token or user credentials to access this api", required = true, value = "The http error code.") + @Schema(example = "you need to provide a valid access token or user credentials to access this api", required = true, description = "The http error code.") public String getErrorDescription() { return errorDescription; } @@ -136,4 +136,3 @@ private String toIndentedString(java.lang.Object o) { } } - diff --git a/client/src/main/java/com/github/gotify/client/model/Health.java b/client/src/main/java/com/github/gotify/client/model/Health.java index 6da1b3f5..e0ad0800 100644 --- a/client/src/main/java/com/github/gotify/client/model/Health.java +++ b/client/src/main/java/com/github/gotify/client/model/Health.java @@ -1,8 +1,8 @@ /* * 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 either transmitted through a header named `X-Gotify-Key` or a query parameter named `token`. 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) + * 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.1 + * OpenAPI spec version: 2.0.2 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -10,23 +10,23 @@ * 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.io.IOException; - /** * Health represents how healthy the application is. */ -@ApiModel(description = "Health represents how healthy the application is.") +@Schema(description = "Health represents how healthy the application is.") + + public class Health { @SerializedName("database") private String database = null; @@ -43,7 +43,7 @@ public Health database(String database) { * The health of the database connection. * @return database **/ - @ApiModelProperty(example = "green", required = true, value = "The health of the database connection.") + @Schema(example = "green", required = true, description = "The health of the database connection.") public String getDatabase() { return database; } @@ -61,7 +61,7 @@ public Health health(String health) { * The health of the overall application. * @return health **/ - @ApiModelProperty(example = "green", required = true, value = "The health of the overall application.") + @Schema(example = "green", required = true, description = "The health of the overall application.") public String getHealth() { return health; } @@ -113,4 +113,3 @@ private String toIndentedString(java.lang.Object o) { } } - diff --git a/client/src/main/java/com/github/gotify/client/model/IdImageBody.java b/client/src/main/java/com/github/gotify/client/model/IdImageBody.java new file mode 100644 index 00000000..3a5672fd --- /dev/null +++ b/client/src/main/java/com/github/gotify/client/model/IdImageBody.java @@ -0,0 +1,93 @@ +/* + * 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 "); + } + +} diff --git a/client/src/main/java/com/github/gotify/client/model/Message.java b/client/src/main/java/com/github/gotify/client/model/Message.java index 2c501098..ccf8ca3c 100644 --- a/client/src/main/java/com/github/gotify/client/model/Message.java +++ b/client/src/main/java/com/github/gotify/client/model/Message.java @@ -1,8 +1,8 @@ /* * 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 either transmitted through a header named `X-Gotify-Key` or a query parameter named `token`. 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) + * 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.1 + * OpenAPI spec version: 2.0.2 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -10,27 +10,27 @@ * 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.io.IOException; 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. */ -@ApiModel(description = "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.") + + public class Message { @SerializedName("appid") private Long appid = null; @@ -57,7 +57,7 @@ public class Message { * The application id that send this message. * @return appid **/ - @ApiModelProperty(example = "5", required = true, value = "The application id that send this message.") + @Schema(example = "5", required = true, description = "The application id that send this message.") public Long getAppid() { return appid; } @@ -66,7 +66,7 @@ public Long getAppid() { * The date the message was created. * @return date **/ - @ApiModelProperty(example = "2018-02-27T19:36:10.5045044+01:00", required = true, value = "The date the message was created.") + @Schema(example = "2018-02-27T19:36:10.504504400+01:00", required = true, description = "The date the message was created.") public OffsetDateTime getDate() { return date; } @@ -88,7 +88,7 @@ public Message putExtrasItem(String key, Object extrasItem) { * 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. * @return extras **/ - @ApiModelProperty(example = "{\"home::appliances::lighting::on\":{\"brightness\":15},\"home::appliances::thermostat::change_temperature\":{\"temperature\":23}}", value = "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: <top-namespace>::[<sub-namespace>::]<action> 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.") + @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: <top-namespace>::[<sub-namespace>::]<action> 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.") public Map getExtras() { return extras; } @@ -101,7 +101,7 @@ public void setExtras(Map extras) { * The message id. * @return id **/ - @ApiModelProperty(example = "25", required = true, value = "The message id.") + @Schema(example = "25", required = true, description = "The message id.") public Long getId() { return id; } @@ -115,7 +115,7 @@ public Message message(String message) { * The message. Markdown (excluding html) is allowed. * @return message **/ - @ApiModelProperty(example = "**Backup** was successfully finished.", required = true, value = "The message. Markdown (excluding html) is allowed.") + @Schema(example = "**Backup** was successfully finished.", required = true, description = "The message. Markdown (excluding html) is allowed.") public String getMessage() { return message; } @@ -130,10 +130,10 @@ public Message priority(Long priority) { } /** - * The priority of the message. + * The priority of the message. If unset, then the default priority of the application will be used. * @return priority **/ - @ApiModelProperty(example = "2", value = "The priority of the message.") + @Schema(example = "2", description = "The priority of the message. If unset, then the default priority of the application will be used.") public Long getPriority() { return priority; } @@ -151,7 +151,7 @@ public Message title(String title) { * The title of the message. * @return title **/ - @ApiModelProperty(example = "Backup", value = "The title of the message.") + @Schema(example = "Backup", description = "The title of the message.") public String getTitle() { return title; } @@ -213,4 +213,3 @@ private String toIndentedString(java.lang.Object o) { } } - diff --git a/client/src/main/java/com/github/gotify/client/model/PagedMessages.java b/client/src/main/java/com/github/gotify/client/model/PagedMessages.java index bd8cfcb1..9d0fd34a 100644 --- a/client/src/main/java/com/github/gotify/client/model/PagedMessages.java +++ b/client/src/main/java/com/github/gotify/client/model/PagedMessages.java @@ -1,8 +1,8 @@ /* * 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 either transmitted through a header named `X-Gotify-Key` or a query parameter named `token`. 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) + * 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.1 + * OpenAPI spec version: 2.0.2 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -10,10 +10,10 @@ * Do not edit the class manually. */ - package com.github.gotify.client.model; import java.util.Objects; +import java.util.Arrays; import com.github.gotify.client.model.Message; import com.github.gotify.client.model.Paging; import com.google.gson.TypeAdapter; @@ -21,16 +21,16 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.io.IOException; import java.util.ArrayList; import java.util.List; - /** - * Wrapper for the paging and the messages + * Wrapper for the paging and the messages. */ -@ApiModel(description = "Wrapper for the paging and the messages") +@Schema(description = "Wrapper for the paging and the messages.") + + public class PagedMessages { @SerializedName("messages") private List messages = new ArrayList(); @@ -38,29 +38,15 @@ public class PagedMessages { @SerializedName("paging") private Paging paging = null; - public PagedMessages messages(List messages) { - this.messages = messages; - return this; - } - - public PagedMessages addMessagesItem(Message messagesItem) { - this.messages.add(messagesItem); - return this; - } - /** * The messages. * @return messages **/ - @ApiModelProperty(required = true, value = "The messages.") + @Schema(required = true, description = "The messages.") public List getMessages() { return messages; } - public void setMessages(List messages) { - this.messages = messages; - } - public PagedMessages paging(Paging paging) { this.paging = paging; return this; @@ -70,7 +56,7 @@ public PagedMessages paging(Paging paging) { * Get paging * @return paging **/ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") public Paging getPaging() { return paging; } @@ -122,4 +108,3 @@ private String toIndentedString(java.lang.Object o) { } } - diff --git a/client/src/main/java/com/github/gotify/client/model/Paging.java b/client/src/main/java/com/github/gotify/client/model/Paging.java index cdf59854..c7df0268 100644 --- a/client/src/main/java/com/github/gotify/client/model/Paging.java +++ b/client/src/main/java/com/github/gotify/client/model/Paging.java @@ -1,8 +1,8 @@ /* * 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 either transmitted through a header named `X-Gotify-Key` or a query parameter named `token`. 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) + * 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.1 + * OpenAPI spec version: 2.0.2 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -10,23 +10,23 @@ * 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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. */ -@ApiModel(description = "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.") + + public class Paging { @SerializedName("limit") private Long limit = null; @@ -46,7 +46,7 @@ public class Paging { * maximum: 200 * @return limit **/ - @ApiModelProperty(example = "123", required = true, value = "The limit of the messages for the current request.") + @Schema(example = "123", required = true, description = "The limit of the messages for the current request.") public Long getLimit() { return limit; } @@ -55,7 +55,7 @@ public Long getLimit() { * The request url for the next page. Empty/Null when no next page is available. * @return next **/ - @ApiModelProperty(example = "http://example.com/message?limit=50&since=123456", value = "The request url for the next page. Empty/Null when no next page is available.") + @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.") public String getNext() { return next; } @@ -65,7 +65,7 @@ public String getNext() { * minimum: 0 * @return since **/ - @ApiModelProperty(example = "5", required = true, value = "The ID of the last message returned in the current request. Use this as alternative to the next link.") + @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.") public Long getSince() { return since; } @@ -74,7 +74,7 @@ public Long getSince() { * The amount of messages that got returned in the current request. * @return size **/ - @ApiModelProperty(example = "5", required = true, value = "The amount of messages that got returned in the current request.") + @Schema(example = "5", required = true, description = "The amount of messages that got returned in the current request.") public Long getSize() { return size; } @@ -126,4 +126,3 @@ private String toIndentedString(java.lang.Object o) { } } - diff --git a/client/src/main/java/com/github/gotify/client/model/PluginConf.java b/client/src/main/java/com/github/gotify/client/model/PluginConf.java index ddd4f06a..ac162dd5 100644 --- a/client/src/main/java/com/github/gotify/client/model/PluginConf.java +++ b/client/src/main/java/com/github/gotify/client/model/PluginConf.java @@ -1,8 +1,8 @@ /* * 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 either transmitted through a header named `X-Gotify-Key` or a query parameter named `token`. 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) + * 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.1 + * OpenAPI spec version: 2.0.2 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -10,25 +10,25 @@ * 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.io.IOException; import java.util.ArrayList; import java.util.List; - /** * Holds information about a plugin instance for one user. */ -@ApiModel(description = "Holds information about a plugin instance for one user.") +@Schema(description = "Holds information about a plugin instance for one user.") + + public class PluginConf { @SerializedName("author") private String author = null; @@ -61,7 +61,7 @@ public class PluginConf { * The author of the plugin. * @return author **/ - @ApiModelProperty(example = "jmattheis", value = "The author of the plugin.") + @Schema(example = "jmattheis", description = "The author of the plugin.") public String getAuthor() { return author; } @@ -80,7 +80,7 @@ public PluginConf addCapabilitiesItem(String capabilitiesItem) { * Capabilities the plugin provides * @return capabilities **/ - @ApiModelProperty(example = "[\"webhook\",\"display\"]", required = true, value = "Capabilities the plugin provides") + @Schema(example = "[\"webhook\",\"display\"]", required = true, description = "Capabilities the plugin provides") public List getCapabilities() { return capabilities; } @@ -98,7 +98,7 @@ public PluginConf enabled(Boolean enabled) { * Whether the plugin instance is enabled. * @return enabled **/ - @ApiModelProperty(example = "true", required = true, value = "Whether the plugin instance is enabled.") + @Schema(example = "true", required = true, description = "Whether the plugin instance is enabled.") public Boolean isEnabled() { return enabled; } @@ -111,7 +111,7 @@ public void setEnabled(Boolean enabled) { * The plugin id. * @return id **/ - @ApiModelProperty(example = "25", required = true, value = "The plugin id.") + @Schema(example = "25", required = true, description = "The plugin id.") public Long getId() { return id; } @@ -120,7 +120,7 @@ public Long getId() { * The license of the plugin. * @return license **/ - @ApiModelProperty(example = "MIT", value = "The license of the plugin.") + @Schema(example = "MIT", description = "The license of the plugin.") public String getLicense() { return license; } @@ -129,7 +129,7 @@ public String getLicense() { * The module path of the plugin. * @return modulePath **/ - @ApiModelProperty(example = "github.com/gotify/server/plugin/example/echo", required = true, value = "The module path of the plugin.") + @Schema(example = "github.com/gotify/server/plugin/example/echo", required = true, description = "The module path of the plugin.") public String getModulePath() { return modulePath; } @@ -138,7 +138,7 @@ public String getModulePath() { * The plugin name. * @return name **/ - @ApiModelProperty(example = "RSS poller", required = true, value = "The plugin name.") + @Schema(example = "RSS poller", required = true, description = "The plugin name.") public String getName() { return name; } @@ -152,7 +152,7 @@ public PluginConf token(String token) { * The user name. For login. * @return token **/ - @ApiModelProperty(example = "P1234", required = true, value = "The user name. For login.") + @Schema(example = "P1234", required = true, description = "The user name. For login.") public String getToken() { return token; } @@ -165,7 +165,7 @@ public void setToken(String token) { * The website of the plugin. * @return website **/ - @ApiModelProperty(example = "gotify.net", value = "The website of the plugin.") + @Schema(example = "gotify.net", description = "The website of the plugin.") public String getWebsite() { return website; } @@ -227,4 +227,3 @@ private String toIndentedString(java.lang.Object o) { } } - diff --git a/client/src/main/java/com/github/gotify/client/model/UpdateUserExternal.java b/client/src/main/java/com/github/gotify/client/model/UpdateUserExternal.java new file mode 100644 index 00000000..a0b2d376 --- /dev/null +++ b/client/src/main/java/com/github/gotify/client/model/UpdateUserExternal.java @@ -0,0 +1,138 @@ +/* + * 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.IOException; +/** + * Used for updating a user. + */ +@Schema(description = "Used for updating a user.") + + +public class UpdateUserExternal { + @SerializedName("admin") + private Boolean admin = null; + + @SerializedName("name") + private String name = null; + + @SerializedName("pass") + private String pass = null; + + public UpdateUserExternal admin(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() { + return admin; + } + + public void setAdmin(Boolean admin) { + this.admin = admin; + } + + public UpdateUserExternal name(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.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public UpdateUserExternal pass(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") + public String getPass() { + return pass; + } + + public void setPass(String pass) { + this.pass = pass; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateUserExternal updateUserExternal = (UpdateUserExternal) o; + return Objects.equals(this.admin, updateUserExternal.admin) && + Objects.equals(this.name, updateUserExternal.name) && + Objects.equals(this.pass, updateUserExternal.pass); + } + + @Override + public int hashCode() { + 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"); + 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 "); + } + +} diff --git a/client/src/main/java/com/github/gotify/client/model/User.java b/client/src/main/java/com/github/gotify/client/model/User.java index e050cfb3..7e87f5e7 100644 --- a/client/src/main/java/com/github/gotify/client/model/User.java +++ b/client/src/main/java/com/github/gotify/client/model/User.java @@ -1,8 +1,8 @@ /* * 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 either transmitted through a header named `X-Gotify-Key` or a query parameter named `token`. 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) + * 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.1 + * OpenAPI spec version: 2.0.2 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -10,23 +10,23 @@ * 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.io.IOException; - /** * The User holds information about permission and other stuff. */ -@ApiModel(description = "The User holds information about permission and other stuff.") +@Schema(description = "The User holds information about permission and other stuff.") + + public class User { @SerializedName("admin") private Boolean admin = null; @@ -46,7 +46,7 @@ public User admin(Boolean admin) { * If the user is an administrator. * @return admin **/ - @ApiModelProperty(example = "true", value = "If the user is an administrator.") + @Schema(example = "true", required = true, description = "If the user is an administrator.") public Boolean isAdmin() { return admin; } @@ -59,7 +59,7 @@ public void setAdmin(Boolean admin) { * The user id. * @return id **/ - @ApiModelProperty(example = "25", required = true, value = "The user id.") + @Schema(example = "25", required = true, description = "The user id.") public Long getId() { return id; } @@ -73,7 +73,7 @@ public User name(String name) { * The user name. For login. * @return name **/ - @ApiModelProperty(example = "unicorn", required = true, value = "The user name. For login.") + @Schema(example = "unicorn", required = true, description = "The user name. For login.") public String getName() { return name; } @@ -127,4 +127,3 @@ private String toIndentedString(java.lang.Object o) { } } - diff --git a/client/src/main/java/com/github/gotify/client/model/UserPass.java b/client/src/main/java/com/github/gotify/client/model/UserPass.java index a5c0a4cb..50c121a9 100644 --- a/client/src/main/java/com/github/gotify/client/model/UserPass.java +++ b/client/src/main/java/com/github/gotify/client/model/UserPass.java @@ -1,8 +1,8 @@ /* * 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 either transmitted through a header named `X-Gotify-Key` or a query parameter named `token`. 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) + * 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.1 + * OpenAPI spec version: 2.0.2 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -10,23 +10,23 @@ * 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.io.IOException; - /** * The Password for updating the user. */ -@ApiModel(description = "The Password for updating the user.") +@Schema(description = "The Password for updating the user.") + + public class UserPass { @SerializedName("pass") private String pass = null; @@ -40,7 +40,7 @@ public UserPass pass(String pass) { * The user password. For login. * @return pass **/ - @ApiModelProperty(example = "nrocinu", required = true, value = "The user password. For login.") + @Schema(example = "nrocinu", required = true, description = "The user password. For login.") public String getPass() { return pass; } @@ -90,4 +90,3 @@ private String toIndentedString(java.lang.Object o) { } } - diff --git a/client/src/main/java/com/github/gotify/client/model/VersionInfo.java b/client/src/main/java/com/github/gotify/client/model/VersionInfo.java index 5aff3612..263326e8 100644 --- a/client/src/main/java/com/github/gotify/client/model/VersionInfo.java +++ b/client/src/main/java/com/github/gotify/client/model/VersionInfo.java @@ -1,8 +1,8 @@ /* * 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 either transmitted through a header named `X-Gotify-Key` or a query parameter named `token`. 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) + * 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.1 + * OpenAPI spec version: 2.0.2 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -10,23 +10,23 @@ * 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.io.IOException; - /** * VersionInfo Model */ -@ApiModel(description = "VersionInfo Model") +@Schema(description = "VersionInfo Model") + + public class VersionInfo { @SerializedName("buildDate") private String buildDate = null; @@ -46,7 +46,7 @@ public VersionInfo buildDate(String buildDate) { * The date on which this binary was built. * @return buildDate **/ - @ApiModelProperty(example = "2018-02-27T19:36:10.5045044+01:00", required = true, value = "The date on which this binary was built.") + @Schema(example = "2018-02-27T19:36:10.5045044+01:00", required = true, description = "The date on which this binary was built.") public String getBuildDate() { return buildDate; } @@ -64,7 +64,7 @@ public VersionInfo commit(String commit) { * The git commit hash on which this binary was built. * @return commit **/ - @ApiModelProperty(example = "ae9512b6b6feea56a110d59a3353ea3b9c293864", required = true, value = "The git commit hash on which this binary was built.") + @Schema(example = "ae9512b6b6feea56a110d59a3353ea3b9c293864", required = true, description = "The git commit hash on which this binary was built.") public String getCommit() { return commit; } @@ -82,7 +82,7 @@ public VersionInfo version(String version) { * The current version. * @return version **/ - @ApiModelProperty(example = "5.2.6", required = true, value = "The current version.") + @Schema(example = "5.2.6", required = true, description = "The current version.") public String getVersion() { return version; } @@ -136,4 +136,3 @@ private String toIndentedString(java.lang.Object o) { } } - diff --git a/client/src/test/java/com/github/gotify/client/api/ApplicationApiTest.java b/client/src/test/java/com/github/gotify/client/api/ApplicationApiTest.java index 9e494b99..2db46e89 100644 --- a/client/src/test/java/com/github/gotify/client/api/ApplicationApiTest.java +++ b/client/src/test/java/com/github/gotify/client/api/ApplicationApiTest.java @@ -2,16 +2,19 @@ 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 */ @@ -24,6 +27,7 @@ public void setup() { api = new ApiClient().createService(ApplicationApi.class); } + /** * Create an application. * @@ -31,11 +35,12 @@ public void setup() { */ @Test public void createAppTest() { - Application body = null; + ApplicationParams body = null; // Application response = api.createApp(body); // TODO: test validations } + /** * Delete an application. * @@ -48,6 +53,7 @@ public void deleteAppTest() { // TODO: test validations } + /** * Return all applications. * @@ -59,6 +65,20 @@ public void getAppsTest() { // 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. * @@ -66,12 +86,13 @@ public void getAppsTest() { */ @Test public void updateApplicationTest() { - Application body = null; + ApplicationParams body = null; Long id = null; // Application response = api.updateApplication(body, id); // TODO: test validations } + /** * Upload an image for an application. * diff --git a/client/src/test/java/com/github/gotify/client/api/ClientApiTest.java b/client/src/test/java/com/github/gotify/client/api/ClientApiTest.java index ed880835..20b9845b 100644 --- a/client/src/test/java/com/github/gotify/client/api/ClientApiTest.java +++ b/client/src/test/java/com/github/gotify/client/api/ClientApiTest.java @@ -2,15 +2,18 @@ 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 */ @@ -23,6 +26,7 @@ public void setup() { api = new ApiClient().createService(ClientApi.class); } + /** * Create a client. * @@ -30,11 +34,12 @@ public void setup() { */ @Test public void createClientTest() { - Client body = null; + ClientParams body = null; // Client response = api.createClient(body); // TODO: test validations } + /** * Delete a client. * @@ -47,6 +52,7 @@ public void deleteClientTest() { // TODO: test validations } + /** * Return all clients. * @@ -58,6 +64,7 @@ public void getClientsTest() { // TODO: test validations } + /** * Update a client. * @@ -65,7 +72,7 @@ public void getClientsTest() { */ @Test public void updateClientTest() { - Client body = null; + ClientParams body = null; Long id = null; // Client response = api.updateClient(body, id); diff --git a/client/src/test/java/com/github/gotify/client/api/HealthApiTest.java b/client/src/test/java/com/github/gotify/client/api/HealthApiTest.java index 83bea549..4275f85a 100644 --- a/client/src/test/java/com/github/gotify/client/api/HealthApiTest.java +++ b/client/src/test/java/com/github/gotify/client/api/HealthApiTest.java @@ -5,11 +5,13 @@ 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 */ @@ -22,6 +24,7 @@ public void setup() { api = new ApiClient().createService(HealthApi.class); } + /** * Get health information. * diff --git a/client/src/test/java/com/github/gotify/client/api/MessageApiTest.java b/client/src/test/java/com/github/gotify/client/api/MessageApiTest.java index e80c1f48..0788b9d0 100644 --- a/client/src/test/java/com/github/gotify/client/api/MessageApiTest.java +++ b/client/src/test/java/com/github/gotify/client/api/MessageApiTest.java @@ -7,11 +7,13 @@ 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 */ @@ -24,6 +26,7 @@ public void setup() { api = new ApiClient().createService(MessageApi.class); } + /** * Create a message. * @@ -36,6 +39,7 @@ public void createMessageTest() { // TODO: test validations } + /** * Delete all messages from a specific application. * @@ -48,6 +52,7 @@ public void deleteAppMessagesTest() { // TODO: test validations } + /** * Deletes a message with an id. * @@ -60,6 +65,7 @@ public void deleteMessageTest() { // TODO: test validations } + /** * Delete all messages. * @@ -71,6 +77,7 @@ public void deleteMessagesTest() { // TODO: test validations } + /** * Return all messages from a specific application. * @@ -85,6 +92,7 @@ public void getAppMessagesTest() { // TODO: test validations } + /** * Return all messages. * @@ -98,6 +106,7 @@ public void getMessagesTest() { // TODO: test validations } + /** * Websocket, return newly created messages. * diff --git a/client/src/test/java/com/github/gotify/client/api/PluginApiTest.java b/client/src/test/java/com/github/gotify/client/api/PluginApiTest.java index 0e7a5529..48bbf472 100644 --- a/client/src/test/java/com/github/gotify/client/api/PluginApiTest.java +++ b/client/src/test/java/com/github/gotify/client/api/PluginApiTest.java @@ -6,11 +6,13 @@ 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 */ @@ -23,6 +25,7 @@ public void setup() { api = new ApiClient().createService(PluginApi.class); } + /** * Disable a plugin. * @@ -35,6 +38,7 @@ public void disablePluginTest() { // TODO: test validations } + /** * Enable a plugin. * @@ -47,6 +51,7 @@ public void enablePluginTest() { // TODO: test validations } + /** * Get YAML configuration for Configurer plugin. * @@ -59,6 +64,7 @@ public void getPluginConfigTest() { // TODO: test validations } + /** * Get display info for a Displayer plugin. * @@ -71,6 +77,7 @@ public void getPluginDisplayTest() { // TODO: test validations } + /** * Return all plugins. * @@ -82,6 +89,7 @@ public void getPluginsTest() { // TODO: test validations } + /** * Update YAML configuration for Configurer plugin. * diff --git a/client/src/test/java/com/github/gotify/client/api/UserApiTest.java b/client/src/test/java/com/github/gotify/client/api/UserApiTest.java index 94d0a12d..48a1f0cf 100644 --- a/client/src/test/java/com/github/gotify/client/api/UserApiTest.java +++ b/client/src/test/java/com/github/gotify/client/api/UserApiTest.java @@ -1,18 +1,21 @@ 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 com.github.gotify.client.model.UserWithPass; 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 */ @@ -25,18 +28,20 @@ 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() { - UserWithPass body = null; + CreateUserExternal body = null; // User response = api.createUser(body); // TODO: test validations } + /** * Return the current user. * @@ -48,6 +53,7 @@ public void currentUserTest() { // TODO: test validations } + /** * Deletes a user. * @@ -60,6 +66,7 @@ public void deleteUserTest() { // TODO: test validations } + /** * Get a user. * @@ -72,6 +79,7 @@ public void getUserTest() { // TODO: test validations } + /** * Return all users. * @@ -83,6 +91,7 @@ public void getUsersTest() { // TODO: test validations } + /** * Update the password of the current user. * @@ -95,6 +104,7 @@ public void updateCurrentUserTest() { // TODO: test validations } + /** * Update a user. * @@ -102,9 +112,9 @@ public void updateCurrentUserTest() { */ @Test public void updateUserTest() { + UpdateUserExternal body = null; Long id = null; - UserWithPass body = null; - // User response = api.updateUser(id, body); + // User response = api.updateUser(body, id); // TODO: test validations } diff --git a/client/src/test/java/com/github/gotify/client/api/VersionApiTest.java b/client/src/test/java/com/github/gotify/client/api/VersionApiTest.java index b2560dca..0890b525 100644 --- a/client/src/test/java/com/github/gotify/client/api/VersionApiTest.java +++ b/client/src/test/java/com/github/gotify/client/api/VersionApiTest.java @@ -5,11 +5,13 @@ 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 */ @@ -22,6 +24,7 @@ public void setup() { api = new ApiClient().createService(VersionApi.class); } + /** * Get version information. * diff --git a/gradle.properties b/gradle.properties index 8cb3e5a9..19cad2d1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,7 +11,6 @@ android.nonFinalResIds=true android.nonTransitiveRClass=true android.useAndroidX=true org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 -org.gradle.unsafe.configuration-cache=true # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects diff --git a/swagger.config.json b/swagger.config.json index 13499e7f..4d0673bd 100644 --- a/swagger.config.json +++ b/swagger.config.json @@ -1,5 +1,7 @@ { "apiPackage": "com.github.gotify.client.api", "modelPackage": "com.github.gotify.client.model", - "library": "retrofit2" + "library": "retrofit2", + "java11": true, + "hideGenerationTimestamp": true } \ No newline at end of file