From 475b930054144a829c50ed328f81b2db3596881d Mon Sep 17 00:00:00 2001 From: Ivan Gomes Date: Mon, 17 Jun 2019 11:49:16 +0200 Subject: [PATCH] Built clean due to refactoring --- README.md | 38 +- build.gradle | 2 +- build.sbt | 2 +- docs/Model.md | 12 - docs/ModelApi.md | 136 ------ gradlew | 0 pom.xml | 2 +- src/main/java/org/omg/sysml/ApiClient.java | 2 +- src/main/java/org/omg/sysml/api/ModelApi.java | 408 ------------------ src/main/java/org/omg/sysml/model/Model.java | 144 ------- .../org/omg/sysml/api/ElementApiTest.java | 33 +- .../java/org/omg/sysml/api/ModelApiTest.java | 83 ---- .../org/omg/sysml/api/ProjectApiTest.java | 1 - .../omg/sysml/api/RelationshipApiTest.java | 44 +- 14 files changed, 54 insertions(+), 853 deletions(-) delete mode 100644 docs/Model.md delete mode 100644 docs/ModelApi.md mode change 100755 => 100644 gradlew delete mode 100644 src/main/java/org/omg/sysml/api/ModelApi.java delete mode 100644 src/main/java/org/omg/sysml/model/Model.java delete mode 100644 src/test/java/org/omg/sysml/api/ModelApiTest.java diff --git a/README.md b/README.md index 9dc0dd3..ed0d031 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ Add this dependency to your project's POM: org.omg.sysml sysml-api-client - 0.1.0 + 2019-05 compile ``` @@ -49,7 +49,7 @@ Add this dependency to your project's POM: Add this dependency to your project's build file: ```groovy -compile "org.omg.sysml:sysml-api-client:0.1.0" +compile "org.omg.sysml:sysml-api-client:2019-05" ``` ### Others @@ -62,7 +62,7 @@ mvn clean package Then manually install the following JARs: -* `target/sysml-api-client-0.1.0.jar` +* `target/sysml-api-client-2019-05.jar` * `target/lib/*.jar` ## Getting Started @@ -84,9 +84,9 @@ public class ElementApiExample { public static void main(String[] args) { ElementApi apiInstance = new ElementApi(); - Element element = new Element(); // Element | + Map requestBody = null; // Map | try { - Element result = apiInstance.createElement(element); + Element result = apiInstance.createElement(requestBody); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ElementApi#createElement"); @@ -103,26 +103,26 @@ All URIs are relative to *http://localhost* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*ElementApi* | [**createElement**](docs/ElementApi.md#createElement) | **POST** /element | Add a new element -*ElementApi* | [**getElement**](docs/ElementApi.md#getElement) | **GET** /element/{id} | Get element by its ID -*ElementApi* | [**getElements**](docs/ElementApi.md#getElements) | **GET** /element | Get all elements -*ElementApi* | [**getElementsInModel**](docs/ElementApi.md#getElementsInModel) | **GET** /element/model/{model_id} | Get all elements in the model -*ModelApi* | [**createModel**](docs/ModelApi.md#createModel) | **POST** /model | Add a new model -*ModelApi* | [**getModel**](docs/ModelApi.md#getModel) | **GET** /model/{id} | Get model by its ID -*ModelApi* | [**getModels**](docs/ModelApi.md#getModels) | **GET** /model | Get all models -*RelationshipApi* | [**createRelationship**](docs/RelationshipApi.md#createRelationship) | **POST** /relationship | Add a new relationship -*RelationshipApi* | [**getRelationship**](docs/RelationshipApi.md#getRelationship) | **GET** /relationship/{id} | Get relationship by its ID -*RelationshipApi* | [**getRelationships**](docs/RelationshipApi.md#getRelationships) | **GET** /relationship | Get all relationships -*RelationshipApi* | [**getRelationshipsByElement**](docs/RelationshipApi.md#getRelationshipsByElement) | **GET** /relationship/element/{element_id} | Get all relationships with the given element as either source or target -*RelationshipApi* | [**getRelationshipsBySource**](docs/RelationshipApi.md#getRelationshipsBySource) | **GET** /relationship/source/{source_id} | Get all relationships with the given element as the source -*RelationshipApi* | [**getRelationshipsByTarget**](docs/RelationshipApi.md#getRelationshipsByTarget) | **GET** /relationship/target/{target_id} | Get all relationships with the given element as the target +*ElementApi* | [**createElement**](docs/ElementApi.md#createElement) | **POST** /elements | Add a new element +*ElementApi* | [**getElement**](docs/ElementApi.md#getElement) | **GET** /elements/{identifier} | Get element by its ID +*ElementApi* | [**getElementByProjectAndId**](docs/ElementApi.md#getElementByProjectAndId) | **GET** /projects/{project_identifier}/elements/{element_identifier} | Get element by project ID and its ID +*ElementApi* | [**getElements**](docs/ElementApi.md#getElements) | **GET** /elements | Get all elements +*ElementApi* | [**getElementsInProject**](docs/ElementApi.md#getElementsInProject) | **GET** /projects/{project_identifier}/elements | Get all elements in the project +*ProjectApi* | [**createProject**](docs/ProjectApi.md#createProject) | **POST** /projects | Add a new project +*ProjectApi* | [**getProject**](docs/ProjectApi.md#getProject) | **GET** /projects/{identifier} | Get project by its ID +*ProjectApi* | [**getProjects**](docs/ProjectApi.md#getProjects) | **GET** /projects | Get all projects +*RelationshipApi* | [**createRelationship**](docs/RelationshipApi.md#createRelationship) | **POST** /relationships | Add a new relationship +*RelationshipApi* | [**getRelationship**](docs/RelationshipApi.md#getRelationship) | **GET** /relationships/{identifier} | Get relationship by its ID +*RelationshipApi* | [**getRelationships**](docs/RelationshipApi.md#getRelationships) | **GET** /relationships | Get all relationships +*RelationshipApi* | [**getRelationshipsByProject**](docs/RelationshipApi.md#getRelationshipsByProject) | **GET** /projects/{project_identifier}/relationships | Get all relationships in the project ## Documentation for Models - [Element](docs/Element.md) - [Error](docs/Error.md) - - [Model](docs/Model.md) + - [Identified](docs/Identified.md) + - [Project](docs/Project.md) - [Relationship](docs/Relationship.md) diff --git a/build.gradle b/build.gradle index 9328f3d..fe6502f 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'idea' apply plugin: 'eclipse' group = 'org.omg.sysml' -version = '0.1.0' +version = '2019-05' buildscript { repositories { diff --git a/build.sbt b/build.sbt index 64eba11..a5cfbe9 100644 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,7 @@ lazy val root = (project in file(".")). settings( organization := "org.omg.sysml", name := "sysml-api-client", - version := "0.1.0", + version := "2019-05", scalaVersion := "2.11.4", scalacOptions ++= Seq("-feature"), javacOptions in compile ++= Seq("-Xlint:deprecation"), diff --git a/docs/Model.md b/docs/Model.md deleted file mode 100644 index 3f9cb72..0000000 --- a/docs/Model.md +++ /dev/null @@ -1,12 +0,0 @@ - -# Model - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**identifier** | [**UUID**](UUID.md) | | [optional] -**name** | **String** | | [optional] -**description** | **String** | | [optional] - - - diff --git a/docs/ModelApi.md b/docs/ModelApi.md deleted file mode 100644 index d3b3a7d..0000000 --- a/docs/ModelApi.md +++ /dev/null @@ -1,136 +0,0 @@ -# ModelApi - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**createModel**](ModelApi.md#createModel) | **POST** /model | Add a new model -[**getModel**](ModelApi.md#getModel) | **GET** /model/{id} | Get model by its ID -[**getModels**](ModelApi.md#getModels) | **GET** /model | Get all models - - - -# **createModel** -> Model createModel(model) - -Add a new model - -### Example -```java -// Import classes: -//import org.omg.sysml.ApiException; -//import org.omg.sysml.api.ModelApi; - - -ModelApi apiInstance = new ModelApi(); -Model model = new Model(); // Model | -try { - Model result = apiInstance.createModel(model); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling ModelApi#createModel"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **model** | [**Model**](Model.md)| | [optional] - -### Return type - -[**Model**](Model.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - -# **getModel** -> Model getModel(id) - -Get model by its ID - -### Example -```java -// Import classes: -//import org.omg.sysml.ApiException; -//import org.omg.sysml.api.ModelApi; - - -ModelApi apiInstance = new ModelApi(); -String id = "id_example"; // String | ID of the model -try { - Model result = apiInstance.getModel(id); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling ModelApi#getModel"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **String**| ID of the model | - -### Return type - -[**Model**](Model.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - - -# **getModels** -> List<Model> getModels() - -Get all models - -### Example -```java -// Import classes: -//import org.omg.sysml.ApiException; -//import org.omg.sysml.api.ModelApi; - - -ModelApi apiInstance = new ModelApi(); -try { - List result = apiInstance.getModels(); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling ModelApi#getModels"); - e.printStackTrace(); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**List<Model>**](Model.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - diff --git a/gradlew b/gradlew old mode 100755 new mode 100644 diff --git a/pom.xml b/pom.xml index a8f83a7..7b9713e 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ sysml-api-client jar sysml-api-client - 0.1.0 + 2019-05 https://github.com/openapitools/openapi-generator OpenAPI Java diff --git a/src/main/java/org/omg/sysml/ApiClient.java b/src/main/java/org/omg/sysml/ApiClient.java index f2bbe82..8f97eca 100644 --- a/src/main/java/org/omg/sysml/ApiClient.java +++ b/src/main/java/org/omg/sysml/ApiClient.java @@ -98,7 +98,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("OpenAPI-Generator/0.1.0/java"); + setUserAgent("OpenAPI-Generator/2019-05/java"); authentications = new HashMap(); } diff --git a/src/main/java/org/omg/sysml/api/ModelApi.java b/src/main/java/org/omg/sysml/api/ModelApi.java deleted file mode 100644 index d2098da..0000000 --- a/src/main/java/org/omg/sysml/api/ModelApi.java +++ /dev/null @@ -1,408 +0,0 @@ -/* - * SysML v2 API and Services - * REST/HTTP binding (PSM) for the SysML v2 standard API. - * - * OpenAPI spec version: 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 org.omg.sysml.api; - -import org.omg.sysml.ApiCallback; -import org.omg.sysml.ApiClient; -import org.omg.sysml.ApiException; -import org.omg.sysml.ApiResponse; -import org.omg.sysml.Configuration; -import org.omg.sysml.Pair; -import org.omg.sysml.ProgressRequestBody; -import org.omg.sysml.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import org.omg.sysml.model.Error; -import org.omg.sysml.model.Model; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class ModelApi { - private ApiClient apiClient; - - public ModelApi() { - this(Configuration.getDefaultApiClient()); - } - - public ModelApi(ApiClient apiClient) { - this.apiClient = apiClient; - } - - public ApiClient getApiClient() { - return apiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * Build call for createModel - * @param model (optional) - * @param progressListener Progress listener - * @param progressRequestListener Progress request listener - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - */ - public com.squareup.okhttp.Call createModelCall(Model model, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = model; - - // create path and map variables - String localVarPath = "/model"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - if (progressListener != null) { - apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { - @Override - public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { - com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); - return originalResponse.newBuilder() - .body(new ProgressResponseBody(originalResponse.body(), progressListener)) - .build(); - } - }); - } - - String[] localVarAuthNames = new String[] { }; - return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call createModelValidateBeforeCall(Model model, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - - - com.squareup.okhttp.Call call = createModelCall(model, progressListener, progressRequestListener); - return call; - - } - - /** - * Add a new model - * - * @param model (optional) - * @return Model - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public Model createModel(Model model) throws ApiException { - ApiResponse resp = createModelWithHttpInfo(model); - return resp.getData(); - } - - /** - * Add a new model - * - * @param model (optional) - * @return ApiResponse<Model> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse createModelWithHttpInfo(Model model) throws ApiException { - com.squareup.okhttp.Call call = createModelValidateBeforeCall(model, null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * Add a new model (asynchronously) - * - * @param model (optional) - * @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 - */ - public com.squareup.okhttp.Call createModelAsync(Model model, final ApiCallback callback) throws ApiException { - - ProgressResponseBody.ProgressListener progressListener = null; - ProgressRequestBody.ProgressRequestListener progressRequestListener = null; - - if (callback != null) { - progressListener = new ProgressResponseBody.ProgressListener() { - @Override - public void update(long bytesRead, long contentLength, boolean done) { - callback.onDownloadProgress(bytesRead, contentLength, done); - } - }; - - progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { - @Override - public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { - callback.onUploadProgress(bytesWritten, contentLength, done); - } - }; - } - - com.squareup.okhttp.Call call = createModelValidateBeforeCall(model, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } - /** - * Build call for getModel - * @param id ID of the model (required) - * @param progressListener Progress listener - * @param progressRequestListener Progress request listener - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - */ - public com.squareup.okhttp.Call getModelCall(String id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = new Object(); - - // create path and map variables - String localVarPath = "/model/{id}" - .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - if (progressListener != null) { - apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { - @Override - public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { - com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); - return originalResponse.newBuilder() - .body(new ProgressResponseBody(originalResponse.body(), progressListener)) - .build(); - } - }); - } - - String[] localVarAuthNames = new String[] { }; - return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call getModelValidateBeforeCall(String id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - - // verify the required parameter 'id' is set - if (id == null) { - throw new ApiException("Missing the required parameter 'id' when calling getModel(Async)"); - } - - - com.squareup.okhttp.Call call = getModelCall(id, progressListener, progressRequestListener); - return call; - - } - - /** - * Get model by its ID - * - * @param id ID of the model (required) - * @return Model - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public Model getModel(String id) throws ApiException { - ApiResponse resp = getModelWithHttpInfo(id); - return resp.getData(); - } - - /** - * Get model by its ID - * - * @param id ID of the model (required) - * @return ApiResponse<Model> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse getModelWithHttpInfo(String id) throws ApiException { - com.squareup.okhttp.Call call = getModelValidateBeforeCall(id, null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * Get model by its ID (asynchronously) - * - * @param id ID of the model (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 - */ - public com.squareup.okhttp.Call getModelAsync(String id, final ApiCallback callback) throws ApiException { - - ProgressResponseBody.ProgressListener progressListener = null; - ProgressRequestBody.ProgressRequestListener progressRequestListener = null; - - if (callback != null) { - progressListener = new ProgressResponseBody.ProgressListener() { - @Override - public void update(long bytesRead, long contentLength, boolean done) { - callback.onDownloadProgress(bytesRead, contentLength, done); - } - }; - - progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { - @Override - public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { - callback.onUploadProgress(bytesWritten, contentLength, done); - } - }; - } - - com.squareup.okhttp.Call call = getModelValidateBeforeCall(id, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } - /** - * Build call for getModels - * @param progressListener Progress listener - * @param progressRequestListener Progress request listener - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - */ - public com.squareup.okhttp.Call getModelsCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = new Object(); - - // create path and map variables - String localVarPath = "/model"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - if (progressListener != null) { - apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { - @Override - public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { - com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); - return originalResponse.newBuilder() - .body(new ProgressResponseBody(originalResponse.body(), progressListener)) - .build(); - } - }); - } - - String[] localVarAuthNames = new String[] { }; - return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call getModelsValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - - - com.squareup.okhttp.Call call = getModelsCall(progressListener, progressRequestListener); - return call; - - } - - /** - * Get all models - * - * @return List<Model> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public List getModels() throws ApiException { - ApiResponse> resp = getModelsWithHttpInfo(); - return resp.getData(); - } - - /** - * Get all models - * - * @return ApiResponse<List<Model>> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse> getModelsWithHttpInfo() throws ApiException { - com.squareup.okhttp.Call call = getModelsValidateBeforeCall(null, null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * Get all models (asynchronously) - * - * @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 - */ - public com.squareup.okhttp.Call getModelsAsync(final ApiCallback> callback) throws ApiException { - - ProgressResponseBody.ProgressListener progressListener = null; - ProgressRequestBody.ProgressRequestListener progressRequestListener = null; - - if (callback != null) { - progressListener = new ProgressResponseBody.ProgressListener() { - @Override - public void update(long bytesRead, long contentLength, boolean done) { - callback.onDownloadProgress(bytesRead, contentLength, done); - } - }; - - progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { - @Override - public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { - callback.onUploadProgress(bytesWritten, contentLength, done); - } - }; - } - - com.squareup.okhttp.Call call = getModelsValidateBeforeCall(progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken>(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } -} diff --git a/src/main/java/org/omg/sysml/model/Model.java b/src/main/java/org/omg/sysml/model/Model.java deleted file mode 100644 index e431eb8..0000000 --- a/src/main/java/org/omg/sysml/model/Model.java +++ /dev/null @@ -1,144 +0,0 @@ -/* - * SysML v2 API and Services - * REST/HTTP binding (PSM) for the SysML v2 standard API. - * - * OpenAPI spec version: 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 org.omg.sysml.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.UUID; - -/** - * Model - */ - -public class Model { - public static final String SERIALIZED_NAME_IDENTIFIER = "identifier"; - @SerializedName(SERIALIZED_NAME_IDENTIFIER) - private UUID identifier; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public Model identifier(UUID identifier) { - this.identifier = identifier; - return this; - } - - /** - * Get identifier - * @return identifier - **/ - @ApiModelProperty(value = "") - public UUID getIdentifier() { - return identifier; - } - - public void setIdentifier(UUID identifier) { - this.identifier = identifier; - } - - public Model name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Model description(String description) { - this.description = description; - return this; - } - - /** - * Get description - * @return description - **/ - @ApiModelProperty(value = "") - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Model model = (Model) o; - return Objects.equals(this.identifier, model.identifier) && - Objects.equals(this.name, model.name) && - Objects.equals(this.description, model.description); - } - - @Override - public int hashCode() { - return Objects.hash(identifier, name, description); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Model {\n"); - - sb.append(" identifier: ").append(toIndentedString(identifier)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).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(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/src/test/java/org/omg/sysml/api/ElementApiTest.java b/src/test/java/org/omg/sysml/api/ElementApiTest.java index b6e38a4..1b2a980 100644 --- a/src/test/java/org/omg/sysml/api/ElementApiTest.java +++ b/src/test/java/org/omg/sysml/api/ElementApiTest.java @@ -43,8 +43,8 @@ public class ElementApiTest { */ @Test public void createElementTest() throws ApiException { - Element element = null; - Element response = api.createElement(element); + Map requestBody = null; + Element response = api.createElement(requestBody); // TODO: test validations } @@ -59,8 +59,25 @@ public void createElementTest() throws ApiException { */ @Test public void getElementTest() throws ApiException { - String id = null; - Element response = api.getElement(id); + String identifier = null; + Element response = api.getElement(identifier); + + // TODO: test validations + } + + /** + * Get element by project ID and its ID + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getElementByProjectAndIdTest() throws ApiException { + String projectIdentifier = null; + String elementIdentifier = null; + Element response = api.getElementByProjectAndId(projectIdentifier, elementIdentifier); // TODO: test validations } @@ -81,7 +98,7 @@ public void getElementsTest() throws ApiException { } /** - * Get all elements in the model + * Get all elements in the project * * * @@ -89,9 +106,9 @@ public void getElementsTest() throws ApiException { * if the Api call fails */ @Test - public void getElementsInModelTest() throws ApiException { - String modelId = null; - Element response = api.getElementsInModel(modelId); + public void getElementsInProjectTest() throws ApiException { + String projectIdentifier = null; + Element response = api.getElementsInProject(projectIdentifier); // TODO: test validations } diff --git a/src/test/java/org/omg/sysml/api/ModelApiTest.java b/src/test/java/org/omg/sysml/api/ModelApiTest.java deleted file mode 100644 index 3923f6f..0000000 --- a/src/test/java/org/omg/sysml/api/ModelApiTest.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * SysML v2 API and Services - * REST/HTTP binding (PSM) for the SysML v2 standard API. - * - * OpenAPI spec version: 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 org.omg.sysml.api; - -import org.omg.sysml.ApiException; -import org.omg.sysml.model.Error; -import org.omg.sysml.model.Model; -import org.junit.Test; -import org.junit.Ignore; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * API tests for ModelApi - */ -@Ignore -public class ModelApiTest { - - private final ModelApi api = new ModelApi(); - - - /** - * Add a new model - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void createModelTest() throws ApiException { - Model model = null; - Model response = api.createModel(model); - - // TODO: test validations - } - - /** - * Get model by its ID - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void getModelTest() throws ApiException { - String id = null; - Model response = api.getModel(id); - - // TODO: test validations - } - - /** - * Get all models - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void getModelsTest() throws ApiException { - List response = api.getModels(); - - // TODO: test validations - } - -} diff --git a/src/test/java/org/omg/sysml/api/ProjectApiTest.java b/src/test/java/org/omg/sysml/api/ProjectApiTest.java index af1ef1b..1bf2f77 100644 --- a/src/test/java/org/omg/sysml/api/ProjectApiTest.java +++ b/src/test/java/org/omg/sysml/api/ProjectApiTest.java @@ -15,7 +15,6 @@ import org.omg.sysml.ApiException; import org.omg.sysml.model.Error; -import org.omg.sysml.model.Identified; import org.omg.sysml.model.Project; import org.junit.Test; import org.junit.Ignore; diff --git a/src/test/java/org/omg/sysml/api/RelationshipApiTest.java b/src/test/java/org/omg/sysml/api/RelationshipApiTest.java index 5c44b6c..e04d5e9 100644 --- a/src/test/java/org/omg/sysml/api/RelationshipApiTest.java +++ b/src/test/java/org/omg/sysml/api/RelationshipApiTest.java @@ -59,8 +59,8 @@ public void createRelationshipTest() throws ApiException { */ @Test public void getRelationshipTest() throws ApiException { - String id = null; - Relationship response = api.getRelationship(id); + String identifier = null; + Relationship response = api.getRelationship(identifier); // TODO: test validations } @@ -81,7 +81,7 @@ public void getRelationshipsTest() throws ApiException { } /** - * Get all relationships with the given element as either source or target + * Get all relationships in the project * * * @@ -89,41 +89,9 @@ public void getRelationshipsTest() throws ApiException { * if the Api call fails */ @Test - public void getRelationshipsByElementTest() throws ApiException { - String elementId = null; - List response = api.getRelationshipsByElement(elementId); - - // TODO: test validations - } - - /** - * Get all relationships with the given element as the source - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void getRelationshipsBySourceTest() throws ApiException { - String sourceId = null; - List response = api.getRelationshipsBySource(sourceId); - - // TODO: test validations - } - - /** - * Get all relationships with the given element as the target - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void getRelationshipsByTargetTest() throws ApiException { - String targetId = null; - List response = api.getRelationshipsByTarget(targetId); + public void getRelationshipsByProjectTest() throws ApiException { + String projectIdentifier = null; + List response = api.getRelationshipsByProject(projectIdentifier); // TODO: test validations }