diff --git a/services/sfs/oas_commit b/services/sfs/oas_commit index 2753762..9f1e046 100644 --- a/services/sfs/oas_commit +++ b/services/sfs/oas_commit @@ -1 +1 @@ -1c36f3781c31a0e21c4588c7c4ec835d477d2f21 +d272f56ef0626e62c4f2e77985406a18fda765b7 diff --git a/services/sfs/src/main/java/cloud/stackit/sdk/sfs/JSON.java b/services/sfs/src/main/java/cloud/stackit/sdk/sfs/JSON.java index 6140179..b94c8a0 100644 --- a/services/sfs/src/main/java/cloud/stackit/sdk/sfs/JSON.java +++ b/services/sfs/src/main/java/cloud/stackit/sdk/sfs/JSON.java @@ -131,8 +131,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.sfs.model.GetResourcePoolSnapshotResponse .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.sfs.model.GetScheduleResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.sfs.model.GetShareExportPolicyResponse .CustomTypeAdapterFactory()); @@ -152,8 +150,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.sfs.model.ListResourcePoolsResponse .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.sfs.model.ListSchedulesResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.sfs.model.ListShareExportPoliciesResponse .CustomTypeAdapterFactory()); @@ -176,8 +172,6 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.sfs.model.ResourcePoolSpace.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.sfs.model.Schedule.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.sfs.model.Share.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( diff --git a/services/sfs/src/main/java/cloud/stackit/sdk/sfs/api/DefaultApi.java b/services/sfs/src/main/java/cloud/stackit/sdk/sfs/api/DefaultApi.java index 59dc076..082be41 100644 --- a/services/sfs/src/main/java/cloud/stackit/sdk/sfs/api/DefaultApi.java +++ b/services/sfs/src/main/java/cloud/stackit/sdk/sfs/api/DefaultApi.java @@ -30,14 +30,12 @@ import cloud.stackit.sdk.sfs.model.GetLockResponse; import cloud.stackit.sdk.sfs.model.GetResourcePoolResponse; import cloud.stackit.sdk.sfs.model.GetResourcePoolSnapshotResponse; -import cloud.stackit.sdk.sfs.model.GetScheduleResponse; import cloud.stackit.sdk.sfs.model.GetShareExportPolicyResponse; import cloud.stackit.sdk.sfs.model.GetShareResponse; import cloud.stackit.sdk.sfs.model.GetSnapshotPolicyResponse; import cloud.stackit.sdk.sfs.model.ListPerformanceClassesResponse; import cloud.stackit.sdk.sfs.model.ListResourcePoolSnapshotsResponse; import cloud.stackit.sdk.sfs.model.ListResourcePoolsResponse; -import cloud.stackit.sdk.sfs.model.ListSchedulesResponse; import cloud.stackit.sdk.sfs.model.ListShareExportPoliciesResponse; import cloud.stackit.sdk.sfs.model.ListSharesResponse; import cloud.stackit.sdk.sfs.model.ListSnapshotPoliciesResponse; @@ -2878,181 +2876,6 @@ public okhttp3.Call getResourcePoolSnapshotAsync( return localVarCall; } - /** - * Build call for getSchedule - * - * @param projectId (required) - * @param id (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 OK -
0 Default error response -
- */ - public okhttp3.Call getScheduleCall( - @javax.annotation.Nonnull String projectId, - @javax.annotation.Nonnull String id, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/v1/projects/{projectId}/schedules/{id}" - .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) - .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getScheduleValidateBeforeCall( - @javax.annotation.Nonnull String projectId, - @javax.annotation.Nonnull String id, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new ApiException( - "Missing the required parameter 'projectId' when calling getSchedule(Async)"); - } - - // verify the required parameter 'id' is set - if (id == null) { - throw new ApiException( - "Missing the required parameter 'id' when calling getSchedule(Async)"); - } - - return getScheduleCall(projectId, id, _callback); - } - - /** - * Get Schedule - * - * @param projectId (required) - * @param id (required) - * @return GetScheduleResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 OK -
0 Default error response -
- */ - public GetScheduleResponse getSchedule( - @javax.annotation.Nonnull String projectId, @javax.annotation.Nonnull String id) - throws ApiException { - ApiResponse localVarResp = getScheduleWithHttpInfo(projectId, id); - return localVarResp.getData(); - } - - /** - * Get Schedule - * - * @param projectId (required) - * @param id (required) - * @return ApiResponse<GetScheduleResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 OK -
0 Default error response -
- */ - public ApiResponse getScheduleWithHttpInfo( - @javax.annotation.Nonnull String projectId, @javax.annotation.Nonnull String id) - throws ApiException { - okhttp3.Call localVarCall = getScheduleValidateBeforeCall(projectId, id, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) Get Schedule - * - * @param projectId (required) - * @param id (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 OK -
0 Default error response -
- */ - public okhttp3.Call getScheduleAsync( - @javax.annotation.Nonnull String projectId, - @javax.annotation.Nonnull String id, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = getScheduleValidateBeforeCall(projectId, id, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** * Build call for getShare * @@ -4219,163 +4042,6 @@ public okhttp3.Call listResourcePoolsAsync( return localVarCall; } - /** - * Build call for listSchedules - * - * @param projectId (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 OK -
0 Default error response -
- */ - public okhttp3.Call listSchedulesCall( - @javax.annotation.Nonnull String projectId, final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/v1/projects/{projectId}/schedules" - .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call listSchedulesValidateBeforeCall( - @javax.annotation.Nonnull String projectId, final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new ApiException( - "Missing the required parameter 'projectId' when calling listSchedules(Async)"); - } - - return listSchedulesCall(projectId, _callback); - } - - /** - * List Schedules - * - * @param projectId (required) - * @return ListSchedulesResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 OK -
0 Default error response -
- */ - public ListSchedulesResponse listSchedules(@javax.annotation.Nonnull String projectId) - throws ApiException { - ApiResponse localVarResp = listSchedulesWithHttpInfo(projectId); - return localVarResp.getData(); - } - - /** - * List Schedules - * - * @param projectId (required) - * @return ApiResponse<ListSchedulesResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 OK -
0 Default error response -
- */ - public ApiResponse listSchedulesWithHttpInfo( - @javax.annotation.Nonnull String projectId) throws ApiException { - okhttp3.Call localVarCall = listSchedulesValidateBeforeCall(projectId, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) List Schedules - * - * @param projectId (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 OK -
0 Default error response -
- */ - public okhttp3.Call listSchedulesAsync( - @javax.annotation.Nonnull String projectId, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = listSchedulesValidateBeforeCall(projectId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** * Build call for listShareExportPolicies * diff --git a/services/sfs/src/main/java/cloud/stackit/sdk/sfs/model/GetScheduleResponse.java b/services/sfs/src/main/java/cloud/stackit/sdk/sfs/model/GetScheduleResponse.java deleted file mode 100644 index 219c073..0000000 --- a/services/sfs/src/main/java/cloud/stackit/sdk/sfs/model/GetScheduleResponse.java +++ /dev/null @@ -1,291 +0,0 @@ -/* - * STACKIT File Storage (SFS) - * API used to create and manage NFS Shares. - * - * The version of the OpenAPI document: 1.0.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 cloud.stackit.sdk.sfs.model; - -import cloud.stackit.sdk.sfs.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** GetScheduleResponse */ -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.19.0") -public class GetScheduleResponse { - public static final String SERIALIZED_NAME_SCHEDULE = "schedule"; - - @SerializedName(SERIALIZED_NAME_SCHEDULE) - @javax.annotation.Nullable private Schedule schedule; - - public GetScheduleResponse() {} - - public GetScheduleResponse schedule(@javax.annotation.Nullable Schedule schedule) { - this.schedule = schedule; - return this; - } - - /** - * Schedule - * - * @return schedule - */ - @javax.annotation.Nullable public Schedule getSchedule() { - return schedule; - } - - public void setSchedule(@javax.annotation.Nullable Schedule schedule) { - this.schedule = schedule; - } - - /** - * A container for additional, undeclared properties. This is a holder for any undeclared - * properties as specified with the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. If the property - * does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the GetScheduleResponse instance itself - */ - public GetScheduleResponse putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetScheduleResponse getScheduleResponse = (GetScheduleResponse) o; - return Objects.equals(this.schedule, getScheduleResponse.schedule) - && Objects.equals( - this.additionalProperties, getScheduleResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(schedule, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetScheduleResponse {\n"); - sb.append(" schedule: ").append(toIndentedString(schedule)).append("\n"); - sb.append(" additionalProperties: ") - .append(toIndentedString(additionalProperties)) - .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 "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("schedule")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(0); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to GetScheduleResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!GetScheduleResponse.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in GetScheduleResponse is not found in the empty JSON string", - GetScheduleResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `schedule` - if (jsonObj.get("schedule") != null && !jsonObj.get("schedule").isJsonNull()) { - Schedule.validateJsonElement(jsonObj.get("schedule")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetScheduleResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetScheduleResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(GetScheduleResponse.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, GetScheduleResponse value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : - value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty( - entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public GetScheduleResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - GetScheduleResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty( - entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty( - entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty( - entry.getKey(), - entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of GetScheduleResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetScheduleResponse - * @throws IOException if the JSON string is invalid with respect to GetScheduleResponse - */ - public static GetScheduleResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetScheduleResponse.class); - } - - /** - * Convert an instance of GetScheduleResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/sfs/src/main/java/cloud/stackit/sdk/sfs/model/ListSchedulesResponse.java b/services/sfs/src/main/java/cloud/stackit/sdk/sfs/model/ListSchedulesResponse.java deleted file mode 100644 index eda1ee6..0000000 --- a/services/sfs/src/main/java/cloud/stackit/sdk/sfs/model/ListSchedulesResponse.java +++ /dev/null @@ -1,316 +0,0 @@ -/* - * STACKIT File Storage (SFS) - * API used to create and manage NFS Shares. - * - * The version of the OpenAPI document: 1.0.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 cloud.stackit.sdk.sfs.model; - -import cloud.stackit.sdk.sfs.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** ListSchedulesResponse */ -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.19.0") -public class ListSchedulesResponse { - public static final String SERIALIZED_NAME_SCHEDULES = "schedules"; - - @SerializedName(SERIALIZED_NAME_SCHEDULES) - @javax.annotation.Nullable private List schedules = new ArrayList<>(); - - public ListSchedulesResponse() {} - - public ListSchedulesResponse schedules(@javax.annotation.Nullable List schedules) { - this.schedules = schedules; - return this; - } - - public ListSchedulesResponse addSchedulesItem(Schedule schedulesItem) { - if (this.schedules == null) { - this.schedules = new ArrayList<>(); - } - this.schedules.add(schedulesItem); - return this; - } - - /** - * List of Schedules - * - * @return schedules - */ - @javax.annotation.Nullable public List getSchedules() { - return schedules; - } - - public void setSchedules(@javax.annotation.Nullable List schedules) { - this.schedules = schedules; - } - - /** - * A container for additional, undeclared properties. This is a holder for any undeclared - * properties as specified with the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. If the property - * does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the ListSchedulesResponse instance itself - */ - public ListSchedulesResponse putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ListSchedulesResponse listSchedulesResponse = (ListSchedulesResponse) o; - return Objects.equals(this.schedules, listSchedulesResponse.schedules) - && Objects.equals( - this.additionalProperties, listSchedulesResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(schedules, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ListSchedulesResponse {\n"); - sb.append(" schedules: ").append(toIndentedString(schedules)).append("\n"); - sb.append(" additionalProperties: ") - .append(toIndentedString(additionalProperties)) - .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 "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("schedules")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(0); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ListSchedulesResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ListSchedulesResponse.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in ListSchedulesResponse is not found in the empty JSON string", - ListSchedulesResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("schedules") != null && !jsonObj.get("schedules").isJsonNull()) { - JsonArray jsonArrayschedules = jsonObj.getAsJsonArray("schedules"); - if (jsonArrayschedules != null) { - // ensure the json data is an array - if (!jsonObj.get("schedules").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `schedules` to be an array in the JSON string but got `%s`", - jsonObj.get("schedules").toString())); - } - - // validate the optional field `schedules` (array) - for (int i = 0; i < jsonArrayschedules.size(); i++) { - Schedule.validateJsonElement(jsonArrayschedules.get(i)); - } - ; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ListSchedulesResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ListSchedulesResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(ListSchedulesResponse.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ListSchedulesResponse value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : - value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty( - entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public ListSchedulesResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - ListSchedulesResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty( - entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty( - entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty( - entry.getKey(), - entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of ListSchedulesResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of ListSchedulesResponse - * @throws IOException if the JSON string is invalid with respect to ListSchedulesResponse - */ - public static ListSchedulesResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ListSchedulesResponse.class); - } - - /** - * Convert an instance of ListSchedulesResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/sfs/src/main/java/cloud/stackit/sdk/sfs/model/Schedule.java b/services/sfs/src/main/java/cloud/stackit/sdk/sfs/model/Schedule.java deleted file mode 100644 index 2978c2d..0000000 --- a/services/sfs/src/main/java/cloud/stackit/sdk/sfs/model/Schedule.java +++ /dev/null @@ -1,385 +0,0 @@ -/* - * STACKIT File Storage (SFS) - * API used to create and manage NFS Shares. - * - * The version of the OpenAPI document: 1.0.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 cloud.stackit.sdk.sfs.model; - -import cloud.stackit.sdk.sfs.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** Schedule */ -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.19.0") -public class Schedule { - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - - @SerializedName(SERIALIZED_NAME_CREATED_AT) - @javax.annotation.Nullable private OffsetDateTime createdAt; - - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - @javax.annotation.Nullable private String id; - - public static final String SERIALIZED_NAME_INTERVAL = "interval"; - - @SerializedName(SERIALIZED_NAME_INTERVAL) - @javax.annotation.Nullable private String interval; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - @javax.annotation.Nullable private String name; - - public Schedule() {} - - public Schedule createdAt(@javax.annotation.Nullable OffsetDateTime createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - * created at timestamp - * - * @return createdAt - */ - @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(@javax.annotation.Nullable OffsetDateTime createdAt) { - this.createdAt = createdAt; - } - - public Schedule id(@javax.annotation.Nullable String id) { - this.id = id; - return this; - } - - /** - * ID of the Schedule - * - * @return id - */ - @javax.annotation.Nullable public String getId() { - return id; - } - - public void setId(@javax.annotation.Nullable String id) { - this.id = id; - } - - public Schedule interval(@javax.annotation.Nullable String interval) { - this.interval = interval; - return this; - } - - /** - * Interval of the Schedule (follows the cron schedule expression in Unix-like systems) - * - * @return interval - */ - @javax.annotation.Nullable public String getInterval() { - return interval; - } - - public void setInterval(@javax.annotation.Nullable String interval) { - this.interval = interval; - } - - public Schedule name(@javax.annotation.Nullable String name) { - this.name = name; - return this; - } - - /** - * Name of the Schedule - * - * @return name - */ - @javax.annotation.Nullable public String getName() { - return name; - } - - public void setName(@javax.annotation.Nullable String name) { - this.name = name; - } - - /** - * A container for additional, undeclared properties. This is a holder for any undeclared - * properties as specified with the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. If the property - * does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the Schedule instance itself - */ - public Schedule putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Schedule schedule = (Schedule) o; - return Objects.equals(this.createdAt, schedule.createdAt) - && Objects.equals(this.id, schedule.id) - && Objects.equals(this.interval, schedule.interval) - && Objects.equals(this.name, schedule.name) - && Objects.equals(this.additionalProperties, schedule.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(createdAt, id, interval, name, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Schedule {\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" additionalProperties: ") - .append(toIndentedString(additionalProperties)) - .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 "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("createdAt", "id", "interval", "name")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(0); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Schedule - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!Schedule.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in Schedule is not found in the empty JSON string", - Schedule.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) - && !jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `id` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("id").toString())); - } - if ((jsonObj.get("interval") != null && !jsonObj.get("interval").isJsonNull()) - && !jsonObj.get("interval").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `interval` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("interval").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) - && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `name` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Schedule.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Schedule' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Schedule.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, Schedule value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : - value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty( - entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public Schedule read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - Schedule instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty( - entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty( - entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty( - entry.getKey(), - entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of Schedule given an JSON string - * - * @param jsonString JSON string - * @return An instance of Schedule - * @throws IOException if the JSON string is invalid with respect to Schedule - */ - public static Schedule fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Schedule.class); - } - - /** - * Convert an instance of Schedule to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -}