Files
maptology/testing/api-client/docs/ShareApi.md
T
Ole e3935842c7
lbs-gitea/maptology/master There was a failure building this commit
move generated client code in the projects source folder & successfully create devices
2018-01-25 01:33:33 +01:00

8.0 KiB

ShareApi

All URIs are relative to http://localhost/api

Method HTTP request Description
createShare POST /shares Creates a new share.
deleteShare DELETE /shares/{id} Delete a share.
getShare GET /shares/{id} Returns a share.
getShareInfo GET /shares/{token}/info Get a share info by its secret token.
getShareLocation GET /shares/{token}/location Get a shared location by its secret token.
setShare PUT /shares/{id} Updates an existing share.

createShare

Share createShare(body)

Creates a new share.

Example

// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.ShareApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: device
ApiKeyAuth device = (ApiKeyAuth) defaultClient.getAuthentication("device");
device.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//device.setApiKeyPrefix("Token");

ShareApi apiInstance = new ShareApi();
ShareInfo body = new ShareInfo(); // ShareInfo | Necessary data from to create a share.
try {
    Share result = apiInstance.createShare(body);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling ShareApi#createShare");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
body ShareInfo Necessary data from to create a share.

Return type

Share

Authorization

device

HTTP request headers

  • Content-Type: application/json, application/xml
  • Accept: application/json, application/xml

deleteShare

deleteShare(id)

Delete a share.

Example

// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.ShareApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: device
ApiKeyAuth device = (ApiKeyAuth) defaultClient.getAuthentication("device");
device.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//device.setApiKeyPrefix("Token");

ShareApi apiInstance = new ShareApi();
Long id = 789L; // Long | The share id.
try {
    apiInstance.deleteShare(id);
} catch (ApiException e) {
    System.err.println("Exception when calling ShareApi#deleteShare");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
id Long The share id.

Return type

null (empty response body)

Authorization

device

HTTP request headers

  • Content-Type: application/json, application/xml
  • Accept: application/json, application/xml

getShare

Share getShare(id)

Returns a share.

Example

// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.ShareApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: device
ApiKeyAuth device = (ApiKeyAuth) defaultClient.getAuthentication("device");
device.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//device.setApiKeyPrefix("Token");

ShareApi apiInstance = new ShareApi();
Long id = 789L; // Long | The share id.
try {
    Share result = apiInstance.getShare(id);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling ShareApi#getShare");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
id Long The share id.

Return type

Share

Authorization

device

HTTP request headers

  • Content-Type: application/json, application/xml
  • Accept: application/json, application/xml

getShareInfo

ShareInfo getShareInfo(token)

Get a share info by its secret token.

Example

// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.ShareApi;


ShareApi apiInstance = new ShareApi();
String token = "token_example"; // String | The secret token.
try {
    ShareInfo result = apiInstance.getShareInfo(token);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling ShareApi#getShareInfo");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
token String The secret token.

Return type

ShareInfo

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, application/xml
  • Accept: application/json, application/xml

getShareLocation

Location getShareLocation(token)

Get a shared location by its secret token.

Example

// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.ShareApi;


ShareApi apiInstance = new ShareApi();
String token = "token_example"; // String | The secret token.
try {
    Location result = apiInstance.getShareLocation(token);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling ShareApi#getShareLocation");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
token String The secret token.

Return type

Location

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, application/xml
  • Accept: application/json, application/xml

setShare

Share setShare(id, body)

Updates an existing share.

Example

// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.ShareApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: device
ApiKeyAuth device = (ApiKeyAuth) defaultClient.getAuthentication("device");
device.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//device.setApiKeyPrefix("Token");

ShareApi apiInstance = new ShareApi();
Long id = 789L; // Long | The share id.
Share body = new Share(); // Share | The new share to set.
try {
    Share result = apiInstance.setShare(id, body);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling ShareApi#setShare");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
id Long The share id.
body Share The new share to set. [optional]

Return type

Share

Authorization

device

HTTP request headers

  • Content-Type: application/json, application/xml
  • Accept: application/json, application/xml