lenientDatetimeFormat is enabled.
+ */
+ public static final String LENIENT_DATETIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSSZ";
+
+ private String basePath = "http://localhost/api";
+ private boolean lenientOnJson = false;
+ private boolean debugging = false;
+ private MapparseDatetime.
+ this.lenientDatetimeFormat = true;
+
+ // Set default User-Agent.
+ setUserAgent("Swagger-Codegen/1.0.0/java");
+
+ // Setup authentications (key: authentication name, value: authentication).
+ authentications = new HashMapdateFormat supports these ISO 8601 date formats:
+ * 2015-08-16
+ * 2015-8-16
+ * @param str String to be parsed
+ * @return Date
+ */
+ public Date parseDate(String str) {
+ if (str == null)
+ return null;
+ try {
+ return dateFormat.parse(str);
+ } catch (ParseException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ /**
+ * Parse the given datetime string into Date object.
+ * When lenientDatetimeFormat is enabled, the following ISO 8601 datetime formats are supported:
+ * 2015-08-16T08:20:05Z
+ * 2015-8-16T8:20:05Z
+ * 2015-08-16T08:20:05+00:00
+ * 2015-08-16T08:20:05+0000
+ * 2015-08-16T08:20:05.376Z
+ * 2015-08-16T08:20:05.376+00:00
+ * 2015-08-16T08:20:05.376+00
+ * Note: The 3-digit milli-seconds is optional. Time zone is required and can be in one of
+ * these formats:
+ * Z (same with +0000)
+ * +08:00 (same with +0800)
+ * -02 (same with -0200)
+ * -0200
+ * @see ISO 8601
+ * @param str Date time string to be parsed
+ * @return Date representation of the string
+ */
+ public Date parseDatetime(String str) {
+ if (str == null)
+ return null;
+
+ DateFormat format;
+ if (lenientDatetimeFormat) {
+ /*
+ * When lenientDatetimeFormat is enabled, normalize the date string
+ * into LENIENT_DATETIME_FORMAT to support various formats
+ * defined by ISO 8601.
+ */
+ // normalize time zone
+ // trailing "Z": 2015-08-16T08:20:05Z => 2015-08-16T08:20:05+0000
+ str = str.replaceAll("[zZ]\\z", "+0000");
+ // remove colon in time zone: 2015-08-16T08:20:05+00:00 => 2015-08-16T08:20:05+0000
+ str = str.replaceAll("([+-]\\d{2}):(\\d{2})\\z", "$1$2");
+ // expand time zone: 2015-08-16T08:20:05+00 => 2015-08-16T08:20:05+0000
+ str = str.replaceAll("([+-]\\d{2})\\z", "$100");
+ // add milliseconds when missing
+ // 2015-08-16T08:20:05+0000 => 2015-08-16T08:20:05.000+0000
+ str = str.replaceAll("(:\\d{1,2})([+-]\\d{4})\\z", "$1.000$2");
+ format = new SimpleDateFormat(LENIENT_DATETIME_FORMAT);
+ } else {
+ format = this.datetimeFormat;
+ }
+
+ try {
+ return format.parse(str);
+ } catch (ParseException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ /*
+ * Parse date or date time in string format into Date object.
+ *
+ * @param str Date time string to be parsed
+ * @return Date representation of the string
+ */
+ public Date parseDateOrDatetime(String str) {
+ if (str == null)
+ return null;
+ else if (str.length() <= dateLength)
+ return parseDate(str);
+ else
+ return parseDatetime(str);
+ }
+
+ /**
+ * Format the given Date object into string (Date format).
+ *
+ * @param date Date object
+ * @return Formatted date in string representation
+ */
+ public String formatDate(Date date) {
+ return dateFormat.format(date);
+ }
+
+ /**
+ * Format the given Date object into string (Datetime format).
+ *
+ * @param date Date object
+ * @return Formatted datetime in string representation
+ */
+ public String formatDatetime(Date date) {
+ return datetimeFormat.format(date);
+ }
+
+ /**
+ * Get authentications (key: authentication name, value: authentication).
+ *
+ * @return Map of authentication objects
+ */
+ public Mapnull, i.e. using
+ * the system's default tempopary folder.
+ *
+ * @see createTempFile
+ * @return Temporary folder path
+ */
+ public String getTempFolderPath() {
+ return tempFolderPath;
+ }
+
+ /**
+ * Set the tempoaray folder path (for downloading files)
+ *
+ * @param tempFolderPath Temporary folder path
+ * @return ApiClient
+ */
+ public ApiClient setTempFolderPath(String tempFolderPath) {
+ this.tempFolderPath = tempFolderPath;
+ return this;
+ }
+
+ /**
+ * Get connection timeout (in milliseconds).
+ *
+ * @return Timeout in milliseconds
+ */
+ public int getConnectTimeout() {
+ return httpClient.getConnectTimeout();
+ }
+
+ /**
+ * Sets the connect timeout (in milliseconds).
+ * A value of 0 means no timeout, otherwise values must be between 1 and
+ *
+ * @param connectionTimeout connection timeout in milliseconds
+ * @return Api client
+ */
+ public ApiClient setConnectTimeout(int connectionTimeout) {
+ httpClient.setConnectTimeout(connectionTimeout, TimeUnit.MILLISECONDS);
+ return this;
+ }
+
+ /**
+ * Format the given parameter object into string.
+ *
+ * @param param Parameter
+ * @return String representation of the parameter
+ */
+ public String parameterToString(Object param) {
+ if (param == null) {
+ return "";
+ } else if (param instanceof Date) {
+ return formatDatetime((Date) param);
+ } else if (param instanceof Collection) {
+ StringBuilder b = new StringBuilder();
+ for (Object o : (Collection)param) {
+ if (b.length() > 0) {
+ b.append(",");
+ }
+ b.append(String.valueOf(o));
+ }
+ return b.toString();
+ } else {
+ return String.valueOf(param);
+ }
+ }
+
+ /**
+ * Format to {@code Pair} objects.
+ *
+ * @param collectionFormat collection format (e.g. csv, tsv)
+ * @param name Name
+ * @param value Value
+ * @return A list of Pair objects
+ */
+ public List+ * Note: This might be replaced by utility method from commons-lang or guava someday + * if one of those libraries is added as dependency. + *
+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) return ""; + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } +} diff --git a/testing/api-client/src/main/java/io/swagger/client/api/DefaultApi.java b/testing/api-client/src/main/java/io/swagger/client/api/DefaultApi.java new file mode 100644 index 0000000..0062e11 --- /dev/null +++ b/testing/api-client/src/main/java/io/swagger/client/api/DefaultApi.java @@ -0,0 +1,6793 @@ +/* + * Maptology Service + * Maptology Service + * + * OpenAPI spec version: 0.0.1-SNAPSHOT + * Contact: nes-admin@uni-due.de + * + * 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 io.swagger.client.api; + +import io.swagger.client.ApiCallback; +import io.swagger.client.ApiClient; +import io.swagger.client.ApiException; +import io.swagger.client.ApiResponse; +import io.swagger.client.Configuration; +import io.swagger.client.Pair; +import io.swagger.client.ProgressRequestBody; +import io.swagger.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.swagger.client.model.BuildVersion; +import io.swagger.client.model.Device; +import io.swagger.client.model.DeviceHandle; +import io.swagger.client.model.DeviceInfo; +import io.swagger.client.model.DevicePage; +import io.swagger.client.model.EntityStatistic; +import io.swagger.client.model.LoadStatistic; +import io.swagger.client.model.Location; +import io.swagger.client.model.LocationUpdate; +import io.swagger.client.model.LogMessage; +import io.swagger.client.model.Notice; +import io.swagger.client.model.NoticePage; +import io.swagger.client.model.Place; +import io.swagger.client.model.PlacePage; +import io.swagger.client.model.Privilege; +import io.swagger.client.model.PrivilegePage; +import io.swagger.client.model.Share; +import io.swagger.client.model.ShareInfo; +import io.swagger.client.model.User; +import io.swagger.client.model.UserPage; +import io.swagger.client.model.UserPassword; +import io.swagger.client.model.UserRegistration; +import io.swagger.client.model.Visit; +import io.swagger.client.model.VisitPage; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class DefaultApi { + private ApiClient apiClient; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Build call for addCurrentUserPrivilege + * @param share The token of the share. (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call addCurrentUserPrivilegeCall(String share, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/users/current/privileges"; + + List