diff --git a/.run/Run Demo.run.xml b/.run/Run Demo.run.xml index 764b3b9..8aa97dd 100644 --- a/.run/Run Demo.run.xml +++ b/.run/Run Demo.run.xml @@ -1,7 +1,7 @@ + + org.apache.maven.plugins + maven-assembly-plugin + 3.6.0 + + + + ${mainClass} + + + true + + + + jar-with-dependencies + + false + + + + make-assembly + package + + single + + + + diff --git a/sessionize-java-client-demo/src/main/java/software/xdev/Application.java b/sessionize-java-client-demo/src/main/java/software/xdev/Application.java new file mode 100644 index 0000000..52e6a13 --- /dev/null +++ b/sessionize-java-client-demo/src/main/java/software/xdev/Application.java @@ -0,0 +1,42 @@ +package software.xdev; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import software.xdev.sessionize.api.AllApi; +import software.xdev.sessionize.api.SessionsApi; +import software.xdev.sessionize.api.SpeakersApi; +import software.xdev.sessionize.client.ApiClient; + + +public final class Application +{ + public static final Logger LOG = LoggerFactory.getLogger(Application.class); + public static final String TEST_ENDPOINT_ID = "jl4ktls0"; + + @SuppressWarnings("java:S2629") // Just a demo + public static void main(final String[] args) + { + final CustomApiClient apiClient = new CustomApiClient(); + + LOG.info("*** Speakers-Endpoint ***"); + new SpeakersApi(apiClient).getAllSpeakers(TEST_ENDPOINT_ID) + .forEach(x -> LOG.info(x.toString())); + + LOG.info("*** Sessions-Endpoint ***"); + new SessionsApi(apiClient).getAllSessions(TEST_ENDPOINT_ID) + .forEach(x -> LOG.info(x.toString())); + + LOG.info("*** All-Endpoint ***"); + LOG.info(new AllApi(apiClient).getAll(TEST_ENDPOINT_ID).toString()); + } + + public static class CustomApiClient extends ApiClient + { + public CustomApiClient() + { + this.setConnectTimeout(30_000); + this.setUserAgent("Sessionize-Java-Client-Demo"); + } + } +} diff --git a/sessionize-java-client-demo/src/main/resources/log4j2.xml b/sessionize-java-client-demo/src/main/resources/log4j2.xml new file mode 100644 index 0000000..eb5bcc0 --- /dev/null +++ b/sessionize-java-client-demo/src/main/resources/log4j2.xml @@ -0,0 +1,20 @@ + + + + + + %d{HH:mm:ss} %-5p [%t] [%-25.25c] %m %n + + + + + + + + + + + + + + diff --git a/sessionize-java-client/pom.xml b/sessionize-java-client/pom.xml new file mode 100644 index 0000000..ef609a6 --- /dev/null +++ b/sessionize-java-client/pom.xml @@ -0,0 +1,388 @@ + + + 4.0.0 + + com.xdev-software + sessionize-java-client + 1.0.0-SNAPSHOT + jar + + sessionize-java-client + sessionize-java-client + https://github.com/xdev-software/sessionize-java-client + + + https://github.com/xdev-software/sessionize-java-client + https://github.com/xdev-software/sessionize-java-client.git + + + 2023 + + + XDEV Software + https://xdev.software + + + + + XDEV Software + XDEV Software + https://xdev.software + + + + + + Apache License, Version 2.0 + https://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + 17 + ${javaVersion} + + UTF-8 + UTF-8 + + + + src/generated/** + + + + + + + central + https://repo.maven.apache.org/maven2 + + false + + + + + + + + central + https://repo.maven.apache.org/maven2 + + false + + + + + + + ossrh + https://oss.sonatype.org/content/repositories/snapshots + + + ossrh + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + + + + com.fasterxml.jackson + jackson-bom + 2.15.2 + pom + import + + + + + + + + org.apache.httpcomponents.client5 + httpclient5 + 5.2.1 + + + + + com.fasterxml.jackson.core + jackson-core + + + com.fasterxml.jackson.core + jackson-annotations + + + com.fasterxml.jackson.core + jackson-databind + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + + + org.openapitools + jackson-databind-nullable + 0.2.6 + + + + jakarta.annotation + jakarta.annotation-api + 2.1.1 + + + + + + + com.mycila + license-maven-plugin + 4.2 + + + ${project.organization.url} + + + +
com/mycila/maven/plugin/license/templates/APACHE-2.txt
+ + src/main/java/** + src/test/java/** + +
+
+
+ + + first + + format + + process-sources + + +
+ + + org.apache.maven.plugins + maven-compiler-plugin + 3.11.0 + + ${maven.compiler.release} + + -proc:none + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.5.0 + + + attach-javadocs + verify + + jar + + + + + true + none + + + + org.apache.maven.plugins + maven-source-plugin + 3.3.0 + + + attach-sources + verify + + jar-no-fork + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.4.0 + + + generate-sources + + add-source + + + + src/generated/java + + + + + +
+
+ + + ossrh + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.1.0 + + + sign-artifacts + verify + + sign + + + + + + --pinentry-mode + loopback + + + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.13 + true + + ossrh + https://oss.sonatype.org/ + + 30 + true + + + + + + + openapi-generator + + software.xdev.sessionize + + ${project.basedir}/src/generated/java + src/gen + + ${project.basedir}/target/generated-sources/openapi/${openApiRelativeGeneratorDir} + + + + + + org.openapitools + openapi-generator-maven-plugin + 6.6.0 + + + + generate + + + ${project.basedir}/../openapi/openapi.yml + java + + ${openApiRelativeGeneratorDir} + apache-httpclient + ${basePackage}.api + ${basePackage}.model + ${basePackage}.client + + true + + false + + + true + + false + false + false + false + + + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.3.1 + + + copy-generated-resources + process-resources + + copy-resources + + + ${generatedDir} + + + ${openApiGeneratorDir} + + + + + + + + org.apache.maven.plugins + maven-clean-plugin + 3.3.1 + + + pre-generation-clean + initialize + + clean + + + true + + + ${generatedDir} + + + + + + post-generation-clean + process-resources + + clean + + + + + + + + +
diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/api/AllApi.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/api/AllApi.java new file mode 100644 index 0000000..6a88e16 --- /dev/null +++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/api/AllApi.java @@ -0,0 +1,130 @@ +/* + * Sessionize JSON-REST API + * Sessionize JSON-REST API documentation by XDEV Software + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package software.xdev.sessionize.api; + +import com.fasterxml.jackson.core.type.TypeReference; + +import software.xdev.sessionize.client.ApiException; +import software.xdev.sessionize.client.ApiClient; +import software.xdev.sessionize.client.Configuration; +import software.xdev.sessionize.model.*; +import software.xdev.sessionize.client.Pair; + +import software.xdev.sessionize.model.AllResult; + + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-26T17:30:53.867882+02:00[Europe/Berlin]") +public class AllApi { + + + private ApiClient apiClient; + + public AllApi() { + this(Configuration.getDefaultApiClient()); + } + + public AllApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * + * + * @param endpointId (required) + * @return AllResult + * @throws ApiException if fails to make API call + */ + public AllResult getAll(String endpointId) throws ApiException { + return this.getAll(endpointId, Collections.emptyMap()); + } + + + /** + * + * + * @param endpointId (required) + * @param additionalHeaders additionalHeaders for this call + * @return AllResult + * @throws ApiException if fails to make API call + */ + public AllResult getAll(String endpointId, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'endpointId' is set + if (endpointId == null) { + throw new ApiException(400, "Missing the required parameter 'endpointId' when calling getAll"); + } + + // create path and map variables + String localVarPath = "/api/v2/{endpointId}/view/All" + .replaceAll("\\{" + "endpointId" + "\\}", apiClient.escapeString(endpointId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + +} diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/api/SessionsApi.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/api/SessionsApi.java new file mode 100644 index 0000000..172a6cd --- /dev/null +++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/api/SessionsApi.java @@ -0,0 +1,130 @@ +/* + * Sessionize JSON-REST API + * Sessionize JSON-REST API documentation by XDEV Software + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package software.xdev.sessionize.api; + +import com.fasterxml.jackson.core.type.TypeReference; + +import software.xdev.sessionize.client.ApiException; +import software.xdev.sessionize.client.ApiClient; +import software.xdev.sessionize.client.Configuration; +import software.xdev.sessionize.model.*; +import software.xdev.sessionize.client.Pair; + +import software.xdev.sessionize.model.SessionGroup; + + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-26T17:30:53.867882+02:00[Europe/Berlin]") +public class SessionsApi { + + + private ApiClient apiClient; + + public SessionsApi() { + this(Configuration.getDefaultApiClient()); + } + + public SessionsApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * + * + * @param endpointId (required) + * @return List<SessionGroup> + * @throws ApiException if fails to make API call + */ + public List getAllSessions(String endpointId) throws ApiException { + return this.getAllSessions(endpointId, Collections.emptyMap()); + } + + + /** + * + * + * @param endpointId (required) + * @param additionalHeaders additionalHeaders for this call + * @return List<SessionGroup> + * @throws ApiException if fails to make API call + */ + public List getAllSessions(String endpointId, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'endpointId' is set + if (endpointId == null) { + throw new ApiException(400, "Missing the required parameter 'endpointId' when calling getAllSessions"); + } + + // create path and map variables + String localVarPath = "/api/v2/{endpointId}/view/Sessions" + .replaceAll("\\{" + "endpointId" + "\\}", apiClient.escapeString(endpointId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + TypeReference> localVarReturnType = new TypeReference>() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + +} diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/api/SpeakersApi.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/api/SpeakersApi.java new file mode 100644 index 0000000..888f524 --- /dev/null +++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/api/SpeakersApi.java @@ -0,0 +1,130 @@ +/* + * Sessionize JSON-REST API + * Sessionize JSON-REST API documentation by XDEV Software + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package software.xdev.sessionize.api; + +import com.fasterxml.jackson.core.type.TypeReference; + +import software.xdev.sessionize.client.ApiException; +import software.xdev.sessionize.client.ApiClient; +import software.xdev.sessionize.client.Configuration; +import software.xdev.sessionize.model.*; +import software.xdev.sessionize.client.Pair; + +import software.xdev.sessionize.model.Speaker; + + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-26T17:30:53.867882+02:00[Europe/Berlin]") +public class SpeakersApi { + + + private ApiClient apiClient; + + public SpeakersApi() { + this(Configuration.getDefaultApiClient()); + } + + public SpeakersApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * + * + * @param endpointId (required) + * @return List<Speaker> + * @throws ApiException if fails to make API call + */ + public List getAllSpeakers(String endpointId) throws ApiException { + return this.getAllSpeakers(endpointId, Collections.emptyMap()); + } + + + /** + * + * + * @param endpointId (required) + * @param additionalHeaders additionalHeaders for this call + * @return List<Speaker> + * @throws ApiException if fails to make API call + */ + public List getAllSpeakers(String endpointId, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'endpointId' is set + if (endpointId == null) { + throw new ApiException(400, "Missing the required parameter 'endpointId' when calling getAllSpeakers"); + } + + // create path and map variables + String localVarPath = "/api/v2/{endpointId}/view/Speakers" + .replaceAll("\\{" + "endpointId" + "\\}", apiClient.escapeString(endpointId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + TypeReference> localVarReturnType = new TypeReference>() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + +} diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/ApiClient.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/ApiClient.java new file mode 100644 index 0000000..cfa5793 --- /dev/null +++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/ApiClient.java @@ -0,0 +1,975 @@ +/* + * Sessionize JSON-REST API + * Sessionize JSON-REST API documentation by XDEV Software + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package software.xdev.sessionize.client; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.*; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import java.time.OffsetDateTime; +import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JavaType; +import org.openapitools.jackson.nullable.JsonNullableModule; + +import org.apache.hc.client5.http.cookie.BasicCookieStore; +import org.apache.hc.client5.http.cookie.Cookie; +import org.apache.hc.client5.http.entity.UrlEncodedFormEntity; +import org.apache.hc.client5.http.entity.mime.MultipartEntityBuilder; +import org.apache.hc.client5.http.impl.classic.CloseableHttpClient; +import org.apache.hc.client5.http.impl.classic.CloseableHttpResponse; +import org.apache.hc.client5.http.impl.classic.HttpClients; +import org.apache.hc.client5.http.impl.cookie.BasicClientCookie; +import org.apache.hc.client5.http.protocol.HttpClientContext; +import org.apache.hc.core5.http.ContentType; +import org.apache.hc.core5.http.Header; +import org.apache.hc.core5.http.HttpEntity; +import org.apache.hc.core5.http.HttpResponse; +import org.apache.hc.core5.http.HttpStatus; +import org.apache.hc.core5.http.NameValuePair; +import org.apache.hc.core5.http.ParseException; +import org.apache.hc.core5.http.io.entity.ByteArrayEntity; +import org.apache.hc.core5.http.io.entity.EntityUtils; +import org.apache.hc.core5.http.io.entity.FileEntity; +import org.apache.hc.core5.http.io.entity.StringEntity; +import org.apache.hc.core5.http.io.support.ClassicRequestBuilder; +import org.apache.hc.core5.http.message.BasicNameValuePair; + +import java.util.Collection; +import java.util.Collections; +import java.util.Map; +import java.util.Map.Entry; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Arrays; +import java.util.ArrayList; +import java.util.Date; +import java.util.TimeZone; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import java.net.URLEncoder; + +import java.io.File; +import java.io.InputStream; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.nio.charset.Charset; +import java.nio.charset.UnsupportedCharsetException; +import java.nio.file.Files; +import java.nio.file.StandardCopyOption; +import java.nio.file.Paths; +import java.lang.reflect.Type; +import java.net.URI; + +import java.text.DateFormat; + +import software.xdev.sessionize.client.auth.Authentication; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-26T17:30:53.867882+02:00[Europe/Berlin]") +public class ApiClient extends JavaTimeFormatter { + private Map defaultHeaderMap = new HashMap(); + private Map defaultCookieMap = new HashMap(); + private String basePath = "https://sessionize.com"; + protected List servers = new ArrayList(Arrays.asList( + new ServerConfiguration( + "https://sessionize.com", + "No description provided", + new HashMap() + ) + )); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + private boolean debugging = false; + private int connectionTimeout = 0; + + private CloseableHttpClient httpClient; + private ObjectMapper objectMapper; + protected String tempFolderPath = null; + + private Map authentications; + + private int statusCode; + private Map> responseHeaders; + + private DateFormat dateFormat; + + // Methods that can have a request body + private static List bodyMethods = Arrays.asList("POST", "PUT", "DELETE", "PATCH"); + + public ApiClient(CloseableHttpClient httpClient) { + objectMapper = new ObjectMapper(); + objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); + objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + objectMapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, false); + objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); + objectMapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); + objectMapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); + objectMapper.registerModule(new JavaTimeModule()); + objectMapper.registerModule(new JsonNullableModule()); + objectMapper.setDateFormat(ApiClient.buildDefaultDateFormat()); + + dateFormat = ApiClient.buildDefaultDateFormat(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/2.0/java"); + + // Setup authentications (key: authentication name, value: authentication). + authentications = new HashMap(); + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + + this.httpClient = httpClient; + } + + public ApiClient() { + this(HttpClients.createDefault()); + } + + public static DateFormat buildDefaultDateFormat() { + return new RFC3339DateFormat(); + } + + /** + * Returns the current object mapper used for JSON serialization/deserialization. + *

+ * Note: If you make changes to the object mapper, remember to set it back via + * setObjectMapper in order to trigger HTTP client rebuilding. + *

+ * @return Object mapper + */ + public ObjectMapper getObjectMapper() { + return objectMapper; + } + + /** + * Sets the object mapper. + * + * @param objectMapper object mapper + * @return API client + */ + public ApiClient setObjectMapper(ObjectMapper objectMapper) { + this.objectMapper = objectMapper; + return this; + } + + public CloseableHttpClient getHttpClient() { + return httpClient; + } + + /** + * Sets the HTTP client. + * + * @param httpClient HTTP client + * @return API client + */ + public ApiClient setHttpClient(CloseableHttpClient httpClient) { + this.httpClient = httpClient; + return this; + } + + public String getBasePath() { + return basePath; + } + + /** + * Sets the base path. + * + * @param basePath base path + * @return API client + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + this.serverIndex = null; + return this; + } + + public List getServers() { + return servers; + } + + /** + * Sets the server. + * + * @param servers a list of server configuration + * @return API client + */ + public ApiClient setServers(List servers) { + this.servers = servers; + return this; + } + + public Integer getServerIndex() { + return serverIndex; + } + + /** + * Sets the server index. + * + * @param serverIndex server index + * @return API client + */ + public ApiClient setServerIndex(Integer serverIndex) { + this.serverIndex = serverIndex; + return this; + } + + public Map getServerVariables() { + return serverVariables; + } + + /** + * Sets the server variables. + * + * @param serverVariables server variables + * @return API client + */ + public ApiClient setServerVariables(Map serverVariables) { + this.serverVariables = serverVariables; + return this; + } + + /** + * Gets the status code of the previous request + * + * @return Status code + */ + public int getStatusCode() { + return statusCode; + } + + /** + * Gets the response headers of the previous request + * @return Response headers + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get authentications (key: authentication name, value: authentication). + * @return Map of authentication + */ + public Map getAuthentications() { + return authentications; + } + + /** + * Get authentication for the given name. + * + * @param authName The authentication name + * @return The authentication, null if not found + */ + public Authentication getAuthentication(String authName) { + return authentications.get(authName); + } + + /** + * The path of temporary folder used to store downloaded files from endpoints + * with file response. The default value is null, i.e. using + * the system's default temporary folder. + * + * @return Temp folder path + */ + public String getTempFolderPath() { + return tempFolderPath; + } + + + + + + /** + * Set the User-Agent header's value (by adding to the default header map). + * @param userAgent User agent + * @return API client + */ + public ApiClient setUserAgent(String userAgent) { + addDefaultHeader("User-Agent", userAgent); + return this; + } + + /** + * Set temp folder path + * @param tempFolderPath Temp folder path + * @return API client + */ + public ApiClient setTempFolderPath(String tempFolderPath) { + this.tempFolderPath = tempFolderPath; + return this; + } + + /** + * Add a default header. + * + * @param key The header's key + * @param value The header's value + * @return API client + */ + public ApiClient addDefaultHeader(String key, String value) { + defaultHeaderMap.put(key, value); + return this; + } + + /** + * Add a default cookie. + * + * @param key The cookie's key + * @param value The cookie's value + * @return API client + */ + public ApiClient addDefaultCookie(String key, String value) { + defaultCookieMap.put(key, value); + return this; + } + + /** + * Check that whether debugging is enabled for this API client. + * @return True if debugging is on + */ + public boolean isDebugging() { + return debugging; + } + + /** + * Enable/disable debugging for this API client. + * + * @param debugging To enable (true) or disable (false) debugging + * @return API client + */ + public ApiClient setDebugging(boolean debugging) { + // TODO: implement debugging mode + this.debugging = debugging; + return this; + } + + /** + * Connect timeout (in milliseconds). + * @return Connection timeout + */ + public int getConnectTimeout() { + return connectionTimeout; + } + + /** + * Set the connect timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link Integer#MAX_VALUE}. + * @param connectionTimeout Connection timeout in milliseconds + * @return API client + */ + public ApiClient setConnectTimeout(int connectionTimeout) { + this.connectionTimeout = connectionTimeout; + return this; + } + + /** + * Get the date format used to parse/format date parameters. + * @return Date format + */ + public DateFormat getDateFormat() { + return dateFormat; + } + + /** + * Set the date format used to parse/format date parameters. + * @param dateFormat Date format + * @return API client + */ + public ApiClient setDateFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + // Also set the date format for model (de)serialization with Date properties. + this.objectMapper.setDateFormat((DateFormat) dateFormat.clone()); + return this; + } + + /** + * Parse the given string into Date object. + * @param str String + * @return Date + */ + public Date parseDate(String str) { + try { + return dateFormat.parse(str); + } catch (java.text.ParseException e) { + throw new RuntimeException(e); + } + } + + /** + * Format the given Date object into string. + * @param date Date + * @return Date in string format + */ + public String formatDate(Date date) { + return dateFormat.format(date); + } + + /** + * Format the given parameter object into string. + * @param param Object + * @return Object in string format + */ + public String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date) { + return formatDate((Date) param); + } else if (param instanceof OffsetDateTime) { + return formatOffsetDateTime((OffsetDateTime) 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); + } + } + + /** + * Formats the specified query parameter to a list containing a single {@code Pair} object. + * + * Note that {@code value} must not be a collection. + * + * @param name The name of the parameter. + * @param value The value of the parameter. + * @return A list containing a single {@code Pair} object. + */ + public List parameterToPair(String name, Object value) { + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null || value instanceof Collection) { + return params; + } + + params.add(new Pair(name, escapeString(parameterToString(value)))); + return params; + } + + /** + * Formats the specified collection query parameters to a list of {@code Pair} objects. + * + * Note that the values of each of the returned Pair objects are percent-encoded. + * + * @param collectionFormat The collection format of the parameter. + * @param name The name of the parameter. + * @param value The value of the parameter. + * @return A list of {@code Pair} objects. + */ + public List parameterToPairs(String collectionFormat, String name, Collection value) { + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null) { + return params; + } + + // create the params based on the collection format + if ("multi".equals(collectionFormat)) { + for (Object item : value) { + params.add(new Pair(name, escapeString(parameterToString(item)))); + } + return params; + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + // escape all delimiters except commas, which are URI reserved + // characters + if ("ssv".equals(collectionFormat)) { + delimiter = escapeString(" "); + } else if ("tsv".equals(collectionFormat)) { + delimiter = escapeString("\t"); + } else if ("pipes".equals(collectionFormat)) { + delimiter = escapeString("|"); + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(escapeString(parameterToString(item))); + } + + params.add(new Pair(name, sb.substring(delimiter.length()))); + + return params; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime MIME + * @return True if MIME type is boolean + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * or matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0 || contentTypes[0].equals("*/*")) { + return "application/json"; + } + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * @param str String + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Transforms response headers into map. + * + * @param headers HTTP headers + * @return a map of string array + */ + protected Map> transformResponseHeaders(Header[] headers) { + Map> headersMap = new HashMap<>(); + for (Header header : headers) { + List valuesList = headersMap.get(header.getName()); + if (valuesList != null) { + valuesList.add(header.getValue()); + } else { + valuesList = new ArrayList<>(); + valuesList.add(header.getValue()); + headersMap.put(header.getName(), valuesList); + } + } + return headersMap; + } + + /** + * Parse content type object from header value + */ + private ContentType getContentType(String headerValue) throws ApiException { + try { + return ContentType.parse(headerValue); + } catch (UnsupportedCharsetException e) { + throw new ApiException("Could not parse content type " + headerValue); + } + } + + /** + * Get content type of a response or null if one was not provided + */ + private String getResponseMimeType(HttpResponse response) throws ApiException { + Header contentTypeHeader = response.getFirstHeader("Content-Type"); + if (contentTypeHeader != null) { + return getContentType(contentTypeHeader.getValue()).getMimeType(); + } + return null; + } + + /** + * Serialize the given Java object into string according the given + * Content-Type (only JSON is supported for now). + * @param obj Object + * @param contentType Content type + * @param formParams Form parameters + * @return Object + * @throws ApiException API exception + */ + public HttpEntity serialize(Object obj, Map formParams, ContentType contentType) throws ApiException { + String mimeType = contentType.getMimeType(); + if (isJsonMime(mimeType)) { + try { + return new StringEntity(objectMapper.writeValueAsString(obj), contentType); + } catch (JsonProcessingException e) { + throw new ApiException(e); + } + } else if (mimeType.equals(ContentType.MULTIPART_FORM_DATA.getMimeType())) { + MultipartEntityBuilder multiPartBuilder = MultipartEntityBuilder.create(); + for (Entry paramEntry : formParams.entrySet()) { + Object value = paramEntry.getValue(); + if (value instanceof File) { + multiPartBuilder.addBinaryBody(paramEntry.getKey(), (File) value); + } else if (value instanceof byte[]) { + multiPartBuilder.addBinaryBody(paramEntry.getKey(), (byte[]) value); + } else { + Charset charset = contentType.getCharset(); + if (charset != null) { + ContentType customContentType = ContentType.create(ContentType.TEXT_PLAIN.getMimeType(), charset); + multiPartBuilder.addTextBody(paramEntry.getKey(), parameterToString(paramEntry.getValue()), + customContentType); + } else { + multiPartBuilder.addTextBody(paramEntry.getKey(), parameterToString(paramEntry.getValue())); + } + } + } + return multiPartBuilder.build(); + } else if (mimeType.equals(ContentType.APPLICATION_FORM_URLENCODED.getMimeType())) { + List formValues = new ArrayList<>(); + for (Entry paramEntry : formParams.entrySet()) { + formValues.add(new BasicNameValuePair(paramEntry.getKey(), parameterToString(paramEntry.getValue()))); + } + return new UrlEncodedFormEntity(formValues, contentType.getCharset()); + } else { + // Handle files with unknown content type + if (obj instanceof File) { + return new FileEntity((File) obj, contentType); + } else if (obj instanceof byte[]) { + return new ByteArrayEntity((byte[]) obj, contentType); + } + throw new ApiException("Serialization for content type '" + contentType + "' not supported"); + } + } + + /** + * Deserialize response body to Java object according to the Content-Type. + * + * @param Type + * @param response Response + * @param valueType Return type + * @return Deserialized object + * @throws ApiException API exception + * @throws IOException IO exception + */ + @SuppressWarnings("unchecked") + public T deserialize(CloseableHttpResponse response, TypeReference valueType) throws ApiException, IOException, ParseException { + if (valueType == null) { + return null; + } + HttpEntity entity = response.getEntity(); + Type valueRawType = valueType.getType(); + if (valueRawType.equals(byte[].class)) { + return (T) EntityUtils.toByteArray(entity); + } else if (valueRawType.equals(File.class)) { + return (T) downloadFileFromResponse(response); + } + String mimeType = getResponseMimeType(response); + if (mimeType == null || isJsonMime(mimeType)) { + // Assume json if no mime type + // convert input stream to string + java.util.Scanner s = new java.util.Scanner(entity.getContent()).useDelimiter("\\A"); + String content = (String) (s.hasNext() ? s.next() : ""); + + if ("".equals(content)) { // returns null for empty body + return null; + } + + return objectMapper.readValue(content, valueType); + } else if ("text/plain".equalsIgnoreCase(mimeType)) { + // convert input stream to string + java.util.Scanner s = new java.util.Scanner(entity.getContent()).useDelimiter("\\A"); + return (T) (s.hasNext() ? s.next() : ""); + } else { + throw new ApiException( + "Deserialization for content type '" + mimeType + "' not supported for type '" + valueType + "'", + response.getCode(), + responseHeaders, + EntityUtils.toString(entity) + ); + } + } + + private File downloadFileFromResponse(CloseableHttpResponse response) throws IOException { + Header contentDispositionHeader = response.getFirstHeader("Content-Disposition"); + String contentDisposition = contentDispositionHeader == null ? null : contentDispositionHeader.getValue(); + File file = prepareDownloadFile(contentDisposition); + Files.copy(response.getEntity().getContent(), file.toPath(), StandardCopyOption.REPLACE_EXISTING); + return file; + } + + protected File prepareDownloadFile(String contentDisposition) throws IOException { + String filename = null; + if (contentDisposition != null && !"".equals(contentDisposition)) { + // Get filename from the Content-Disposition header. + Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + Matcher matcher = pattern.matcher(contentDisposition); + if (matcher.find()) + filename = matcher.group(1); + } + + String prefix; + String suffix = null; + if (filename == null) { + prefix = "download-"; + suffix = ""; + } else { + int pos = filename.lastIndexOf('.'); + if (pos == -1) { + prefix = filename + "-"; + } else { + prefix = filename.substring(0, pos) + "-"; + suffix = filename.substring(pos); + } + // Files.createTempFile requires the prefix to be at least three characters long + if (prefix.length() < 3) + prefix = "download-"; + } + + if (tempFolderPath == null) + return Files.createTempFile(prefix, suffix).toFile(); + else + return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); + } + + /** + * Build full URL by concatenating base path, the given sub path and query parameters. + * + * @param path The sub path + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param urlQueryDeepObject URL query string of the deep object parameters + * @return The full URL + */ + private String buildUrl(String path, List queryParams, List collectionQueryParams, String urlQueryDeepObject) { + String baseURL; + if (serverIndex != null) { + if (serverIndex < 0 || serverIndex >= servers.size()) { + throw new ArrayIndexOutOfBoundsException(String.format( + "Invalid index %d when selecting the host settings. Must be less than %d", serverIndex, servers.size() + )); + } + baseURL = servers.get(serverIndex).URL(serverVariables); + } else { + baseURL = basePath; + } + + final StringBuilder url = new StringBuilder(); + url.append(baseURL).append(path); + + if (queryParams != null && !queryParams.isEmpty()) { + // support (constant) query string in `path`, e.g. "/posts?draft=1" + String prefix = path.contains("?") ? "&" : "?"; + for (Pair param : queryParams) { + if (param.getValue() != null) { + if (prefix != null) { + url.append(prefix); + prefix = null; + } else { + url.append("&"); + } + String value = parameterToString(param.getValue()); + // query parameter value already escaped as part of parameterToPair + url.append(escapeString(param.getName())).append("=").append(value); + } + } + } + + if (collectionQueryParams != null && !collectionQueryParams.isEmpty()) { + String prefix = url.toString().contains("?") ? "&" : "?"; + for (Pair param : collectionQueryParams) { + if (param.getValue() != null) { + if (prefix != null) { + url.append(prefix); + prefix = null; + } else { + url.append("&"); + } + String value = parameterToString(param.getValue()); + // collection query parameter value already escaped as part of parameterToPairs + url.append(escapeString(param.getName())).append("=").append(value); + } + } + } + + if (urlQueryDeepObject != null && urlQueryDeepObject.length() > 0) { + url.append(url.toString().contains("?") ? "&" : "?"); + url.append(urlQueryDeepObject); + } + + return url.toString(); + } + + protected boolean isSuccessfulStatus(int statusCode) { + return statusCode >= 200 && statusCode < 300; + } + + protected boolean isBodyAllowed(String method) { + return bodyMethods.contains(method); + } + + protected Cookie buildCookie(String key, String value, URI uri) { + BasicClientCookie cookie = new BasicClientCookie(key, value); + cookie.setDomain(uri.getHost()); + cookie.setPath("/"); + return cookie; + } + + protected T processResponse(CloseableHttpResponse response, TypeReference returnType) throws ApiException, IOException, ParseException { + statusCode = response.getCode(); + if (statusCode == HttpStatus.SC_NO_CONTENT) { + return null; + } + + responseHeaders = transformResponseHeaders(response.getHeaders()); + if (isSuccessfulStatus(statusCode)) { + return this.deserialize(response, returnType); + } else { + String message = EntityUtils.toString(response.getEntity()); + throw new ApiException(message, statusCode, responseHeaders, message); + } + } + + /** + * Invoke API by sending HTTP request with the given options. + * + * @param Type + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "POST", "PUT", and "DELETE" + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param urlQueryDeepObject A URL query string for deep object parameters + * @param body The request body object - if it is not binary, otherwise null + * @param headerParams The header parameters + * @param cookieParams The cookie parameters + * @param formParams The form parameters + * @param accept The request's Accept header + * @param contentType The request's Content-Type header + * @param authNames The authentications to apply + * @param returnType Return type + * @return The response body in type of string + * @throws ApiException API exception + */ + public T invokeAPI( + String path, + String method, + List queryParams, + List collectionQueryParams, + String urlQueryDeepObject, + Object body, + Map headerParams, + Map cookieParams, + Map formParams, + String accept, + String contentType, + String[] authNames, + TypeReference returnType) throws ApiException { + if (body != null && !formParams.isEmpty()) { + throw new ApiException("Cannot have body and form params"); + } + + updateParamsForAuth(authNames, queryParams, headerParams, cookieParams); + final String url = buildUrl(path, queryParams, collectionQueryParams, urlQueryDeepObject); + + ClassicRequestBuilder builder = ClassicRequestBuilder.create(method); + builder.setUri(url); + + if (accept != null) { + builder.addHeader("Accept", accept); + } + for (Entry keyValue : headerParams.entrySet()) { + builder.addHeader(keyValue.getKey(), keyValue.getValue()); + } + for (Map.Entry keyValue : defaultHeaderMap.entrySet()) { + if (!headerParams.containsKey(keyValue.getKey())) { + builder.addHeader(keyValue.getKey(), keyValue.getValue()); + } + } + + BasicCookieStore store = new BasicCookieStore(); + for (Entry keyValue : cookieParams.entrySet()) { + store.addCookie(buildCookie(keyValue.getKey(), keyValue.getValue(), builder.getUri())); + } + for (Entry keyValue : defaultCookieMap.entrySet()) { + if (!cookieParams.containsKey(keyValue.getKey())) { + store.addCookie(buildCookie(keyValue.getKey(), keyValue.getValue(), builder.getUri())); + } + } + + HttpClientContext context = HttpClientContext.create(); + context.setCookieStore(store); + + ContentType contentTypeObj = getContentType(contentType); + if (body != null || !formParams.isEmpty()) { + if (isBodyAllowed(method)) { + // Add entity if we have content and a valid method + builder.setEntity(serialize(body, formParams, contentTypeObj)); + } else { + throw new ApiException("method " + method + " does not support a request body"); + } + } else { + // for empty body + builder.setEntity(new StringEntity("", contentTypeObj)); + } + + try (CloseableHttpResponse response = httpClient.execute(builder.build(), context)) { + return processResponse(response, returnType); + } catch (IOException | ParseException e) { + throw new ApiException(e); + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams Query parameters + * @param headerParams Header parameters + * @param cookieParams Cookie parameters + */ + private void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, Map cookieParams) { + for (String authName : authNames) { + Authentication auth = authentications.get(authName); + if (auth == null) throw new RuntimeException("Authentication undefined: " + authName); + auth.applyToParams(queryParams, headerParams, cookieParams); + } + } +} diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/ApiException.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/ApiException.java new file mode 100644 index 0000000..26a752f --- /dev/null +++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/ApiException.java @@ -0,0 +1,100 @@ +/* + * Sessionize JSON-REST API + * Sessionize JSON-REST API documentation by XDEV Software + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package software.xdev.sessionize.client; + +import java.util.Map; +import java.util.List; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-26T17:30:53.867882+02:00[Europe/Berlin]") +public class ApiException extends RuntimeException { + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + public ApiException() {} + + public ApiException(Throwable throwable) { + super(throwable); + } + + public ApiException(String message) { + super(message); + } + + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) { + super(message, throwable); + this.code = code; + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + public ApiException(String message, int code, Map> responseHeaders, String responseBody) { + this(message, (Throwable) null, code, responseHeaders, responseBody); + } + + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) { + this(message, throwable, code, responseHeaders, null); + } + + public ApiException(int code, Map> responseHeaders, String responseBody) { + this("Response Code: " + code + " Response Body: " + responseBody, (Throwable) null, code, responseHeaders, responseBody); + } + + public ApiException(int code, String message) { + super(message); + this.code = code; + } + + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } + + @Override + public String toString() { + return "ApiException{" + + "code=" + code + + ", responseHeaders=" + responseHeaders + + ", responseBody='" + responseBody + '\'' + + '}'; + } +} diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/Configuration.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/Configuration.java new file mode 100644 index 0000000..10f7363 --- /dev/null +++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/Configuration.java @@ -0,0 +1,39 @@ +/* + * Sessionize JSON-REST API + * Sessionize JSON-REST API documentation by XDEV Software + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package software.xdev.sessionize.client; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-26T17:30:53.867882+02:00[Europe/Berlin]") +public class Configuration { + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/JavaTimeFormatter.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/JavaTimeFormatter.java new file mode 100644 index 0000000..37ed48a --- /dev/null +++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/JavaTimeFormatter.java @@ -0,0 +1,64 @@ +/* + * Sessionize JSON-REST API + * Sessionize JSON-REST API documentation by XDEV Software + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package software.xdev.sessionize.client; + +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; + +/** + * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class. + * It's generated for java clients when {@code AbstractJavaCodegen#dateLibrary} specified as {@code java8}. + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-26T17:30:53.867882+02:00[Europe/Berlin]") +public class JavaTimeFormatter { + + private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME; + + /** + * Get the date format used to parse/format {@code OffsetDateTime} parameters. + * @return DateTimeFormatter + */ + public DateTimeFormatter getOffsetDateTimeFormatter() { + return offsetDateTimeFormatter; + } + + /** + * Set the date format used to parse/format {@code OffsetDateTime} parameters. + * @param offsetDateTimeFormatter {@code DateTimeFormatter} + */ + public void setOffsetDateTimeFormatter(DateTimeFormatter offsetDateTimeFormatter) { + this.offsetDateTimeFormatter = offsetDateTimeFormatter; + } + + /** + * Parse the given string into {@code OffsetDateTime} object. + * @param str String + * @return {@code OffsetDateTime} + */ + public OffsetDateTime parseOffsetDateTime(String str) { + try { + return OffsetDateTime.parse(str, offsetDateTimeFormatter); + } catch (DateTimeParseException e) { + throw new RuntimeException(e); + } + } + /** + * Format the given {@code OffsetDateTime} object into string. + * @param offsetDateTime {@code OffsetDateTime} + * @return {@code OffsetDateTime} in string format + */ + public String formatOffsetDateTime(OffsetDateTime offsetDateTime) { + return offsetDateTimeFormatter.format(offsetDateTime); + } +} diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/Pair.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/Pair.java new file mode 100644 index 0000000..b87aa6b --- /dev/null +++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Sessionize JSON-REST API + * Sessionize JSON-REST API documentation by XDEV Software + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package software.xdev.sessionize.client; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-26T17:30:53.867882+02:00[Europe/Berlin]") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/RFC3339DateFormat.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/RFC3339DateFormat.java new file mode 100644 index 0000000..0a36e97 --- /dev/null +++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/RFC3339DateFormat.java @@ -0,0 +1,57 @@ +/* + * Sessionize JSON-REST API + * Sessionize JSON-REST API documentation by XDEV Software + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package software.xdev.sessionize.client; + +import com.fasterxml.jackson.databind.util.StdDateFormat; + +import java.text.DateFormat; +import java.text.FieldPosition; +import java.text.ParsePosition; +import java.util.Date; +import java.text.DecimalFormat; +import java.util.GregorianCalendar; +import java.util.TimeZone; + +public class RFC3339DateFormat extends DateFormat { + private static final long serialVersionUID = 1L; + private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); + + private final StdDateFormat fmt = new StdDateFormat() + .withTimeZone(TIMEZONE_Z) + .withColonInTimeZone(true); + + public RFC3339DateFormat() { + this.calendar = new GregorianCalendar(); + this.numberFormat = new DecimalFormat(); + } + + @Override + public Date parse(String source) { + return parse(source, new ParsePosition(0)); + } + + @Override + public Date parse(String source, ParsePosition pos) { + return fmt.parse(source, pos); + } + + @Override + public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { + return fmt.format(date, toAppendTo, fieldPosition); + } + + @Override + public Object clone() { + return super.clone(); + } +} \ No newline at end of file diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/ServerConfiguration.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/ServerConfiguration.java new file mode 100644 index 0000000..708706d --- /dev/null +++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package software.xdev.sessionize.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/ServerVariable.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/ServerVariable.java new file mode 100644 index 0000000..9e2fce3 --- /dev/null +++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/ServerVariable.java @@ -0,0 +1,23 @@ +package software.xdev.sessionize.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/StringUtil.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/StringUtil.java new file mode 100644 index 0000000..5292c3f --- /dev/null +++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Sessionize JSON-REST API + * Sessionize JSON-REST API documentation by XDEV Software + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package software.xdev.sessionize.client; + +import java.util.Collection; +import java.util.Iterator; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-26T17:30:53.867882+02:00[Europe/Berlin]") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

+ * 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(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/auth/ApiKeyAuth.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/auth/ApiKeyAuth.java new file mode 100644 index 0000000..078905a --- /dev/null +++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/auth/ApiKeyAuth.java @@ -0,0 +1,77 @@ +/* + * Sessionize JSON-REST API + * Sessionize JSON-REST API documentation by XDEV Software + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package software.xdev.sessionize.client.auth; + +import software.xdev.sessionize.client.Pair; + +import java.util.Map; +import java.util.List; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-26T17:30:53.867882+02:00[Europe/Berlin]") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams) { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/auth/Authentication.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/auth/Authentication.java new file mode 100644 index 0000000..761305d --- /dev/null +++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/auth/Authentication.java @@ -0,0 +1,30 @@ +/* + * Sessionize JSON-REST API + * Sessionize JSON-REST API documentation by XDEV Software + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package software.xdev.sessionize.client.auth; + +import software.xdev.sessionize.client.Pair; + +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + */ + void applyToParams(List queryParams, Map headerParams, Map cookieParams); +} diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/auth/HttpBasicAuth.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/auth/HttpBasicAuth.java new file mode 100644 index 0000000..6ce2184 --- /dev/null +++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/auth/HttpBasicAuth.java @@ -0,0 +1,53 @@ +/* + * Sessionize JSON-REST API + * Sessionize JSON-REST API documentation by XDEV Software + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package software.xdev.sessionize.client.auth; + +import software.xdev.sessionize.client.Pair; + +import java.util.Base64; +import java.nio.charset.StandardCharsets; + +import java.util.Map; +import java.util.List; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-26T17:30:53.867882+02:00[Europe/Berlin]") +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams) { + if (username == null && password == null) { + return; + } + String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); + headerParams.put("Authorization", "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); + } +} diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/auth/HttpBearerAuth.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/auth/HttpBearerAuth.java new file mode 100644 index 0000000..b0f5055 --- /dev/null +++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/auth/HttpBearerAuth.java @@ -0,0 +1,60 @@ +/* + * Sessionize JSON-REST API + * Sessionize JSON-REST API documentation by XDEV Software + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package software.xdev.sessionize.client.auth; + +import software.xdev.sessionize.client.Pair; + +import java.util.Map; +import java.util.List; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-26T17:30:53.867882+02:00[Europe/Berlin]") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return bearerToken; + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams) { + if(bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/AllResult.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/AllResult.java new file mode 100644 index 0000000..c6522d9 --- /dev/null +++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/AllResult.java @@ -0,0 +1,366 @@ +/* + * Sessionize JSON-REST API + * Sessionize JSON-REST API documentation by XDEV Software + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package software.xdev.sessionize.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.List; +import software.xdev.sessionize.model.Category; +import software.xdev.sessionize.model.Question; +import software.xdev.sessionize.model.Room; +import software.xdev.sessionize.model.SessionAll; +import software.xdev.sessionize.model.SpeakerAll; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * AllResult + */ +@JsonPropertyOrder({ + AllResult.JSON_PROPERTY_SESSIONS, + AllResult.JSON_PROPERTY_SPEAKERS, + AllResult.JSON_PROPERTY_QUESTIONS, + AllResult.JSON_PROPERTY_CATEGORIES, + AllResult.JSON_PROPERTY_ROOMS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-26T17:30:53.867882+02:00[Europe/Berlin]") +public class AllResult { + public static final String JSON_PROPERTY_SESSIONS = "sessions"; + private List sessions = new ArrayList<>(); + + public static final String JSON_PROPERTY_SPEAKERS = "speakers"; + private List speakers = new ArrayList<>(); + + public static final String JSON_PROPERTY_QUESTIONS = "questions"; + private List questions = new ArrayList<>(); + + public static final String JSON_PROPERTY_CATEGORIES = "categories"; + private List categories = new ArrayList<>(); + + public static final String JSON_PROPERTY_ROOMS = "rooms"; + private List rooms = new ArrayList<>(); + + public AllResult() { + } + + public AllResult sessions(List sessions) { + + this.sessions = sessions; + return this; + } + + public AllResult addSessionsItem(SessionAll sessionsItem) { + if (this.sessions == null) { + this.sessions = new ArrayList<>(); + } + this.sessions.add(sessionsItem); + return this; + } + + /** + * Get sessions + * @return sessions + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SESSIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getSessions() { + return sessions; + } + + + @JsonProperty(JSON_PROPERTY_SESSIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSessions(List sessions) { + this.sessions = sessions; + } + + + public AllResult speakers(List speakers) { + + this.speakers = speakers; + return this; + } + + public AllResult addSpeakersItem(SpeakerAll speakersItem) { + if (this.speakers == null) { + this.speakers = new ArrayList<>(); + } + this.speakers.add(speakersItem); + return this; + } + + /** + * Get speakers + * @return speakers + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SPEAKERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getSpeakers() { + return speakers; + } + + + @JsonProperty(JSON_PROPERTY_SPEAKERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSpeakers(List speakers) { + this.speakers = speakers; + } + + + public AllResult questions(List questions) { + + this.questions = questions; + return this; + } + + public AllResult addQuestionsItem(Question questionsItem) { + if (this.questions == null) { + this.questions = new ArrayList<>(); + } + this.questions.add(questionsItem); + return this; + } + + /** + * Get questions + * @return questions + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_QUESTIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getQuestions() { + return questions; + } + + + @JsonProperty(JSON_PROPERTY_QUESTIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setQuestions(List questions) { + this.questions = questions; + } + + + public AllResult categories(List categories) { + + this.categories = categories; + return this; + } + + public AllResult addCategoriesItem(Category categoriesItem) { + if (this.categories == null) { + this.categories = new ArrayList<>(); + } + this.categories.add(categoriesItem); + return this; + } + + /** + * Get categories + * @return categories + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CATEGORIES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getCategories() { + return categories; + } + + + @JsonProperty(JSON_PROPERTY_CATEGORIES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCategories(List categories) { + this.categories = categories; + } + + + public AllResult rooms(List rooms) { + + this.rooms = rooms; + return this; + } + + public AllResult addRoomsItem(Room roomsItem) { + if (this.rooms == null) { + this.rooms = new ArrayList<>(); + } + this.rooms.add(roomsItem); + return this; + } + + /** + * Get rooms + * @return rooms + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ROOMS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getRooms() { + return rooms; + } + + + @JsonProperty(JSON_PROPERTY_ROOMS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRooms(List rooms) { + this.rooms = rooms; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AllResult allResult = (AllResult) o; + return Objects.equals(this.sessions, allResult.sessions) && + Objects.equals(this.speakers, allResult.speakers) && + Objects.equals(this.questions, allResult.questions) && + Objects.equals(this.categories, allResult.categories) && + Objects.equals(this.rooms, allResult.rooms); + } + + @Override + public int hashCode() { + return Objects.hash(sessions, speakers, questions, categories, rooms); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AllResult {\n"); + sb.append(" sessions: ").append(toIndentedString(sessions)).append("\n"); + sb.append(" speakers: ").append(toIndentedString(speakers)).append("\n"); + sb.append(" questions: ").append(toIndentedString(questions)).append("\n"); + sb.append(" categories: ").append(toIndentedString(categories)).append("\n"); + sb.append(" rooms: ").append(toIndentedString(rooms)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `sessions` to the URL query string + if (getSessions() != null) { + for (int i = 0; i < getSessions().size(); i++) { + if (getSessions().get(i) != null) { + joiner.add(getSessions().get(i).toUrlQueryString(String.format("%ssessions%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `speakers` to the URL query string + if (getSpeakers() != null) { + for (int i = 0; i < getSpeakers().size(); i++) { + if (getSpeakers().get(i) != null) { + joiner.add(getSpeakers().get(i).toUrlQueryString(String.format("%sspeakers%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `questions` to the URL query string + if (getQuestions() != null) { + for (int i = 0; i < getQuestions().size(); i++) { + if (getQuestions().get(i) != null) { + joiner.add(getQuestions().get(i).toUrlQueryString(String.format("%squestions%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `categories` to the URL query string + if (getCategories() != null) { + for (int i = 0; i < getCategories().size(); i++) { + if (getCategories().get(i) != null) { + joiner.add(getCategories().get(i).toUrlQueryString(String.format("%scategories%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `rooms` to the URL query string + if (getRooms() != null) { + for (int i = 0; i < getRooms().size(); i++) { + if (getRooms().get(i) != null) { + joiner.add(getRooms().get(i).toUrlQueryString(String.format("%srooms%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/BaseSession.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/BaseSession.java new file mode 100644 index 0000000..6cc35eb --- /dev/null +++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/BaseSession.java @@ -0,0 +1,627 @@ +/* + * Sessionize JSON-REST API + * Sessionize JSON-REST API documentation by XDEV Software + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package software.xdev.sessionize.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.net.URI; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import software.xdev.sessionize.model.Status; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * BaseSession + */ +@JsonPropertyOrder({ + BaseSession.JSON_PROPERTY_TITLE, + BaseSession.JSON_PROPERTY_DESCRIPTION, + BaseSession.JSON_PROPERTY_STARTS_AT, + BaseSession.JSON_PROPERTY_ENDS_AT, + BaseSession.JSON_PROPERTY_IS_SERVICE_SESSION, + BaseSession.JSON_PROPERTY_IS_PLENUM_SESSION, + BaseSession.JSON_PROPERTY_CATEGORY_ITEMS, + BaseSession.JSON_PROPERTY_ROOM_ID, + BaseSession.JSON_PROPERTY_LIVE_URL, + BaseSession.JSON_PROPERTY_RECORDING_URL, + BaseSession.JSON_PROPERTY_STATUS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-26T17:30:53.867882+02:00[Europe/Berlin]") +public class BaseSession { + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private JsonNullable description = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_STARTS_AT = "startsAt"; + private OffsetDateTime startsAt; + + public static final String JSON_PROPERTY_ENDS_AT = "endsAt"; + private OffsetDateTime endsAt; + + public static final String JSON_PROPERTY_IS_SERVICE_SESSION = "isServiceSession"; + private Boolean isServiceSession; + + public static final String JSON_PROPERTY_IS_PLENUM_SESSION = "isPlenumSession"; + private Boolean isPlenumSession; + + public static final String JSON_PROPERTY_CATEGORY_ITEMS = "categoryItems"; + private List categoryItems = new ArrayList<>(); + + public static final String JSON_PROPERTY_ROOM_ID = "roomId"; + private Integer roomId; + + public static final String JSON_PROPERTY_LIVE_URL = "liveUrl"; + private JsonNullable liveUrl = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_RECORDING_URL = "recordingUrl"; + private JsonNullable recordingUrl = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_STATUS = "status"; + private Status status; + + public BaseSession() { + } + + public BaseSession title(String title) { + + this.title = title; + return this; + } + + /** + * Get title + * @return title + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getTitle() { + return title; + } + + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTitle(String title) { + this.title = title; + } + + + public BaseSession description(String description) { + this.description = JsonNullable.of(description); + + return this; + } + + /** + * Get description + * @return description + **/ + @jakarta.annotation.Nullable + @JsonIgnore + + public String getDescription() { + return description.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getDescription_JsonNullable() { + return description; + } + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + public void setDescription_JsonNullable(JsonNullable description) { + this.description = description; + } + + public void setDescription(String description) { + this.description = JsonNullable.of(description); + } + + + public BaseSession startsAt(OffsetDateTime startsAt) { + + this.startsAt = startsAt; + return this; + } + + /** + * Get startsAt + * @return startsAt + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STARTS_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public OffsetDateTime getStartsAt() { + return startsAt; + } + + + @JsonProperty(JSON_PROPERTY_STARTS_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStartsAt(OffsetDateTime startsAt) { + this.startsAt = startsAt; + } + + + public BaseSession endsAt(OffsetDateTime endsAt) { + + this.endsAt = endsAt; + return this; + } + + /** + * Get endsAt + * @return endsAt + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENDS_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public OffsetDateTime getEndsAt() { + return endsAt; + } + + + @JsonProperty(JSON_PROPERTY_ENDS_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEndsAt(OffsetDateTime endsAt) { + this.endsAt = endsAt; + } + + + public BaseSession isServiceSession(Boolean isServiceSession) { + + this.isServiceSession = isServiceSession; + return this; + } + + /** + * Get isServiceSession + * @return isServiceSession + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_IS_SERVICE_SESSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Boolean getIsServiceSession() { + return isServiceSession; + } + + + @JsonProperty(JSON_PROPERTY_IS_SERVICE_SESSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setIsServiceSession(Boolean isServiceSession) { + this.isServiceSession = isServiceSession; + } + + + public BaseSession isPlenumSession(Boolean isPlenumSession) { + + this.isPlenumSession = isPlenumSession; + return this; + } + + /** + * Get isPlenumSession + * @return isPlenumSession + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_IS_PLENUM_SESSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Boolean getIsPlenumSession() { + return isPlenumSession; + } + + + @JsonProperty(JSON_PROPERTY_IS_PLENUM_SESSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setIsPlenumSession(Boolean isPlenumSession) { + this.isPlenumSession = isPlenumSession; + } + + + public BaseSession categoryItems(List categoryItems) { + + this.categoryItems = categoryItems; + return this; + } + + public BaseSession addCategoryItemsItem(Integer categoryItemsItem) { + if (this.categoryItems == null) { + this.categoryItems = new ArrayList<>(); + } + this.categoryItems.add(categoryItemsItem); + return this; + } + + /** + * Get categoryItems + * @return categoryItems + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CATEGORY_ITEMS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getCategoryItems() { + return categoryItems; + } + + + @JsonProperty(JSON_PROPERTY_CATEGORY_ITEMS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCategoryItems(List categoryItems) { + this.categoryItems = categoryItems; + } + + + public BaseSession roomId(Integer roomId) { + + this.roomId = roomId; + return this; + } + + /** + * Get roomId + * @return roomId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ROOM_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getRoomId() { + return roomId; + } + + + @JsonProperty(JSON_PROPERTY_ROOM_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRoomId(Integer roomId) { + this.roomId = roomId; + } + + + public BaseSession liveUrl(URI liveUrl) { + this.liveUrl = JsonNullable.of(liveUrl); + + return this; + } + + /** + * Get liveUrl + * @return liveUrl + **/ + @jakarta.annotation.Nullable + @JsonIgnore + + public URI getLiveUrl() { + return liveUrl.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_LIVE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getLiveUrl_JsonNullable() { + return liveUrl; + } + + @JsonProperty(JSON_PROPERTY_LIVE_URL) + public void setLiveUrl_JsonNullable(JsonNullable liveUrl) { + this.liveUrl = liveUrl; + } + + public void setLiveUrl(URI liveUrl) { + this.liveUrl = JsonNullable.of(liveUrl); + } + + + public BaseSession recordingUrl(URI recordingUrl) { + this.recordingUrl = JsonNullable.of(recordingUrl); + + return this; + } + + /** + * Get recordingUrl + * @return recordingUrl + **/ + @jakarta.annotation.Nullable + @JsonIgnore + + public URI getRecordingUrl() { + return recordingUrl.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_RECORDING_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getRecordingUrl_JsonNullable() { + return recordingUrl; + } + + @JsonProperty(JSON_PROPERTY_RECORDING_URL) + public void setRecordingUrl_JsonNullable(JsonNullable recordingUrl) { + this.recordingUrl = recordingUrl; + } + + public void setRecordingUrl(URI recordingUrl) { + this.recordingUrl = JsonNullable.of(recordingUrl); + } + + + public BaseSession status(Status status) { + + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Status getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStatus(Status status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BaseSession baseSession = (BaseSession) o; + return Objects.equals(this.title, baseSession.title) && + equalsNullable(this.description, baseSession.description) && + Objects.equals(this.startsAt, baseSession.startsAt) && + Objects.equals(this.endsAt, baseSession.endsAt) && + Objects.equals(this.isServiceSession, baseSession.isServiceSession) && + Objects.equals(this.isPlenumSession, baseSession.isPlenumSession) && + Objects.equals(this.categoryItems, baseSession.categoryItems) && + Objects.equals(this.roomId, baseSession.roomId) && + equalsNullable(this.liveUrl, baseSession.liveUrl) && + equalsNullable(this.recordingUrl, baseSession.recordingUrl) && + Objects.equals(this.status, baseSession.status); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(title, hashCodeNullable(description), startsAt, endsAt, isServiceSession, isPlenumSession, categoryItems, roomId, hashCodeNullable(liveUrl), hashCodeNullable(recordingUrl), status); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BaseSession {\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" startsAt: ").append(toIndentedString(startsAt)).append("\n"); + sb.append(" endsAt: ").append(toIndentedString(endsAt)).append("\n"); + sb.append(" isServiceSession: ").append(toIndentedString(isServiceSession)).append("\n"); + sb.append(" isPlenumSession: ").append(toIndentedString(isPlenumSession)).append("\n"); + sb.append(" categoryItems: ").append(toIndentedString(categoryItems)).append("\n"); + sb.append(" roomId: ").append(toIndentedString(roomId)).append("\n"); + sb.append(" liveUrl: ").append(toIndentedString(liveUrl)).append("\n"); + sb.append(" recordingUrl: ").append(toIndentedString(recordingUrl)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `title` to the URL query string + if (getTitle() != null) { + try { + joiner.add(String.format("%stitle%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTitle()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `description` to the URL query string + if (getDescription() != null) { + try { + joiner.add(String.format("%sdescription%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDescription()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `startsAt` to the URL query string + if (getStartsAt() != null) { + try { + joiner.add(String.format("%sstartsAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStartsAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `endsAt` to the URL query string + if (getEndsAt() != null) { + try { + joiner.add(String.format("%sendsAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEndsAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `isServiceSession` to the URL query string + if (getIsServiceSession() != null) { + try { + joiner.add(String.format("%sisServiceSession%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIsServiceSession()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `isPlenumSession` to the URL query string + if (getIsPlenumSession() != null) { + try { + joiner.add(String.format("%sisPlenumSession%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIsPlenumSession()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `categoryItems` to the URL query string + if (getCategoryItems() != null) { + for (int i = 0; i < getCategoryItems().size(); i++) { + try { + joiner.add(String.format("%scategoryItems%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getCategoryItems().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `roomId` to the URL query string + if (getRoomId() != null) { + try { + joiner.add(String.format("%sroomId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getRoomId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `liveUrl` to the URL query string + if (getLiveUrl() != null) { + try { + joiner.add(String.format("%sliveUrl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getLiveUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `recordingUrl` to the URL query string + if (getRecordingUrl() != null) { + try { + joiner.add(String.format("%srecordingUrl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getRecordingUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `status` to the URL query string + if (getStatus() != null) { + try { + joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStatus()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/BaseSpeaker.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/BaseSpeaker.java new file mode 100644 index 0000000..6abdec1 --- /dev/null +++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/BaseSpeaker.java @@ -0,0 +1,531 @@ +/* + * Sessionize JSON-REST API + * Sessionize JSON-REST API documentation by XDEV Software + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package software.xdev.sessionize.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.net.URI; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; +import software.xdev.sessionize.model.Link; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * BaseSpeaker + */ +@JsonPropertyOrder({ + BaseSpeaker.JSON_PROPERTY_ID, + BaseSpeaker.JSON_PROPERTY_FIRST_NAME, + BaseSpeaker.JSON_PROPERTY_LAST_NAME, + BaseSpeaker.JSON_PROPERTY_BIO, + BaseSpeaker.JSON_PROPERTY_TAG_LINE, + BaseSpeaker.JSON_PROPERTY_PROFILE_PICTURE, + BaseSpeaker.JSON_PROPERTY_IS_TOP_SPEAKER, + BaseSpeaker.JSON_PROPERTY_LINKS, + BaseSpeaker.JSON_PROPERTY_FULL_NAME +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-26T17:30:53.867882+02:00[Europe/Berlin]") +public class BaseSpeaker { + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; + private String firstName; + + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; + private String lastName; + + public static final String JSON_PROPERTY_BIO = "bio"; + private JsonNullable bio = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_TAG_LINE = "tagLine"; + private String tagLine; + + public static final String JSON_PROPERTY_PROFILE_PICTURE = "profilePicture"; + private JsonNullable profilePicture = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_IS_TOP_SPEAKER = "isTopSpeaker"; + private Boolean isTopSpeaker; + + public static final String JSON_PROPERTY_LINKS = "links"; + private List links = new ArrayList<>(); + + public static final String JSON_PROPERTY_FULL_NAME = "fullName"; + private String fullName; + + public BaseSpeaker() { + } + + public BaseSpeaker id(UUID id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public UUID getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(UUID id) { + this.id = id; + } + + + public BaseSpeaker firstName(String firstName) { + + this.firstName = firstName; + return this; + } + + /** + * Get firstName + * @return firstName + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getFirstName() { + return firstName; + } + + + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + + public BaseSpeaker lastName(String lastName) { + + this.lastName = lastName; + return this; + } + + /** + * Get lastName + * @return lastName + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getLastName() { + return lastName; + } + + + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setLastName(String lastName) { + this.lastName = lastName; + } + + + public BaseSpeaker bio(String bio) { + this.bio = JsonNullable.of(bio); + + return this; + } + + /** + * Get bio + * @return bio + **/ + @jakarta.annotation.Nullable + @JsonIgnore + + public String getBio() { + return bio.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_BIO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getBio_JsonNullable() { + return bio; + } + + @JsonProperty(JSON_PROPERTY_BIO) + public void setBio_JsonNullable(JsonNullable bio) { + this.bio = bio; + } + + public void setBio(String bio) { + this.bio = JsonNullable.of(bio); + } + + + public BaseSpeaker tagLine(String tagLine) { + + this.tagLine = tagLine; + return this; + } + + /** + * Get tagLine + * @return tagLine + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAG_LINE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getTagLine() { + return tagLine; + } + + + @JsonProperty(JSON_PROPERTY_TAG_LINE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTagLine(String tagLine) { + this.tagLine = tagLine; + } + + + public BaseSpeaker profilePicture(URI profilePicture) { + this.profilePicture = JsonNullable.of(profilePicture); + + return this; + } + + /** + * Get profilePicture + * @return profilePicture + **/ + @jakarta.annotation.Nullable + @JsonIgnore + + public URI getProfilePicture() { + return profilePicture.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_PROFILE_PICTURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getProfilePicture_JsonNullable() { + return profilePicture; + } + + @JsonProperty(JSON_PROPERTY_PROFILE_PICTURE) + public void setProfilePicture_JsonNullable(JsonNullable profilePicture) { + this.profilePicture = profilePicture; + } + + public void setProfilePicture(URI profilePicture) { + this.profilePicture = JsonNullable.of(profilePicture); + } + + + public BaseSpeaker isTopSpeaker(Boolean isTopSpeaker) { + + this.isTopSpeaker = isTopSpeaker; + return this; + } + + /** + * Get isTopSpeaker + * @return isTopSpeaker + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_IS_TOP_SPEAKER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Boolean getIsTopSpeaker() { + return isTopSpeaker; + } + + + @JsonProperty(JSON_PROPERTY_IS_TOP_SPEAKER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setIsTopSpeaker(Boolean isTopSpeaker) { + this.isTopSpeaker = isTopSpeaker; + } + + + public BaseSpeaker links(List links) { + + this.links = links; + return this; + } + + public BaseSpeaker addLinksItem(Link linksItem) { + if (this.links == null) { + this.links = new ArrayList<>(); + } + this.links.add(linksItem); + return this; + } + + /** + * Get links + * @return links + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_LINKS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getLinks() { + return links; + } + + + @JsonProperty(JSON_PROPERTY_LINKS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setLinks(List links) { + this.links = links; + } + + + public BaseSpeaker fullName(String fullName) { + + this.fullName = fullName; + return this; + } + + /** + * Get fullName + * @return fullName + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FULL_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getFullName() { + return fullName; + } + + + @JsonProperty(JSON_PROPERTY_FULL_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFullName(String fullName) { + this.fullName = fullName; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BaseSpeaker baseSpeaker = (BaseSpeaker) o; + return Objects.equals(this.id, baseSpeaker.id) && + Objects.equals(this.firstName, baseSpeaker.firstName) && + Objects.equals(this.lastName, baseSpeaker.lastName) && + equalsNullable(this.bio, baseSpeaker.bio) && + Objects.equals(this.tagLine, baseSpeaker.tagLine) && + equalsNullable(this.profilePicture, baseSpeaker.profilePicture) && + Objects.equals(this.isTopSpeaker, baseSpeaker.isTopSpeaker) && + Objects.equals(this.links, baseSpeaker.links) && + Objects.equals(this.fullName, baseSpeaker.fullName); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(id, firstName, lastName, hashCodeNullable(bio), tagLine, hashCodeNullable(profilePicture), isTopSpeaker, links, fullName); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BaseSpeaker {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" bio: ").append(toIndentedString(bio)).append("\n"); + sb.append(" tagLine: ").append(toIndentedString(tagLine)).append("\n"); + sb.append(" profilePicture: ").append(toIndentedString(profilePicture)).append("\n"); + sb.append(" isTopSpeaker: ").append(toIndentedString(isTopSpeaker)).append("\n"); + sb.append(" links: ").append(toIndentedString(links)).append("\n"); + sb.append(" fullName: ").append(toIndentedString(fullName)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `firstName` to the URL query string + if (getFirstName() != null) { + try { + joiner.add(String.format("%sfirstName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFirstName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `lastName` to the URL query string + if (getLastName() != null) { + try { + joiner.add(String.format("%slastName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getLastName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `bio` to the URL query string + if (getBio() != null) { + try { + joiner.add(String.format("%sbio%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getBio()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `tagLine` to the URL query string + if (getTagLine() != null) { + try { + joiner.add(String.format("%stagLine%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTagLine()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `profilePicture` to the URL query string + if (getProfilePicture() != null) { + try { + joiner.add(String.format("%sprofilePicture%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getProfilePicture()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `isTopSpeaker` to the URL query string + if (getIsTopSpeaker() != null) { + try { + joiner.add(String.format("%sisTopSpeaker%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIsTopSpeaker()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `links` to the URL query string + if (getLinks() != null) { + for (int i = 0; i < getLinks().size(); i++) { + if (getLinks().get(i) != null) { + joiner.add(getLinks().get(i).toUrlQueryString(String.format("%slinks%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `fullName` to the URL query string + if (getFullName() != null) { + try { + joiner.add(String.format("%sfullName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFullName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/Category.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/Category.java new file mode 100644 index 0000000..f05fc36 --- /dev/null +++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/Category.java @@ -0,0 +1,330 @@ +/* + * Sessionize JSON-REST API + * Sessionize JSON-REST API documentation by XDEV Software + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package software.xdev.sessionize.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.List; +import software.xdev.sessionize.model.CategoryItem; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Category + */ +@JsonPropertyOrder({ + Category.JSON_PROPERTY_ID, + Category.JSON_PROPERTY_TITLE, + Category.JSON_PROPERTY_ITEMS, + Category.JSON_PROPERTY_SORT, + Category.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-26T17:30:53.867882+02:00[Europe/Berlin]") +public class Category { + public static final String JSON_PROPERTY_ID = "id"; + private Integer id; + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public static final String JSON_PROPERTY_ITEMS = "items"; + private List items = new ArrayList<>(); + + public static final String JSON_PROPERTY_SORT = "sort"; + private Integer sort; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public Category() { + } + + public Category id(Integer id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(Integer id) { + this.id = id; + } + + + public Category title(String title) { + + this.title = title; + return this; + } + + /** + * Get title + * @return title + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getTitle() { + return title; + } + + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTitle(String title) { + this.title = title; + } + + + public Category items(List items) { + + this.items = items; + return this; + } + + public Category addItemsItem(CategoryItem itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * Get items + * @return items + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ITEMS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getItems() { + return items; + } + + + @JsonProperty(JSON_PROPERTY_ITEMS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setItems(List items) { + this.items = items; + } + + + public Category sort(Integer sort) { + + this.sort = sort; + return this; + } + + /** + * Get sort + * @return sort + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SORT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getSort() { + return sort; + } + + + @JsonProperty(JSON_PROPERTY_SORT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSort(Integer sort) { + this.sort = sort; + } + + + public Category type(String type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(String type) { + this.type = type; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Category category = (Category) o; + return Objects.equals(this.id, category.id) && + Objects.equals(this.title, category.title) && + Objects.equals(this.items, category.items) && + Objects.equals(this.sort, category.sort) && + Objects.equals(this.type, category.type); + } + + @Override + public int hashCode() { + return Objects.hash(id, title, items, sort, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" sort: ").append(toIndentedString(sort)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `title` to the URL query string + if (getTitle() != null) { + try { + joiner.add(String.format("%stitle%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTitle()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `items` to the URL query string + if (getItems() != null) { + for (int i = 0; i < getItems().size(); i++) { + if (getItems().get(i) != null) { + joiner.add(getItems().get(i).toUrlQueryString(String.format("%sitems%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `sort` to the URL query string + if (getSort() != null) { + try { + joiner.add(String.format("%ssort%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSort()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `type` to the URL query string + if (getType() != null) { + try { + joiner.add(String.format("%stype%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getType()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/CategoryItem.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/CategoryItem.java new file mode 100644 index 0000000..fe2ca3c --- /dev/null +++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/CategoryItem.java @@ -0,0 +1,235 @@ +/* + * Sessionize JSON-REST API + * Sessionize JSON-REST API documentation by XDEV Software + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package software.xdev.sessionize.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CategoryItem + */ +@JsonPropertyOrder({ + CategoryItem.JSON_PROPERTY_ID, + CategoryItem.JSON_PROPERTY_NAME, + CategoryItem.JSON_PROPERTY_SORT +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-26T17:30:53.867882+02:00[Europe/Berlin]") +public class CategoryItem { + public static final String JSON_PROPERTY_ID = "id"; + private Integer id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_SORT = "sort"; + private Integer sort; + + public CategoryItem() { + } + + public CategoryItem id(Integer id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(Integer id) { + this.id = id; + } + + + public CategoryItem name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + + public CategoryItem sort(Integer sort) { + + this.sort = sort; + return this; + } + + /** + * Get sort + * @return sort + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SORT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getSort() { + return sort; + } + + + @JsonProperty(JSON_PROPERTY_SORT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSort(Integer sort) { + this.sort = sort; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CategoryItem categoryItem = (CategoryItem) o; + return Objects.equals(this.id, categoryItem.id) && + Objects.equals(this.name, categoryItem.name) && + Objects.equals(this.sort, categoryItem.sort); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, sort); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CategoryItem {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" sort: ").append(toIndentedString(sort)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `sort` to the URL query string + if (getSort() != null) { + try { + joiner.add(String.format("%ssort%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSort()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/Link.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/Link.java new file mode 100644 index 0000000..1e65e31 --- /dev/null +++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/Link.java @@ -0,0 +1,236 @@ +/* + * Sessionize JSON-REST API + * Sessionize JSON-REST API documentation by XDEV Software + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package software.xdev.sessionize.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.net.URI; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Link + */ +@JsonPropertyOrder({ + Link.JSON_PROPERTY_TITLE, + Link.JSON_PROPERTY_URL, + Link.JSON_PROPERTY_LINK_TYPE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-26T17:30:53.867882+02:00[Europe/Berlin]") +public class Link { + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public static final String JSON_PROPERTY_URL = "url"; + private URI url; + + public static final String JSON_PROPERTY_LINK_TYPE = "linkType"; + private String linkType; + + public Link() { + } + + public Link title(String title) { + + this.title = title; + return this; + } + + /** + * Get title + * @return title + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getTitle() { + return title; + } + + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTitle(String title) { + this.title = title; + } + + + public Link url(URI url) { + + this.url = url; + return this; + } + + /** + * Get url + * @return url + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public URI getUrl() { + return url; + } + + + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUrl(URI url) { + this.url = url; + } + + + public Link linkType(String linkType) { + + this.linkType = linkType; + return this; + } + + /** + * Get linkType + * @return linkType + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_LINK_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getLinkType() { + return linkType; + } + + + @JsonProperty(JSON_PROPERTY_LINK_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setLinkType(String linkType) { + this.linkType = linkType; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Link link = (Link) o; + return Objects.equals(this.title, link.title) && + Objects.equals(this.url, link.url) && + Objects.equals(this.linkType, link.linkType); + } + + @Override + public int hashCode() { + return Objects.hash(title, url, linkType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Link {\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" linkType: ").append(toIndentedString(linkType)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `title` to the URL query string + if (getTitle() != null) { + try { + joiner.add(String.format("%stitle%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTitle()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `url` to the URL query string + if (getUrl() != null) { + try { + joiner.add(String.format("%surl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `linkType` to the URL query string + if (getLinkType() != null) { + try { + joiner.add(String.format("%slinkType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getLinkType()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/Question.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/Question.java new file mode 100644 index 0000000..e93f9a1 --- /dev/null +++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/Question.java @@ -0,0 +1,277 @@ +/* + * Sessionize JSON-REST API + * Sessionize JSON-REST API documentation by XDEV Software + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package software.xdev.sessionize.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Question + */ +@JsonPropertyOrder({ + Question.JSON_PROPERTY_ID, + Question.JSON_PROPERTY_QUESTION, + Question.JSON_PROPERTY_QUESTION_TYPE, + Question.JSON_PROPERTY_SORT +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-26T17:30:53.867882+02:00[Europe/Berlin]") +public class Question { + public static final String JSON_PROPERTY_ID = "id"; + private Integer id; + + public static final String JSON_PROPERTY_QUESTION = "question"; + private String question; + + public static final String JSON_PROPERTY_QUESTION_TYPE = "questionType"; + private String questionType; + + public static final String JSON_PROPERTY_SORT = "sort"; + private Integer sort; + + public Question() { + } + + public Question id(Integer id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(Integer id) { + this.id = id; + } + + + public Question question(String question) { + + this.question = question; + return this; + } + + /** + * Get question + * @return question + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_QUESTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getQuestion() { + return question; + } + + + @JsonProperty(JSON_PROPERTY_QUESTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setQuestion(String question) { + this.question = question; + } + + + public Question questionType(String questionType) { + + this.questionType = questionType; + return this; + } + + /** + * Get questionType + * @return questionType + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_QUESTION_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getQuestionType() { + return questionType; + } + + + @JsonProperty(JSON_PROPERTY_QUESTION_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setQuestionType(String questionType) { + this.questionType = questionType; + } + + + public Question sort(Integer sort) { + + this.sort = sort; + return this; + } + + /** + * Get sort + * @return sort + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SORT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getSort() { + return sort; + } + + + @JsonProperty(JSON_PROPERTY_SORT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSort(Integer sort) { + this.sort = sort; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Question question = (Question) o; + return Objects.equals(this.id, question.id) && + Objects.equals(this.question, question.question) && + Objects.equals(this.questionType, question.questionType) && + Objects.equals(this.sort, question.sort); + } + + @Override + public int hashCode() { + return Objects.hash(id, question, questionType, sort); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Question {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" question: ").append(toIndentedString(question)).append("\n"); + sb.append(" questionType: ").append(toIndentedString(questionType)).append("\n"); + sb.append(" sort: ").append(toIndentedString(sort)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `question` to the URL query string + if (getQuestion() != null) { + try { + joiner.add(String.format("%squestion%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getQuestion()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `questionType` to the URL query string + if (getQuestionType() != null) { + try { + joiner.add(String.format("%squestionType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getQuestionType()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `sort` to the URL query string + if (getSort() != null) { + try { + joiner.add(String.format("%ssort%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSort()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/QuestionAnswer.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/QuestionAnswer.java new file mode 100644 index 0000000..d171e7c --- /dev/null +++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/QuestionAnswer.java @@ -0,0 +1,193 @@ +/* + * Sessionize JSON-REST API + * Sessionize JSON-REST API documentation by XDEV Software + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package software.xdev.sessionize.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * QuestionAnswer + */ +@JsonPropertyOrder({ + QuestionAnswer.JSON_PROPERTY_QUESTION_ID, + QuestionAnswer.JSON_PROPERTY_ANSWER_VALUE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-26T17:30:53.867882+02:00[Europe/Berlin]") +public class QuestionAnswer { + public static final String JSON_PROPERTY_QUESTION_ID = "questionId"; + private Integer questionId; + + public static final String JSON_PROPERTY_ANSWER_VALUE = "answerValue"; + private String answerValue; + + public QuestionAnswer() { + } + + public QuestionAnswer questionId(Integer questionId) { + + this.questionId = questionId; + return this; + } + + /** + * Get questionId + * @return questionId + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_QUESTION_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getQuestionId() { + return questionId; + } + + + @JsonProperty(JSON_PROPERTY_QUESTION_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setQuestionId(Integer questionId) { + this.questionId = questionId; + } + + + public QuestionAnswer answerValue(String answerValue) { + + this.answerValue = answerValue; + return this; + } + + /** + * Get answerValue + * @return answerValue + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ANSWER_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getAnswerValue() { + return answerValue; + } + + + @JsonProperty(JSON_PROPERTY_ANSWER_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAnswerValue(String answerValue) { + this.answerValue = answerValue; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QuestionAnswer questionAnswer = (QuestionAnswer) o; + return Objects.equals(this.questionId, questionAnswer.questionId) && + Objects.equals(this.answerValue, questionAnswer.answerValue); + } + + @Override + public int hashCode() { + return Objects.hash(questionId, answerValue); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QuestionAnswer {\n"); + sb.append(" questionId: ").append(toIndentedString(questionId)).append("\n"); + sb.append(" answerValue: ").append(toIndentedString(answerValue)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `questionId` to the URL query string + if (getQuestionId() != null) { + try { + joiner.add(String.format("%squestionId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getQuestionId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `answerValue` to the URL query string + if (getAnswerValue() != null) { + try { + joiner.add(String.format("%sanswerValue%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAnswerValue()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/QuestionAnswerFull.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/QuestionAnswerFull.java new file mode 100644 index 0000000..a2a7f77 --- /dev/null +++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/QuestionAnswerFull.java @@ -0,0 +1,319 @@ +/* + * Sessionize JSON-REST API + * Sessionize JSON-REST API documentation by XDEV Software + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package software.xdev.sessionize.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * QuestionAnswerFull + */ +@JsonPropertyOrder({ + QuestionAnswerFull.JSON_PROPERTY_ID, + QuestionAnswerFull.JSON_PROPERTY_QUESTION, + QuestionAnswerFull.JSON_PROPERTY_QUESTION_TYPE, + QuestionAnswerFull.JSON_PROPERTY_ANSWER, + QuestionAnswerFull.JSON_PROPERTY_SORT +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-26T17:30:53.867882+02:00[Europe/Berlin]") +public class QuestionAnswerFull { + public static final String JSON_PROPERTY_ID = "id"; + private Integer id; + + public static final String JSON_PROPERTY_QUESTION = "question"; + private String question; + + public static final String JSON_PROPERTY_QUESTION_TYPE = "questionType"; + private String questionType; + + public static final String JSON_PROPERTY_ANSWER = "answer"; + private String answer; + + public static final String JSON_PROPERTY_SORT = "sort"; + private Integer sort; + + public QuestionAnswerFull() { + } + + public QuestionAnswerFull id(Integer id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(Integer id) { + this.id = id; + } + + + public QuestionAnswerFull question(String question) { + + this.question = question; + return this; + } + + /** + * Get question + * @return question + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_QUESTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getQuestion() { + return question; + } + + + @JsonProperty(JSON_PROPERTY_QUESTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setQuestion(String question) { + this.question = question; + } + + + public QuestionAnswerFull questionType(String questionType) { + + this.questionType = questionType; + return this; + } + + /** + * Get questionType + * @return questionType + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_QUESTION_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getQuestionType() { + return questionType; + } + + + @JsonProperty(JSON_PROPERTY_QUESTION_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setQuestionType(String questionType) { + this.questionType = questionType; + } + + + public QuestionAnswerFull answer(String answer) { + + this.answer = answer; + return this; + } + + /** + * Get answer + * @return answer + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ANSWER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getAnswer() { + return answer; + } + + + @JsonProperty(JSON_PROPERTY_ANSWER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAnswer(String answer) { + this.answer = answer; + } + + + public QuestionAnswerFull sort(Integer sort) { + + this.sort = sort; + return this; + } + + /** + * Get sort + * @return sort + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SORT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getSort() { + return sort; + } + + + @JsonProperty(JSON_PROPERTY_SORT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSort(Integer sort) { + this.sort = sort; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QuestionAnswerFull questionAnswerFull = (QuestionAnswerFull) o; + return Objects.equals(this.id, questionAnswerFull.id) && + Objects.equals(this.question, questionAnswerFull.question) && + Objects.equals(this.questionType, questionAnswerFull.questionType) && + Objects.equals(this.answer, questionAnswerFull.answer) && + Objects.equals(this.sort, questionAnswerFull.sort); + } + + @Override + public int hashCode() { + return Objects.hash(id, question, questionType, answer, sort); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QuestionAnswerFull {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" question: ").append(toIndentedString(question)).append("\n"); + sb.append(" questionType: ").append(toIndentedString(questionType)).append("\n"); + sb.append(" answer: ").append(toIndentedString(answer)).append("\n"); + sb.append(" sort: ").append(toIndentedString(sort)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `question` to the URL query string + if (getQuestion() != null) { + try { + joiner.add(String.format("%squestion%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getQuestion()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `questionType` to the URL query string + if (getQuestionType() != null) { + try { + joiner.add(String.format("%squestionType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getQuestionType()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `answer` to the URL query string + if (getAnswer() != null) { + try { + joiner.add(String.format("%sanswer%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAnswer()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `sort` to the URL query string + if (getSort() != null) { + try { + joiner.add(String.format("%ssort%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSort()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/Room.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/Room.java new file mode 100644 index 0000000..e9f87db --- /dev/null +++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/Room.java @@ -0,0 +1,235 @@ +/* + * Sessionize JSON-REST API + * Sessionize JSON-REST API documentation by XDEV Software + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package software.xdev.sessionize.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Room + */ +@JsonPropertyOrder({ + Room.JSON_PROPERTY_ID, + Room.JSON_PROPERTY_NAME, + Room.JSON_PROPERTY_SORT +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-26T17:30:53.867882+02:00[Europe/Berlin]") +public class Room { + public static final String JSON_PROPERTY_ID = "id"; + private Integer id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_SORT = "sort"; + private Integer sort; + + public Room() { + } + + public Room id(Integer id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(Integer id) { + this.id = id; + } + + + public Room name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + + public Room sort(Integer sort) { + + this.sort = sort; + return this; + } + + /** + * Get sort + * @return sort + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SORT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getSort() { + return sort; + } + + + @JsonProperty(JSON_PROPERTY_SORT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSort(Integer sort) { + this.sort = sort; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Room room = (Room) o; + return Objects.equals(this.id, room.id) && + Objects.equals(this.name, room.name) && + Objects.equals(this.sort, room.sort); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, sort); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Room {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" sort: ").append(toIndentedString(sort)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `sort` to the URL query string + if (getSort() != null) { + try { + joiner.add(String.format("%ssort%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSort()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/Session.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/Session.java new file mode 100644 index 0000000..67851e8 --- /dev/null +++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/Session.java @@ -0,0 +1,771 @@ +/* + * Sessionize JSON-REST API + * Sessionize JSON-REST API documentation by XDEV Software + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package software.xdev.sessionize.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.net.URI; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import software.xdev.sessionize.model.QuestionAnswerFull; +import software.xdev.sessionize.model.SpeakerMinimal; +import software.xdev.sessionize.model.Status; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Session + */ +@JsonPropertyOrder({ + Session.JSON_PROPERTY_TITLE, + Session.JSON_PROPERTY_DESCRIPTION, + Session.JSON_PROPERTY_STARTS_AT, + Session.JSON_PROPERTY_ENDS_AT, + Session.JSON_PROPERTY_IS_SERVICE_SESSION, + Session.JSON_PROPERTY_IS_PLENUM_SESSION, + Session.JSON_PROPERTY_CATEGORY_ITEMS, + Session.JSON_PROPERTY_ROOM_ID, + Session.JSON_PROPERTY_LIVE_URL, + Session.JSON_PROPERTY_RECORDING_URL, + Session.JSON_PROPERTY_STATUS, + Session.JSON_PROPERTY_ID, + Session.JSON_PROPERTY_SPEAKERS, + Session.JSON_PROPERTY_QUESTION_ANSWERS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-26T17:30:53.867882+02:00[Europe/Berlin]") +public class Session { + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private JsonNullable description = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_STARTS_AT = "startsAt"; + private OffsetDateTime startsAt; + + public static final String JSON_PROPERTY_ENDS_AT = "endsAt"; + private OffsetDateTime endsAt; + + public static final String JSON_PROPERTY_IS_SERVICE_SESSION = "isServiceSession"; + private Boolean isServiceSession; + + public static final String JSON_PROPERTY_IS_PLENUM_SESSION = "isPlenumSession"; + private Boolean isPlenumSession; + + public static final String JSON_PROPERTY_CATEGORY_ITEMS = "categoryItems"; + private List categoryItems = new ArrayList<>(); + + public static final String JSON_PROPERTY_ROOM_ID = "roomId"; + private Integer roomId; + + public static final String JSON_PROPERTY_LIVE_URL = "liveUrl"; + private JsonNullable liveUrl = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_RECORDING_URL = "recordingUrl"; + private JsonNullable recordingUrl = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_STATUS = "status"; + private Status status; + + public static final String JSON_PROPERTY_ID = "id"; + private Integer id; + + public static final String JSON_PROPERTY_SPEAKERS = "speakers"; + private List speakers = new ArrayList<>(); + + public static final String JSON_PROPERTY_QUESTION_ANSWERS = "questionAnswers"; + private List questionAnswers = new ArrayList<>(); + + public Session() { + } + + public Session title(String title) { + + this.title = title; + return this; + } + + /** + * Get title + * @return title + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getTitle() { + return title; + } + + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTitle(String title) { + this.title = title; + } + + + public Session description(String description) { + this.description = JsonNullable.of(description); + + return this; + } + + /** + * Get description + * @return description + **/ + @jakarta.annotation.Nullable + @JsonIgnore + + public String getDescription() { + return description.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getDescription_JsonNullable() { + return description; + } + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + public void setDescription_JsonNullable(JsonNullable description) { + this.description = description; + } + + public void setDescription(String description) { + this.description = JsonNullable.of(description); + } + + + public Session startsAt(OffsetDateTime startsAt) { + + this.startsAt = startsAt; + return this; + } + + /** + * Get startsAt + * @return startsAt + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STARTS_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public OffsetDateTime getStartsAt() { + return startsAt; + } + + + @JsonProperty(JSON_PROPERTY_STARTS_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStartsAt(OffsetDateTime startsAt) { + this.startsAt = startsAt; + } + + + public Session endsAt(OffsetDateTime endsAt) { + + this.endsAt = endsAt; + return this; + } + + /** + * Get endsAt + * @return endsAt + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENDS_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public OffsetDateTime getEndsAt() { + return endsAt; + } + + + @JsonProperty(JSON_PROPERTY_ENDS_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEndsAt(OffsetDateTime endsAt) { + this.endsAt = endsAt; + } + + + public Session isServiceSession(Boolean isServiceSession) { + + this.isServiceSession = isServiceSession; + return this; + } + + /** + * Get isServiceSession + * @return isServiceSession + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_IS_SERVICE_SESSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Boolean getIsServiceSession() { + return isServiceSession; + } + + + @JsonProperty(JSON_PROPERTY_IS_SERVICE_SESSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setIsServiceSession(Boolean isServiceSession) { + this.isServiceSession = isServiceSession; + } + + + public Session isPlenumSession(Boolean isPlenumSession) { + + this.isPlenumSession = isPlenumSession; + return this; + } + + /** + * Get isPlenumSession + * @return isPlenumSession + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_IS_PLENUM_SESSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Boolean getIsPlenumSession() { + return isPlenumSession; + } + + + @JsonProperty(JSON_PROPERTY_IS_PLENUM_SESSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setIsPlenumSession(Boolean isPlenumSession) { + this.isPlenumSession = isPlenumSession; + } + + + public Session categoryItems(List categoryItems) { + + this.categoryItems = categoryItems; + return this; + } + + public Session addCategoryItemsItem(Integer categoryItemsItem) { + if (this.categoryItems == null) { + this.categoryItems = new ArrayList<>(); + } + this.categoryItems.add(categoryItemsItem); + return this; + } + + /** + * Get categoryItems + * @return categoryItems + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CATEGORY_ITEMS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getCategoryItems() { + return categoryItems; + } + + + @JsonProperty(JSON_PROPERTY_CATEGORY_ITEMS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCategoryItems(List categoryItems) { + this.categoryItems = categoryItems; + } + + + public Session roomId(Integer roomId) { + + this.roomId = roomId; + return this; + } + + /** + * Get roomId + * @return roomId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ROOM_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getRoomId() { + return roomId; + } + + + @JsonProperty(JSON_PROPERTY_ROOM_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRoomId(Integer roomId) { + this.roomId = roomId; + } + + + public Session liveUrl(URI liveUrl) { + this.liveUrl = JsonNullable.of(liveUrl); + + return this; + } + + /** + * Get liveUrl + * @return liveUrl + **/ + @jakarta.annotation.Nullable + @JsonIgnore + + public URI getLiveUrl() { + return liveUrl.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_LIVE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getLiveUrl_JsonNullable() { + return liveUrl; + } + + @JsonProperty(JSON_PROPERTY_LIVE_URL) + public void setLiveUrl_JsonNullable(JsonNullable liveUrl) { + this.liveUrl = liveUrl; + } + + public void setLiveUrl(URI liveUrl) { + this.liveUrl = JsonNullable.of(liveUrl); + } + + + public Session recordingUrl(URI recordingUrl) { + this.recordingUrl = JsonNullable.of(recordingUrl); + + return this; + } + + /** + * Get recordingUrl + * @return recordingUrl + **/ + @jakarta.annotation.Nullable + @JsonIgnore + + public URI getRecordingUrl() { + return recordingUrl.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_RECORDING_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getRecordingUrl_JsonNullable() { + return recordingUrl; + } + + @JsonProperty(JSON_PROPERTY_RECORDING_URL) + public void setRecordingUrl_JsonNullable(JsonNullable recordingUrl) { + this.recordingUrl = recordingUrl; + } + + public void setRecordingUrl(URI recordingUrl) { + this.recordingUrl = JsonNullable.of(recordingUrl); + } + + + public Session status(Status status) { + + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Status getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStatus(Status status) { + this.status = status; + } + + + public Session id(Integer id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(Integer id) { + this.id = id; + } + + + public Session speakers(List speakers) { + + this.speakers = speakers; + return this; + } + + public Session addSpeakersItem(SpeakerMinimal speakersItem) { + if (this.speakers == null) { + this.speakers = new ArrayList<>(); + } + this.speakers.add(speakersItem); + return this; + } + + /** + * Get speakers + * @return speakers + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SPEAKERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getSpeakers() { + return speakers; + } + + + @JsonProperty(JSON_PROPERTY_SPEAKERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSpeakers(List speakers) { + this.speakers = speakers; + } + + + public Session questionAnswers(List questionAnswers) { + + this.questionAnswers = questionAnswers; + return this; + } + + public Session addQuestionAnswersItem(QuestionAnswerFull questionAnswersItem) { + if (this.questionAnswers == null) { + this.questionAnswers = new ArrayList<>(); + } + this.questionAnswers.add(questionAnswersItem); + return this; + } + + /** + * Get questionAnswers + * @return questionAnswers + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_QUESTION_ANSWERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getQuestionAnswers() { + return questionAnswers; + } + + + @JsonProperty(JSON_PROPERTY_QUESTION_ANSWERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setQuestionAnswers(List questionAnswers) { + this.questionAnswers = questionAnswers; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Session session = (Session) o; + return Objects.equals(this.title, session.title) && + equalsNullable(this.description, session.description) && + Objects.equals(this.startsAt, session.startsAt) && + Objects.equals(this.endsAt, session.endsAt) && + Objects.equals(this.isServiceSession, session.isServiceSession) && + Objects.equals(this.isPlenumSession, session.isPlenumSession) && + Objects.equals(this.categoryItems, session.categoryItems) && + Objects.equals(this.roomId, session.roomId) && + equalsNullable(this.liveUrl, session.liveUrl) && + equalsNullable(this.recordingUrl, session.recordingUrl) && + Objects.equals(this.status, session.status) && + Objects.equals(this.id, session.id) && + Objects.equals(this.speakers, session.speakers) && + Objects.equals(this.questionAnswers, session.questionAnswers); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(title, hashCodeNullable(description), startsAt, endsAt, isServiceSession, isPlenumSession, categoryItems, roomId, hashCodeNullable(liveUrl), hashCodeNullable(recordingUrl), status, id, speakers, questionAnswers); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Session {\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" startsAt: ").append(toIndentedString(startsAt)).append("\n"); + sb.append(" endsAt: ").append(toIndentedString(endsAt)).append("\n"); + sb.append(" isServiceSession: ").append(toIndentedString(isServiceSession)).append("\n"); + sb.append(" isPlenumSession: ").append(toIndentedString(isPlenumSession)).append("\n"); + sb.append(" categoryItems: ").append(toIndentedString(categoryItems)).append("\n"); + sb.append(" roomId: ").append(toIndentedString(roomId)).append("\n"); + sb.append(" liveUrl: ").append(toIndentedString(liveUrl)).append("\n"); + sb.append(" recordingUrl: ").append(toIndentedString(recordingUrl)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" speakers: ").append(toIndentedString(speakers)).append("\n"); + sb.append(" questionAnswers: ").append(toIndentedString(questionAnswers)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `title` to the URL query string + if (getTitle() != null) { + try { + joiner.add(String.format("%stitle%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTitle()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `description` to the URL query string + if (getDescription() != null) { + try { + joiner.add(String.format("%sdescription%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDescription()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `startsAt` to the URL query string + if (getStartsAt() != null) { + try { + joiner.add(String.format("%sstartsAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStartsAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `endsAt` to the URL query string + if (getEndsAt() != null) { + try { + joiner.add(String.format("%sendsAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEndsAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `isServiceSession` to the URL query string + if (getIsServiceSession() != null) { + try { + joiner.add(String.format("%sisServiceSession%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIsServiceSession()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `isPlenumSession` to the URL query string + if (getIsPlenumSession() != null) { + try { + joiner.add(String.format("%sisPlenumSession%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIsPlenumSession()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `categoryItems` to the URL query string + if (getCategoryItems() != null) { + for (int i = 0; i < getCategoryItems().size(); i++) { + try { + joiner.add(String.format("%scategoryItems%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getCategoryItems().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `roomId` to the URL query string + if (getRoomId() != null) { + try { + joiner.add(String.format("%sroomId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getRoomId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `liveUrl` to the URL query string + if (getLiveUrl() != null) { + try { + joiner.add(String.format("%sliveUrl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getLiveUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `recordingUrl` to the URL query string + if (getRecordingUrl() != null) { + try { + joiner.add(String.format("%srecordingUrl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getRecordingUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `status` to the URL query string + if (getStatus() != null) { + try { + joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStatus()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `speakers` to the URL query string + if (getSpeakers() != null) { + for (int i = 0; i < getSpeakers().size(); i++) { + if (getSpeakers().get(i) != null) { + joiner.add(getSpeakers().get(i).toUrlQueryString(String.format("%sspeakers%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `questionAnswers` to the URL query string + if (getQuestionAnswers() != null) { + for (int i = 0; i < getQuestionAnswers().size(); i++) { + if (getQuestionAnswers().get(i) != null) { + joiner.add(getQuestionAnswers().get(i).toUrlQueryString(String.format("%squestionAnswers%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SessionAll.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SessionAll.java new file mode 100644 index 0000000..6e6110d --- /dev/null +++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SessionAll.java @@ -0,0 +1,774 @@ +/* + * Sessionize JSON-REST API + * Sessionize JSON-REST API documentation by XDEV Software + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package software.xdev.sessionize.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.net.URI; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import software.xdev.sessionize.model.QuestionAnswer; +import software.xdev.sessionize.model.Status; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * SessionAll + */ +@JsonPropertyOrder({ + SessionAll.JSON_PROPERTY_TITLE, + SessionAll.JSON_PROPERTY_DESCRIPTION, + SessionAll.JSON_PROPERTY_STARTS_AT, + SessionAll.JSON_PROPERTY_ENDS_AT, + SessionAll.JSON_PROPERTY_IS_SERVICE_SESSION, + SessionAll.JSON_PROPERTY_IS_PLENUM_SESSION, + SessionAll.JSON_PROPERTY_CATEGORY_ITEMS, + SessionAll.JSON_PROPERTY_ROOM_ID, + SessionAll.JSON_PROPERTY_LIVE_URL, + SessionAll.JSON_PROPERTY_RECORDING_URL, + SessionAll.JSON_PROPERTY_STATUS, + SessionAll.JSON_PROPERTY_ID, + SessionAll.JSON_PROPERTY_SPEAKERS, + SessionAll.JSON_PROPERTY_QUESTION_ANSWERS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-26T17:30:53.867882+02:00[Europe/Berlin]") +public class SessionAll { + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private JsonNullable description = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_STARTS_AT = "startsAt"; + private OffsetDateTime startsAt; + + public static final String JSON_PROPERTY_ENDS_AT = "endsAt"; + private OffsetDateTime endsAt; + + public static final String JSON_PROPERTY_IS_SERVICE_SESSION = "isServiceSession"; + private Boolean isServiceSession; + + public static final String JSON_PROPERTY_IS_PLENUM_SESSION = "isPlenumSession"; + private Boolean isPlenumSession; + + public static final String JSON_PROPERTY_CATEGORY_ITEMS = "categoryItems"; + private List categoryItems = new ArrayList<>(); + + public static final String JSON_PROPERTY_ROOM_ID = "roomId"; + private Integer roomId; + + public static final String JSON_PROPERTY_LIVE_URL = "liveUrl"; + private JsonNullable liveUrl = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_RECORDING_URL = "recordingUrl"; + private JsonNullable recordingUrl = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_STATUS = "status"; + private Status status; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_SPEAKERS = "speakers"; + private List speakers = new ArrayList<>(); + + public static final String JSON_PROPERTY_QUESTION_ANSWERS = "questionAnswers"; + private List questionAnswers = new ArrayList<>(); + + public SessionAll() { + } + + public SessionAll title(String title) { + + this.title = title; + return this; + } + + /** + * Get title + * @return title + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getTitle() { + return title; + } + + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTitle(String title) { + this.title = title; + } + + + public SessionAll description(String description) { + this.description = JsonNullable.of(description); + + return this; + } + + /** + * Get description + * @return description + **/ + @jakarta.annotation.Nullable + @JsonIgnore + + public String getDescription() { + return description.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getDescription_JsonNullable() { + return description; + } + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + public void setDescription_JsonNullable(JsonNullable description) { + this.description = description; + } + + public void setDescription(String description) { + this.description = JsonNullable.of(description); + } + + + public SessionAll startsAt(OffsetDateTime startsAt) { + + this.startsAt = startsAt; + return this; + } + + /** + * Get startsAt + * @return startsAt + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STARTS_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public OffsetDateTime getStartsAt() { + return startsAt; + } + + + @JsonProperty(JSON_PROPERTY_STARTS_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStartsAt(OffsetDateTime startsAt) { + this.startsAt = startsAt; + } + + + public SessionAll endsAt(OffsetDateTime endsAt) { + + this.endsAt = endsAt; + return this; + } + + /** + * Get endsAt + * @return endsAt + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENDS_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public OffsetDateTime getEndsAt() { + return endsAt; + } + + + @JsonProperty(JSON_PROPERTY_ENDS_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEndsAt(OffsetDateTime endsAt) { + this.endsAt = endsAt; + } + + + public SessionAll isServiceSession(Boolean isServiceSession) { + + this.isServiceSession = isServiceSession; + return this; + } + + /** + * Get isServiceSession + * @return isServiceSession + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_IS_SERVICE_SESSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Boolean getIsServiceSession() { + return isServiceSession; + } + + + @JsonProperty(JSON_PROPERTY_IS_SERVICE_SESSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setIsServiceSession(Boolean isServiceSession) { + this.isServiceSession = isServiceSession; + } + + + public SessionAll isPlenumSession(Boolean isPlenumSession) { + + this.isPlenumSession = isPlenumSession; + return this; + } + + /** + * Get isPlenumSession + * @return isPlenumSession + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_IS_PLENUM_SESSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Boolean getIsPlenumSession() { + return isPlenumSession; + } + + + @JsonProperty(JSON_PROPERTY_IS_PLENUM_SESSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setIsPlenumSession(Boolean isPlenumSession) { + this.isPlenumSession = isPlenumSession; + } + + + public SessionAll categoryItems(List categoryItems) { + + this.categoryItems = categoryItems; + return this; + } + + public SessionAll addCategoryItemsItem(Integer categoryItemsItem) { + if (this.categoryItems == null) { + this.categoryItems = new ArrayList<>(); + } + this.categoryItems.add(categoryItemsItem); + return this; + } + + /** + * Get categoryItems + * @return categoryItems + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CATEGORY_ITEMS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getCategoryItems() { + return categoryItems; + } + + + @JsonProperty(JSON_PROPERTY_CATEGORY_ITEMS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCategoryItems(List categoryItems) { + this.categoryItems = categoryItems; + } + + + public SessionAll roomId(Integer roomId) { + + this.roomId = roomId; + return this; + } + + /** + * Get roomId + * @return roomId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ROOM_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getRoomId() { + return roomId; + } + + + @JsonProperty(JSON_PROPERTY_ROOM_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRoomId(Integer roomId) { + this.roomId = roomId; + } + + + public SessionAll liveUrl(URI liveUrl) { + this.liveUrl = JsonNullable.of(liveUrl); + + return this; + } + + /** + * Get liveUrl + * @return liveUrl + **/ + @jakarta.annotation.Nullable + @JsonIgnore + + public URI getLiveUrl() { + return liveUrl.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_LIVE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getLiveUrl_JsonNullable() { + return liveUrl; + } + + @JsonProperty(JSON_PROPERTY_LIVE_URL) + public void setLiveUrl_JsonNullable(JsonNullable liveUrl) { + this.liveUrl = liveUrl; + } + + public void setLiveUrl(URI liveUrl) { + this.liveUrl = JsonNullable.of(liveUrl); + } + + + public SessionAll recordingUrl(URI recordingUrl) { + this.recordingUrl = JsonNullable.of(recordingUrl); + + return this; + } + + /** + * Get recordingUrl + * @return recordingUrl + **/ + @jakarta.annotation.Nullable + @JsonIgnore + + public URI getRecordingUrl() { + return recordingUrl.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_RECORDING_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getRecordingUrl_JsonNullable() { + return recordingUrl; + } + + @JsonProperty(JSON_PROPERTY_RECORDING_URL) + public void setRecordingUrl_JsonNullable(JsonNullable recordingUrl) { + this.recordingUrl = recordingUrl; + } + + public void setRecordingUrl(URI recordingUrl) { + this.recordingUrl = JsonNullable.of(recordingUrl); + } + + + public SessionAll status(Status status) { + + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Status getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStatus(Status status) { + this.status = status; + } + + + public SessionAll id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(String id) { + this.id = id; + } + + + public SessionAll speakers(List speakers) { + + this.speakers = speakers; + return this; + } + + public SessionAll addSpeakersItem(String speakersItem) { + if (this.speakers == null) { + this.speakers = new ArrayList<>(); + } + this.speakers.add(speakersItem); + return this; + } + + /** + * Get speakers + * @return speakers + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SPEAKERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getSpeakers() { + return speakers; + } + + + @JsonProperty(JSON_PROPERTY_SPEAKERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSpeakers(List speakers) { + this.speakers = speakers; + } + + + public SessionAll questionAnswers(List questionAnswers) { + + this.questionAnswers = questionAnswers; + return this; + } + + public SessionAll addQuestionAnswersItem(QuestionAnswer questionAnswersItem) { + if (this.questionAnswers == null) { + this.questionAnswers = new ArrayList<>(); + } + this.questionAnswers.add(questionAnswersItem); + return this; + } + + /** + * Get questionAnswers + * @return questionAnswers + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_QUESTION_ANSWERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getQuestionAnswers() { + return questionAnswers; + } + + + @JsonProperty(JSON_PROPERTY_QUESTION_ANSWERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setQuestionAnswers(List questionAnswers) { + this.questionAnswers = questionAnswers; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SessionAll sessionAll = (SessionAll) o; + return Objects.equals(this.title, sessionAll.title) && + equalsNullable(this.description, sessionAll.description) && + Objects.equals(this.startsAt, sessionAll.startsAt) && + Objects.equals(this.endsAt, sessionAll.endsAt) && + Objects.equals(this.isServiceSession, sessionAll.isServiceSession) && + Objects.equals(this.isPlenumSession, sessionAll.isPlenumSession) && + Objects.equals(this.categoryItems, sessionAll.categoryItems) && + Objects.equals(this.roomId, sessionAll.roomId) && + equalsNullable(this.liveUrl, sessionAll.liveUrl) && + equalsNullable(this.recordingUrl, sessionAll.recordingUrl) && + Objects.equals(this.status, sessionAll.status) && + Objects.equals(this.id, sessionAll.id) && + Objects.equals(this.speakers, sessionAll.speakers) && + Objects.equals(this.questionAnswers, sessionAll.questionAnswers); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(title, hashCodeNullable(description), startsAt, endsAt, isServiceSession, isPlenumSession, categoryItems, roomId, hashCodeNullable(liveUrl), hashCodeNullable(recordingUrl), status, id, speakers, questionAnswers); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SessionAll {\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" startsAt: ").append(toIndentedString(startsAt)).append("\n"); + sb.append(" endsAt: ").append(toIndentedString(endsAt)).append("\n"); + sb.append(" isServiceSession: ").append(toIndentedString(isServiceSession)).append("\n"); + sb.append(" isPlenumSession: ").append(toIndentedString(isPlenumSession)).append("\n"); + sb.append(" categoryItems: ").append(toIndentedString(categoryItems)).append("\n"); + sb.append(" roomId: ").append(toIndentedString(roomId)).append("\n"); + sb.append(" liveUrl: ").append(toIndentedString(liveUrl)).append("\n"); + sb.append(" recordingUrl: ").append(toIndentedString(recordingUrl)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" speakers: ").append(toIndentedString(speakers)).append("\n"); + sb.append(" questionAnswers: ").append(toIndentedString(questionAnswers)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `title` to the URL query string + if (getTitle() != null) { + try { + joiner.add(String.format("%stitle%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTitle()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `description` to the URL query string + if (getDescription() != null) { + try { + joiner.add(String.format("%sdescription%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDescription()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `startsAt` to the URL query string + if (getStartsAt() != null) { + try { + joiner.add(String.format("%sstartsAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStartsAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `endsAt` to the URL query string + if (getEndsAt() != null) { + try { + joiner.add(String.format("%sendsAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEndsAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `isServiceSession` to the URL query string + if (getIsServiceSession() != null) { + try { + joiner.add(String.format("%sisServiceSession%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIsServiceSession()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `isPlenumSession` to the URL query string + if (getIsPlenumSession() != null) { + try { + joiner.add(String.format("%sisPlenumSession%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIsPlenumSession()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `categoryItems` to the URL query string + if (getCategoryItems() != null) { + for (int i = 0; i < getCategoryItems().size(); i++) { + try { + joiner.add(String.format("%scategoryItems%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getCategoryItems().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `roomId` to the URL query string + if (getRoomId() != null) { + try { + joiner.add(String.format("%sroomId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getRoomId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `liveUrl` to the URL query string + if (getLiveUrl() != null) { + try { + joiner.add(String.format("%sliveUrl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getLiveUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `recordingUrl` to the URL query string + if (getRecordingUrl() != null) { + try { + joiner.add(String.format("%srecordingUrl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getRecordingUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `status` to the URL query string + if (getStatus() != null) { + try { + joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStatus()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `speakers` to the URL query string + if (getSpeakers() != null) { + for (int i = 0; i < getSpeakers().size(); i++) { + try { + joiner.add(String.format("%sspeakers%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getSpeakers().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `questionAnswers` to the URL query string + if (getQuestionAnswers() != null) { + for (int i = 0; i < getQuestionAnswers().size(); i++) { + if (getQuestionAnswers().get(i) != null) { + joiner.add(getQuestionAnswers().get(i).toUrlQueryString(String.format("%squestionAnswers%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SessionAllAllOf.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SessionAllAllOf.java new file mode 100644 index 0000000..97a1bde --- /dev/null +++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SessionAllAllOf.java @@ -0,0 +1,259 @@ +/* + * Sessionize JSON-REST API + * Sessionize JSON-REST API documentation by XDEV Software + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package software.xdev.sessionize.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.List; +import software.xdev.sessionize.model.QuestionAnswer; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * SessionAllAllOf + */ +@JsonPropertyOrder({ + SessionAllAllOf.JSON_PROPERTY_ID, + SessionAllAllOf.JSON_PROPERTY_SPEAKERS, + SessionAllAllOf.JSON_PROPERTY_QUESTION_ANSWERS +}) +@JsonTypeName("SessionAll_allOf") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-26T17:30:53.867882+02:00[Europe/Berlin]") +public class SessionAllAllOf { + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_SPEAKERS = "speakers"; + private List speakers = new ArrayList<>(); + + public static final String JSON_PROPERTY_QUESTION_ANSWERS = "questionAnswers"; + private List questionAnswers = new ArrayList<>(); + + public SessionAllAllOf() { + } + + public SessionAllAllOf id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(String id) { + this.id = id; + } + + + public SessionAllAllOf speakers(List speakers) { + + this.speakers = speakers; + return this; + } + + public SessionAllAllOf addSpeakersItem(String speakersItem) { + if (this.speakers == null) { + this.speakers = new ArrayList<>(); + } + this.speakers.add(speakersItem); + return this; + } + + /** + * Get speakers + * @return speakers + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SPEAKERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getSpeakers() { + return speakers; + } + + + @JsonProperty(JSON_PROPERTY_SPEAKERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSpeakers(List speakers) { + this.speakers = speakers; + } + + + public SessionAllAllOf questionAnswers(List questionAnswers) { + + this.questionAnswers = questionAnswers; + return this; + } + + public SessionAllAllOf addQuestionAnswersItem(QuestionAnswer questionAnswersItem) { + if (this.questionAnswers == null) { + this.questionAnswers = new ArrayList<>(); + } + this.questionAnswers.add(questionAnswersItem); + return this; + } + + /** + * Get questionAnswers + * @return questionAnswers + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_QUESTION_ANSWERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getQuestionAnswers() { + return questionAnswers; + } + + + @JsonProperty(JSON_PROPERTY_QUESTION_ANSWERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setQuestionAnswers(List questionAnswers) { + this.questionAnswers = questionAnswers; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SessionAllAllOf sessionAllAllOf = (SessionAllAllOf) o; + return Objects.equals(this.id, sessionAllAllOf.id) && + Objects.equals(this.speakers, sessionAllAllOf.speakers) && + Objects.equals(this.questionAnswers, sessionAllAllOf.questionAnswers); + } + + @Override + public int hashCode() { + return Objects.hash(id, speakers, questionAnswers); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SessionAllAllOf {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" speakers: ").append(toIndentedString(speakers)).append("\n"); + sb.append(" questionAnswers: ").append(toIndentedString(questionAnswers)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `speakers` to the URL query string + if (getSpeakers() != null) { + for (int i = 0; i < getSpeakers().size(); i++) { + try { + joiner.add(String.format("%sspeakers%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getSpeakers().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `questionAnswers` to the URL query string + if (getQuestionAnswers() != null) { + for (int i = 0; i < getQuestionAnswers().size(); i++) { + if (getQuestionAnswers().get(i) != null) { + joiner.add(getQuestionAnswers().get(i).toUrlQueryString(String.format("%squestionAnswers%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SessionAllOf.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SessionAllOf.java new file mode 100644 index 0000000..10bafbf --- /dev/null +++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SessionAllOf.java @@ -0,0 +1,256 @@ +/* + * Sessionize JSON-REST API + * Sessionize JSON-REST API documentation by XDEV Software + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package software.xdev.sessionize.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.List; +import software.xdev.sessionize.model.QuestionAnswerFull; +import software.xdev.sessionize.model.SpeakerMinimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * SessionAllOf + */ +@JsonPropertyOrder({ + SessionAllOf.JSON_PROPERTY_ID, + SessionAllOf.JSON_PROPERTY_SPEAKERS, + SessionAllOf.JSON_PROPERTY_QUESTION_ANSWERS +}) +@JsonTypeName("Session_allOf") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-26T17:30:53.867882+02:00[Europe/Berlin]") +public class SessionAllOf { + public static final String JSON_PROPERTY_ID = "id"; + private Integer id; + + public static final String JSON_PROPERTY_SPEAKERS = "speakers"; + private List speakers = new ArrayList<>(); + + public static final String JSON_PROPERTY_QUESTION_ANSWERS = "questionAnswers"; + private List questionAnswers = new ArrayList<>(); + + public SessionAllOf() { + } + + public SessionAllOf id(Integer id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(Integer id) { + this.id = id; + } + + + public SessionAllOf speakers(List speakers) { + + this.speakers = speakers; + return this; + } + + public SessionAllOf addSpeakersItem(SpeakerMinimal speakersItem) { + if (this.speakers == null) { + this.speakers = new ArrayList<>(); + } + this.speakers.add(speakersItem); + return this; + } + + /** + * Get speakers + * @return speakers + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SPEAKERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getSpeakers() { + return speakers; + } + + + @JsonProperty(JSON_PROPERTY_SPEAKERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSpeakers(List speakers) { + this.speakers = speakers; + } + + + public SessionAllOf questionAnswers(List questionAnswers) { + + this.questionAnswers = questionAnswers; + return this; + } + + public SessionAllOf addQuestionAnswersItem(QuestionAnswerFull questionAnswersItem) { + if (this.questionAnswers == null) { + this.questionAnswers = new ArrayList<>(); + } + this.questionAnswers.add(questionAnswersItem); + return this; + } + + /** + * Get questionAnswers + * @return questionAnswers + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_QUESTION_ANSWERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getQuestionAnswers() { + return questionAnswers; + } + + + @JsonProperty(JSON_PROPERTY_QUESTION_ANSWERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setQuestionAnswers(List questionAnswers) { + this.questionAnswers = questionAnswers; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SessionAllOf sessionAllOf = (SessionAllOf) o; + return Objects.equals(this.id, sessionAllOf.id) && + Objects.equals(this.speakers, sessionAllOf.speakers) && + Objects.equals(this.questionAnswers, sessionAllOf.questionAnswers); + } + + @Override + public int hashCode() { + return Objects.hash(id, speakers, questionAnswers); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SessionAllOf {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" speakers: ").append(toIndentedString(speakers)).append("\n"); + sb.append(" questionAnswers: ").append(toIndentedString(questionAnswers)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `speakers` to the URL query string + if (getSpeakers() != null) { + for (int i = 0; i < getSpeakers().size(); i++) { + if (getSpeakers().get(i) != null) { + joiner.add(getSpeakers().get(i).toUrlQueryString(String.format("%sspeakers%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `questionAnswers` to the URL query string + if (getQuestionAnswers() != null) { + for (int i = 0; i < getQuestionAnswers().size(); i++) { + if (getQuestionAnswers().get(i) != null) { + joiner.add(getQuestionAnswers().get(i).toUrlQueryString(String.format("%squestionAnswers%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SessionGroup.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SessionGroup.java new file mode 100644 index 0000000..ee39322 --- /dev/null +++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SessionGroup.java @@ -0,0 +1,288 @@ +/* + * Sessionize JSON-REST API + * Sessionize JSON-REST API documentation by XDEV Software + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package software.xdev.sessionize.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.List; +import software.xdev.sessionize.model.Session; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * SessionGroup + */ +@JsonPropertyOrder({ + SessionGroup.JSON_PROPERTY_GROUP_ID, + SessionGroup.JSON_PROPERTY_GROUP_NAME, + SessionGroup.JSON_PROPERTY_SESSIONS, + SessionGroup.JSON_PROPERTY_IS_DEFAULT +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-26T17:30:53.867882+02:00[Europe/Berlin]") +public class SessionGroup { + public static final String JSON_PROPERTY_GROUP_ID = "groupId"; + private Integer groupId; + + public static final String JSON_PROPERTY_GROUP_NAME = "groupName"; + private String groupName; + + public static final String JSON_PROPERTY_SESSIONS = "sessions"; + private List sessions; + + public static final String JSON_PROPERTY_IS_DEFAULT = "isDefault"; + private Boolean isDefault; + + public SessionGroup() { + } + + public SessionGroup groupId(Integer groupId) { + + this.groupId = groupId; + return this; + } + + /** + * Get groupId + * @return groupId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GROUP_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getGroupId() { + return groupId; + } + + + @JsonProperty(JSON_PROPERTY_GROUP_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroupId(Integer groupId) { + this.groupId = groupId; + } + + + public SessionGroup groupName(String groupName) { + + this.groupName = groupName; + return this; + } + + /** + * Get groupName + * @return groupName + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GROUP_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getGroupName() { + return groupName; + } + + + @JsonProperty(JSON_PROPERTY_GROUP_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroupName(String groupName) { + this.groupName = groupName; + } + + + public SessionGroup sessions(List sessions) { + + this.sessions = sessions; + return this; + } + + public SessionGroup addSessionsItem(Session sessionsItem) { + if (this.sessions == null) { + this.sessions = new ArrayList<>(); + } + this.sessions.add(sessionsItem); + return this; + } + + /** + * Get sessions + * @return sessions + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SESSIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getSessions() { + return sessions; + } + + + @JsonProperty(JSON_PROPERTY_SESSIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSessions(List sessions) { + this.sessions = sessions; + } + + + public SessionGroup isDefault(Boolean isDefault) { + + this.isDefault = isDefault; + return this; + } + + /** + * Get isDefault + * @return isDefault + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_DEFAULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsDefault() { + return isDefault; + } + + + @JsonProperty(JSON_PROPERTY_IS_DEFAULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsDefault(Boolean isDefault) { + this.isDefault = isDefault; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SessionGroup sessionGroup = (SessionGroup) o; + return Objects.equals(this.groupId, sessionGroup.groupId) && + Objects.equals(this.groupName, sessionGroup.groupName) && + Objects.equals(this.sessions, sessionGroup.sessions) && + Objects.equals(this.isDefault, sessionGroup.isDefault); + } + + @Override + public int hashCode() { + return Objects.hash(groupId, groupName, sessions, isDefault); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SessionGroup {\n"); + sb.append(" groupId: ").append(toIndentedString(groupId)).append("\n"); + sb.append(" groupName: ").append(toIndentedString(groupName)).append("\n"); + sb.append(" sessions: ").append(toIndentedString(sessions)).append("\n"); + sb.append(" isDefault: ").append(toIndentedString(isDefault)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `groupId` to the URL query string + if (getGroupId() != null) { + try { + joiner.add(String.format("%sgroupId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getGroupId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `groupName` to the URL query string + if (getGroupName() != null) { + try { + joiner.add(String.format("%sgroupName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getGroupName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `sessions` to the URL query string + if (getSessions() != null) { + for (int i = 0; i < getSessions().size(); i++) { + if (getSessions().get(i) != null) { + joiner.add(getSessions().get(i).toUrlQueryString(String.format("%ssessions%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `isDefault` to the URL query string + if (getIsDefault() != null) { + try { + joiner.add(String.format("%sisDefault%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIsDefault()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SessionMinimal.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SessionMinimal.java new file mode 100644 index 0000000..fb04271 --- /dev/null +++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SessionMinimal.java @@ -0,0 +1,193 @@ +/* + * Sessionize JSON-REST API + * Sessionize JSON-REST API documentation by XDEV Software + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package software.xdev.sessionize.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * SessionMinimal + */ +@JsonPropertyOrder({ + SessionMinimal.JSON_PROPERTY_ID, + SessionMinimal.JSON_PROPERTY_NAME +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-26T17:30:53.867882+02:00[Europe/Berlin]") +public class SessionMinimal { + public static final String JSON_PROPERTY_ID = "id"; + private Integer id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public SessionMinimal() { + } + + public SessionMinimal id(Integer id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(Integer id) { + this.id = id; + } + + + public SessionMinimal name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SessionMinimal sessionMinimal = (SessionMinimal) o; + return Objects.equals(this.id, sessionMinimal.id) && + Objects.equals(this.name, sessionMinimal.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SessionMinimal {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/Speaker.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/Speaker.java new file mode 100644 index 0000000..d415b53 --- /dev/null +++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/Speaker.java @@ -0,0 +1,582 @@ +/* + * Sessionize JSON-REST API + * Sessionize JSON-REST API documentation by XDEV Software + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package software.xdev.sessionize.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.net.URI; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; +import software.xdev.sessionize.model.Link; +import software.xdev.sessionize.model.SessionMinimal; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Speaker + */ +@JsonPropertyOrder({ + Speaker.JSON_PROPERTY_ID, + Speaker.JSON_PROPERTY_FIRST_NAME, + Speaker.JSON_PROPERTY_LAST_NAME, + Speaker.JSON_PROPERTY_BIO, + Speaker.JSON_PROPERTY_TAG_LINE, + Speaker.JSON_PROPERTY_PROFILE_PICTURE, + Speaker.JSON_PROPERTY_IS_TOP_SPEAKER, + Speaker.JSON_PROPERTY_LINKS, + Speaker.JSON_PROPERTY_FULL_NAME, + Speaker.JSON_PROPERTY_SESSIONS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-26T17:30:53.867882+02:00[Europe/Berlin]") +public class Speaker { + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; + private String firstName; + + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; + private String lastName; + + public static final String JSON_PROPERTY_BIO = "bio"; + private JsonNullable bio = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_TAG_LINE = "tagLine"; + private String tagLine; + + public static final String JSON_PROPERTY_PROFILE_PICTURE = "profilePicture"; + private JsonNullable profilePicture = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_IS_TOP_SPEAKER = "isTopSpeaker"; + private Boolean isTopSpeaker; + + public static final String JSON_PROPERTY_LINKS = "links"; + private List links = new ArrayList<>(); + + public static final String JSON_PROPERTY_FULL_NAME = "fullName"; + private String fullName; + + public static final String JSON_PROPERTY_SESSIONS = "sessions"; + private List sessions = new ArrayList<>(); + + public Speaker() { + } + + public Speaker id(UUID id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public UUID getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(UUID id) { + this.id = id; + } + + + public Speaker firstName(String firstName) { + + this.firstName = firstName; + return this; + } + + /** + * Get firstName + * @return firstName + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getFirstName() { + return firstName; + } + + + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + + public Speaker lastName(String lastName) { + + this.lastName = lastName; + return this; + } + + /** + * Get lastName + * @return lastName + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getLastName() { + return lastName; + } + + + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setLastName(String lastName) { + this.lastName = lastName; + } + + + public Speaker bio(String bio) { + this.bio = JsonNullable.of(bio); + + return this; + } + + /** + * Get bio + * @return bio + **/ + @jakarta.annotation.Nullable + @JsonIgnore + + public String getBio() { + return bio.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_BIO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getBio_JsonNullable() { + return bio; + } + + @JsonProperty(JSON_PROPERTY_BIO) + public void setBio_JsonNullable(JsonNullable bio) { + this.bio = bio; + } + + public void setBio(String bio) { + this.bio = JsonNullable.of(bio); + } + + + public Speaker tagLine(String tagLine) { + + this.tagLine = tagLine; + return this; + } + + /** + * Get tagLine + * @return tagLine + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAG_LINE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getTagLine() { + return tagLine; + } + + + @JsonProperty(JSON_PROPERTY_TAG_LINE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTagLine(String tagLine) { + this.tagLine = tagLine; + } + + + public Speaker profilePicture(URI profilePicture) { + this.profilePicture = JsonNullable.of(profilePicture); + + return this; + } + + /** + * Get profilePicture + * @return profilePicture + **/ + @jakarta.annotation.Nullable + @JsonIgnore + + public URI getProfilePicture() { + return profilePicture.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_PROFILE_PICTURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getProfilePicture_JsonNullable() { + return profilePicture; + } + + @JsonProperty(JSON_PROPERTY_PROFILE_PICTURE) + public void setProfilePicture_JsonNullable(JsonNullable profilePicture) { + this.profilePicture = profilePicture; + } + + public void setProfilePicture(URI profilePicture) { + this.profilePicture = JsonNullable.of(profilePicture); + } + + + public Speaker isTopSpeaker(Boolean isTopSpeaker) { + + this.isTopSpeaker = isTopSpeaker; + return this; + } + + /** + * Get isTopSpeaker + * @return isTopSpeaker + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_IS_TOP_SPEAKER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Boolean getIsTopSpeaker() { + return isTopSpeaker; + } + + + @JsonProperty(JSON_PROPERTY_IS_TOP_SPEAKER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setIsTopSpeaker(Boolean isTopSpeaker) { + this.isTopSpeaker = isTopSpeaker; + } + + + public Speaker links(List links) { + + this.links = links; + return this; + } + + public Speaker addLinksItem(Link linksItem) { + if (this.links == null) { + this.links = new ArrayList<>(); + } + this.links.add(linksItem); + return this; + } + + /** + * Get links + * @return links + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_LINKS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getLinks() { + return links; + } + + + @JsonProperty(JSON_PROPERTY_LINKS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setLinks(List links) { + this.links = links; + } + + + public Speaker fullName(String fullName) { + + this.fullName = fullName; + return this; + } + + /** + * Get fullName + * @return fullName + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FULL_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getFullName() { + return fullName; + } + + + @JsonProperty(JSON_PROPERTY_FULL_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFullName(String fullName) { + this.fullName = fullName; + } + + + public Speaker sessions(List sessions) { + + this.sessions = sessions; + return this; + } + + public Speaker addSessionsItem(SessionMinimal sessionsItem) { + if (this.sessions == null) { + this.sessions = new ArrayList<>(); + } + this.sessions.add(sessionsItem); + return this; + } + + /** + * Get sessions + * @return sessions + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SESSIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getSessions() { + return sessions; + } + + + @JsonProperty(JSON_PROPERTY_SESSIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSessions(List sessions) { + this.sessions = sessions; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Speaker speaker = (Speaker) o; + return Objects.equals(this.id, speaker.id) && + Objects.equals(this.firstName, speaker.firstName) && + Objects.equals(this.lastName, speaker.lastName) && + equalsNullable(this.bio, speaker.bio) && + Objects.equals(this.tagLine, speaker.tagLine) && + equalsNullable(this.profilePicture, speaker.profilePicture) && + Objects.equals(this.isTopSpeaker, speaker.isTopSpeaker) && + Objects.equals(this.links, speaker.links) && + Objects.equals(this.fullName, speaker.fullName) && + Objects.equals(this.sessions, speaker.sessions); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(id, firstName, lastName, hashCodeNullable(bio), tagLine, hashCodeNullable(profilePicture), isTopSpeaker, links, fullName, sessions); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Speaker {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" bio: ").append(toIndentedString(bio)).append("\n"); + sb.append(" tagLine: ").append(toIndentedString(tagLine)).append("\n"); + sb.append(" profilePicture: ").append(toIndentedString(profilePicture)).append("\n"); + sb.append(" isTopSpeaker: ").append(toIndentedString(isTopSpeaker)).append("\n"); + sb.append(" links: ").append(toIndentedString(links)).append("\n"); + sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); + sb.append(" sessions: ").append(toIndentedString(sessions)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `firstName` to the URL query string + if (getFirstName() != null) { + try { + joiner.add(String.format("%sfirstName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFirstName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `lastName` to the URL query string + if (getLastName() != null) { + try { + joiner.add(String.format("%slastName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getLastName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `bio` to the URL query string + if (getBio() != null) { + try { + joiner.add(String.format("%sbio%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getBio()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `tagLine` to the URL query string + if (getTagLine() != null) { + try { + joiner.add(String.format("%stagLine%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTagLine()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `profilePicture` to the URL query string + if (getProfilePicture() != null) { + try { + joiner.add(String.format("%sprofilePicture%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getProfilePicture()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `isTopSpeaker` to the URL query string + if (getIsTopSpeaker() != null) { + try { + joiner.add(String.format("%sisTopSpeaker%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIsTopSpeaker()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `links` to the URL query string + if (getLinks() != null) { + for (int i = 0; i < getLinks().size(); i++) { + if (getLinks().get(i) != null) { + joiner.add(getLinks().get(i).toUrlQueryString(String.format("%slinks%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `fullName` to the URL query string + if (getFullName() != null) { + try { + joiner.add(String.format("%sfullName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFullName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `sessions` to the URL query string + if (getSessions() != null) { + for (int i = 0; i < getSessions().size(); i++) { + if (getSessions().get(i) != null) { + joiner.add(getSessions().get(i).toUrlQueryString(String.format("%ssessions%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SpeakerAll.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SpeakerAll.java new file mode 100644 index 0000000..934eddb --- /dev/null +++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SpeakerAll.java @@ -0,0 +1,585 @@ +/* + * Sessionize JSON-REST API + * Sessionize JSON-REST API documentation by XDEV Software + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package software.xdev.sessionize.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.net.URI; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; +import software.xdev.sessionize.model.Link; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * SpeakerAll + */ +@JsonPropertyOrder({ + SpeakerAll.JSON_PROPERTY_ID, + SpeakerAll.JSON_PROPERTY_FIRST_NAME, + SpeakerAll.JSON_PROPERTY_LAST_NAME, + SpeakerAll.JSON_PROPERTY_BIO, + SpeakerAll.JSON_PROPERTY_TAG_LINE, + SpeakerAll.JSON_PROPERTY_PROFILE_PICTURE, + SpeakerAll.JSON_PROPERTY_IS_TOP_SPEAKER, + SpeakerAll.JSON_PROPERTY_LINKS, + SpeakerAll.JSON_PROPERTY_FULL_NAME, + SpeakerAll.JSON_PROPERTY_SESSIONS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-26T17:30:53.867882+02:00[Europe/Berlin]") +public class SpeakerAll { + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; + private String firstName; + + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; + private String lastName; + + public static final String JSON_PROPERTY_BIO = "bio"; + private JsonNullable bio = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_TAG_LINE = "tagLine"; + private String tagLine; + + public static final String JSON_PROPERTY_PROFILE_PICTURE = "profilePicture"; + private JsonNullable profilePicture = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_IS_TOP_SPEAKER = "isTopSpeaker"; + private Boolean isTopSpeaker; + + public static final String JSON_PROPERTY_LINKS = "links"; + private List links = new ArrayList<>(); + + public static final String JSON_PROPERTY_FULL_NAME = "fullName"; + private String fullName; + + public static final String JSON_PROPERTY_SESSIONS = "sessions"; + private List sessions = new ArrayList<>(); + + public SpeakerAll() { + } + + public SpeakerAll id(UUID id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public UUID getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(UUID id) { + this.id = id; + } + + + public SpeakerAll firstName(String firstName) { + + this.firstName = firstName; + return this; + } + + /** + * Get firstName + * @return firstName + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getFirstName() { + return firstName; + } + + + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + + public SpeakerAll lastName(String lastName) { + + this.lastName = lastName; + return this; + } + + /** + * Get lastName + * @return lastName + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getLastName() { + return lastName; + } + + + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setLastName(String lastName) { + this.lastName = lastName; + } + + + public SpeakerAll bio(String bio) { + this.bio = JsonNullable.of(bio); + + return this; + } + + /** + * Get bio + * @return bio + **/ + @jakarta.annotation.Nullable + @JsonIgnore + + public String getBio() { + return bio.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_BIO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getBio_JsonNullable() { + return bio; + } + + @JsonProperty(JSON_PROPERTY_BIO) + public void setBio_JsonNullable(JsonNullable bio) { + this.bio = bio; + } + + public void setBio(String bio) { + this.bio = JsonNullable.of(bio); + } + + + public SpeakerAll tagLine(String tagLine) { + + this.tagLine = tagLine; + return this; + } + + /** + * Get tagLine + * @return tagLine + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAG_LINE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getTagLine() { + return tagLine; + } + + + @JsonProperty(JSON_PROPERTY_TAG_LINE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTagLine(String tagLine) { + this.tagLine = tagLine; + } + + + public SpeakerAll profilePicture(URI profilePicture) { + this.profilePicture = JsonNullable.of(profilePicture); + + return this; + } + + /** + * Get profilePicture + * @return profilePicture + **/ + @jakarta.annotation.Nullable + @JsonIgnore + + public URI getProfilePicture() { + return profilePicture.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_PROFILE_PICTURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getProfilePicture_JsonNullable() { + return profilePicture; + } + + @JsonProperty(JSON_PROPERTY_PROFILE_PICTURE) + public void setProfilePicture_JsonNullable(JsonNullable profilePicture) { + this.profilePicture = profilePicture; + } + + public void setProfilePicture(URI profilePicture) { + this.profilePicture = JsonNullable.of(profilePicture); + } + + + public SpeakerAll isTopSpeaker(Boolean isTopSpeaker) { + + this.isTopSpeaker = isTopSpeaker; + return this; + } + + /** + * Get isTopSpeaker + * @return isTopSpeaker + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_IS_TOP_SPEAKER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Boolean getIsTopSpeaker() { + return isTopSpeaker; + } + + + @JsonProperty(JSON_PROPERTY_IS_TOP_SPEAKER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setIsTopSpeaker(Boolean isTopSpeaker) { + this.isTopSpeaker = isTopSpeaker; + } + + + public SpeakerAll links(List links) { + + this.links = links; + return this; + } + + public SpeakerAll addLinksItem(Link linksItem) { + if (this.links == null) { + this.links = new ArrayList<>(); + } + this.links.add(linksItem); + return this; + } + + /** + * Get links + * @return links + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_LINKS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getLinks() { + return links; + } + + + @JsonProperty(JSON_PROPERTY_LINKS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setLinks(List links) { + this.links = links; + } + + + public SpeakerAll fullName(String fullName) { + + this.fullName = fullName; + return this; + } + + /** + * Get fullName + * @return fullName + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FULL_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getFullName() { + return fullName; + } + + + @JsonProperty(JSON_PROPERTY_FULL_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFullName(String fullName) { + this.fullName = fullName; + } + + + public SpeakerAll sessions(List sessions) { + + this.sessions = sessions; + return this; + } + + public SpeakerAll addSessionsItem(Integer sessionsItem) { + if (this.sessions == null) { + this.sessions = new ArrayList<>(); + } + this.sessions.add(sessionsItem); + return this; + } + + /** + * Get sessions + * @return sessions + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SESSIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getSessions() { + return sessions; + } + + + @JsonProperty(JSON_PROPERTY_SESSIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSessions(List sessions) { + this.sessions = sessions; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpeakerAll speakerAll = (SpeakerAll) o; + return Objects.equals(this.id, speakerAll.id) && + Objects.equals(this.firstName, speakerAll.firstName) && + Objects.equals(this.lastName, speakerAll.lastName) && + equalsNullable(this.bio, speakerAll.bio) && + Objects.equals(this.tagLine, speakerAll.tagLine) && + equalsNullable(this.profilePicture, speakerAll.profilePicture) && + Objects.equals(this.isTopSpeaker, speakerAll.isTopSpeaker) && + Objects.equals(this.links, speakerAll.links) && + Objects.equals(this.fullName, speakerAll.fullName) && + Objects.equals(this.sessions, speakerAll.sessions); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(id, firstName, lastName, hashCodeNullable(bio), tagLine, hashCodeNullable(profilePicture), isTopSpeaker, links, fullName, sessions); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpeakerAll {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" bio: ").append(toIndentedString(bio)).append("\n"); + sb.append(" tagLine: ").append(toIndentedString(tagLine)).append("\n"); + sb.append(" profilePicture: ").append(toIndentedString(profilePicture)).append("\n"); + sb.append(" isTopSpeaker: ").append(toIndentedString(isTopSpeaker)).append("\n"); + sb.append(" links: ").append(toIndentedString(links)).append("\n"); + sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); + sb.append(" sessions: ").append(toIndentedString(sessions)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `firstName` to the URL query string + if (getFirstName() != null) { + try { + joiner.add(String.format("%sfirstName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFirstName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `lastName` to the URL query string + if (getLastName() != null) { + try { + joiner.add(String.format("%slastName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getLastName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `bio` to the URL query string + if (getBio() != null) { + try { + joiner.add(String.format("%sbio%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getBio()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `tagLine` to the URL query string + if (getTagLine() != null) { + try { + joiner.add(String.format("%stagLine%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTagLine()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `profilePicture` to the URL query string + if (getProfilePicture() != null) { + try { + joiner.add(String.format("%sprofilePicture%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getProfilePicture()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `isTopSpeaker` to the URL query string + if (getIsTopSpeaker() != null) { + try { + joiner.add(String.format("%sisTopSpeaker%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIsTopSpeaker()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `links` to the URL query string + if (getLinks() != null) { + for (int i = 0; i < getLinks().size(); i++) { + if (getLinks().get(i) != null) { + joiner.add(getLinks().get(i).toUrlQueryString(String.format("%slinks%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `fullName` to the URL query string + if (getFullName() != null) { + try { + joiner.add(String.format("%sfullName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFullName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `sessions` to the URL query string + if (getSessions() != null) { + for (int i = 0; i < getSessions().size(); i++) { + try { + joiner.add(String.format("%ssessions%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getSessions().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SpeakerAllAllOf.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SpeakerAllAllOf.java new file mode 100644 index 0000000..94f67c4 --- /dev/null +++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SpeakerAllAllOf.java @@ -0,0 +1,166 @@ +/* + * Sessionize JSON-REST API + * Sessionize JSON-REST API documentation by XDEV Software + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package software.xdev.sessionize.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * SpeakerAllAllOf + */ +@JsonPropertyOrder({ + SpeakerAllAllOf.JSON_PROPERTY_SESSIONS +}) +@JsonTypeName("SpeakerAll_allOf") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-26T17:30:53.867882+02:00[Europe/Berlin]") +public class SpeakerAllAllOf { + public static final String JSON_PROPERTY_SESSIONS = "sessions"; + private List sessions = new ArrayList<>(); + + public SpeakerAllAllOf() { + } + + public SpeakerAllAllOf sessions(List sessions) { + + this.sessions = sessions; + return this; + } + + public SpeakerAllAllOf addSessionsItem(Integer sessionsItem) { + if (this.sessions == null) { + this.sessions = new ArrayList<>(); + } + this.sessions.add(sessionsItem); + return this; + } + + /** + * Get sessions + * @return sessions + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SESSIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getSessions() { + return sessions; + } + + + @JsonProperty(JSON_PROPERTY_SESSIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSessions(List sessions) { + this.sessions = sessions; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpeakerAllAllOf speakerAllAllOf = (SpeakerAllAllOf) o; + return Objects.equals(this.sessions, speakerAllAllOf.sessions); + } + + @Override + public int hashCode() { + return Objects.hash(sessions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpeakerAllAllOf {\n"); + sb.append(" sessions: ").append(toIndentedString(sessions)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `sessions` to the URL query string + if (getSessions() != null) { + for (int i = 0; i < getSessions().size(); i++) { + try { + joiner.add(String.format("%ssessions%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getSessions().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SpeakerAllOf.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SpeakerAllOf.java new file mode 100644 index 0000000..b97caa5 --- /dev/null +++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SpeakerAllOf.java @@ -0,0 +1,163 @@ +/* + * Sessionize JSON-REST API + * Sessionize JSON-REST API documentation by XDEV Software + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package software.xdev.sessionize.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.List; +import software.xdev.sessionize.model.SessionMinimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * SpeakerAllOf + */ +@JsonPropertyOrder({ + SpeakerAllOf.JSON_PROPERTY_SESSIONS +}) +@JsonTypeName("Speaker_allOf") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-26T17:30:53.867882+02:00[Europe/Berlin]") +public class SpeakerAllOf { + public static final String JSON_PROPERTY_SESSIONS = "sessions"; + private List sessions = new ArrayList<>(); + + public SpeakerAllOf() { + } + + public SpeakerAllOf sessions(List sessions) { + + this.sessions = sessions; + return this; + } + + public SpeakerAllOf addSessionsItem(SessionMinimal sessionsItem) { + if (this.sessions == null) { + this.sessions = new ArrayList<>(); + } + this.sessions.add(sessionsItem); + return this; + } + + /** + * Get sessions + * @return sessions + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SESSIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getSessions() { + return sessions; + } + + + @JsonProperty(JSON_PROPERTY_SESSIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSessions(List sessions) { + this.sessions = sessions; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpeakerAllOf speakerAllOf = (SpeakerAllOf) o; + return Objects.equals(this.sessions, speakerAllOf.sessions); + } + + @Override + public int hashCode() { + return Objects.hash(sessions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpeakerAllOf {\n"); + sb.append(" sessions: ").append(toIndentedString(sessions)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `sessions` to the URL query string + if (getSessions() != null) { + for (int i = 0; i < getSessions().size(); i++) { + if (getSessions().get(i) != null) { + joiner.add(getSessions().get(i).toUrlQueryString(String.format("%ssessions%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SpeakerMinimal.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SpeakerMinimal.java new file mode 100644 index 0000000..9cde8d7 --- /dev/null +++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SpeakerMinimal.java @@ -0,0 +1,194 @@ +/* + * Sessionize JSON-REST API + * Sessionize JSON-REST API documentation by XDEV Software + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package software.xdev.sessionize.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * SpeakerMinimal + */ +@JsonPropertyOrder({ + SpeakerMinimal.JSON_PROPERTY_ID, + SpeakerMinimal.JSON_PROPERTY_NAME +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-26T17:30:53.867882+02:00[Europe/Berlin]") +public class SpeakerMinimal { + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public SpeakerMinimal() { + } + + public SpeakerMinimal id(UUID id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public UUID getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(UUID id) { + this.id = id; + } + + + public SpeakerMinimal name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpeakerMinimal speakerMinimal = (SpeakerMinimal) o; + return Objects.equals(this.id, speakerMinimal.id) && + Objects.equals(this.name, speakerMinimal.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpeakerMinimal {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/Status.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/Status.java new file mode 100644 index 0000000..2320008 --- /dev/null +++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/Status.java @@ -0,0 +1,82 @@ +/* + * Sessionize JSON-REST API + * Sessionize JSON-REST API documentation by XDEV Software + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package software.xdev.sessionize.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets Status + */ +public enum Status { + + ACCEPTED("Accepted"), + + ACCEPTED_QUEUE("Accepted_Queue"), + + NOMINATED("Nominated"), + + DECLINE_QUEUE("Decline_Queue"), + + DECLINED("Declined"); + + private String value; + + Status(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Status fromValue(String value) { + for (Status b : Status.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} + diff --git a/standard-maven-template/pom.xml b/standard-maven-template/pom.xml deleted file mode 100644 index 34593b7..0000000 --- a/standard-maven-template/pom.xml +++ /dev/null @@ -1,208 +0,0 @@ - - - 4.0.0 - - com.xdev-software - standard-maven-template - 1.0.0-SNAPSHOT - jar - - standard-maven-template - standard-maven-template - https://github.com/xdev-software/standard-maven-template - - - https://github.com/xdev-software/standard-maven-template - https://github.com/xdev-software/standard-maven-template.git - - - 2023 - - - XDEV Software - https://xdev.software - - - - - XDEV Software - XDEV Software - https://xdev.software - - - - - - Apache License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - - 17 - ${javaVersion} - - UTF-8 - UTF-8 - - - - - - central - https://repo.maven.apache.org/maven2 - - false - - - - - - - - central - https://repo.maven.apache.org/maven2 - - false - - - - - - - ossrh - https://oss.sonatype.org/content/repositories/snapshots - - - ossrh - https://oss.sonatype.org/service/local/staging/deploy/maven2/ - - - - - - - com.mycila - license-maven-plugin - 4.2 - - - ${project.organization.url} - - - -
com/mycila/maven/plugin/license/templates/APACHE-2.txt
- - src/main/java/** - src/test/java/** - -
-
-
- - - first - - format - - process-sources - - -
- - - org.apache.maven.plugins - maven-compiler-plugin - 3.11.0 - - ${maven.compiler.release} - - -proc:none - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.5.0 - - - attach-javadocs - verify - - jar - - - - - true - none - - - - org.apache.maven.plugins - maven-source-plugin - 3.2.1 - - - attach-sources - verify - - jar-no-fork - - - - -
-
- - - ossrh - - - - org.apache.maven.plugins - maven-gpg-plugin - 3.0.1 - - - sign-artifacts - verify - - sign - - - - - - --pinentry-mode - loopback - - - - - - - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.13 - true - - ossrh - https://oss.sonatype.org/ - - 30 - true - - - - - - -