Update client
This commit is contained in:
@@ -7,6 +7,7 @@ Method | HTTP request | Description
|
||||
[**createClient**](ClientApi.md#createClient) | **POST** client | Create a client.
|
||||
[**deleteClient**](ClientApi.md#deleteClient) | **DELETE** client/{id} | Delete a client.
|
||||
[**getClients**](ClientApi.md#getClients) | **GET** client | Return all clients.
|
||||
[**updateClient**](ClientApi.md#updateClient) | **PUT** client/{id} | Update a client.
|
||||
|
||||
|
||||
<a name="createClient"></a>
|
||||
@@ -108,7 +109,7 @@ clientTokenQuery.setApiKey("YOUR API KEY");
|
||||
//clientTokenQuery.setApiKeyPrefix("Token");
|
||||
|
||||
ClientApi apiInstance = new ClientApi();
|
||||
Integer id = 56; // Integer | the client id
|
||||
Long id = 789L; // Long | the client id
|
||||
try {
|
||||
Void result = apiInstance.deleteClient(id);
|
||||
System.out.println(result);
|
||||
@@ -122,7 +123,7 @@ try {
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**id** | **Integer**| the client id |
|
||||
**id** | **Long**| the client id |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -197,3 +198,69 @@ This endpoint does not need any parameter.
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
<a name="updateClient"></a>
|
||||
# **updateClient**
|
||||
> Client updateClient(body, id)
|
||||
|
||||
Update a client.
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import com.github.gotify.client.ApiClient;
|
||||
//import com.github.gotify.client.ApiException;
|
||||
//import com.github.gotify.client.Configuration;
|
||||
//import com.github.gotify.client.auth.*;
|
||||
//import com.github.gotify.client.api.ClientApi;
|
||||
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
|
||||
// Configure HTTP basic authorization: basicAuth
|
||||
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
|
||||
basicAuth.setUsername("YOUR USERNAME");
|
||||
basicAuth.setPassword("YOUR PASSWORD");
|
||||
|
||||
// Configure API key authorization: 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 update
|
||||
Long id = 789L; // Long | the client id
|
||||
try {
|
||||
Client result = apiInstance.updateClient(body, id);
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling ClientApi#updateClient");
|
||||
e.printStackTrace();
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Client**](Client.md)| the client to update |
|
||||
**id** | **Long**| the client id |
|
||||
|
||||
### 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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user