From 1280814425a74823dd94cda0fae4ec4c07d2d317 Mon Sep 17 00:00:00 2001 From: Jannis Mattheis Date: Mon, 18 Feb 2019 17:53:42 +0100 Subject: [PATCH] Update swagger client --- client/docs/Application.md | 1 + client/docs/ApplicationApi.md | 333 +++++++++++ client/docs/ClientApi.md | 199 +++++++ client/docs/Message.md | 3 +- client/docs/{TokenApi.md => PluginApi.md} | 519 ++++++++---------- client/docs/PluginConf.md | 18 + client/src/main/AndroidManifest.xml | 3 + .../java/com/github/gotify/client/JSON.java | 2 +- .../com/github/gotify/client/StringUtil.java | 4 +- .../{TokenApi.java => ApplicationApi.java} | 46 +- .../github/gotify/client/api/ClientApi.java | 60 ++ .../github/gotify/client/api/PluginApi.java | 102 ++++ .../github/gotify/client/auth/OAuthFlow.java | 2 +- .../gotify/client/model/Application.java | 22 +- .../github/gotify/client/model/Client.java | 4 +- .../com/github/gotify/client/model/Error.java | 4 +- .../github/gotify/client/model/Message.java | 46 +- .../gotify/client/model/PagedMessages.java | 4 +- .../github/gotify/client/model/Paging.java | 4 +- .../gotify/client/model/PluginConf.java | 231 ++++++++ .../com/github/gotify/client/model/User.java | 4 +- .../github/gotify/client/model/UserPass.java | 4 +- .../gotify/client/model/UserWithPass.java | 4 +- .../gotify/client/model/VersionInfo.java | 4 +- ...enApiTest.java => ApplicationApiTest.java} | 45 +- .../gotify/client/api/ClientApiTest.java | 61 ++ .../gotify/client/api/PluginApiTest.java | 97 ++++ 27 files changed, 1433 insertions(+), 393 deletions(-) create mode 100644 client/docs/ApplicationApi.md create mode 100644 client/docs/ClientApi.md rename client/docs/{TokenApi.md => PluginApi.md} (65%) create mode 100644 client/docs/PluginConf.md create mode 100644 client/src/main/AndroidManifest.xml rename client/src/main/java/com/github/gotify/client/api/{TokenApi.java => ApplicationApi.java} (68%) create mode 100644 client/src/main/java/com/github/gotify/client/api/ClientApi.java create mode 100644 client/src/main/java/com/github/gotify/client/api/PluginApi.java create mode 100644 client/src/main/java/com/github/gotify/client/model/PluginConf.java rename client/src/test/java/com/github/gotify/client/api/{TokenApiTest.java => ApplicationApiTest.java} (64%) create mode 100644 client/src/test/java/com/github/gotify/client/api/ClientApiTest.java create mode 100644 client/src/test/java/com/github/gotify/client/api/PluginApiTest.java diff --git a/client/docs/Application.md b/client/docs/Application.md index bf05b27..dc6909f 100644 --- a/client/docs/Application.md +++ b/client/docs/Application.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes **description** | **String** | The description of the application. | **id** | **Integer** | 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. | **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 new file mode 100644 index 0000000..d094ccb --- /dev/null +++ b/client/docs/ApplicationApi.md @@ -0,0 +1,333 @@ +# ApplicationApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createApp**](ApplicationApi.md#createApp) | **POST** application | Create an application. +[**deleteApp**](ApplicationApi.md#deleteApp) | **DELETE** application/{id} | Delete an application. +[**getApps**](ApplicationApi.md#getApps) | **GET** application | Return all applications. +[**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) + +Create an application. + +### Example +```java +// Import classes: +//import com.github.gotify.client.ApiClient; +//import com.github.gotify.client.ApiException; +//import com.github.gotify.client.Configuration; +//import com.github.gotify.client.auth.*; +//import com.github.gotify.client.api.ApplicationApi; + +ApiClient defaultClient = Configuration.getDefaultApiClient(); + +// Configure HTTP basic authorization: basicAuth +HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth"); +basicAuth.setUsername("YOUR USERNAME"); +basicAuth.setPassword("YOUR PASSWORD"); + +// Configure API key authorization: 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(); +Application body = new Application(); // Application | the application to add +try { + Application result = apiInstance.createApp(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling ApplicationApi#createApp"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Application**](Application.md)| the application to add | + +### Return type + +[**Application**](Application.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [clientTokenHeader](../README.md#clientTokenHeader), [clientTokenQuery](../README.md#clientTokenQuery) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +# **deleteApp** +> Void deleteApp(id) + +Delete an application. + +### Example +```java +// Import classes: +//import com.github.gotify.client.ApiClient; +//import com.github.gotify.client.ApiException; +//import com.github.gotify.client.Configuration; +//import com.github.gotify.client.auth.*; +//import com.github.gotify.client.api.ApplicationApi; + +ApiClient defaultClient = Configuration.getDefaultApiClient(); + +// Configure HTTP basic authorization: basicAuth +HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth"); +basicAuth.setUsername("YOUR USERNAME"); +basicAuth.setPassword("YOUR PASSWORD"); + +// Configure API key authorization: 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(); +Integer id = 56; // Integer | the application id +try { + Void result = apiInstance.deleteApp(id); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling ApplicationApi#deleteApp"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **Integer**| the application id | + +### Return type + +[**Void**](.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [clientTokenHeader](../README.md#clientTokenHeader), [clientTokenQuery](../README.md#clientTokenQuery) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +# **getApps** +> List<Application> getApps() + +Return all applications. + +### Example +```java +// Import classes: +//import com.github.gotify.client.ApiClient; +//import com.github.gotify.client.ApiException; +//import com.github.gotify.client.Configuration; +//import com.github.gotify.client.auth.*; +//import com.github.gotify.client.api.ApplicationApi; + +ApiClient defaultClient = Configuration.getDefaultApiClient(); + +// Configure HTTP basic authorization: basicAuth +HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth"); +basicAuth.setUsername("YOUR USERNAME"); +basicAuth.setPassword("YOUR PASSWORD"); + +// Configure API key authorization: clientTokenHeader +ApiKeyAuth clientTokenHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenHeader"); +clientTokenHeader.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//clientTokenHeader.setApiKeyPrefix("Token"); + +// Configure API key authorization: clientTokenQuery +ApiKeyAuth clientTokenQuery = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenQuery"); +clientTokenQuery.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//clientTokenQuery.setApiKeyPrefix("Token"); + +ApplicationApi apiInstance = new ApplicationApi(); +try { + List result = apiInstance.getApps(); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling ApplicationApi#getApps"); + e.printStackTrace(); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**List<Application>**](Application.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [clientTokenHeader](../README.md#clientTokenHeader), [clientTokenQuery](../README.md#clientTokenQuery) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +# **updateApplication** +> Application updateApplication(body, id) + +Update an application. + +### Example +```java +// Import classes: +//import com.github.gotify.client.ApiClient; +//import com.github.gotify.client.ApiException; +//import com.github.gotify.client.Configuration; +//import com.github.gotify.client.auth.*; +//import com.github.gotify.client.api.ApplicationApi; + +ApiClient defaultClient = Configuration.getDefaultApiClient(); + +// Configure HTTP basic authorization: basicAuth +HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth"); +basicAuth.setUsername("YOUR USERNAME"); +basicAuth.setPassword("YOUR PASSWORD"); + +// Configure API key authorization: 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(); +Application body = new Application(); // Application | the application to update +Integer id = 56; // Integer | the application id +try { + Application result = apiInstance.updateApplication(body, id); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling ApplicationApi#updateApplication"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Application**](Application.md)| the application to update | + **id** | **Integer**| the application id | + +### Return type + +[**Application**](Application.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [clientTokenHeader](../README.md#clientTokenHeader), [clientTokenQuery](../README.md#clientTokenQuery) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +# **uploadAppImage** +> Application uploadAppImage(file, id) + +Upload an image for an application. + +### Example +```java +// Import classes: +//import com.github.gotify.client.ApiClient; +//import com.github.gotify.client.ApiException; +//import com.github.gotify.client.Configuration; +//import com.github.gotify.client.auth.*; +//import com.github.gotify.client.api.ApplicationApi; + +ApiClient defaultClient = Configuration.getDefaultApiClient(); + +// Configure HTTP basic authorization: basicAuth +HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth"); +basicAuth.setUsername("YOUR USERNAME"); +basicAuth.setPassword("YOUR PASSWORD"); + +// Configure API key authorization: clientTokenHeader +ApiKeyAuth clientTokenHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenHeader"); +clientTokenHeader.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//clientTokenHeader.setApiKeyPrefix("Token"); + +// Configure API key authorization: clientTokenQuery +ApiKeyAuth clientTokenQuery = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenQuery"); +clientTokenQuery.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//clientTokenQuery.setApiKeyPrefix("Token"); + +ApplicationApi apiInstance = new ApplicationApi(); +File file = new File("/path/to/file.txt"); // File | the application image +Integer id = 56; // Integer | the application id +try { + Application result = apiInstance.uploadAppImage(file, id); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling ApplicationApi#uploadAppImage"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **file** | **File**| the application image | + **id** | **Integer**| the application id | + +### Return type + +[**Application**](Application.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [clientTokenHeader](../README.md#clientTokenHeader), [clientTokenQuery](../README.md#clientTokenQuery) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + diff --git a/client/docs/ClientApi.md b/client/docs/ClientApi.md new file mode 100644 index 0000000..2d1f8c7 --- /dev/null +++ b/client/docs/ClientApi.md @@ -0,0 +1,199 @@ +# ClientApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createClient**](ClientApi.md#createClient) | **POST** client | Create a client. +[**deleteClient**](ClientApi.md#deleteClient) | **DELETE** client/{id} | Delete a client. +[**getClients**](ClientApi.md#getClients) | **GET** client | Return all clients. + + + +# **createClient** +> Client createClient(body) + +Create a client. + +### Example +```java +// Import classes: +//import com.github.gotify.client.ApiClient; +//import com.github.gotify.client.ApiException; +//import com.github.gotify.client.Configuration; +//import com.github.gotify.client.auth.*; +//import com.github.gotify.client.api.ClientApi; + +ApiClient defaultClient = Configuration.getDefaultApiClient(); + +// Configure HTTP basic authorization: basicAuth +HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth"); +basicAuth.setUsername("YOUR USERNAME"); +basicAuth.setPassword("YOUR PASSWORD"); + +// Configure API key authorization: clientTokenHeader +ApiKeyAuth clientTokenHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenHeader"); +clientTokenHeader.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//clientTokenHeader.setApiKeyPrefix("Token"); + +// Configure API key authorization: clientTokenQuery +ApiKeyAuth clientTokenQuery = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenQuery"); +clientTokenQuery.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//clientTokenQuery.setApiKeyPrefix("Token"); + +ClientApi apiInstance = new ClientApi(); +Client body = new Client(); // Client | the client to add +try { + Client result = apiInstance.createClient(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling ClientApi#createClient"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| the client to add | + +### Return type + +[**Client**](Client.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [clientTokenHeader](../README.md#clientTokenHeader), [clientTokenQuery](../README.md#clientTokenQuery) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +# **deleteClient** +> Void deleteClient(id) + +Delete a client. + +### Example +```java +// Import classes: +//import com.github.gotify.client.ApiClient; +//import com.github.gotify.client.ApiException; +//import com.github.gotify.client.Configuration; +//import com.github.gotify.client.auth.*; +//import com.github.gotify.client.api.ClientApi; + +ApiClient defaultClient = Configuration.getDefaultApiClient(); + +// Configure HTTP basic authorization: basicAuth +HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth"); +basicAuth.setUsername("YOUR USERNAME"); +basicAuth.setPassword("YOUR PASSWORD"); + +// Configure API key authorization: clientTokenHeader +ApiKeyAuth clientTokenHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenHeader"); +clientTokenHeader.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//clientTokenHeader.setApiKeyPrefix("Token"); + +// Configure API key authorization: clientTokenQuery +ApiKeyAuth clientTokenQuery = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenQuery"); +clientTokenQuery.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//clientTokenQuery.setApiKeyPrefix("Token"); + +ClientApi apiInstance = new ClientApi(); +Integer id = 56; // Integer | the client id +try { + Void result = apiInstance.deleteClient(id); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling ClientApi#deleteClient"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **Integer**| the client id | + +### Return type + +[**Void**](.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [clientTokenHeader](../README.md#clientTokenHeader), [clientTokenQuery](../README.md#clientTokenQuery) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +# **getClients** +> List<Client> getClients() + +Return all clients. + +### Example +```java +// Import classes: +//import com.github.gotify.client.ApiClient; +//import com.github.gotify.client.ApiException; +//import com.github.gotify.client.Configuration; +//import com.github.gotify.client.auth.*; +//import com.github.gotify.client.api.ClientApi; + +ApiClient defaultClient = Configuration.getDefaultApiClient(); + +// Configure HTTP basic authorization: basicAuth +HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth"); +basicAuth.setUsername("YOUR USERNAME"); +basicAuth.setPassword("YOUR PASSWORD"); + +// Configure API key authorization: clientTokenHeader +ApiKeyAuth clientTokenHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenHeader"); +clientTokenHeader.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//clientTokenHeader.setApiKeyPrefix("Token"); + +// Configure API key authorization: clientTokenQuery +ApiKeyAuth clientTokenQuery = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenQuery"); +clientTokenQuery.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//clientTokenQuery.setApiKeyPrefix("Token"); + +ClientApi apiInstance = new ClientApi(); +try { + List result = apiInstance.getClients(); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling ClientApi#getClients"); + e.printStackTrace(); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**List<Client>**](Client.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [clientTokenHeader](../README.md#clientTokenHeader), [clientTokenQuery](../README.md#clientTokenQuery) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/client/docs/Message.md b/client/docs/Message.md index 38becf7..e5baed9 100644 --- a/client/docs/Message.md +++ b/client/docs/Message.md @@ -6,10 +6,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **appid** | **Integer** | The application id that send this message. | **date** | [**OffsetDateTime**](OffsetDateTime.md) | The date the message was created. | +**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** | **Integer** | The message id. | **message** | **String** | The actual message. | **priority** | **Long** | The priority of the message. | [optional] -**title** | **String** | The title of the message. | +**title** | **String** | The title of the message. | [optional] diff --git a/client/docs/TokenApi.md b/client/docs/PluginApi.md similarity index 65% rename from client/docs/TokenApi.md rename to client/docs/PluginApi.md index afb55ea..0aa3544 100644 --- a/client/docs/TokenApi.md +++ b/client/docs/PluginApi.md @@ -1,23 +1,22 @@ -# TokenApi +# PluginApi All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- -[**createApp**](TokenApi.md#createApp) | **POST** application | Create an application. -[**createClient**](TokenApi.md#createClient) | **POST** client | Create a client. -[**deleteApp**](TokenApi.md#deleteApp) | **DELETE** application/{id} | Delete an application. -[**deleteClient**](TokenApi.md#deleteClient) | **DELETE** client/{id} | Delete a client. -[**getApps**](TokenApi.md#getApps) | **GET** application | Return all applications. -[**getClients**](TokenApi.md#getClients) | **GET** client | Return all clients. -[**uploadAppImage**](TokenApi.md#uploadAppImage) | **POST** application/{id}/image | +[**disablePlugin**](PluginApi.md#disablePlugin) | **POST** plugin/{id}/disable | Disable a plugin. +[**enablePlugin**](PluginApi.md#enablePlugin) | **POST** plugin/{id}/enable | Enable a plugin. +[**getPluginConfig**](PluginApi.md#getPluginConfig) | **GET** plugin/{id}/config | Get YAML configuration for Configurer plugin. +[**getPluginDisplay**](PluginApi.md#getPluginDisplay) | **GET** plugin/{id}/display | Get display info for a Displayer plugin. +[**getPlugins**](PluginApi.md#getPlugins) | **GET** plugin | Return all plugins. +[**updatePluginConfig**](PluginApi.md#updatePluginConfig) | **POST** plugin/{id}/config | Update YAML configuration for Configurer plugin. - -# **createApp** -> Application createApp(body) + +# **disablePlugin** +> Void disablePlugin(id) -Create an application. +Disable a plugin. ### Example ```java @@ -26,7 +25,7 @@ Create an application. //import com.github.gotify.client.ApiException; //import com.github.gotify.client.Configuration; //import com.github.gotify.client.auth.*; -//import com.github.gotify.client.api.TokenApi; +//import com.github.gotify.client.api.PluginApi; ApiClient defaultClient = Configuration.getDefaultApiClient(); @@ -47,13 +46,13 @@ 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"); -TokenApi apiInstance = new TokenApi(); -Application body = new Application(); // Application | the application to add +PluginApi apiInstance = new PluginApi(); +Integer id = 56; // Integer | the plugin id try { - Application result = apiInstance.createApp(body); + Void result = apiInstance.disablePlugin(id); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling TokenApi#createApp"); + System.err.println("Exception when calling PluginApi#disablePlugin"); e.printStackTrace(); } ``` @@ -62,135 +61,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Application**](Application.md)| the application to add | - -### Return type - -[**Application**](Application.md) - -### Authorization - -[basicAuth](../README.md#basicAuth), [clientTokenHeader](../README.md#clientTokenHeader), [clientTokenQuery](../README.md#clientTokenQuery) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - -# **createClient** -> Client createClient(body) - -Create a client. - -### Example -```java -// Import classes: -//import com.github.gotify.client.ApiClient; -//import com.github.gotify.client.ApiException; -//import com.github.gotify.client.Configuration; -//import com.github.gotify.client.auth.*; -//import com.github.gotify.client.api.TokenApi; - -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: 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"); - -TokenApi apiInstance = new TokenApi(); -Client body = new Client(); // Client | the client to add -try { - Client result = apiInstance.createClient(body); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling TokenApi#createClient"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| the client to add | - -### Return type - -[**Client**](Client.md) - -### Authorization - -[basicAuth](../README.md#basicAuth), [clientTokenHeader](../README.md#clientTokenHeader), [clientTokenQuery](../README.md#clientTokenQuery) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - -# **deleteApp** -> Void deleteApp(id) - -Delete an application. - -### Example -```java -// Import classes: -//import com.github.gotify.client.ApiClient; -//import com.github.gotify.client.ApiException; -//import com.github.gotify.client.Configuration; -//import com.github.gotify.client.auth.*; -//import com.github.gotify.client.api.TokenApi; - -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: 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"); - -TokenApi apiInstance = new TokenApi(); -Integer id = 56; // Integer | the application id -try { - Void result = apiInstance.deleteApp(id); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling TokenApi#deleteApp"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **Integer**| the application id | + **id** | **Integer**| the plugin id | ### Return type @@ -205,11 +76,11 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - -# **deleteClient** -> Void deleteClient(id) + +# **enablePlugin** +> Void enablePlugin(id) -Delete a client. +Enable a plugin. ### Example ```java @@ -218,7 +89,7 @@ Delete a client. //import com.github.gotify.client.ApiException; //import com.github.gotify.client.Configuration; //import com.github.gotify.client.auth.*; -//import com.github.gotify.client.api.TokenApi; +//import com.github.gotify.client.api.PluginApi; ApiClient defaultClient = Configuration.getDefaultApiClient(); @@ -239,13 +110,13 @@ 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"); -TokenApi apiInstance = new TokenApi(); -Integer id = 56; // Integer | the client id +PluginApi apiInstance = new PluginApi(); +Integer id = 56; // Integer | the plugin id try { - Void result = apiInstance.deleteClient(id); + Void result = apiInstance.enablePlugin(id); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling TokenApi#deleteClient"); + System.err.println("Exception when calling PluginApi#enablePlugin"); e.printStackTrace(); } ``` @@ -254,7 +125,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **Integer**| the client id | + **id** | **Integer**| the plugin id | ### Return type @@ -269,11 +140,11 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - -# **getApps** -> List<Application> getApps() + +# **getPluginConfig** +> Object getPluginConfig(id) -Return all applications. +Get YAML configuration for Configurer plugin. ### Example ```java @@ -282,7 +153,7 @@ Return all applications. //import com.github.gotify.client.ApiException; //import com.github.gotify.client.Configuration; //import com.github.gotify.client.auth.*; -//import com.github.gotify.client.api.TokenApi; +//import com.github.gotify.client.api.PluginApi; ApiClient defaultClient = Configuration.getDefaultApiClient(); @@ -303,136 +174,13 @@ 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"); -TokenApi apiInstance = new TokenApi(); +PluginApi apiInstance = new PluginApi(); +Integer id = 56; // Integer | the plugin id try { - List result = apiInstance.getApps(); + Object result = apiInstance.getPluginConfig(id); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling TokenApi#getApps"); - e.printStackTrace(); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**List<Application>**](Application.md) - -### Authorization - -[basicAuth](../README.md#basicAuth), [clientTokenHeader](../README.md#clientTokenHeader), [clientTokenQuery](../README.md#clientTokenQuery) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - -# **getClients** -> List<Client> getClients() - -Return all clients. - -### Example -```java -// Import classes: -//import com.github.gotify.client.ApiClient; -//import com.github.gotify.client.ApiException; -//import com.github.gotify.client.Configuration; -//import com.github.gotify.client.auth.*; -//import com.github.gotify.client.api.TokenApi; - -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: 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"); - -TokenApi apiInstance = new TokenApi(); -try { - List result = apiInstance.getClients(); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling TokenApi#getClients"); - e.printStackTrace(); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**List<Client>**](Client.md) - -### Authorization - -[basicAuth](../README.md#basicAuth), [clientTokenHeader](../README.md#clientTokenHeader), [clientTokenQuery](../README.md#clientTokenQuery) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - -# **uploadAppImage** -> Application uploadAppImage(file, id) - - - -Upload an image for an application - -### Example -```java -// Import classes: -//import com.github.gotify.client.ApiClient; -//import com.github.gotify.client.ApiException; -//import com.github.gotify.client.Configuration; -//import com.github.gotify.client.auth.*; -//import com.github.gotify.client.api.TokenApi; - -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: 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"); - -TokenApi apiInstance = new TokenApi(); -File file = new File("/path/to/file.txt"); // File | the application image -Integer id = 56; // Integer | the application id -try { - Application result = apiInstance.uploadAppImage(file, id); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling TokenApi#uploadAppImage"); + System.err.println("Exception when calling PluginApi#getPluginConfig"); e.printStackTrace(); } ``` @@ -441,12 +189,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **file** | **File**| the application image | - **id** | **Integer**| the application id | + **id** | **Integer**| the plugin id | ### Return type -[**Application**](Application.md) +**Object** ### Authorization @@ -454,6 +201,194 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: multipart/form-data + - **Content-Type**: application/json + - **Accept**: application/x-yaml + + +# **getPluginDisplay** +> String getPluginDisplay(id) + +Get display info for a Displayer plugin. + +### Example +```java +// Import classes: +//import com.github.gotify.client.ApiClient; +//import com.github.gotify.client.ApiException; +//import com.github.gotify.client.Configuration; +//import com.github.gotify.client.auth.*; +//import com.github.gotify.client.api.PluginApi; + +ApiClient defaultClient = Configuration.getDefaultApiClient(); + +// Configure HTTP basic authorization: basicAuth +HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth"); +basicAuth.setUsername("YOUR USERNAME"); +basicAuth.setPassword("YOUR PASSWORD"); + +// Configure API key authorization: clientTokenHeader +ApiKeyAuth clientTokenHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenHeader"); +clientTokenHeader.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//clientTokenHeader.setApiKeyPrefix("Token"); + +// Configure API key authorization: clientTokenQuery +ApiKeyAuth clientTokenQuery = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenQuery"); +clientTokenQuery.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//clientTokenQuery.setApiKeyPrefix("Token"); + +PluginApi apiInstance = new PluginApi(); +Integer id = 56; // Integer | the plugin id +try { + String result = apiInstance.getPluginDisplay(id); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling PluginApi#getPluginDisplay"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **Integer**| the plugin id | + +### Return type + +**String** + +### Authorization + +[basicAuth](../README.md#basicAuth), [clientTokenHeader](../README.md#clientTokenHeader), [clientTokenQuery](../README.md#clientTokenQuery) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +# **getPlugins** +> List<PluginConf> getPlugins() + +Return all plugins. + +### Example +```java +// Import classes: +//import com.github.gotify.client.ApiClient; +//import com.github.gotify.client.ApiException; +//import com.github.gotify.client.Configuration; +//import com.github.gotify.client.auth.*; +//import com.github.gotify.client.api.PluginApi; + +ApiClient defaultClient = Configuration.getDefaultApiClient(); + +// Configure HTTP basic authorization: basicAuth +HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth"); +basicAuth.setUsername("YOUR USERNAME"); +basicAuth.setPassword("YOUR PASSWORD"); + +// Configure API key authorization: clientTokenHeader +ApiKeyAuth clientTokenHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenHeader"); +clientTokenHeader.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//clientTokenHeader.setApiKeyPrefix("Token"); + +// Configure API key authorization: clientTokenQuery +ApiKeyAuth clientTokenQuery = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenQuery"); +clientTokenQuery.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//clientTokenQuery.setApiKeyPrefix("Token"); + +PluginApi apiInstance = new PluginApi(); +try { + List result = apiInstance.getPlugins(); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling PluginApi#getPlugins"); + e.printStackTrace(); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**List<PluginConf>**](PluginConf.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [clientTokenHeader](../README.md#clientTokenHeader), [clientTokenQuery](../README.md#clientTokenQuery) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +# **updatePluginConfig** +> Void updatePluginConfig(id) + +Update YAML configuration for Configurer plugin. + +### Example +```java +// Import classes: +//import com.github.gotify.client.ApiClient; +//import com.github.gotify.client.ApiException; +//import com.github.gotify.client.Configuration; +//import com.github.gotify.client.auth.*; +//import com.github.gotify.client.api.PluginApi; + +ApiClient defaultClient = Configuration.getDefaultApiClient(); + +// Configure HTTP basic authorization: basicAuth +HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth"); +basicAuth.setUsername("YOUR USERNAME"); +basicAuth.setPassword("YOUR PASSWORD"); + +// Configure API key authorization: clientTokenHeader +ApiKeyAuth clientTokenHeader = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenHeader"); +clientTokenHeader.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//clientTokenHeader.setApiKeyPrefix("Token"); + +// Configure API key authorization: clientTokenQuery +ApiKeyAuth clientTokenQuery = (ApiKeyAuth) defaultClient.getAuthentication("clientTokenQuery"); +clientTokenQuery.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//clientTokenQuery.setApiKeyPrefix("Token"); + +PluginApi apiInstance = new PluginApi(); +Integer id = 56; // Integer | the plugin id +try { + Void result = apiInstance.updatePluginConfig(id); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling PluginApi#updatePluginConfig"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **Integer**| the plugin id | + +### Return type + +[**Void**](.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [clientTokenHeader](../README.md#clientTokenHeader), [clientTokenQuery](../README.md#clientTokenQuery) + +### HTTP request headers + + - **Content-Type**: application/x-yaml - **Accept**: application/json diff --git a/client/docs/PluginConf.md b/client/docs/PluginConf.md new file mode 100644 index 0000000..0a78fb1 --- /dev/null +++ b/client/docs/PluginConf.md @@ -0,0 +1,18 @@ + +# PluginConf + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**author** | **String** | The author of the plugin. | [optional] +**capabilities** | **List<String>** | Capabilities the plugin provides | +**enabled** | **Boolean** | Whether the plugin instance is enabled. | +**id** | **Integer** | The plugin id. | +**license** | **String** | The license of the plugin. | [optional] +**modulePath** | **String** | The module path of the plugin. | +**name** | **String** | The plugin name. | +**token** | **String** | The user name. For login. | +**website** | **String** | The website of the plugin. | [optional] + + + diff --git a/client/src/main/AndroidManifest.xml b/client/src/main/AndroidManifest.xml new file mode 100644 index 0000000..3212fe4 --- /dev/null +++ b/client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + 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 8c9c770..918b320 100644 --- a/client/src/main/java/com/github/gotify/client/JSON.java +++ b/client/src/main/java/com/github/gotify/client/JSON.java @@ -2,7 +2,7 @@ * 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) * - * OpenAPI spec version: 1.0.4 + * OpenAPI spec version: 1.0.6 * * * NOTE: This class is auto generated by the swagger code generator program. 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 30f0cc5..c042ca5 100644 --- a/client/src/main/java/com/github/gotify/client/StringUtil.java +++ b/client/src/main/java/com/github/gotify/client/StringUtil.java @@ -2,7 +2,7 @@ * 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) * - * OpenAPI spec version: 1.0.4 + * OpenAPI spec version: 1.0.6 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -13,7 +13,7 @@ package com.github.gotify.client; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-11-12T21:00:23.670+01:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2019-02-17T19:42:51.206+01:00") 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/TokenApi.java b/client/src/main/java/com/github/gotify/client/api/ApplicationApi.java similarity index 68% rename from client/src/main/java/com/github/gotify/client/api/TokenApi.java rename to client/src/main/java/com/github/gotify/client/api/ApplicationApi.java index 144ae51..375e6ff 100644 --- a/client/src/main/java/com/github/gotify/client/api/TokenApi.java +++ b/client/src/main/java/com/github/gotify/client/api/ApplicationApi.java @@ -9,7 +9,6 @@ import okhttp3.RequestBody; import okhttp3.ResponseBody; import com.github.gotify.client.model.Application; -import com.github.gotify.client.model.Client; import com.github.gotify.client.model.Error; import java.io.File; @@ -18,7 +17,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -public interface TokenApi { +public interface ApplicationApi { /** * Create an application. * @@ -33,20 +32,6 @@ public interface TokenApi { @retrofit2.http.Body Application body ); - /** - * Create a client. - * - * @param body the client to add (required) - * @return Call<Client> - */ - @Headers({ - "Content-Type:application/json" - }) - @POST("client") - Call createClient( - @retrofit2.http.Body Client body - ); - /** * Delete an application. * @@ -61,20 +46,6 @@ public interface TokenApi { @retrofit2.http.Path("id") Integer id ); - /** - * Delete a client. - * - * @param id the client id (required) - * @return Call<Void> - */ - @Headers({ - "Content-Type:application/json" - }) - @DELETE("client/{id}") - Call deleteClient( - @retrofit2.http.Path("id") Integer id - ); - /** * Return all applications. * @@ -88,20 +59,23 @@ public interface TokenApi { /** - * Return all clients. + * Update an application. * - * @return Call<List<Client>> + * @param body the application to update (required) + * @param id the application id (required) + * @return Call<Application> */ @Headers({ "Content-Type:application/json" }) - @GET("client") - Call> getClients(); - + @PUT("application/{id}") + Call updateApplication( + @retrofit2.http.Body Application body, @retrofit2.http.Path("id") Integer id + ); /** + * Upload an image for an application. * - * Upload an image for an application * @param file the application image (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 new file mode 100644 index 0000000..71cb1b6 --- /dev/null +++ b/client/src/main/java/com/github/gotify/client/api/ClientApi.java @@ -0,0 +1,60 @@ +package com.github.gotify.client.api; + +import com.github.gotify.client.CollectionFormats.*; + +import retrofit2.Call; +import retrofit2.http.*; + +import okhttp3.RequestBody; +import okhttp3.ResponseBody; + +import com.github.gotify.client.model.Client; +import com.github.gotify.client.model.Error; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public interface ClientApi { + /** + * Create a client. + * + * @param body the client to add (required) + * @return Call<Client> + */ + @Headers({ + "Content-Type:application/json" + }) + @POST("client") + Call createClient( + @retrofit2.http.Body Client body + ); + + /** + * Delete a client. + * + * @param id the client id (required) + * @return Call<Void> + */ + @Headers({ + "Content-Type:application/json" + }) + @DELETE("client/{id}") + Call deleteClient( + @retrofit2.http.Path("id") Integer id + ); + + /** + * Return all clients. + * + * @return Call<List<Client>> + */ + @Headers({ + "Content-Type:application/json" + }) + @GET("client") + Call> getClients(); + + +} 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 new file mode 100644 index 0000000..b144706 --- /dev/null +++ b/client/src/main/java/com/github/gotify/client/api/PluginApi.java @@ -0,0 +1,102 @@ +package com.github.gotify.client.api; + +import com.github.gotify.client.CollectionFormats.*; + +import retrofit2.Call; +import retrofit2.http.*; + +import okhttp3.RequestBody; +import okhttp3.ResponseBody; + +import com.github.gotify.client.model.Error; +import com.github.gotify.client.model.PluginConf; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public interface PluginApi { + /** + * Disable a plugin. + * + * @param id the plugin id (required) + * @return Call<Void> + */ + @Headers({ + "Content-Type:application/json" + }) + @POST("plugin/{id}/disable") + Call disablePlugin( + @retrofit2.http.Path("id") Integer id + ); + + /** + * Enable a plugin. + * + * @param id the plugin id (required) + * @return Call<Void> + */ + @Headers({ + "Content-Type:application/json" + }) + @POST("plugin/{id}/enable") + Call enablePlugin( + @retrofit2.http.Path("id") Integer id + ); + + /** + * Get YAML configuration for Configurer plugin. + * + * @param id the plugin id (required) + * @return Call<Object> + */ + @Headers({ + "Content-Type:application/json" + }) + @GET("plugin/{id}/config") + Call getPluginConfig( + @retrofit2.http.Path("id") Integer id + ); + + /** + * Get display info for a Displayer plugin. + * + * @param id the plugin id (required) + * @return Call<String> + */ + @Headers({ + "Content-Type:application/json" + }) + @GET("plugin/{id}/display") + Call getPluginDisplay( + @retrofit2.http.Path("id") Integer id + ); + + /** + * Return all plugins. + * + * @return Call<List<PluginConf>> + */ + @Headers({ + "Content-Type:application/json" + }) + @GET("plugin") + Call> getPlugins(); + + + /** + * Update YAML configuration for Configurer plugin. + * + * @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") Integer id + ); + +} 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 9680c6c..1db007e 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 @@ -2,7 +2,7 @@ * 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) * - * OpenAPI spec version: 1.0.4 + * OpenAPI spec version: 1.0.6 * * * NOTE: This class is auto generated by the swagger code generator program. 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 a52535a..fad9100 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 @@ -2,7 +2,7 @@ * 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) * - * OpenAPI spec version: 1.0.4 + * OpenAPI spec version: 1.0.6 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -27,7 +27,7 @@ import java.io.IOException; * The Application holds information about an app which can send notifications. */ @ApiModel(description = "The Application holds information about an app which can send notifications.") -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-11-12T21:00:23.670+01:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2019-02-17T19:42:51.206+01:00") public class Application { @SerializedName("description") private String description = null; @@ -38,6 +38,9 @@ public class Application { @SerializedName("image") private String image = null; + @SerializedName("internal") + private Boolean internal = null; + @SerializedName("name") private String name = null; @@ -75,11 +78,20 @@ public class Application { * The image of the application. * @return image **/ - @ApiModelProperty(example = "https://example.com/image.jpeg", required = true, value = "The image of the application.") + @ApiModelProperty(example = "image/image.jpeg", required = true, value = "The image of the application.") public String getImage() { return image; } + /** + * 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.") + public Boolean isInternal() { + return internal; + } + public Application name(String name) { this.name = name; return this; @@ -120,13 +132,14 @@ public class Application { return 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.name, application.name) && Objects.equals(this.token, application.token); } @Override public int hashCode() { - return Objects.hash(description, id, image, name, token); + return Objects.hash(description, id, image, internal, name, token); } @@ -138,6 +151,7 @@ public class Application { 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(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" token: ").append(toIndentedString(token)).append("\n"); sb.append("}"); 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 b4753fc..21f9988 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 @@ -2,7 +2,7 @@ * 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) * - * OpenAPI spec version: 1.0.4 + * OpenAPI spec version: 1.0.6 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -27,7 +27,7 @@ import java.io.IOException; * 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).") -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-11-12T21:00:23.670+01:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2019-02-17T19:42:51.206+01:00") public class Client { @SerializedName("id") private Integer id = null; 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 28cc7d0..c77a7c8 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 @@ -2,7 +2,7 @@ * 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) * - * OpenAPI spec version: 1.0.4 + * OpenAPI spec version: 1.0.6 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -27,7 +27,7 @@ import java.io.IOException; * The Error contains error relevant information. */ @ApiModel(description = "The Error contains error relevant information.") -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-11-12T21:00:23.670+01:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2019-02-17T19:42:51.206+01:00") public class Error { @SerializedName("error") private String error = null; 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 576795b..eab6a97 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 @@ -2,7 +2,7 @@ * 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) * - * OpenAPI spec version: 1.0.4 + * OpenAPI spec version: 1.0.6 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -22,13 +22,16 @@ import com.google.gson.stream.JsonWriter; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import org.threeten.bp.OffsetDateTime; /** - * The Message holds information about a message which was sent by an Application. + * The MessageExternal holds information about a message which was sent by an Application. */ -@ApiModel(description = "The Message holds information about a message which was sent by an Application.") -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-11-12T21:00:23.670+01:00") +@ApiModel(description = "The MessageExternal holds information about a message which was sent by an Application.") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2019-02-17T19:42:51.206+01:00") public class Message { @SerializedName("appid") private Integer appid = null; @@ -36,6 +39,9 @@ public class Message { @SerializedName("date") private OffsetDateTime date = null; + @SerializedName("extras") + private Map extras = null; + @SerializedName("id") private Integer id = null; @@ -66,6 +72,32 @@ public class Message { return date; } + public Message extras(Map extras) { + this.extras = extras; + return this; + } + + public Message putExtrasItem(String key, Object extrasItem) { + if (this.extras == null) { + this.extras = new HashMap(); + } + this.extras.put(key, extrasItem); + return this; + } + + /** + * The extra data sent along the message. The extra fields are stored in a key-value scheme. Only accepted in CreateMessage requests with application/json content-type. The keys should be in the following format: &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.") + public Map getExtras() { + return extras; + } + + public void setExtras(Map extras) { + this.extras = extras; + } + /** * The message id. * @return id @@ -120,7 +152,7 @@ public class Message { * The title of the message. * @return title **/ - @ApiModelProperty(example = "Backup", required = true, value = "The title of the message.") + @ApiModelProperty(example = "Backup", value = "The title of the message.") public String getTitle() { return title; } @@ -141,6 +173,7 @@ public class Message { Message message = (Message) o; return Objects.equals(this.appid, message.appid) && Objects.equals(this.date, message.date) && + Objects.equals(this.extras, message.extras) && Objects.equals(this.id, message.id) && Objects.equals(this.message, message.message) && Objects.equals(this.priority, message.priority) && @@ -149,7 +182,7 @@ public class Message { @Override public int hashCode() { - return Objects.hash(appid, date, id, message, priority, title); + return Objects.hash(appid, date, extras, id, message, priority, title); } @@ -160,6 +193,7 @@ public class Message { sb.append(" appid: ").append(toIndentedString(appid)).append("\n"); sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" extras: ").append(toIndentedString(extras)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" message: ").append(toIndentedString(message)).append("\n"); sb.append(" priority: ").append(toIndentedString(priority)).append("\n"); 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 2c3d148..cf8fe4b 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 @@ -2,7 +2,7 @@ * 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) * - * OpenAPI spec version: 1.0.4 + * OpenAPI spec version: 1.0.6 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -31,7 +31,7 @@ import java.util.List; * Wrapper for the paging and the messages */ @ApiModel(description = "Wrapper for the paging and the messages") -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-11-12T21:00:23.670+01:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2019-02-17T19:42:51.206+01:00") public class PagedMessages { @SerializedName("messages") private List messages = new ArrayList(); 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 69241f3..7a475b6 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 @@ -2,7 +2,7 @@ * 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) * - * OpenAPI spec version: 1.0.4 + * OpenAPI spec version: 1.0.6 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -27,7 +27,7 @@ import java.io.IOException; * The Paging holds holds information about the limit and making requests to the next page. */ @ApiModel(description = "The Paging holds holds information about the limit and making requests to the next page.") -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-11-12T21:00:23.670+01:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2019-02-17T19:42:51.206+01:00") public class Paging { @SerializedName("limit") private Long limit = null; 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 new file mode 100644 index 0000000..e486fca --- /dev/null +++ b/client/src/main/java/com/github/gotify/client/model/PluginConf.java @@ -0,0 +1,231 @@ +/* + * 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) + * + * OpenAPI spec version: 1.0.6 + * + * + * 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 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 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.") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2019-02-17T19:42:51.206+01:00") +public class PluginConf { + @SerializedName("author") + private String author = null; + + @SerializedName("capabilities") + private List capabilities = new ArrayList(); + + @SerializedName("enabled") + private Boolean enabled = null; + + @SerializedName("id") + private Integer id = null; + + @SerializedName("license") + private String license = null; + + @SerializedName("modulePath") + private String modulePath = null; + + @SerializedName("name") + private String name = null; + + @SerializedName("token") + private String token = null; + + @SerializedName("website") + private String website = null; + + /** + * The author of the plugin. + * @return author + **/ + @ApiModelProperty(example = "jmattheis", value = "The author of the plugin.") + public String getAuthor() { + return author; + } + + public PluginConf capabilities(List capabilities) { + this.capabilities = capabilities; + return this; + } + + public PluginConf addCapabilitiesItem(String capabilitiesItem) { + this.capabilities.add(capabilitiesItem); + return this; + } + + /** + * Capabilities the plugin provides + * @return capabilities + **/ + @ApiModelProperty(example = "[\"webhook\",\"display\"]", required = true, value = "Capabilities the plugin provides") + public List getCapabilities() { + return capabilities; + } + + public void setCapabilities(List capabilities) { + this.capabilities = capabilities; + } + + public PluginConf enabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Whether the plugin instance is enabled. + * @return enabled + **/ + @ApiModelProperty(example = "true", required = true, value = "Whether the plugin instance is enabled.") + public Boolean isEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + /** + * The plugin id. + * @return id + **/ + @ApiModelProperty(example = "25", required = true, value = "The plugin id.") + public Integer getId() { + return id; + } + + /** + * The license of the plugin. + * @return license + **/ + @ApiModelProperty(example = "MIT", value = "The license of the plugin.") + public String getLicense() { + return license; + } + + /** + * 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.") + public String getModulePath() { + return modulePath; + } + + /** + * The plugin name. + * @return name + **/ + @ApiModelProperty(example = "RSS poller", required = true, value = "The plugin name.") + public String getName() { + return name; + } + + public PluginConf token(String token) { + this.token = token; + return this; + } + + /** + * The user name. For login. + * @return token + **/ + @ApiModelProperty(example = "P1234", required = true, value = "The user name. For login.") + public String getToken() { + return token; + } + + public void setToken(String token) { + this.token = token; + } + + /** + * The website of the plugin. + * @return website + **/ + @ApiModelProperty(example = "gotify.net", value = "The website of the plugin.") + public String getWebsite() { + return website; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PluginConf pluginConf = (PluginConf) o; + return Objects.equals(this.author, pluginConf.author) && + Objects.equals(this.capabilities, pluginConf.capabilities) && + Objects.equals(this.enabled, pluginConf.enabled) && + Objects.equals(this.id, pluginConf.id) && + Objects.equals(this.license, pluginConf.license) && + Objects.equals(this.modulePath, pluginConf.modulePath) && + Objects.equals(this.name, pluginConf.name) && + Objects.equals(this.token, pluginConf.token) && + Objects.equals(this.website, pluginConf.website); + } + + @Override + public int hashCode() { + return Objects.hash(author, capabilities, enabled, id, license, modulePath, name, token, website); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PluginConf {\n"); + + sb.append(" author: ").append(toIndentedString(author)).append("\n"); + sb.append(" capabilities: ").append(toIndentedString(capabilities)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" license: ").append(toIndentedString(license)).append("\n"); + sb.append(" modulePath: ").append(toIndentedString(modulePath)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" token: ").append(toIndentedString(token)).append("\n"); + sb.append(" website: ").append(toIndentedString(website)).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 1539e02..240db9e 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 @@ -2,7 +2,7 @@ * 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) * - * OpenAPI spec version: 1.0.4 + * OpenAPI spec version: 1.0.6 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -27,7 +27,7 @@ import java.io.IOException; * The User holds information about permission and other stuff. */ @ApiModel(description = "The User holds information about permission and other stuff.") -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-11-12T21:00:23.670+01:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2019-02-17T19:42:51.206+01:00") public class User { @SerializedName("admin") private Boolean admin = null; 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 278603e..1bfb387 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 @@ -2,7 +2,7 @@ * 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) * - * OpenAPI spec version: 1.0.4 + * OpenAPI spec version: 1.0.6 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -27,7 +27,7 @@ import java.io.IOException; * The Password for updating the user. */ @ApiModel(description = "The Password for updating the user.") -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-11-12T21:00:23.670+01:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2019-02-17T19:42:51.206+01:00") public class UserPass { @SerializedName("pass") private String pass = null; diff --git a/client/src/main/java/com/github/gotify/client/model/UserWithPass.java b/client/src/main/java/com/github/gotify/client/model/UserWithPass.java index 8078a60..c6f97e5 100644 --- a/client/src/main/java/com/github/gotify/client/model/UserWithPass.java +++ b/client/src/main/java/com/github/gotify/client/model/UserWithPass.java @@ -2,7 +2,7 @@ * 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) * - * OpenAPI spec version: 1.0.4 + * OpenAPI spec version: 1.0.6 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -27,7 +27,7 @@ import java.io.IOException; * The UserWithPass holds information about the credentials and other stuff. */ @ApiModel(description = "The UserWithPass holds information about the credentials and other stuff.") -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-11-12T21:00:23.670+01:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2019-02-17T19:42:51.206+01:00") public class UserWithPass { @SerializedName("admin") private Boolean admin = null; 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 043c416..7d78707 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 @@ -2,7 +2,7 @@ * 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) * - * OpenAPI spec version: 1.0.4 + * OpenAPI spec version: 1.0.6 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -27,7 +27,7 @@ import java.io.IOException; * VersionInfo Model */ @ApiModel(description = "VersionInfo Model") -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-11-12T21:00:23.670+01:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2019-02-17T19:42:51.206+01:00") public class VersionInfo { @SerializedName("buildDate") private String buildDate = null; diff --git a/client/src/test/java/com/github/gotify/client/api/TokenApiTest.java b/client/src/test/java/com/github/gotify/client/api/ApplicationApiTest.java similarity index 64% rename from client/src/test/java/com/github/gotify/client/api/TokenApiTest.java rename to client/src/test/java/com/github/gotify/client/api/ApplicationApiTest.java index 2003247..78659fd 100644 --- a/client/src/test/java/com/github/gotify/client/api/TokenApiTest.java +++ b/client/src/test/java/com/github/gotify/client/api/ApplicationApiTest.java @@ -2,7 +2,6 @@ package com.github.gotify.client.api; import com.github.gotify.client.ApiClient; import com.github.gotify.client.model.Application; -import com.github.gotify.client.model.Client; import com.github.gotify.client.model.Error; import java.io.File; import org.junit.Before; @@ -14,15 +13,15 @@ import java.util.List; import java.util.Map; /** - * API tests for TokenApi + * API tests for ApplicationApi */ -public class TokenApiTest { +public class ApplicationApiTest { - private TokenApi api; + private ApplicationApi api; @Before public void setup() { - api = new ApiClient().createService(TokenApi.class); + api = new ApiClient().createService(ApplicationApi.class); } /** @@ -37,18 +36,6 @@ public class TokenApiTest { // TODO: test validations } - /** - * Create a client. - * - * - */ - @Test - public void createClientTest() { - Client body = null; - // Client response = api.createClient(body); - - // TODO: test validations - } /** * Delete an application. * @@ -61,18 +48,6 @@ public class TokenApiTest { // TODO: test validations } - /** - * Delete a client. - * - * - */ - @Test - public void deleteClientTest() { - Integer id = null; - // Void response = api.deleteClient(id); - - // TODO: test validations - } /** * Return all applications. * @@ -85,20 +60,22 @@ public class TokenApiTest { // TODO: test validations } /** - * Return all clients. + * Update an application. * * */ @Test - public void getClientsTest() { - // List response = api.getClients(); + public void updateApplicationTest() { + Application body = null; + Integer id = null; + // Application response = api.updateApplication(body, id); // TODO: test validations } /** - * + * Upload an image for an application. * - * Upload an image for an application + * */ @Test public void uploadAppImageTest() { 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 new file mode 100644 index 0000000..e4e0791 --- /dev/null +++ b/client/src/test/java/com/github/gotify/client/api/ClientApiTest.java @@ -0,0 +1,61 @@ +package com.github.gotify.client.api; + +import com.github.gotify.client.ApiClient; +import com.github.gotify.client.model.Client; +import com.github.gotify.client.model.Error; +import org.junit.Before; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for ClientApi + */ +public class ClientApiTest { + + private ClientApi api; + + @Before + public void setup() { + api = new ApiClient().createService(ClientApi.class); + } + + /** + * Create a client. + * + * + */ + @Test + public void createClientTest() { + Client body = null; + // Client response = api.createClient(body); + + // TODO: test validations + } + /** + * Delete a client. + * + * + */ + @Test + public void deleteClientTest() { + Integer id = null; + // Void response = api.deleteClient(id); + + // TODO: test validations + } + /** + * Return all clients. + * + * + */ + @Test + public void getClientsTest() { + // List response = api.getClients(); + + // TODO: test validations + } +} 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 new file mode 100644 index 0000000..24887c6 --- /dev/null +++ b/client/src/test/java/com/github/gotify/client/api/PluginApiTest.java @@ -0,0 +1,97 @@ +package com.github.gotify.client.api; + +import com.github.gotify.client.ApiClient; +import com.github.gotify.client.model.Error; +import com.github.gotify.client.model.PluginConf; +import org.junit.Before; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for PluginApi + */ +public class PluginApiTest { + + private PluginApi api; + + @Before + public void setup() { + api = new ApiClient().createService(PluginApi.class); + } + + /** + * Disable a plugin. + * + * + */ + @Test + public void disablePluginTest() { + Integer id = null; + // Void response = api.disablePlugin(id); + + // TODO: test validations + } + /** + * Enable a plugin. + * + * + */ + @Test + public void enablePluginTest() { + Integer id = null; + // Void response = api.enablePlugin(id); + + // TODO: test validations + } + /** + * Get YAML configuration for Configurer plugin. + * + * + */ + @Test + public void getPluginConfigTest() { + Integer id = null; + // Object response = api.getPluginConfig(id); + + // TODO: test validations + } + /** + * Get display info for a Displayer plugin. + * + * + */ + @Test + public void getPluginDisplayTest() { + Integer id = null; + // String response = api.getPluginDisplay(id); + + // TODO: test validations + } + /** + * Return all plugins. + * + * + */ + @Test + public void getPluginsTest() { + // List response = api.getPlugins(); + + // TODO: test validations + } + /** + * Update YAML configuration for Configurer plugin. + * + * + */ + @Test + public void updatePluginConfigTest() { + Integer id = null; + // Void response = api.updatePluginConfig(id); + + // TODO: test validations + } +}