diff --git a/.gitignore b/.gitignore index ee9ec22..a530464 100644 --- a/.gitignore +++ b/.gitignore @@ -19,5 +19,3 @@ hs_err_pid* target .gradle build -*.iml -.idea diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index 2c6109e..8c7fafd 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -3.3.4 \ No newline at end of file +4.1.3 \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 80a7f2f..e3bdf2a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,17 +1,22 @@ # -# Generated by: https://openapi-generator.tech +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ # language: java jdk: - - oraclejdk8 - - oraclejdk7 + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 before_install: # ensure gradlew has proper permission - chmod a+x ./gradlew script: # test using maven - - mvn test - # uncomment below to test using gradle - # - gradle test - # uncomment below to test using sbt + #- mvn test + # test using gradle + - gradle test + # test using sbt # - sbt test diff --git a/README.md b/README.md index ed0d031..ecbe8f3 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# sysml-api-client +# sysml-v2-api-client SysML v2 API and Services - API version: 1.0.0 @@ -38,8 +38,8 @@ Add this dependency to your project's POM: ```xml org.omg.sysml - sysml-api-client - 2019-05 + sysml-v2-api-client + 2019-09 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:2019-05" +compile "org.omg.sysml:sysml-v2-api-client:2019-09" ``` ### Others @@ -62,7 +62,7 @@ mvn clean package Then manually install the following JARs: -* `target/sysml-api-client-2019-05.jar` +* `target/sysml-v2-api-client-2019-09.jar` * `target/lib/*.jar` ## Getting Started @@ -71,28 +71,31 @@ Please follow the [installation](#installation) instruction and execute the foll ```java -import org.omg.sysml.*; -import org.omg.sysml.auth.*; -import org.omg.sysml.model.*; +// Import classes: +import org.omg.sysml.ApiClient; +import org.omg.sysml.ApiException; +import org.omg.sysml.Configuration; +import org.omg.sysml.models.*; import org.omg.sysml.api.ElementApi; -import java.io.File; -import java.util.*; - -public class ElementApiExample { - - public static void main(String[] args) { - - ElementApi apiInstance = new ElementApi(); - Map requestBody = null; // Map | - try { - Element result = apiInstance.createElement(requestBody); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ElementApi#createElement"); - e.printStackTrace(); - } +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + ElementApi apiInstance = new ElementApi(defaultClient); + Map body = null; // Map | + try { + Element result = apiInstance.createElement(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ElementApi#createElement"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -124,6 +127,7 @@ Class | Method | HTTP request | Description - [Identified](docs/Identified.md) - [Project](docs/Project.md) - [Relationship](docs/Relationship.md) + - [RelationshipAllOf](docs/RelationshipAllOf.md) ## Documentation for Authorization diff --git a/build.gradle b/build.gradle index fe6502f..eb86a88 100644 --- a/build.gradle +++ b/build.gradle @@ -1,11 +1,13 @@ apply plugin: 'idea' apply plugin: 'eclipse' +apply plugin: 'java' group = 'org.omg.sysml' -version = '2019-05' +version = '2019-09' buildscript { repositories { + mavenCentral() jcenter() } dependencies { @@ -17,7 +19,9 @@ buildscript { repositories { jcenter() } - +sourceSets { + main.java.srcDirs = ['src/main/java'] +} if(hasProperty('target') && target == 'android') { @@ -83,7 +87,7 @@ if(hasProperty('target') && target == 'android') { install { repositories.mavenInstaller { - pom.artifactId = 'sysml-api-client' + pom.artifactId = 'sysml-v2-api-client' } } @@ -94,12 +98,17 @@ if(hasProperty('target') && target == 'android') { } dependencies { - compile 'io.swagger:swagger-annotations:1.5.17' - compile 'com.squareup.okhttp:okhttp:2.7.5' - compile 'com.squareup.okhttp:logging-interceptor:2.7.5' - compile 'com.google.code.gson:gson:2.8.1' - compile 'io.gsonfire:gson-fire:1.8.0' - compile group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.1' + compile 'io.swagger:swagger-annotations:1.5.22' + compile "com.google.code.findbugs:jsr305:3.0.2" + compile 'com.squareup.okhttp3:okhttp:3.14.2' + compile 'com.squareup.okhttp3:logging-interceptor:3.14.2' + compile 'com.google.code.gson:gson:2.8.5' + compile 'io.gsonfire:gson-fire:1.8.3' + compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.9' compile 'org.threeten:threetenbp:1.3.5' testCompile 'junit:junit:4.12' } + +javadoc { + options.tags = [ "http.response.details:a:Http Response Details" ] +} diff --git a/build.sbt b/build.sbt index a5cfbe9..c855338 100644 --- a/build.sbt +++ b/build.sbt @@ -1,20 +1,22 @@ lazy val root = (project in file(".")). settings( organization := "org.omg.sysml", - name := "sysml-api-client", - version := "2019-05", + name := "sysml-v2-api-client", + version := "2019-09", scalaVersion := "2.11.4", scalacOptions ++= Seq("-feature"), javacOptions in compile ++= Seq("-Xlint:deprecation"), publishArtifact in (Compile, packageDoc) := false, resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( - "io.swagger" % "swagger-annotations" % "1.5.17", - "com.squareup.okhttp" % "okhttp" % "2.7.5", - "com.squareup.okhttp" % "logging-interceptor" % "2.7.5", - "com.google.code.gson" % "gson" % "2.8.1", + "io.swagger" % "swagger-annotations" % "1.5.22", + "com.squareup.okhttp3" % "okhttp" % "3.14.2", + "com.squareup.okhttp3" % "logging-interceptor" % "3.14.2", + "com.google.code.gson" % "gson" % "2.8.5", + "org.apache.commons" % "commons-lang3" % "3.9", "org.threeten" % "threetenbp" % "1.3.5" % "compile", - "io.gsonfire" % "gson-fire" % "1.8.0" % "compile", + "io.gsonfire" % "gson-fire" % "1.8.3" % "compile", + "javax.annotation" % "jsr250-api" % "1.0" % "compile", "junit" % "junit" % "4.12" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" ) diff --git a/docs/Element.md b/docs/Element.md index 3338479..1e52b40 100644 --- a/docs/Element.md +++ b/docs/Element.md @@ -1,7 +1,9 @@ + # Element ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **atType** | **String** | | [optional] diff --git a/docs/ElementApi.md b/docs/ElementApi.md index 9ceadf3..d895702 100644 --- a/docs/ElementApi.md +++ b/docs/ElementApi.md @@ -13,25 +13,37 @@ Method | HTTP request | Description # **createElement** -> Element createElement(requestBody) +> Element createElement(body) Add a new element ### Example ```java // Import classes: -//import org.omg.sysml.ApiException; -//import org.omg.sysml.api.ElementApi; - - -ElementApi apiInstance = new ElementApi(); -Map requestBody = null; // Map | -try { - Element result = apiInstance.createElement(requestBody); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling ElementApi#createElement"); - e.printStackTrace(); +import org.omg.sysml.ApiClient; +import org.omg.sysml.ApiException; +import org.omg.sysml.Configuration; +import org.omg.sysml.models.*; +import org.omg.sysml.api.ElementApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + ElementApi apiInstance = new ElementApi(defaultClient); + Map body = null; // Map | + try { + Element result = apiInstance.createElement(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ElementApi#createElement"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } } ``` @@ -39,7 +51,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **requestBody** | [**Map<String, Object>**](Object.md)| | + **body** | [**Map<String, Object>**](Object.md)| | ### Return type @@ -54,6 +66,14 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | - | +**415** | The requested content type is not acceptable. | - | +**500** | Internal server error. | - | +**0** | Unexpected response. | - | + # **getElement** > Element getElement(identifier) @@ -63,18 +83,30 @@ Get element by its ID ### Example ```java // Import classes: -//import org.omg.sysml.ApiException; -//import org.omg.sysml.api.ElementApi; - - -ElementApi apiInstance = new ElementApi(); -String identifier = "identifier_example"; // String | ID of the element -try { - Element result = apiInstance.getElement(identifier); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling ElementApi#getElement"); - e.printStackTrace(); +import org.omg.sysml.ApiClient; +import org.omg.sysml.ApiException; +import org.omg.sysml.Configuration; +import org.omg.sysml.models.*; +import org.omg.sysml.api.ElementApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + ElementApi apiInstance = new ElementApi(defaultClient); + String identifier = "identifier_example"; // String | ID of the element + try { + Element result = apiInstance.getElement(identifier); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ElementApi#getElement"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } } ``` @@ -97,6 +129,15 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Ok | - | +**404** | Not found. | - | +**415** | The requested content type is not acceptable. | - | +**500** | Internal server error. | - | +**0** | Unexpected response. | - | + # **getElementByProjectAndId** > Element getElementByProjectAndId(projectIdentifier, elementIdentifier) @@ -106,19 +147,31 @@ Get element by project ID and its ID ### Example ```java // Import classes: -//import org.omg.sysml.ApiException; -//import org.omg.sysml.api.ElementApi; - - -ElementApi apiInstance = new ElementApi(); -String projectIdentifier = "projectIdentifier_example"; // String | ID of the project -String elementIdentifier = "elementIdentifier_example"; // String | ID of the element -try { - Element result = apiInstance.getElementByProjectAndId(projectIdentifier, elementIdentifier); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling ElementApi#getElementByProjectAndId"); - e.printStackTrace(); +import org.omg.sysml.ApiClient; +import org.omg.sysml.ApiException; +import org.omg.sysml.Configuration; +import org.omg.sysml.models.*; +import org.omg.sysml.api.ElementApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + ElementApi apiInstance = new ElementApi(defaultClient); + String projectIdentifier = "projectIdentifier_example"; // String | ID of the project + String elementIdentifier = "elementIdentifier_example"; // String | ID of the element + try { + Element result = apiInstance.getElementByProjectAndId(projectIdentifier, elementIdentifier); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ElementApi#getElementByProjectAndId"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } } ``` @@ -142,6 +195,15 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Ok | - | +**404** | Not found. | - | +**415** | The requested content type is not acceptable. | - | +**500** | Internal server error. | - | +**0** | Unexpected response. | - | + # **getElements** > List<Element> getElements() @@ -151,17 +213,29 @@ Get all elements ### Example ```java // Import classes: -//import org.omg.sysml.ApiException; -//import org.omg.sysml.api.ElementApi; - - -ElementApi apiInstance = new ElementApi(); -try { - List result = apiInstance.getElements(); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling ElementApi#getElements"); - e.printStackTrace(); +import org.omg.sysml.ApiClient; +import org.omg.sysml.ApiException; +import org.omg.sysml.Configuration; +import org.omg.sysml.models.*; +import org.omg.sysml.api.ElementApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + ElementApi apiInstance = new ElementApi(defaultClient); + try { + List result = apiInstance.getElements(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ElementApi#getElements"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } } ``` @@ -181,6 +255,14 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Ok | - | +**415** | The requested content type is not acceptable. | - | +**500** | Internal server error. | - | +**0** | Unexpected response. | - | + # **getElementsInProject** > Element getElementsInProject(projectIdentifier) @@ -190,18 +272,30 @@ Get all elements in the project ### Example ```java // Import classes: -//import org.omg.sysml.ApiException; -//import org.omg.sysml.api.ElementApi; - - -ElementApi apiInstance = new ElementApi(); -String projectIdentifier = "projectIdentifier_example"; // String | ID of the project -try { - Element result = apiInstance.getElementsInProject(projectIdentifier); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling ElementApi#getElementsInProject"); - e.printStackTrace(); +import org.omg.sysml.ApiClient; +import org.omg.sysml.ApiException; +import org.omg.sysml.Configuration; +import org.omg.sysml.models.*; +import org.omg.sysml.api.ElementApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + ElementApi apiInstance = new ElementApi(defaultClient); + String projectIdentifier = "projectIdentifier_example"; // String | ID of the project + try { + Element result = apiInstance.getElementsInProject(projectIdentifier); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ElementApi#getElementsInProject"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } } ``` @@ -224,3 +318,12 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Ok | - | +**404** | Not found. | - | +**415** | The requested content type is not acceptable. | - | +**500** | Internal server error. | - | +**0** | Unexpected response. | - | + diff --git a/docs/Error.md b/docs/Error.md index ca189bc..e4763d7 100644 --- a/docs/Error.md +++ b/docs/Error.md @@ -1,7 +1,9 @@ + # Error ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **error** | **String** | | [optional] diff --git a/docs/Identified.md b/docs/Identified.md index 971186c..6c7156c 100644 --- a/docs/Identified.md +++ b/docs/Identified.md @@ -1,7 +1,9 @@ + # Identified ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **identifier** | [**UUID**](UUID.md) | | [optional] diff --git a/docs/Project.md b/docs/Project.md index 464fd4d..7e5b307 100644 --- a/docs/Project.md +++ b/docs/Project.md @@ -1,7 +1,9 @@ + # Project ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **atType** | **String** | | [optional] diff --git a/docs/ProjectApi.md b/docs/ProjectApi.md index 93d7957..7409662 100644 --- a/docs/ProjectApi.md +++ b/docs/ProjectApi.md @@ -11,25 +11,37 @@ Method | HTTP request | Description # **createProject** -> Project createProject(project) +> Project createProject(body) Add a new project ### Example ```java // Import classes: -//import org.omg.sysml.ApiException; -//import org.omg.sysml.api.ProjectApi; - - -ProjectApi apiInstance = new ProjectApi(); -Project project = new Project(); // Project | -try { - Project result = apiInstance.createProject(project); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling ProjectApi#createProject"); - e.printStackTrace(); +import org.omg.sysml.ApiClient; +import org.omg.sysml.ApiException; +import org.omg.sysml.Configuration; +import org.omg.sysml.models.*; +import org.omg.sysml.api.ProjectApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + ProjectApi apiInstance = new ProjectApi(defaultClient); + Project body = new Project(); // Project | + try { + Project result = apiInstance.createProject(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ProjectApi#createProject"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } } ``` @@ -37,7 +49,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **project** | [**Project**](Project.md)| | [optional] + **body** | [**Project**](Project.md)| | [optional] ### Return type @@ -52,6 +64,14 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | - | +**415** | The requested content type is not acceptable. | - | +**500** | Internal server error. | - | +**0** | Unexpected response. | - | + # **getProject** > Project getProject(identifier) @@ -61,18 +81,30 @@ Get project by its ID ### Example ```java // Import classes: -//import org.omg.sysml.ApiException; -//import org.omg.sysml.api.ProjectApi; - - -ProjectApi apiInstance = new ProjectApi(); -String identifier = "identifier_example"; // String | ID of the project -try { - Project result = apiInstance.getProject(identifier); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling ProjectApi#getProject"); - e.printStackTrace(); +import org.omg.sysml.ApiClient; +import org.omg.sysml.ApiException; +import org.omg.sysml.Configuration; +import org.omg.sysml.models.*; +import org.omg.sysml.api.ProjectApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + ProjectApi apiInstance = new ProjectApi(defaultClient); + String identifier = "identifier_example"; // String | ID of the project + try { + Project result = apiInstance.getProject(identifier); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ProjectApi#getProject"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } } ``` @@ -95,6 +127,15 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Ok | - | +**404** | Not found. | - | +**415** | The requested content type is not acceptable. | - | +**500** | Internal server error. | - | +**0** | Unexpected response. | - | + # **getProjects** > List<Project> getProjects() @@ -104,17 +145,29 @@ Get all projects ### Example ```java // Import classes: -//import org.omg.sysml.ApiException; -//import org.omg.sysml.api.ProjectApi; - - -ProjectApi apiInstance = new ProjectApi(); -try { - List result = apiInstance.getProjects(); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling ProjectApi#getProjects"); - e.printStackTrace(); +import org.omg.sysml.ApiClient; +import org.omg.sysml.ApiException; +import org.omg.sysml.Configuration; +import org.omg.sysml.models.*; +import org.omg.sysml.api.ProjectApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + ProjectApi apiInstance = new ProjectApi(defaultClient); + try { + List result = apiInstance.getProjects(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ProjectApi#getProjects"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } } ``` @@ -134,3 +187,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Ok | - | +**415** | The requested content type is not acceptable. | - | +**500** | Internal server error. | - | +**0** | Unexpected response. | - | + diff --git a/docs/Relationship.md b/docs/Relationship.md index 0348dc9..47af9f8 100644 --- a/docs/Relationship.md +++ b/docs/Relationship.md @@ -1,9 +1,14 @@ + # Relationship ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**atType** | **String** | | [optional] +**containingProject** | [**Identified**](Identified.md) | | [optional] +**identifier** | [**UUID**](UUID.md) | | [optional] **source** | [**List<Identified>**](Identified.md) | | [optional] **target** | [**List<Identified>**](Identified.md) | | [optional] diff --git a/docs/RelationshipAllOf.md b/docs/RelationshipAllOf.md new file mode 100644 index 0000000..dd5b01b --- /dev/null +++ b/docs/RelationshipAllOf.md @@ -0,0 +1,13 @@ + + +# RelationshipAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**source** | [**List<Identified>**](Identified.md) | | [optional] +**target** | [**List<Identified>**](Identified.md) | | [optional] + + + diff --git a/docs/RelationshipApi.md b/docs/RelationshipApi.md index fc4e03f..fc593fc 100644 --- a/docs/RelationshipApi.md +++ b/docs/RelationshipApi.md @@ -12,25 +12,37 @@ Method | HTTP request | Description # **createRelationship** -> Relationship createRelationship(relationship) +> Relationship createRelationship(body) Add a new relationship ### Example ```java // Import classes: -//import org.omg.sysml.ApiException; -//import org.omg.sysml.api.RelationshipApi; - - -RelationshipApi apiInstance = new RelationshipApi(); -Relationship relationship = new Relationship(); // Relationship | -try { - Relationship result = apiInstance.createRelationship(relationship); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling RelationshipApi#createRelationship"); - e.printStackTrace(); +import org.omg.sysml.ApiClient; +import org.omg.sysml.ApiException; +import org.omg.sysml.Configuration; +import org.omg.sysml.models.*; +import org.omg.sysml.api.RelationshipApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + RelationshipApi apiInstance = new RelationshipApi(defaultClient); + Relationship body = new Relationship(); // Relationship | + try { + Relationship result = apiInstance.createRelationship(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RelationshipApi#createRelationship"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } } ``` @@ -38,7 +50,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **relationship** | [**Relationship**](Relationship.md)| | + **body** | [**Relationship**](Relationship.md)| | ### Return type @@ -53,6 +65,14 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | - | +**415** | The requested content type is not acceptable. | - | +**500** | Internal server error. | - | +**0** | Unexpected response. | - | + # **getRelationship** > Relationship getRelationship(identifier) @@ -62,18 +82,30 @@ Get relationship by its ID ### Example ```java // Import classes: -//import org.omg.sysml.ApiException; -//import org.omg.sysml.api.RelationshipApi; - - -RelationshipApi apiInstance = new RelationshipApi(); -String identifier = "identifier_example"; // String | ID of the relationship -try { - Relationship result = apiInstance.getRelationship(identifier); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling RelationshipApi#getRelationship"); - e.printStackTrace(); +import org.omg.sysml.ApiClient; +import org.omg.sysml.ApiException; +import org.omg.sysml.Configuration; +import org.omg.sysml.models.*; +import org.omg.sysml.api.RelationshipApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + RelationshipApi apiInstance = new RelationshipApi(defaultClient); + String identifier = "identifier_example"; // String | ID of the relationship + try { + Relationship result = apiInstance.getRelationship(identifier); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RelationshipApi#getRelationship"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } } ``` @@ -96,6 +128,15 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Ok | - | +**404** | Not found. | - | +**415** | The requested content type is not acceptable. | - | +**500** | Internal server error. | - | +**0** | Unexpected response. | - | + # **getRelationships** > List<Relationship> getRelationships() @@ -105,17 +146,29 @@ Get all relationships ### Example ```java // Import classes: -//import org.omg.sysml.ApiException; -//import org.omg.sysml.api.RelationshipApi; - - -RelationshipApi apiInstance = new RelationshipApi(); -try { - List result = apiInstance.getRelationships(); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling RelationshipApi#getRelationships"); - e.printStackTrace(); +import org.omg.sysml.ApiClient; +import org.omg.sysml.ApiException; +import org.omg.sysml.Configuration; +import org.omg.sysml.models.*; +import org.omg.sysml.api.RelationshipApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + RelationshipApi apiInstance = new RelationshipApi(defaultClient); + try { + List result = apiInstance.getRelationships(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RelationshipApi#getRelationships"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } } ``` @@ -135,6 +188,14 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Ok | - | +**415** | The requested content type is not acceptable. | - | +**500** | Internal server error. | - | +**0** | Unexpected response. | - | + # **getRelationshipsByProject** > List<Relationship> getRelationshipsByProject(projectIdentifier) @@ -144,18 +205,30 @@ Get all relationships in the project ### Example ```java // Import classes: -//import org.omg.sysml.ApiException; -//import org.omg.sysml.api.RelationshipApi; - - -RelationshipApi apiInstance = new RelationshipApi(); -String projectIdentifier = "projectIdentifier_example"; // String | ID of the project -try { - List result = apiInstance.getRelationshipsByProject(projectIdentifier); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling RelationshipApi#getRelationshipsByProject"); - e.printStackTrace(); +import org.omg.sysml.ApiClient; +import org.omg.sysml.ApiException; +import org.omg.sysml.Configuration; +import org.omg.sysml.models.*; +import org.omg.sysml.api.RelationshipApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + RelationshipApi apiInstance = new RelationshipApi(defaultClient); + String projectIdentifier = "projectIdentifier_example"; // String | ID of the project + try { + List result = apiInstance.getRelationshipsByProject(projectIdentifier); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RelationshipApi#getRelationshipsByProject"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } } ``` @@ -178,3 +251,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Ok | - | +**415** | The requested content type is not acceptable. | - | +**500** | Internal server error. | - | +**0** | Unexpected response. | - | + diff --git a/git_push.sh b/git_push.sh index 8442b80..ced3be2 100644 --- a/git_push.sh +++ b/git_push.sh @@ -1,11 +1,17 @@ #!/bin/sh # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ # -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" git_user_id=$1 git_repo_id=$2 release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="GIT_USER_ID" @@ -28,7 +34,7 @@ git init # Adds the files in the local repository and stages them for commit. git add . -# Commits the tracked changes and prepares them to be pushed to a remote repository. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 2c6137b..87b738c 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index b7a3647..e496c05 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Tue May 17 23:08:05 CST 2016 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.6-bin.zip diff --git a/gradlew b/gradlew index 9d82f78..af6708f 100755 --- a/gradlew +++ b/gradlew @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh ############################################################################## ## @@ -6,20 +6,38 @@ ## ############################################################################## -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m"' + # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" -warn ( ) { +warn () { echo "$*" } -die ( ) { +die () { echo echo "$*" echo @@ -30,6 +48,7 @@ die ( ) { cygwin=false msys=false darwin=false +nonstop=false case "`uname`" in CYGWIN* ) cygwin=true @@ -40,26 +59,11 @@ case "`uname`" in MINGW* ) msys=true ;; + NONSTOP* ) + nonstop=true + ;; esac -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. @@ -85,7 +89,7 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then MAX_FD_LIMIT=`ulimit -H -n` if [ $? -eq 0 ] ; then if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then @@ -150,11 +154,19 @@ if $cygwin ; then esac fi -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " } -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" +APP_ARGS=$(save "$@") + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index 5f19212..f955316 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -8,14 +8,14 @@ @rem Set local scope for the variables with windows NT shell if "%OS%"=="Windows_NT" setlocal -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - set DIRNAME=%~dp0 if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome @@ -49,7 +49,6 @@ goto fail @rem Get command-line arguments, handling Windows variants if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args :win9xME_args @rem Slurp the command line arguments. @@ -60,11 +59,6 @@ set _SKIP=2 if "x%~1" == "x" goto execute set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ :execute @rem Setup the command line diff --git a/pom.xml b/pom.xml index 7b9713e..93517a8 100644 --- a/pom.xml +++ b/pom.xml @@ -2,10 +2,10 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 org.omg.sysml - sysml-api-client + sysml-v2-api-client jar - sysml-api-client - 2019-05 + sysml-v2-api-client + 2019-09 https://github.com/openapitools/openapi-generator OpenAPI Java @@ -24,9 +24,9 @@ - OpenAPI + OpenAPI-Generator Contributors team@openapitools.org - OpenAPI + OpenAPITools.org http://openapitools.org @@ -114,8 +114,7 @@ - - src/main/java + src/main/java @@ -127,8 +126,7 @@ - - src/test/java + src/test/java @@ -146,6 +144,15 @@ + + + + http.response.details + a + Http Response Details: + + + org.apache.maven.plugins @@ -193,13 +200,19 @@ swagger-annotations ${swagger-core-version} + + + com.google.code.findbugs + jsr305 + 3.0.2 + - com.squareup.okhttp + com.squareup.okhttp3 okhttp ${okhttp-version} - com.squareup.okhttp + com.squareup.okhttp3 logging-interceptor ${okhttp-version} @@ -214,15 +227,20 @@ ${gson-fire-version} - org.apache.oltu.oauth2 - org.apache.oltu.oauth2.client - 1.0.1 + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + + org.threeten + threetenbp + ${threetenbp-version} + + + javax.annotation + jsr250-api + ${javax-annotation-version} - - org.threeten - threetenbp - ${threetenbp-version} - junit @@ -235,12 +253,14 @@ 1.7 ${java.version} ${java.version} - 1.8.0 - 1.5.18 - 2.7.5 - 2.8.1 - 1.3.5 + 1.8.3 + 1.5.22 + 3.14.2 + 2.8.5 + 3.9 + 1.3.8 1.0.0 + 1.0 4.12 UTF-8 diff --git a/settings.gradle b/settings.gradle index 6ee1d54..89ca2cf 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1 @@ -rootProject.name = "sysml-api-client" \ No newline at end of file +rootProject.name = "sysml-v2-api-client" \ No newline at end of file diff --git a/src/main/java/org/omg/sysml/ApiCallback.java b/src/main/java/org/omg/sysml/ApiCallback.java index dbbbb41..9d85470 100644 --- a/src/main/java/org/omg/sysml/ApiCallback.java +++ b/src/main/java/org/omg/sysml/ApiCallback.java @@ -2,7 +2,7 @@ * SysML v2 API and Services * REST/HTTP binding (PSM) for the SysML v2 standard API. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/org/omg/sysml/ApiClient.java b/src/main/java/org/omg/sysml/ApiClient.java index 8f97eca..497830a 100644 --- a/src/main/java/org/omg/sysml/ApiClient.java +++ b/src/main/java/org/omg/sysml/ApiClient.java @@ -2,7 +2,7 @@ * SysML v2 API and Services * REST/HTTP binding (PSM) for the SysML v2 standard API. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,19 +13,16 @@ package org.omg.sysml; -import com.squareup.okhttp.*; -import com.squareup.okhttp.internal.http.HttpMethod; -import com.squareup.okhttp.logging.HttpLoggingInterceptor; -import com.squareup.okhttp.logging.HttpLoggingInterceptor.Level; +import okhttp3.*; +import okhttp3.internal.http.HttpMethod; +import okhttp3.logging.HttpLoggingInterceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; import okio.BufferedSink; import okio.Okio; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; import org.threeten.bp.format.DateTimeFormatter; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; -import org.apache.oltu.oauth2.common.message.types.GrantType; - import javax.net.ssl.*; import java.io.File; import java.io.IOException; @@ -50,10 +47,8 @@ import org.omg.sysml.auth.Authentication; import org.omg.sysml.auth.HttpBasicAuth; +import org.omg.sysml.auth.HttpBearerAuth; import org.omg.sysml.auth.ApiKeyAuth; -import org.omg.sysml.auth.OAuth; -import org.omg.sysml.auth.RetryingOAuth; -import org.omg.sysml.auth.OAuthFlow; public class ApiClient { @@ -88,9 +83,11 @@ public ApiClient() { // Prevent the authentications from being modified. authentications = Collections.unmodifiableMap(authentications); } - + private void init() { - httpClient = new OkHttpClient(); + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + httpClient = builder.build(); verifyingSsl = true; @@ -98,7 +95,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("OpenAPI-Generator/2019-05/java"); + setUserAgent("OpenAPI-Generator/2019-09/java"); authentications = new HashMap(); } @@ -133,13 +130,14 @@ public OkHttpClient getHttpClient() { } /** - * Set HTTP client + * Set HTTP client, which must never be null. * - * @param httpClient An instance of OkHttpClient + * @param newHttpClient An instance of OkHttpClient * @return Api Client + * @throws NullPointerException when newHttpClient is null */ - public ApiClient setHttpClient(OkHttpClient httpClient) { - this.httpClient = httpClient; + public ApiClient setHttpClient(OkHttpClient newHttpClient) { + this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); return this; } @@ -339,12 +337,6 @@ public void setApiKeyPrefix(String apiKeyPrefix) { * @param accessToken Access token */ public void setAccessToken(String accessToken) { - for (Authentication auth : authentications.values()) { - if (auth instanceof OAuth) { - ((OAuth) auth).setAccessToken(accessToken); - return; - } - } throw new RuntimeException("No OAuth2 authentication configured!"); } @@ -391,7 +383,7 @@ public ApiClient setDebugging(boolean debugging) { if (debugging) { loggingInterceptor = new HttpLoggingInterceptor(); loggingInterceptor.setLevel(Level.BODY); - httpClient.interceptors().add(loggingInterceptor); + httpClient = httpClient.newBuilder().addInterceptor(loggingInterceptor).build(); } else { httpClient.interceptors().remove(loggingInterceptor); loggingInterceptor = null; @@ -430,7 +422,7 @@ public ApiClient setTempFolderPath(String tempFolderPath) { * @return Timeout in milliseconds */ public int getConnectTimeout() { - return httpClient.getConnectTimeout(); + return httpClient.connectTimeoutMillis(); } /** @@ -442,7 +434,7 @@ public int getConnectTimeout() { * @return Api client */ public ApiClient setConnectTimeout(int connectionTimeout) { - httpClient.setConnectTimeout(connectionTimeout, TimeUnit.MILLISECONDS); + httpClient = httpClient.newBuilder().connectTimeout(connectionTimeout, TimeUnit.MILLISECONDS).build(); return this; } @@ -452,7 +444,7 @@ public ApiClient setConnectTimeout(int connectionTimeout) { * @return Timeout in milliseconds */ public int getReadTimeout() { - return httpClient.getReadTimeout(); + return httpClient.readTimeoutMillis(); } /** @@ -464,7 +456,7 @@ public int getReadTimeout() { * @return Api client */ public ApiClient setReadTimeout(int readTimeout) { - httpClient.setReadTimeout(readTimeout, TimeUnit.MILLISECONDS); + httpClient = httpClient.newBuilder().readTimeout(readTimeout, TimeUnit.MILLISECONDS).build(); return this; } @@ -474,7 +466,7 @@ public ApiClient setReadTimeout(int readTimeout) { * @return Timeout in milliseconds */ public int getWriteTimeout() { - return httpClient.getWriteTimeout(); + return httpClient.writeTimeoutMillis(); } /** @@ -486,23 +478,10 @@ public int getWriteTimeout() { * @return Api client */ public ApiClient setWriteTimeout(int writeTimeout) { - httpClient.setWriteTimeout(writeTimeout, TimeUnit.MILLISECONDS); + httpClient = httpClient.newBuilder().writeTimeout(writeTimeout, TimeUnit.MILLISECONDS).build(); return this; } - /** - * Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * @return Token request builder - */ - public TokenRequestBuilder getTokenEndPoint() { - for (Authentication apiAuth : authentications.values()) { - if (apiAuth instanceof RetryingOAuth) { - RetryingOAuth retryingOAuth = (RetryingOAuth) apiAuth; - return retryingOAuth.getTokenRequestBuilder(); - } - } - return null; - } /** * Format the given parameter object into string. @@ -602,6 +581,40 @@ public List parameterToPairs(String collectionFormat, String name, Collect return params; } + /** + * Formats the specified collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param value The value of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(String collectionFormat, Collection value) { + // create the value based on the collection format + if ("multi".equals(collectionFormat)) { + // not valid for path params + return parameterToString(value); + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + if ("ssv".equals(collectionFormat)) { + delimiter = " "; + } else if ("tsv".equals(collectionFormat)) { + delimiter = "\t"; + } else if ("pipes".equals(collectionFormat)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + return sb.substring(delimiter.length()); + } + /** * Sanitize filename by removing path. * e.g. ../../sun.gif becomes sun.gif @@ -625,8 +638,8 @@ public String sanitizeFilename(String filename) { * @return True if the given MIME is JSON, false otherwise. */ public boolean isJsonMime(String mime) { - String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; - return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); } /** @@ -799,8 +812,8 @@ public File downloadFileFromResponse(Response response) throws ApiException { * Prepare file for download * * @param response An instance of the Response object - * @throws IOException If fail to prepare file for download * @return Prepared file for the download + * @throws IOException If fail to prepare file for download */ public File prepareDownloadFile(Response response) throws IOException { String filename = null; @@ -843,8 +856,8 @@ public File prepareDownloadFile(Response response) throws IOException { * * @param Type * @param call An instance of the Call object - * @throws ApiException If fail to execute the call * @return ApiResponse<T> + * @throws ApiException If fail to execute the call */ public ApiResponse execute(Call call) throws ApiException { return execute(call, null); @@ -885,22 +898,22 @@ public void executeAsync(Call call, ApiCallback callback) { /** * Execute HTTP call asynchronously. * - * @see #execute(Call, Type) * @param Type * @param call The callback to be executed when the API call finishes * @param returnType Return type * @param callback ApiCallback + * @see #execute(Call, Type) */ @SuppressWarnings("unchecked") public void executeAsync(Call call, final Type returnType, final ApiCallback callback) { call.enqueue(new Callback() { @Override - public void onFailure(Request request, IOException e) { + public void onFailure(Call call, IOException e) { callback.onFailure(new ApiException(e), 0, null); } @Override - public void onResponse(Response response) throws IOException { + public void onResponse(Call call, Response response) throws IOException { T result; try { result = (T) handleResponse(response, returnType); @@ -919,9 +932,9 @@ public void onResponse(Response response) throws IOException { * @param Type * @param response Response * @param returnType Return type - * @throws ApiException If the response has an unsuccessful status code or - * fail to deserialize the response body * @return Type + * @throws ApiException If the response has an unsuccessful status code or + * fail to deserialize the response body */ public T handleResponse(Response response, Type returnType) throws ApiException { if (response.isSuccessful()) { @@ -931,7 +944,7 @@ public T handleResponse(Response response, Type returnType) throws ApiExcept if (response.body() != null) { try { response.body().close(); - } catch (IOException e) { + } catch (Exception e) { throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); } } @@ -963,12 +976,12 @@ public T handleResponse(Response response, Type returnType) throws ApiExcept * @param headerParams The header parameters * @param formParams The form parameters * @param authNames The authentications to apply - * @param progressRequestListener Progress request listener + * @param callback Callback for upload/download progress * @return The HTTP call * @throws ApiException If fail to serialize the request body object */ - public Call buildCall(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map formParams, String[] authNames, ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Request request = buildRequest(path, method, queryParams, collectionQueryParams, body, headerParams, formParams, authNames, progressRequestListener); + public Call buildCall(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { + Request request = buildRequest(path, method, queryParams, collectionQueryParams, body, headerParams, formParams, authNames, callback); return httpClient.newCall(request); } @@ -984,11 +997,11 @@ public Call buildCall(String path, String method, List queryParams, List

queryParams, List collectionQueryParams, Object body, Map headerParams, Map formParams, String[] authNames, ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + public Request buildRequest(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { updateParamsForAuth(authNames, queryParams, headerParams); final String url = buildUrl(path, queryParams, collectionQueryParams); @@ -1020,10 +1033,14 @@ public Request buildRequest(String path, String method, List queryParams, reqBody = serialize(body, contentType); } + // Associate callback with request (if not null) so interceptor can + // access it when creating ProgressResponseBody + reqBuilder.tag(callback); + Request request = null; - if(progressRequestListener != null && reqBody != null) { - ProgressRequestBody progressRequestBody = new ProgressRequestBody(reqBody, progressRequestListener); + if (callback != null && reqBody != null) { + ProgressRequestBody progressRequestBody = new ProgressRequestBody(reqBody, callback); request = reqBuilder.method(method, progressRequestBody).build(); } else { request = reqBuilder.method(method, reqBody).build(); @@ -1122,7 +1139,7 @@ public void updateParamsForAuth(String[] authNames, List queryParams, Map< * @return RequestBody */ public RequestBody buildRequestBodyFormEncoding(Map formParams) { - FormEncodingBuilder formBuilder = new FormEncodingBuilder(); + okhttp3.FormBody.Builder formBuilder = new okhttp3.FormBody.Builder(); for (Entry param : formParams.entrySet()) { formBuilder.add(param.getKey(), parameterToString(param.getValue())); } @@ -1137,7 +1154,7 @@ public RequestBody buildRequestBodyFormEncoding(Map formParams) * @return RequestBody */ public RequestBody buildRequestBodyMultipart(Map formParams) { - MultipartBuilder mpBuilder = new MultipartBuilder().type(MultipartBuilder.FORM); + MultipartBody.Builder mpBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); for (Entry param : formParams.entrySet()) { if (param.getValue() instanceof File) { File file = (File) param.getValue(); @@ -1167,6 +1184,27 @@ public String guessContentTypeFromFile(File file) { } } + /** + * Get network interceptor to add it to the httpClient to track download progress for + * async requests. + */ + private Interceptor getProgressInterceptor() { + return new Interceptor() { + @Override + public Response intercept(Interceptor.Chain chain) throws IOException { + final Request request = chain.request(); + final Response originalResponse = chain.proceed(request); + if (request.tag() instanceof ApiCallback) { + final ApiCallback callback = (ApiCallback) request.tag(); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), callback)) + .build(); + } + return originalResponse; + } + }; + } + /** * Apply SSL related settings to httpClient according to the current values of * verifyingSsl and sslCaCert. @@ -1176,16 +1214,23 @@ private void applySslSettings() { TrustManager[] trustManagers = null; HostnameVerifier hostnameVerifier = null; if (!verifyingSsl) { - TrustManager trustAll = new X509TrustManager() { - @Override - public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {} - @Override - public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {} - @Override - public X509Certificate[] getAcceptedIssuers() { return null; } + trustManagers = new TrustManager[]{ + new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } + } }; SSLContext sslContext = SSLContext.getInstance("TLS"); - trustManagers = new TrustManager[] {trustAll}; hostnameVerifier = new HostnameVerifier() { @Override public boolean verify(String hostname, SSLSession session) { @@ -1213,11 +1258,12 @@ public boolean verify(String hostname, SSLSession session) { if (keyManagers != null || trustManagers != null) { SSLContext sslContext = SSLContext.getInstance("TLS"); sslContext.init(keyManagers, trustManagers, new SecureRandom()); - httpClient.setSslSocketFactory(sslContext.getSocketFactory()); + httpClient = httpClient.newBuilder().sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]).build(); } else { - httpClient.setSslSocketFactory(null); + httpClient = httpClient.newBuilder().sslSocketFactory(null, (X509TrustManager) trustManagers[0]).build(); } - httpClient.setHostnameVerifier(hostnameVerifier); + + httpClient = httpClient.newBuilder().hostnameVerifier(hostnameVerifier).build(); } catch (GeneralSecurityException e) { throw new RuntimeException(e); } diff --git a/src/main/java/org/omg/sysml/ApiException.java b/src/main/java/org/omg/sysml/ApiException.java index 8438680..706c3cd 100644 --- a/src/main/java/org/omg/sysml/ApiException.java +++ b/src/main/java/org/omg/sysml/ApiException.java @@ -2,7 +2,7 @@ * SysML v2 API and Services * REST/HTTP binding (PSM) for the SysML v2 standard API. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/org/omg/sysml/ApiResponse.java b/src/main/java/org/omg/sysml/ApiResponse.java index 2435fb4..368c123 100644 --- a/src/main/java/org/omg/sysml/ApiResponse.java +++ b/src/main/java/org/omg/sysml/ApiResponse.java @@ -2,7 +2,7 @@ * SysML v2 API and Services * REST/HTTP binding (PSM) for the SysML v2 standard API. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/org/omg/sysml/Configuration.java b/src/main/java/org/omg/sysml/Configuration.java index 7027b32..122a7ba 100644 --- a/src/main/java/org/omg/sysml/Configuration.java +++ b/src/main/java/org/omg/sysml/Configuration.java @@ -2,7 +2,7 @@ * SysML v2 API and Services * REST/HTTP binding (PSM) for the SysML v2 standard API. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/org/omg/sysml/GzipRequestInterceptor.java b/src/main/java/org/omg/sysml/GzipRequestInterceptor.java index 1d98989..ba51a22 100644 --- a/src/main/java/org/omg/sysml/GzipRequestInterceptor.java +++ b/src/main/java/org/omg/sysml/GzipRequestInterceptor.java @@ -2,7 +2,7 @@ * SysML v2 API and Services * REST/HTTP binding (PSM) for the SysML v2 standard API. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,7 +13,7 @@ package org.omg.sysml; -import com.squareup.okhttp.*; +import okhttp3.*; import okio.Buffer; import okio.BufferedSink; import okio.GzipSink; diff --git a/src/main/java/org/omg/sysml/JSON.java b/src/main/java/org/omg/sysml/JSON.java index 7c4cfa7..4d892c3 100644 --- a/src/main/java/org/omg/sysml/JSON.java +++ b/src/main/java/org/omg/sysml/JSON.java @@ -2,7 +2,7 @@ * SysML v2 API and Services * REST/HTTP binding (PSM) for the SysML v2 standard API. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/org/omg/sysml/Pair.java b/src/main/java/org/omg/sysml/Pair.java index 2892122..dc0528d 100644 --- a/src/main/java/org/omg/sysml/Pair.java +++ b/src/main/java/org/omg/sysml/Pair.java @@ -2,7 +2,7 @@ * SysML v2 API and Services * REST/HTTP binding (PSM) for the SysML v2 standard API. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/org/omg/sysml/ProgressRequestBody.java b/src/main/java/org/omg/sysml/ProgressRequestBody.java index 77790b2..7da170d 100644 --- a/src/main/java/org/omg/sysml/ProgressRequestBody.java +++ b/src/main/java/org/omg/sysml/ProgressRequestBody.java @@ -2,7 +2,7 @@ * SysML v2 API and Services * REST/HTTP binding (PSM) for the SysML v2 standard API. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,8 +13,8 @@ package org.omg.sysml; -import com.squareup.okhttp.MediaType; -import com.squareup.okhttp.RequestBody; +import okhttp3.MediaType; +import okhttp3.RequestBody; import java.io.IOException; @@ -26,17 +26,13 @@ public class ProgressRequestBody extends RequestBody { - public interface ProgressRequestListener { - void onRequestProgress(long bytesWritten, long contentLength, boolean done); - } - private final RequestBody requestBody; - private final ProgressRequestListener progressListener; + private final ApiCallback callback; - public ProgressRequestBody(RequestBody requestBody, ProgressRequestListener progressListener) { + public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { this.requestBody = requestBody; - this.progressListener = progressListener; + this.callback = callback; } @Override @@ -70,7 +66,7 @@ public void write(Buffer source, long byteCount) throws IOException { } bytesWritten += byteCount; - progressListener.onRequestProgress(bytesWritten, contentLength, bytesWritten == contentLength); + callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); } }; } diff --git a/src/main/java/org/omg/sysml/ProgressResponseBody.java b/src/main/java/org/omg/sysml/ProgressResponseBody.java index 1fcca37..441a9ab 100644 --- a/src/main/java/org/omg/sysml/ProgressResponseBody.java +++ b/src/main/java/org/omg/sysml/ProgressResponseBody.java @@ -2,7 +2,7 @@ * SysML v2 API and Services * REST/HTTP binding (PSM) for the SysML v2 standard API. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,8 +13,8 @@ package org.omg.sysml; -import com.squareup.okhttp.MediaType; -import com.squareup.okhttp.ResponseBody; +import okhttp3.MediaType; +import okhttp3.ResponseBody; import java.io.IOException; @@ -26,17 +26,13 @@ public class ProgressResponseBody extends ResponseBody { - public interface ProgressListener { - void update(long bytesRead, long contentLength, boolean done); - } - private final ResponseBody responseBody; - private final ProgressListener progressListener; + private final ApiCallback callback; private BufferedSource bufferedSource; - public ProgressResponseBody(ResponseBody responseBody, ProgressListener progressListener) { + public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { this.responseBody = responseBody; - this.progressListener = progressListener; + this.callback = callback; } @Override @@ -45,12 +41,12 @@ public MediaType contentType() { } @Override - public long contentLength() throws IOException { + public long contentLength() { return responseBody.contentLength(); } @Override - public BufferedSource source() throws IOException { + public BufferedSource source() { if (bufferedSource == null) { bufferedSource = Okio.buffer(source(responseBody.source())); } @@ -66,7 +62,7 @@ public long read(Buffer sink, long byteCount) throws IOException { long bytesRead = super.read(sink, byteCount); // read() returns the number of bytes read, or -1 if this source is exhausted. totalBytesRead += bytesRead != -1 ? bytesRead : 0; - progressListener.update(totalBytesRead, responseBody.contentLength(), bytesRead == -1); + callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); return bytesRead; } }; diff --git a/src/main/java/org/omg/sysml/StringUtil.java b/src/main/java/org/omg/sysml/StringUtil.java index 591f790..10b38be 100644 --- a/src/main/java/org/omg/sysml/StringUtil.java +++ b/src/main/java/org/omg/sysml/StringUtil.java @@ -2,7 +2,7 @@ * SysML v2 API and Services * REST/HTTP binding (PSM) for the SysML v2 standard API. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/org/omg/sysml/api/ElementApi.java b/src/main/java/org/omg/sysml/api/ElementApi.java index 9a50a87..10114e8 100644 --- a/src/main/java/org/omg/sysml/api/ElementApi.java +++ b/src/main/java/org/omg/sysml/api/ElementApi.java @@ -2,7 +2,7 @@ * SysML v2 API and Services * REST/HTTP binding (PSM) for the SysML v2 standard API. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -37,34 +37,41 @@ import java.util.Map; public class ElementApi { - private ApiClient apiClient; + private ApiClient localVarApiClient; public ElementApi() { this(Configuration.getDefaultApiClient()); } public ElementApi(ApiClient apiClient) { - this.apiClient = apiClient; + this.localVarApiClient = apiClient; } public ApiClient getApiClient() { - return apiClient; + return localVarApiClient; } public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; + this.localVarApiClient = apiClient; } /** * Build call for createElement - * @param requestBody (required) - * @param progressListener Progress listener - * @param progressRequestListener Progress request listener + * @param body (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 + + + + + + +
Status Code Description Response Headers
201 Created -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ - public com.squareup.okhttp.Call createElementCall(Map requestBody, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = requestBody; + public okhttp3.Call createElementCall(Map body, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = body; // create path and map variables String localVarPath = "/elements"; @@ -76,7 +83,7 @@ public com.squareup.okhttp.Call createElementCall(Map requestBod final String[] localVarAccepts = { "application/json" }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -84,112 +91,113 @@ public com.squareup.okhttp.Call createElementCall(Map requestBod final String[] localVarContentTypes = { "application/json" }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = localVarApiClient.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); + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call createElementValidateBeforeCall(Map requestBody, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private okhttp3.Call createElementValidateBeforeCall(Map body, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'requestBody' is set - if (requestBody == null) { - throw new ApiException("Missing the required parameter 'requestBody' when calling createElement(Async)"); + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException("Missing the required parameter 'body' when calling createElement(Async)"); } - com.squareup.okhttp.Call call = createElementCall(requestBody, progressListener, progressRequestListener); - return call; + okhttp3.Call localVarCall = createElementCall(body, _callback); + return localVarCall; } /** * Add a new element * - * @param requestBody (required) + * @param body (required) * @return Element * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 Created -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ - public Element createElement(Map requestBody) throws ApiException { - ApiResponse resp = createElementWithHttpInfo(requestBody); - return resp.getData(); + public Element createElement(Map body) throws ApiException { + ApiResponse localVarResp = createElementWithHttpInfo(body); + return localVarResp.getData(); } /** * Add a new element * - * @param requestBody (required) + * @param body (required) * @return ApiResponse<Element> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 Created -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ - public ApiResponse createElementWithHttpInfo(Map requestBody) throws ApiException { - com.squareup.okhttp.Call call = createElementValidateBeforeCall(requestBody, null, null); + public ApiResponse createElementWithHttpInfo(Map body) throws ApiException { + okhttp3.Call localVarCall = createElementValidateBeforeCall(body, null); Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Add a new element (asynchronously) * - * @param requestBody (required) - * @param callback The callback to be executed when the API call finishes + * @param body (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 + + + + + + +
Status Code Description Response Headers
201 Created -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ - public com.squareup.okhttp.Call createElementAsync(Map requestBody, 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); - } - }; - } + public okhttp3.Call createElementAsync(Map body, final ApiCallback _callback) throws ApiException { - com.squareup.okhttp.Call call = createElementValidateBeforeCall(requestBody, progressListener, progressRequestListener); + okhttp3.Call localVarCall = createElementValidateBeforeCall(body, _callback); Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; } /** * Build call for getElement * @param identifier ID of the element (required) - * @param progressListener Progress listener - * @param progressRequestListener Progress request listener + * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 Ok -
404 Not found. -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ - public com.squareup.okhttp.Call getElementCall(String identifier, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = new Object(); + public okhttp3.Call getElementCall(String identifier, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; // create path and map variables String localVarPath = "/elements/{identifier}" - .replaceAll("\\{" + "identifier" + "\\}", apiClient.escapeString(identifier.toString())); + .replaceAll("\\{" + "identifier" + "\\}", localVarApiClient.escapeString(identifier.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -198,7 +206,7 @@ public com.squareup.okhttp.Call getElementCall(String identifier, final Progress final String[] localVarAccepts = { "application/json" }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -206,27 +214,15 @@ public com.squareup.okhttp.Call getElementCall(String identifier, final Progress final String[] localVarContentTypes = { }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = localVarApiClient.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); + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call getElementValidateBeforeCall(String identifier, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private okhttp3.Call getElementValidateBeforeCall(String identifier, final ApiCallback _callback) throws ApiException { // verify the required parameter 'identifier' is set if (identifier == null) { @@ -234,8 +230,8 @@ private com.squareup.okhttp.Call getElementValidateBeforeCall(String identifier, } - com.squareup.okhttp.Call call = getElementCall(identifier, progressListener, progressRequestListener); - return call; + okhttp3.Call localVarCall = getElementCall(identifier, _callback); + return localVarCall; } @@ -245,10 +241,19 @@ private com.squareup.okhttp.Call getElementValidateBeforeCall(String identifier, * @param identifier ID of the element (required) * @return Element * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 Ok -
404 Not found. -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ public Element getElement(String identifier) throws ApiException { - ApiResponse resp = getElementWithHttpInfo(identifier); - return resp.getData(); + ApiResponse localVarResp = getElementWithHttpInfo(identifier); + return localVarResp.getData(); } /** @@ -257,63 +262,70 @@ public Element getElement(String identifier) throws ApiException { * @param identifier ID of the element (required) * @return ApiResponse<Element> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 Ok -
404 Not found. -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ public ApiResponse getElementWithHttpInfo(String identifier) throws ApiException { - com.squareup.okhttp.Call call = getElementValidateBeforeCall(identifier, null, null); + okhttp3.Call localVarCall = getElementValidateBeforeCall(identifier, null); Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Get element by its ID (asynchronously) * * @param identifier ID of the element (required) - * @param callback The callback to be executed when the API call finishes + * @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 + + + + + + + +
Status Code Description Response Headers
200 Ok -
404 Not found. -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ - public com.squareup.okhttp.Call getElementAsync(String identifier, 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); - } - }; - } + public okhttp3.Call getElementAsync(String identifier, final ApiCallback _callback) throws ApiException { - com.squareup.okhttp.Call call = getElementValidateBeforeCall(identifier, progressListener, progressRequestListener); + okhttp3.Call localVarCall = getElementValidateBeforeCall(identifier, _callback); Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; } /** * Build call for getElementByProjectAndId * @param projectIdentifier ID of the project (required) * @param elementIdentifier ID of the element (required) - * @param progressListener Progress listener - * @param progressRequestListener Progress request listener + * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 Ok -
404 Not found. -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ - public com.squareup.okhttp.Call getElementByProjectAndIdCall(String projectIdentifier, String elementIdentifier, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = new Object(); + public okhttp3.Call getElementByProjectAndIdCall(String projectIdentifier, String elementIdentifier, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; // create path and map variables String localVarPath = "/projects/{project_identifier}/elements/{element_identifier}" - .replaceAll("\\{" + "project_identifier" + "\\}", apiClient.escapeString(projectIdentifier.toString())) - .replaceAll("\\{" + "element_identifier" + "\\}", apiClient.escapeString(elementIdentifier.toString())); + .replaceAll("\\{" + "project_identifier" + "\\}", localVarApiClient.escapeString(projectIdentifier.toString())) + .replaceAll("\\{" + "element_identifier" + "\\}", localVarApiClient.escapeString(elementIdentifier.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -322,7 +334,7 @@ public com.squareup.okhttp.Call getElementByProjectAndIdCall(String projectIdent final String[] localVarAccepts = { "application/json" }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -330,27 +342,15 @@ public com.squareup.okhttp.Call getElementByProjectAndIdCall(String projectIdent final String[] localVarContentTypes = { }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = localVarApiClient.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); + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call getElementByProjectAndIdValidateBeforeCall(String projectIdentifier, String elementIdentifier, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private okhttp3.Call getElementByProjectAndIdValidateBeforeCall(String projectIdentifier, String elementIdentifier, final ApiCallback _callback) throws ApiException { // verify the required parameter 'projectIdentifier' is set if (projectIdentifier == null) { @@ -363,8 +363,8 @@ private com.squareup.okhttp.Call getElementByProjectAndIdValidateBeforeCall(Stri } - com.squareup.okhttp.Call call = getElementByProjectAndIdCall(projectIdentifier, elementIdentifier, progressListener, progressRequestListener); - return call; + okhttp3.Call localVarCall = getElementByProjectAndIdCall(projectIdentifier, elementIdentifier, _callback); + return localVarCall; } @@ -375,10 +375,19 @@ private com.squareup.okhttp.Call getElementByProjectAndIdValidateBeforeCall(Stri * @param elementIdentifier ID of the element (required) * @return Element * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 Ok -
404 Not found. -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ public Element getElementByProjectAndId(String projectIdentifier, String elementIdentifier) throws ApiException { - ApiResponse resp = getElementByProjectAndIdWithHttpInfo(projectIdentifier, elementIdentifier); - return resp.getData(); + ApiResponse localVarResp = getElementByProjectAndIdWithHttpInfo(projectIdentifier, elementIdentifier); + return localVarResp.getData(); } /** @@ -388,11 +397,20 @@ public Element getElementByProjectAndId(String projectIdentifier, String element * @param elementIdentifier ID of the element (required) * @return ApiResponse<Element> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 Ok -
404 Not found. -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ public ApiResponse getElementByProjectAndIdWithHttpInfo(String projectIdentifier, String elementIdentifier) throws ApiException { - com.squareup.okhttp.Call call = getElementByProjectAndIdValidateBeforeCall(projectIdentifier, elementIdentifier, null, null); + okhttp3.Call localVarCall = getElementByProjectAndIdValidateBeforeCall(projectIdentifier, elementIdentifier, null); Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** @@ -400,45 +418,42 @@ public ApiResponse getElementByProjectAndIdWithHttpInfo(String projectI * * @param projectIdentifier ID of the project (required) * @param elementIdentifier ID of the element (required) - * @param callback The callback to be executed when the API call finishes + * @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 + + + + + + + +
Status Code Description Response Headers
200 Ok -
404 Not found. -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ - public com.squareup.okhttp.Call getElementByProjectAndIdAsync(String projectIdentifier, String elementIdentifier, 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); - } - }; - } + public okhttp3.Call getElementByProjectAndIdAsync(String projectIdentifier, String elementIdentifier, final ApiCallback _callback) throws ApiException { - com.squareup.okhttp.Call call = getElementByProjectAndIdValidateBeforeCall(projectIdentifier, elementIdentifier, progressListener, progressRequestListener); + okhttp3.Call localVarCall = getElementByProjectAndIdValidateBeforeCall(projectIdentifier, elementIdentifier, _callback); Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; } /** * Build call for getElements - * @param progressListener Progress listener - * @param progressRequestListener Progress request listener + * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 Ok -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ - public com.squareup.okhttp.Call getElementsCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = new Object(); + public okhttp3.Call getElementsCall(final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; // create path and map variables String localVarPath = "/elements"; @@ -450,7 +465,7 @@ public com.squareup.okhttp.Call getElementsCall(final ProgressResponseBody.Progr final String[] localVarAccepts = { "application/json" }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -458,31 +473,19 @@ public com.squareup.okhttp.Call getElementsCall(final ProgressResponseBody.Progr final String[] localVarContentTypes = { }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = localVarApiClient.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); + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call getElementsValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private okhttp3.Call getElementsValidateBeforeCall(final ApiCallback _callback) throws ApiException { - com.squareup.okhttp.Call call = getElementsCall(progressListener, progressRequestListener); - return call; + okhttp3.Call localVarCall = getElementsCall(_callback); + return localVarCall; } @@ -491,10 +494,18 @@ private com.squareup.okhttp.Call getElementsValidateBeforeCall(final ProgressRes * * @return List<Element> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 Ok -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ public List getElements() throws ApiException { - ApiResponse> resp = getElementsWithHttpInfo(); - return resp.getData(); + ApiResponse> localVarResp = getElementsWithHttpInfo(); + return localVarResp.getData(); } /** @@ -502,60 +513,65 @@ public List getElements() throws ApiException { * * @return ApiResponse<List<Element>> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 Ok -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ public ApiResponse> getElementsWithHttpInfo() throws ApiException { - com.squareup.okhttp.Call call = getElementsValidateBeforeCall(null, null); + okhttp3.Call localVarCall = getElementsValidateBeforeCall(null); Type localVarReturnType = new TypeToken>(){}.getType(); - return apiClient.execute(call, localVarReturnType); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Get all elements (asynchronously) * - * @param callback The callback to be executed when the API call finishes + * @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 + + + + + + +
Status Code Description Response Headers
200 Ok -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ - public com.squareup.okhttp.Call getElementsAsync(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); - } - }; - } + public okhttp3.Call getElementsAsync(final ApiCallback> _callback) throws ApiException { - com.squareup.okhttp.Call call = getElementsValidateBeforeCall(progressListener, progressRequestListener); + okhttp3.Call localVarCall = getElementsValidateBeforeCall(_callback); Type localVarReturnType = new TypeToken>(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; } /** * Build call for getElementsInProject * @param projectIdentifier ID of the project (required) - * @param progressListener Progress listener - * @param progressRequestListener Progress request listener + * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 Ok -
404 Not found. -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ - public com.squareup.okhttp.Call getElementsInProjectCall(String projectIdentifier, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = new Object(); + public okhttp3.Call getElementsInProjectCall(String projectIdentifier, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; // create path and map variables String localVarPath = "/projects/{project_identifier}/elements" - .replaceAll("\\{" + "project_identifier" + "\\}", apiClient.escapeString(projectIdentifier.toString())); + .replaceAll("\\{" + "project_identifier" + "\\}", localVarApiClient.escapeString(projectIdentifier.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -564,7 +580,7 @@ public com.squareup.okhttp.Call getElementsInProjectCall(String projectIdentifie final String[] localVarAccepts = { "application/json" }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -572,27 +588,15 @@ public com.squareup.okhttp.Call getElementsInProjectCall(String projectIdentifie final String[] localVarContentTypes = { }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = localVarApiClient.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); + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call getElementsInProjectValidateBeforeCall(String projectIdentifier, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private okhttp3.Call getElementsInProjectValidateBeforeCall(String projectIdentifier, final ApiCallback _callback) throws ApiException { // verify the required parameter 'projectIdentifier' is set if (projectIdentifier == null) { @@ -600,8 +604,8 @@ private com.squareup.okhttp.Call getElementsInProjectValidateBeforeCall(String p } - com.squareup.okhttp.Call call = getElementsInProjectCall(projectIdentifier, progressListener, progressRequestListener); - return call; + okhttp3.Call localVarCall = getElementsInProjectCall(projectIdentifier, _callback); + return localVarCall; } @@ -611,10 +615,19 @@ private com.squareup.okhttp.Call getElementsInProjectValidateBeforeCall(String p * @param projectIdentifier ID of the project (required) * @return Element * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 Ok -
404 Not found. -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ public Element getElementsInProject(String projectIdentifier) throws ApiException { - ApiResponse resp = getElementsInProjectWithHttpInfo(projectIdentifier); - return resp.getData(); + ApiResponse localVarResp = getElementsInProjectWithHttpInfo(projectIdentifier); + return localVarResp.getData(); } /** @@ -623,45 +636,44 @@ public Element getElementsInProject(String projectIdentifier) throws ApiExceptio * @param projectIdentifier ID of the project (required) * @return ApiResponse<Element> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 Ok -
404 Not found. -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ public ApiResponse getElementsInProjectWithHttpInfo(String projectIdentifier) throws ApiException { - com.squareup.okhttp.Call call = getElementsInProjectValidateBeforeCall(projectIdentifier, null, null); + okhttp3.Call localVarCall = getElementsInProjectValidateBeforeCall(projectIdentifier, null); Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Get all elements in the project (asynchronously) * * @param projectIdentifier ID of the project (required) - * @param callback The callback to be executed when the API call finishes + * @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 + + + + + + + +
Status Code Description Response Headers
200 Ok -
404 Not found. -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ - public com.squareup.okhttp.Call getElementsInProjectAsync(String projectIdentifier, 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); - } - }; - } + public okhttp3.Call getElementsInProjectAsync(String projectIdentifier, final ApiCallback _callback) throws ApiException { - com.squareup.okhttp.Call call = getElementsInProjectValidateBeforeCall(projectIdentifier, progressListener, progressRequestListener); + okhttp3.Call localVarCall = getElementsInProjectValidateBeforeCall(projectIdentifier, _callback); Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; } } diff --git a/src/main/java/org/omg/sysml/api/ProjectApi.java b/src/main/java/org/omg/sysml/api/ProjectApi.java index 3024839..c118bc3 100644 --- a/src/main/java/org/omg/sysml/api/ProjectApi.java +++ b/src/main/java/org/omg/sysml/api/ProjectApi.java @@ -2,7 +2,7 @@ * SysML v2 API and Services * REST/HTTP binding (PSM) for the SysML v2 standard API. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -37,34 +37,41 @@ import java.util.Map; public class ProjectApi { - private ApiClient apiClient; + private ApiClient localVarApiClient; public ProjectApi() { this(Configuration.getDefaultApiClient()); } public ProjectApi(ApiClient apiClient) { - this.apiClient = apiClient; + this.localVarApiClient = apiClient; } public ApiClient getApiClient() { - return apiClient; + return localVarApiClient; } public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; + this.localVarApiClient = apiClient; } /** * Build call for createProject - * @param project (optional) - * @param progressListener Progress listener - * @param progressRequestListener Progress request listener + * @param body (optional) + * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 Created -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ - public com.squareup.okhttp.Call createProjectCall(Project project, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = project; + public okhttp3.Call createProjectCall(Project body, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = body; // create path and map variables String localVarPath = "/projects"; @@ -76,7 +83,7 @@ public com.squareup.okhttp.Call createProjectCall(Project project, final Progres final String[] localVarAccepts = { "application/json" }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -84,107 +91,108 @@ public com.squareup.okhttp.Call createProjectCall(Project project, final Progres final String[] localVarContentTypes = { "application/json" }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = localVarApiClient.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); + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call createProjectValidateBeforeCall(Project project, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private okhttp3.Call createProjectValidateBeforeCall(Project body, final ApiCallback _callback) throws ApiException { - com.squareup.okhttp.Call call = createProjectCall(project, progressListener, progressRequestListener); - return call; + okhttp3.Call localVarCall = createProjectCall(body, _callback); + return localVarCall; } /** * Add a new project * - * @param project (optional) + * @param body (optional) * @return Project * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 Created -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ - public Project createProject(Project project) throws ApiException { - ApiResponse resp = createProjectWithHttpInfo(project); - return resp.getData(); + public Project createProject(Project body) throws ApiException { + ApiResponse localVarResp = createProjectWithHttpInfo(body); + return localVarResp.getData(); } /** * Add a new project * - * @param project (optional) + * @param body (optional) * @return ApiResponse<Project> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 Created -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ - public ApiResponse createProjectWithHttpInfo(Project project) throws ApiException { - com.squareup.okhttp.Call call = createProjectValidateBeforeCall(project, null, null); + public ApiResponse createProjectWithHttpInfo(Project body) throws ApiException { + okhttp3.Call localVarCall = createProjectValidateBeforeCall(body, null); Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Add a new project (asynchronously) * - * @param project (optional) - * @param callback The callback to be executed when the API call finishes + * @param body (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 + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 Created -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ - public com.squareup.okhttp.Call createProjectAsync(Project project, 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); - } - }; - } + public okhttp3.Call createProjectAsync(Project body, final ApiCallback _callback) throws ApiException { - com.squareup.okhttp.Call call = createProjectValidateBeforeCall(project, progressListener, progressRequestListener); + okhttp3.Call localVarCall = createProjectValidateBeforeCall(body, _callback); Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; } /** * Build call for getProject * @param identifier ID of the project (required) - * @param progressListener Progress listener - * @param progressRequestListener Progress request listener + * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 Ok -
404 Not found. -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ - public com.squareup.okhttp.Call getProjectCall(String identifier, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = new Object(); + public okhttp3.Call getProjectCall(String identifier, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; // create path and map variables String localVarPath = "/projects/{identifier}" - .replaceAll("\\{" + "identifier" + "\\}", apiClient.escapeString(identifier.toString())); + .replaceAll("\\{" + "identifier" + "\\}", localVarApiClient.escapeString(identifier.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -193,7 +201,7 @@ public com.squareup.okhttp.Call getProjectCall(String identifier, final Progress final String[] localVarAccepts = { "application/json" }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -201,27 +209,15 @@ public com.squareup.okhttp.Call getProjectCall(String identifier, final Progress final String[] localVarContentTypes = { }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = localVarApiClient.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); + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call getProjectValidateBeforeCall(String identifier, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private okhttp3.Call getProjectValidateBeforeCall(String identifier, final ApiCallback _callback) throws ApiException { // verify the required parameter 'identifier' is set if (identifier == null) { @@ -229,8 +225,8 @@ private com.squareup.okhttp.Call getProjectValidateBeforeCall(String identifier, } - com.squareup.okhttp.Call call = getProjectCall(identifier, progressListener, progressRequestListener); - return call; + okhttp3.Call localVarCall = getProjectCall(identifier, _callback); + return localVarCall; } @@ -240,10 +236,19 @@ private com.squareup.okhttp.Call getProjectValidateBeforeCall(String identifier, * @param identifier ID of the project (required) * @return Project * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 Ok -
404 Not found. -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ public Project getProject(String identifier) throws ApiException { - ApiResponse resp = getProjectWithHttpInfo(identifier); - return resp.getData(); + ApiResponse localVarResp = getProjectWithHttpInfo(identifier); + return localVarResp.getData(); } /** @@ -252,56 +257,62 @@ public Project getProject(String identifier) throws ApiException { * @param identifier ID of the project (required) * @return ApiResponse<Project> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 Ok -
404 Not found. -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ public ApiResponse getProjectWithHttpInfo(String identifier) throws ApiException { - com.squareup.okhttp.Call call = getProjectValidateBeforeCall(identifier, null, null); + okhttp3.Call localVarCall = getProjectValidateBeforeCall(identifier, null); Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Get project by its ID (asynchronously) * * @param identifier ID of the project (required) - * @param callback The callback to be executed when the API call finishes + * @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 + + + + + + + +
Status Code Description Response Headers
200 Ok -
404 Not found. -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ - public com.squareup.okhttp.Call getProjectAsync(String identifier, 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); - } - }; - } + public okhttp3.Call getProjectAsync(String identifier, final ApiCallback _callback) throws ApiException { - com.squareup.okhttp.Call call = getProjectValidateBeforeCall(identifier, progressListener, progressRequestListener); + okhttp3.Call localVarCall = getProjectValidateBeforeCall(identifier, _callback); Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; } /** * Build call for getProjects - * @param progressListener Progress listener - * @param progressRequestListener Progress request listener + * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 Ok -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ - public com.squareup.okhttp.Call getProjectsCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = new Object(); + public okhttp3.Call getProjectsCall(final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; // create path and map variables String localVarPath = "/projects"; @@ -313,7 +324,7 @@ public com.squareup.okhttp.Call getProjectsCall(final ProgressResponseBody.Progr final String[] localVarAccepts = { "application/json" }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -321,31 +332,19 @@ public com.squareup.okhttp.Call getProjectsCall(final ProgressResponseBody.Progr final String[] localVarContentTypes = { }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = localVarApiClient.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); + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call getProjectsValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private okhttp3.Call getProjectsValidateBeforeCall(final ApiCallback _callback) throws ApiException { - com.squareup.okhttp.Call call = getProjectsCall(progressListener, progressRequestListener); - return call; + okhttp3.Call localVarCall = getProjectsCall(_callback); + return localVarCall; } @@ -354,10 +353,18 @@ private com.squareup.okhttp.Call getProjectsValidateBeforeCall(final ProgressRes * * @return List<Project> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 Ok -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ public List getProjects() throws ApiException { - ApiResponse> resp = getProjectsWithHttpInfo(); - return resp.getData(); + ApiResponse> localVarResp = getProjectsWithHttpInfo(); + return localVarResp.getData(); } /** @@ -365,44 +372,41 @@ public List getProjects() throws ApiException { * * @return ApiResponse<List<Project>> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 Ok -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ public ApiResponse> getProjectsWithHttpInfo() throws ApiException { - com.squareup.okhttp.Call call = getProjectsValidateBeforeCall(null, null); + okhttp3.Call localVarCall = getProjectsValidateBeforeCall(null); Type localVarReturnType = new TypeToken>(){}.getType(); - return apiClient.execute(call, localVarReturnType); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Get all projects (asynchronously) * - * @param callback The callback to be executed when the API call finishes + * @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 + + + + + + +
Status Code Description Response Headers
200 Ok -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ - public com.squareup.okhttp.Call getProjectsAsync(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); - } - }; - } + public okhttp3.Call getProjectsAsync(final ApiCallback> _callback) throws ApiException { - com.squareup.okhttp.Call call = getProjectsValidateBeforeCall(progressListener, progressRequestListener); + okhttp3.Call localVarCall = getProjectsValidateBeforeCall(_callback); Type localVarReturnType = new TypeToken>(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; } } diff --git a/src/main/java/org/omg/sysml/api/RelationshipApi.java b/src/main/java/org/omg/sysml/api/RelationshipApi.java index 85d1698..077674b 100644 --- a/src/main/java/org/omg/sysml/api/RelationshipApi.java +++ b/src/main/java/org/omg/sysml/api/RelationshipApi.java @@ -2,7 +2,7 @@ * SysML v2 API and Services * REST/HTTP binding (PSM) for the SysML v2 standard API. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -37,34 +37,41 @@ import java.util.Map; public class RelationshipApi { - private ApiClient apiClient; + private ApiClient localVarApiClient; public RelationshipApi() { this(Configuration.getDefaultApiClient()); } public RelationshipApi(ApiClient apiClient) { - this.apiClient = apiClient; + this.localVarApiClient = apiClient; } public ApiClient getApiClient() { - return apiClient; + return localVarApiClient; } public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; + this.localVarApiClient = apiClient; } /** * Build call for createRelationship - * @param relationship (required) - * @param progressListener Progress listener - * @param progressRequestListener Progress request listener + * @param body (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 + + + + + + +
Status Code Description Response Headers
201 Created -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ - public com.squareup.okhttp.Call createRelationshipCall(Relationship relationship, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = relationship; + public okhttp3.Call createRelationshipCall(Relationship body, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = body; // create path and map variables String localVarPath = "/relationships"; @@ -76,7 +83,7 @@ public com.squareup.okhttp.Call createRelationshipCall(Relationship relationship final String[] localVarAccepts = { "application/json" }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -84,112 +91,113 @@ public com.squareup.okhttp.Call createRelationshipCall(Relationship relationship final String[] localVarContentTypes = { "application/json" }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = localVarApiClient.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); + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call createRelationshipValidateBeforeCall(Relationship relationship, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private okhttp3.Call createRelationshipValidateBeforeCall(Relationship body, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'relationship' is set - if (relationship == null) { - throw new ApiException("Missing the required parameter 'relationship' when calling createRelationship(Async)"); + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException("Missing the required parameter 'body' when calling createRelationship(Async)"); } - com.squareup.okhttp.Call call = createRelationshipCall(relationship, progressListener, progressRequestListener); - return call; + okhttp3.Call localVarCall = createRelationshipCall(body, _callback); + return localVarCall; } /** * Add a new relationship * - * @param relationship (required) + * @param body (required) * @return Relationship * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 Created -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ - public Relationship createRelationship(Relationship relationship) throws ApiException { - ApiResponse resp = createRelationshipWithHttpInfo(relationship); - return resp.getData(); + public Relationship createRelationship(Relationship body) throws ApiException { + ApiResponse localVarResp = createRelationshipWithHttpInfo(body); + return localVarResp.getData(); } /** * Add a new relationship * - * @param relationship (required) + * @param body (required) * @return ApiResponse<Relationship> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 Created -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ - public ApiResponse createRelationshipWithHttpInfo(Relationship relationship) throws ApiException { - com.squareup.okhttp.Call call = createRelationshipValidateBeforeCall(relationship, null, null); + public ApiResponse createRelationshipWithHttpInfo(Relationship body) throws ApiException { + okhttp3.Call localVarCall = createRelationshipValidateBeforeCall(body, null); Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Add a new relationship (asynchronously) * - * @param relationship (required) - * @param callback The callback to be executed when the API call finishes + * @param body (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 + + + + + + +
Status Code Description Response Headers
201 Created -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ - public com.squareup.okhttp.Call createRelationshipAsync(Relationship relationship, 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); - } - }; - } + public okhttp3.Call createRelationshipAsync(Relationship body, final ApiCallback _callback) throws ApiException { - com.squareup.okhttp.Call call = createRelationshipValidateBeforeCall(relationship, progressListener, progressRequestListener); + okhttp3.Call localVarCall = createRelationshipValidateBeforeCall(body, _callback); Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; } /** * Build call for getRelationship * @param identifier ID of the relationship (required) - * @param progressListener Progress listener - * @param progressRequestListener Progress request listener + * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 Ok -
404 Not found. -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ - public com.squareup.okhttp.Call getRelationshipCall(String identifier, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = new Object(); + public okhttp3.Call getRelationshipCall(String identifier, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; // create path and map variables String localVarPath = "/relationships/{identifier}" - .replaceAll("\\{" + "identifier" + "\\}", apiClient.escapeString(identifier.toString())); + .replaceAll("\\{" + "identifier" + "\\}", localVarApiClient.escapeString(identifier.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -198,7 +206,7 @@ public com.squareup.okhttp.Call getRelationshipCall(String identifier, final Pro final String[] localVarAccepts = { "application/json" }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -206,27 +214,15 @@ public com.squareup.okhttp.Call getRelationshipCall(String identifier, final Pro final String[] localVarContentTypes = { }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = localVarApiClient.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); + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call getRelationshipValidateBeforeCall(String identifier, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private okhttp3.Call getRelationshipValidateBeforeCall(String identifier, final ApiCallback _callback) throws ApiException { // verify the required parameter 'identifier' is set if (identifier == null) { @@ -234,8 +230,8 @@ private com.squareup.okhttp.Call getRelationshipValidateBeforeCall(String identi } - com.squareup.okhttp.Call call = getRelationshipCall(identifier, progressListener, progressRequestListener); - return call; + okhttp3.Call localVarCall = getRelationshipCall(identifier, _callback); + return localVarCall; } @@ -245,10 +241,19 @@ private com.squareup.okhttp.Call getRelationshipValidateBeforeCall(String identi * @param identifier ID of the relationship (required) * @return Relationship * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 Ok -
404 Not found. -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ public Relationship getRelationship(String identifier) throws ApiException { - ApiResponse resp = getRelationshipWithHttpInfo(identifier); - return resp.getData(); + ApiResponse localVarResp = getRelationshipWithHttpInfo(identifier); + return localVarResp.getData(); } /** @@ -257,56 +262,62 @@ public Relationship getRelationship(String identifier) throws ApiException { * @param identifier ID of the relationship (required) * @return ApiResponse<Relationship> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 Ok -
404 Not found. -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ public ApiResponse getRelationshipWithHttpInfo(String identifier) throws ApiException { - com.squareup.okhttp.Call call = getRelationshipValidateBeforeCall(identifier, null, null); + okhttp3.Call localVarCall = getRelationshipValidateBeforeCall(identifier, null); Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Get relationship by its ID (asynchronously) * * @param identifier ID of the relationship (required) - * @param callback The callback to be executed when the API call finishes + * @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 + + + + + + + +
Status Code Description Response Headers
200 Ok -
404 Not found. -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ - public com.squareup.okhttp.Call getRelationshipAsync(String identifier, 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); - } - }; - } + public okhttp3.Call getRelationshipAsync(String identifier, final ApiCallback _callback) throws ApiException { - com.squareup.okhttp.Call call = getRelationshipValidateBeforeCall(identifier, progressListener, progressRequestListener); + okhttp3.Call localVarCall = getRelationshipValidateBeforeCall(identifier, _callback); Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; } /** * Build call for getRelationships - * @param progressListener Progress listener - * @param progressRequestListener Progress request listener + * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 Ok -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ - public com.squareup.okhttp.Call getRelationshipsCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = new Object(); + public okhttp3.Call getRelationshipsCall(final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; // create path and map variables String localVarPath = "/relationships"; @@ -318,7 +329,7 @@ public com.squareup.okhttp.Call getRelationshipsCall(final ProgressResponseBody. final String[] localVarAccepts = { "application/json" }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -326,31 +337,19 @@ public com.squareup.okhttp.Call getRelationshipsCall(final ProgressResponseBody. final String[] localVarContentTypes = { }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = localVarApiClient.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); + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call getRelationshipsValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private okhttp3.Call getRelationshipsValidateBeforeCall(final ApiCallback _callback) throws ApiException { - com.squareup.okhttp.Call call = getRelationshipsCall(progressListener, progressRequestListener); - return call; + okhttp3.Call localVarCall = getRelationshipsCall(_callback); + return localVarCall; } @@ -359,10 +358,18 @@ private com.squareup.okhttp.Call getRelationshipsValidateBeforeCall(final Progre * * @return List<Relationship> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 Ok -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ public List getRelationships() throws ApiException { - ApiResponse> resp = getRelationshipsWithHttpInfo(); - return resp.getData(); + ApiResponse> localVarResp = getRelationshipsWithHttpInfo(); + return localVarResp.getData(); } /** @@ -370,60 +377,64 @@ public List getRelationships() throws ApiException { * * @return ApiResponse<List<Relationship>> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 Ok -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ public ApiResponse> getRelationshipsWithHttpInfo() throws ApiException { - com.squareup.okhttp.Call call = getRelationshipsValidateBeforeCall(null, null); + okhttp3.Call localVarCall = getRelationshipsValidateBeforeCall(null); Type localVarReturnType = new TypeToken>(){}.getType(); - return apiClient.execute(call, localVarReturnType); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Get all relationships (asynchronously) * - * @param callback The callback to be executed when the API call finishes + * @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 + + + + + + +
Status Code Description Response Headers
200 Ok -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ - public com.squareup.okhttp.Call getRelationshipsAsync(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); - } - }; - } + public okhttp3.Call getRelationshipsAsync(final ApiCallback> _callback) throws ApiException { - com.squareup.okhttp.Call call = getRelationshipsValidateBeforeCall(progressListener, progressRequestListener); + okhttp3.Call localVarCall = getRelationshipsValidateBeforeCall(_callback); Type localVarReturnType = new TypeToken>(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; } /** * Build call for getRelationshipsByProject * @param projectIdentifier ID of the project (required) - * @param progressListener Progress listener - * @param progressRequestListener Progress request listener + * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 Ok -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ - public com.squareup.okhttp.Call getRelationshipsByProjectCall(String projectIdentifier, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = new Object(); + public okhttp3.Call getRelationshipsByProjectCall(String projectIdentifier, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; // create path and map variables String localVarPath = "/projects/{project_identifier}/relationships" - .replaceAll("\\{" + "project_identifier" + "\\}", apiClient.escapeString(projectIdentifier.toString())); + .replaceAll("\\{" + "project_identifier" + "\\}", localVarApiClient.escapeString(projectIdentifier.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -432,7 +443,7 @@ public com.squareup.okhttp.Call getRelationshipsByProjectCall(String projectIden final String[] localVarAccepts = { "application/json" }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -440,27 +451,15 @@ public com.squareup.okhttp.Call getRelationshipsByProjectCall(String projectIden final String[] localVarContentTypes = { }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = localVarApiClient.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); + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call getRelationshipsByProjectValidateBeforeCall(String projectIdentifier, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private okhttp3.Call getRelationshipsByProjectValidateBeforeCall(String projectIdentifier, final ApiCallback _callback) throws ApiException { // verify the required parameter 'projectIdentifier' is set if (projectIdentifier == null) { @@ -468,8 +467,8 @@ private com.squareup.okhttp.Call getRelationshipsByProjectValidateBeforeCall(Str } - com.squareup.okhttp.Call call = getRelationshipsByProjectCall(projectIdentifier, progressListener, progressRequestListener); - return call; + okhttp3.Call localVarCall = getRelationshipsByProjectCall(projectIdentifier, _callback); + return localVarCall; } @@ -479,10 +478,18 @@ private com.squareup.okhttp.Call getRelationshipsByProjectValidateBeforeCall(Str * @param projectIdentifier ID of the project (required) * @return List<Relationship> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 Ok -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ public List getRelationshipsByProject(String projectIdentifier) throws ApiException { - ApiResponse> resp = getRelationshipsByProjectWithHttpInfo(projectIdentifier); - return resp.getData(); + ApiResponse> localVarResp = getRelationshipsByProjectWithHttpInfo(projectIdentifier); + return localVarResp.getData(); } /** @@ -491,45 +498,42 @@ public List getRelationshipsByProject(String projectIdentifier) th * @param projectIdentifier ID of the project (required) * @return ApiResponse<List<Relationship>> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 Ok -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ public ApiResponse> getRelationshipsByProjectWithHttpInfo(String projectIdentifier) throws ApiException { - com.squareup.okhttp.Call call = getRelationshipsByProjectValidateBeforeCall(projectIdentifier, null, null); + okhttp3.Call localVarCall = getRelationshipsByProjectValidateBeforeCall(projectIdentifier, null); Type localVarReturnType = new TypeToken>(){}.getType(); - return apiClient.execute(call, localVarReturnType); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Get all relationships in the project (asynchronously) * * @param projectIdentifier ID of the project (required) - * @param callback The callback to be executed when the API call finishes + * @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 + + + + + + +
Status Code Description Response Headers
200 Ok -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
*/ - public com.squareup.okhttp.Call getRelationshipsByProjectAsync(String projectIdentifier, 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); - } - }; - } + public okhttp3.Call getRelationshipsByProjectAsync(String projectIdentifier, final ApiCallback> _callback) throws ApiException { - com.squareup.okhttp.Call call = getRelationshipsByProjectValidateBeforeCall(projectIdentifier, progressListener, progressRequestListener); + okhttp3.Call localVarCall = getRelationshipsByProjectValidateBeforeCall(projectIdentifier, _callback); Type localVarReturnType = new TypeToken>(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; } } diff --git a/src/main/java/org/omg/sysml/auth/ApiKeyAuth.java b/src/main/java/org/omg/sysml/auth/ApiKeyAuth.java index 408ecc3..8396764 100644 --- a/src/main/java/org/omg/sysml/auth/ApiKeyAuth.java +++ b/src/main/java/org/omg/sysml/auth/ApiKeyAuth.java @@ -2,7 +2,7 @@ * SysML v2 API and Services * REST/HTTP binding (PSM) for the SysML v2 standard API. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/org/omg/sysml/auth/Authentication.java b/src/main/java/org/omg/sysml/auth/Authentication.java index bb99f4b..7648ffc 100644 --- a/src/main/java/org/omg/sysml/auth/Authentication.java +++ b/src/main/java/org/omg/sysml/auth/Authentication.java @@ -2,7 +2,7 @@ * SysML v2 API and Services * REST/HTTP binding (PSM) for the SysML v2 standard API. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/org/omg/sysml/auth/HttpBasicAuth.java b/src/main/java/org/omg/sysml/auth/HttpBasicAuth.java index ae732f6..eb2ad08 100644 --- a/src/main/java/org/omg/sysml/auth/HttpBasicAuth.java +++ b/src/main/java/org/omg/sysml/auth/HttpBasicAuth.java @@ -2,7 +2,7 @@ * SysML v2 API and Services * REST/HTTP binding (PSM) for the SysML v2 standard API. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -15,7 +15,7 @@ import org.omg.sysml.Pair; -import com.squareup.okhttp.Credentials; +import okhttp3.Credentials; import java.util.Map; import java.util.List; diff --git a/src/main/java/org/omg/sysml/auth/HttpBearerAuth.java b/src/main/java/org/omg/sysml/auth/HttpBearerAuth.java new file mode 100644 index 0000000..ccfda10 --- /dev/null +++ b/src/main/java/org/omg/sysml/auth/HttpBearerAuth.java @@ -0,0 +1,60 @@ +/* + * SysML v2 API and Services + * REST/HTTP binding (PSM) for the SysML v2 standard API. + * + * 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 org.omg.sysml.auth; + +import org.omg.sysml.Pair; + +import java.util.Map; +import java.util.List; + + +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) { + 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/src/main/java/org/omg/sysml/auth/OAuth.java b/src/main/java/org/omg/sysml/auth/OAuth.java deleted file mode 100644 index e9a728e..0000000 --- a/src/main/java/org/omg/sysml/auth/OAuth.java +++ /dev/null @@ -1,39 +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.auth; - -import org.omg.sysml.Pair; - -import java.util.Map; -import java.util.List; - - -public class OAuth implements Authentication { - private String accessToken; - - public String getAccessToken() { - return accessToken; - } - - public void setAccessToken(String accessToken) { - this.accessToken = accessToken; - } - - @Override - public void applyToParams(List queryParams, Map headerParams) { - if (accessToken != null) { - headerParams.put("Authorization", "Bearer " + accessToken); - } - } -} diff --git a/src/main/java/org/omg/sysml/auth/OAuthFlow.java b/src/main/java/org/omg/sysml/auth/OAuthFlow.java deleted file mode 100644 index 6cade48..0000000 --- a/src/main/java/org/omg/sysml/auth/OAuthFlow.java +++ /dev/null @@ -1,18 +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.auth; - -public enum OAuthFlow { - accessCode, implicit, password, application -} diff --git a/src/main/java/org/omg/sysml/auth/OAuthOkHttpClient.java b/src/main/java/org/omg/sysml/auth/OAuthOkHttpClient.java deleted file mode 100644 index 3270a54..0000000 --- a/src/main/java/org/omg/sysml/auth/OAuthOkHttpClient.java +++ /dev/null @@ -1,68 +0,0 @@ -package org.omg.sysml.auth; - -import com.squareup.okhttp.OkHttpClient; -import com.squareup.okhttp.MediaType; -import com.squareup.okhttp.Request; -import com.squareup.okhttp.RequestBody; -import com.squareup.okhttp.Response; - -import org.apache.oltu.oauth2.client.HttpClient; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest; -import org.apache.oltu.oauth2.client.response.OAuthClientResponse; -import org.apache.oltu.oauth2.client.response.OAuthClientResponseFactory; -import org.apache.oltu.oauth2.common.exception.OAuthProblemException; -import org.apache.oltu.oauth2.common.exception.OAuthSystemException; - -import java.io.IOException; -import java.util.Map; -import java.util.Map.Entry; - -public class OAuthOkHttpClient implements HttpClient { - private OkHttpClient client; - - public OAuthOkHttpClient() { - this.client = new OkHttpClient(); - } - - public OAuthOkHttpClient(OkHttpClient client) { - this.client = client; - } - - @Override - public T execute(OAuthClientRequest request, Map headers, - String requestMethod, Class responseClass) - throws OAuthSystemException, OAuthProblemException { - - MediaType mediaType = MediaType.parse("application/json"); - Request.Builder requestBuilder = new Request.Builder().url(request.getLocationUri()); - - if(headers != null) { - for (Entry entry : headers.entrySet()) { - if (entry.getKey().equalsIgnoreCase("Content-Type")) { - mediaType = MediaType.parse(entry.getValue()); - } else { - requestBuilder.addHeader(entry.getKey(), entry.getValue()); - } - } - } - - RequestBody body = request.getBody() != null ? RequestBody.create(mediaType, request.getBody()) : null; - requestBuilder.method(requestMethod, body); - - try { - Response response = client.newCall(requestBuilder.build()).execute(); - return OAuthClientResponseFactory.createCustomResponse( - response.body().string(), - response.body().contentType().toString(), - response.code(), - responseClass); - } catch (IOException e) { - throw new OAuthSystemException(e); - } - } - - @Override - public void shutdown() { - // Nothing to do here - } -} diff --git a/src/main/java/org/omg/sysml/auth/RetryingOAuth.java b/src/main/java/org/omg/sysml/auth/RetryingOAuth.java deleted file mode 100644 index 05bdb71..0000000 --- a/src/main/java/org/omg/sysml/auth/RetryingOAuth.java +++ /dev/null @@ -1,165 +0,0 @@ -package org.omg.sysml.auth; - -import com.squareup.okhttp.Interceptor; -import com.squareup.okhttp.OkHttpClient; -import com.squareup.okhttp.Request; -import com.squareup.okhttp.Response; - -import org.apache.oltu.oauth2.client.OAuthClient; -import org.apache.oltu.oauth2.client.request.OAuthBearerClientRequest; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; -import org.apache.oltu.oauth2.client.response.OAuthJSONAccessTokenResponse; -import org.apache.oltu.oauth2.common.exception.OAuthProblemException; -import org.apache.oltu.oauth2.common.exception.OAuthSystemException; -import org.apache.oltu.oauth2.common.message.types.GrantType; - -import java.io.IOException; -import java.net.HttpURLConnection; -import java.util.Map; - -public class RetryingOAuth extends OAuth implements Interceptor { - private OAuthClient oAuthClient; - - private TokenRequestBuilder tokenRequestBuilder; - - public RetryingOAuth(OkHttpClient client, TokenRequestBuilder tokenRequestBuilder) { - this.oAuthClient = new OAuthClient(new OAuthOkHttpClient(client)); - this.tokenRequestBuilder = tokenRequestBuilder; - } - - public RetryingOAuth(TokenRequestBuilder tokenRequestBuilder) { - this(new OkHttpClient(), tokenRequestBuilder); - } - - public RetryingOAuth( - String tokenUrl, - String clientId, - OAuthFlow flow, - String clientSecret, - Map parameters - ) { - this(OAuthClientRequest.tokenLocation(tokenUrl) - .setClientId(clientId) - .setClientSecret(clientSecret)); - setFlow(flow); - if (parameters != null) { - for (String paramName : parameters.keySet()) { - tokenRequestBuilder.setParameter(paramName, parameters.get(paramName)); - } - } - } - - public void setFlow(OAuthFlow flow) { - switch(flow) { - case accessCode: - tokenRequestBuilder.setGrantType(GrantType.AUTHORIZATION_CODE); - break; - case implicit: - tokenRequestBuilder.setGrantType(GrantType.IMPLICIT); - break; - case password: - tokenRequestBuilder.setGrantType(GrantType.PASSWORD); - break; - case application: - tokenRequestBuilder.setGrantType(GrantType.CLIENT_CREDENTIALS); - break; - default: - break; - } - } - - @Override - public Response intercept(Chain chain) throws IOException { - return retryingIntercept(chain, true); - } - - private Response retryingIntercept(Chain chain, boolean updateTokenAndRetryOnAuthorizationFailure) throws IOException { - Request request = chain.request(); - - // If the request already has an authorization (e.g. Basic auth), proceed with the request as is - if (request.header("Authorization") != null) { - return chain.proceed(request); - } - - // Get the token if it has not yet been acquired - if (getAccessToken() == null) { - updateAccessToken(null); - } - - OAuthClientRequest oAuthRequest; - if (getAccessToken() != null) { - // Build the request - Request.Builder requestBuilder = request.newBuilder(); - - String requestAccessToken = getAccessToken(); - try { - oAuthRequest = - new OAuthBearerClientRequest(request.urlString()). - setAccessToken(requestAccessToken). - buildHeaderMessage(); - } catch (OAuthSystemException e) { - throw new IOException(e); - } - - Map headers = oAuthRequest.getHeaders(); - for (String headerName : headers.keySet()) { - requestBuilder.addHeader(headerName, headers.get(headerName)); - } - requestBuilder.url(oAuthRequest.getLocationUri()); - - // Execute the request - Response response = chain.proceed(requestBuilder.build()); - - // 401/403 response codes most likely indicate an expired access token, unless it happens two times in a row - if ( - response != null && - ( response.code() == HttpURLConnection.HTTP_UNAUTHORIZED || - response.code() == HttpURLConnection.HTTP_FORBIDDEN ) && - updateTokenAndRetryOnAuthorizationFailure - ) { - try { - if (updateAccessToken(requestAccessToken)) { - response.body().close(); - return retryingIntercept(chain, false); - } - } catch (Exception e) { - response.body().close(); - throw e; - } - } - return response; - } - else { - return chain.proceed(chain.request()); - } - } - - /* - * Returns true if the access token has been updated - */ - public synchronized boolean updateAccessToken(String requestAccessToken) throws IOException { - if (getAccessToken() == null || getAccessToken().equals(requestAccessToken)) { - try { - OAuthJSONAccessTokenResponse accessTokenResponse = - oAuthClient.accessToken(tokenRequestBuilder.buildBodyMessage()); - if (accessTokenResponse != null && accessTokenResponse.getAccessToken() != null) { - setAccessToken(accessTokenResponse.getAccessToken()); - return !getAccessToken().equals(requestAccessToken); - } - } catch (OAuthSystemException | OAuthProblemException e) { - throw new IOException(e); - } - } - - return false; - } - - public TokenRequestBuilder getTokenRequestBuilder() { - return tokenRequestBuilder; - } - - public void setTokenRequestBuilder(TokenRequestBuilder tokenRequestBuilder) { - this.tokenRequestBuilder = tokenRequestBuilder; - } -} diff --git a/src/main/java/org/omg/sysml/model/Element.java b/src/main/java/org/omg/sysml/model/Element.java index 5677244..259f544 100644 --- a/src/main/java/org/omg/sysml/model/Element.java +++ b/src/main/java/org/omg/sysml/model/Element.java @@ -2,7 +2,7 @@ * SysML v2 API and Services * REST/HTTP binding (PSM) for the SysML v2 standard API. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -39,13 +39,15 @@ public class Element extends HashMap { public static final String SERIALIZED_NAME_CONTAINING_PROJECT = "containingProject"; @SerializedName(SERIALIZED_NAME_CONTAINING_PROJECT) - private Identified containingProject = null; + private Identified containingProject; public static final String SERIALIZED_NAME_IDENTIFIER = "identifier"; @SerializedName(SERIALIZED_NAME_IDENTIFIER) private UUID identifier; + public Element atType(String atType) { + this.atType = atType; return this; } @@ -54,16 +56,22 @@ public Element atType(String atType) { * Get atType * @return atType **/ + @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getAtType() { return atType; } + + public void setAtType(String atType) { this.atType = atType; } + public Element containingProject(Identified containingProject) { + this.containingProject = containingProject; return this; } @@ -72,16 +80,22 @@ public Element containingProject(Identified containingProject) { * Get containingProject * @return containingProject **/ + @javax.annotation.Nullable @ApiModelProperty(value = "") + public Identified getContainingProject() { return containingProject; } + + public void setContainingProject(Identified containingProject) { this.containingProject = containingProject; } + public Element identifier(UUID identifier) { + this.identifier = identifier; return this; } @@ -90,11 +104,15 @@ public Element identifier(UUID identifier) { * Get identifier * @return identifier **/ + @javax.annotation.Nullable @ApiModelProperty(value = "") + public UUID getIdentifier() { return identifier; } + + public void setIdentifier(UUID identifier) { this.identifier = identifier; } diff --git a/src/main/java/org/omg/sysml/model/Error.java b/src/main/java/org/omg/sysml/model/Error.java index 0abe015..ce7173d 100644 --- a/src/main/java/org/omg/sysml/model/Error.java +++ b/src/main/java/org/omg/sysml/model/Error.java @@ -2,7 +2,7 @@ * SysML v2 API and Services * REST/HTTP binding (PSM) for the SysML v2 standard API. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -33,7 +33,9 @@ public class Error { @SerializedName(SERIALIZED_NAME_ERROR) private String error; + public Error error(String error) { + this.error = error; return this; } @@ -42,11 +44,15 @@ public Error error(String error) { * Get error * @return error **/ + @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getError() { return error; } + + public void setError(String error) { this.error = error; } @@ -74,7 +80,6 @@ public int hashCode() { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Error {\n"); - sb.append(" error: ").append(toIndentedString(error)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/src/main/java/org/omg/sysml/model/Identified.java b/src/main/java/org/omg/sysml/model/Identified.java index 585cddf..c1fb054 100644 --- a/src/main/java/org/omg/sysml/model/Identified.java +++ b/src/main/java/org/omg/sysml/model/Identified.java @@ -2,7 +2,7 @@ * SysML v2 API and Services * REST/HTTP binding (PSM) for the SysML v2 standard API. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -34,7 +34,9 @@ public class Identified { @SerializedName(SERIALIZED_NAME_IDENTIFIER) private UUID identifier; + public Identified identifier(UUID identifier) { + this.identifier = identifier; return this; } @@ -43,11 +45,15 @@ public Identified identifier(UUID identifier) { * Get identifier * @return identifier **/ + @javax.annotation.Nullable @ApiModelProperty(value = "") + public UUID getIdentifier() { return identifier; } + + public void setIdentifier(UUID identifier) { this.identifier = identifier; } @@ -75,7 +81,6 @@ public int hashCode() { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Identified {\n"); - sb.append(" identifier: ").append(toIndentedString(identifier)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/src/main/java/org/omg/sysml/model/Project.java b/src/main/java/org/omg/sysml/model/Project.java index 9d614c4..f43e538 100644 --- a/src/main/java/org/omg/sysml/model/Project.java +++ b/src/main/java/org/omg/sysml/model/Project.java @@ -2,7 +2,7 @@ * SysML v2 API and Services * REST/HTTP binding (PSM) for the SysML v2 standard API. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -42,7 +42,9 @@ public class Project { @SerializedName(SERIALIZED_NAME_IDENTIFIER) private UUID identifier; + public Project atType(String atType) { + this.atType = atType; return this; } @@ -51,16 +53,22 @@ public Project atType(String atType) { * Get atType * @return atType **/ + @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getAtType() { return atType; } + + public void setAtType(String atType) { this.atType = atType; } + public Project name(String name) { + this.name = name; return this; } @@ -69,16 +77,22 @@ public Project name(String name) { * Get name * @return name **/ + @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } + public Project identifier(UUID identifier) { + this.identifier = identifier; return this; } @@ -87,11 +101,15 @@ public Project identifier(UUID identifier) { * Get identifier * @return identifier **/ + @javax.annotation.Nullable @ApiModelProperty(value = "") + public UUID getIdentifier() { return identifier; } + + public void setIdentifier(UUID identifier) { this.identifier = identifier; } @@ -121,7 +139,6 @@ public int hashCode() { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Project {\n"); - sb.append(" atType: ").append(toIndentedString(atType)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" identifier: ").append(toIndentedString(identifier)).append("\n"); diff --git a/src/main/java/org/omg/sysml/model/Relationship.java b/src/main/java/org/omg/sysml/model/Relationship.java index 0b06326..0836cc9 100644 --- a/src/main/java/org/omg/sysml/model/Relationship.java +++ b/src/main/java/org/omg/sysml/model/Relationship.java @@ -2,7 +2,7 @@ * SysML v2 API and Services * REST/HTTP binding (PSM) for the SysML v2 standard API. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -28,12 +28,25 @@ import java.util.UUID; import org.omg.sysml.model.Element; import org.omg.sysml.model.Identified; +import org.omg.sysml.model.RelationshipAllOf; /** * Relationship */ -public class Relationship extends Element { +public class Relationship { + public static final String SERIALIZED_NAME_AT_TYPE = "@type"; + @SerializedName(SERIALIZED_NAME_AT_TYPE) + private String atType; + + public static final String SERIALIZED_NAME_CONTAINING_PROJECT = "containingProject"; + @SerializedName(SERIALIZED_NAME_CONTAINING_PROJECT) + private Identified containingProject; + + public static final String SERIALIZED_NAME_IDENTIFIER = "identifier"; + @SerializedName(SERIALIZED_NAME_IDENTIFIER) + private UUID identifier; + public static final String SERIALIZED_NAME_SOURCE = "source"; @SerializedName(SERIALIZED_NAME_SOURCE) private List source = null; @@ -42,7 +55,81 @@ public class Relationship extends Element { @SerializedName(SERIALIZED_NAME_TARGET) private List target = null; + + public Relationship atType(String atType) { + + this.atType = atType; + return this; + } + + /** + * Get atType + * @return atType + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getAtType() { + return atType; + } + + + + public void setAtType(String atType) { + this.atType = atType; + } + + + public Relationship containingProject(Identified containingProject) { + + this.containingProject = containingProject; + return this; + } + + /** + * Get containingProject + * @return containingProject + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Identified getContainingProject() { + return containingProject; + } + + + + public void setContainingProject(Identified containingProject) { + this.containingProject = containingProject; + } + + + public Relationship identifier(UUID identifier) { + + this.identifier = identifier; + return this; + } + + /** + * Get identifier + * @return identifier + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public UUID getIdentifier() { + return identifier; + } + + + + public void setIdentifier(UUID identifier) { + this.identifier = identifier; + } + + public Relationship source(List source) { + this.source = source; return this; } @@ -59,16 +146,22 @@ public Relationship addSourceItem(Identified sourceItem) { * Get source * @return source **/ + @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getSource() { return source; } + + public void setSource(List source) { this.source = source; } + public Relationship target(List target) { + this.target = target; return this; } @@ -85,11 +178,15 @@ public Relationship addTargetItem(Identified targetItem) { * Get target * @return target **/ + @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getTarget() { return target; } + + public void setTarget(List target) { this.target = target; } @@ -104,14 +201,16 @@ public boolean equals(java.lang.Object o) { return false; } Relationship relationship = (Relationship) o; - return Objects.equals(this.source, relationship.source) && - Objects.equals(this.target, relationship.target) && - super.equals(o); + return Objects.equals(this.atType, relationship.atType) && + Objects.equals(this.containingProject, relationship.containingProject) && + Objects.equals(this.identifier, relationship.identifier) && + Objects.equals(this.source, relationship.source) && + Objects.equals(this.target, relationship.target); } @Override public int hashCode() { - return Objects.hash(source, target, super.hashCode()); + return Objects.hash(atType, containingProject, identifier, source, target); } @@ -119,7 +218,9 @@ public int hashCode() { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Relationship {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" atType: ").append(toIndentedString(atType)).append("\n"); + sb.append(" containingProject: ").append(toIndentedString(containingProject)).append("\n"); + sb.append(" identifier: ").append(toIndentedString(identifier)).append("\n"); sb.append(" source: ").append(toIndentedString(source)).append("\n"); sb.append(" target: ").append(toIndentedString(target)).append("\n"); sb.append("}"); diff --git a/src/main/java/org/omg/sysml/model/RelationshipAllOf.java b/src/main/java/org/omg/sysml/model/RelationshipAllOf.java new file mode 100644 index 0000000..312bade --- /dev/null +++ b/src/main/java/org/omg/sysml/model/RelationshipAllOf.java @@ -0,0 +1,149 @@ +/* + * SysML v2 API and Services + * REST/HTTP binding (PSM) for the SysML v2 standard API. + * + * 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 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.ArrayList; +import java.util.List; +import org.omg.sysml.model.Identified; + +/** + * RelationshipAllOf + */ + +public class RelationshipAllOf { + public static final String SERIALIZED_NAME_SOURCE = "source"; + @SerializedName(SERIALIZED_NAME_SOURCE) + private List source = null; + + public static final String SERIALIZED_NAME_TARGET = "target"; + @SerializedName(SERIALIZED_NAME_TARGET) + private List target = null; + + + public RelationshipAllOf source(List source) { + + this.source = source; + return this; + } + + public RelationshipAllOf addSourceItem(Identified sourceItem) { + if (this.source == null) { + this.source = new ArrayList(); + } + this.source.add(sourceItem); + return this; + } + + /** + * Get source + * @return source + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public List getSource() { + return source; + } + + + + public void setSource(List source) { + this.source = source; + } + + + public RelationshipAllOf target(List target) { + + this.target = target; + return this; + } + + public RelationshipAllOf addTargetItem(Identified targetItem) { + if (this.target == null) { + this.target = new ArrayList(); + } + this.target.add(targetItem); + return this; + } + + /** + * Get target + * @return target + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public List getTarget() { + return target; + } + + + + public void setTarget(List target) { + this.target = target; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RelationshipAllOf relationshipAllOf = (RelationshipAllOf) o; + return Objects.equals(this.source, relationshipAllOf.source) && + Objects.equals(this.target, relationshipAllOf.target); + } + + @Override + public int hashCode() { + return Objects.hash(source, target); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RelationshipAllOf {\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append(" target: ").append(toIndentedString(target)).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 1b2a980..30cca16 100644 --- a/src/test/java/org/omg/sysml/api/ElementApiTest.java +++ b/src/test/java/org/omg/sysml/api/ElementApiTest.java @@ -2,7 +2,7 @@ * SysML v2 API and Services * REST/HTTP binding (PSM) for the SysML v2 standard API. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -43,8 +43,8 @@ public class ElementApiTest { */ @Test public void createElementTest() throws ApiException { - Map requestBody = null; - Element response = api.createElement(requestBody); + Map body = null; + Element response = api.createElement(body); // 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 1bf2f77..d042716 100644 --- a/src/test/java/org/omg/sysml/api/ProjectApiTest.java +++ b/src/test/java/org/omg/sysml/api/ProjectApiTest.java @@ -2,7 +2,7 @@ * SysML v2 API and Services * REST/HTTP binding (PSM) for the SysML v2 standard API. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -43,8 +43,8 @@ public class ProjectApiTest { */ @Test public void createProjectTest() throws ApiException { - Project project = null; - Project response = api.createProject(project); + Project body = null; + Project response = api.createProject(body); // TODO: test validations } diff --git a/src/test/java/org/omg/sysml/api/RelationshipApiTest.java b/src/test/java/org/omg/sysml/api/RelationshipApiTest.java index e04d5e9..7d39346 100644 --- a/src/test/java/org/omg/sysml/api/RelationshipApiTest.java +++ b/src/test/java/org/omg/sysml/api/RelationshipApiTest.java @@ -2,7 +2,7 @@ * SysML v2 API and Services * REST/HTTP binding (PSM) for the SysML v2 standard API. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -43,8 +43,8 @@ public class RelationshipApiTest { */ @Test public void createRelationshipTest() throws ApiException { - Relationship relationship = null; - Relationship response = api.createRelationship(relationship); + Relationship body = null; + Relationship response = api.createRelationship(body); // TODO: test validations } diff --git a/src/test/java/org/omg/sysml/model/ElementTest.java b/src/test/java/org/omg/sysml/model/ElementTest.java new file mode 100644 index 0000000..9251eea --- /dev/null +++ b/src/test/java/org/omg/sysml/model/ElementTest.java @@ -0,0 +1,71 @@ +/* + * SysML v2 API and Services + * REST/HTTP binding (PSM) for the SysML v2 standard API. + * + * 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 org.omg.sysml.model; + +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.HashMap; +import java.util.Map; +import java.util.UUID; +import org.omg.sysml.model.Identified; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Element + */ +public class ElementTest { + private final Element model = new Element(); + + /** + * Model tests for Element + */ + @Test + public void testElement() { + // TODO: test Element + } + + /** + * Test the property 'atType' + */ + @Test + public void atTypeTest() { + // TODO: test atType + } + + /** + * Test the property 'containingProject' + */ + @Test + public void containingProjectTest() { + // TODO: test containingProject + } + + /** + * Test the property 'identifier' + */ + @Test + public void identifierTest() { + // TODO: test identifier + } + +} diff --git a/src/test/java/org/omg/sysml/model/ErrorTest.java b/src/test/java/org/omg/sysml/model/ErrorTest.java new file mode 100644 index 0000000..57c0d26 --- /dev/null +++ b/src/test/java/org/omg/sysml/model/ErrorTest.java @@ -0,0 +1,51 @@ +/* + * SysML v2 API and Services + * REST/HTTP binding (PSM) for the SysML v2 standard API. + * + * 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 org.omg.sysml.model; + +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 org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Error + */ +public class ErrorTest { + private final Error model = new Error(); + + /** + * Model tests for Error + */ + @Test + public void testError() { + // TODO: test Error + } + + /** + * Test the property 'error' + */ + @Test + public void errorTest() { + // TODO: test error + } + +} diff --git a/src/test/java/org/omg/sysml/model/IdentifiedTest.java b/src/test/java/org/omg/sysml/model/IdentifiedTest.java new file mode 100644 index 0000000..5f00d10 --- /dev/null +++ b/src/test/java/org/omg/sysml/model/IdentifiedTest.java @@ -0,0 +1,52 @@ +/* + * SysML v2 API and Services + * REST/HTTP binding (PSM) for the SysML v2 standard API. + * + * 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 org.omg.sysml.model; + +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; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Identified + */ +public class IdentifiedTest { + private final Identified model = new Identified(); + + /** + * Model tests for Identified + */ + @Test + public void testIdentified() { + // TODO: test Identified + } + + /** + * Test the property 'identifier' + */ + @Test + public void identifierTest() { + // TODO: test identifier + } + +} diff --git a/src/test/java/org/omg/sysml/model/ProjectTest.java b/src/test/java/org/omg/sysml/model/ProjectTest.java new file mode 100644 index 0000000..9814656 --- /dev/null +++ b/src/test/java/org/omg/sysml/model/ProjectTest.java @@ -0,0 +1,68 @@ +/* + * SysML v2 API and Services + * REST/HTTP binding (PSM) for the SysML v2 standard API. + * + * 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 org.omg.sysml.model; + +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; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Project + */ +public class ProjectTest { + private final Project model = new Project(); + + /** + * Model tests for Project + */ + @Test + public void testProject() { + // TODO: test Project + } + + /** + * Test the property 'atType' + */ + @Test + public void atTypeTest() { + // TODO: test atType + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'identifier' + */ + @Test + public void identifierTest() { + // TODO: test identifier + } + +} diff --git a/src/test/java/org/omg/sysml/model/RelationshipAllOfTest.java b/src/test/java/org/omg/sysml/model/RelationshipAllOfTest.java new file mode 100644 index 0000000..3bbb089 --- /dev/null +++ b/src/test/java/org/omg/sysml/model/RelationshipAllOfTest.java @@ -0,0 +1,62 @@ +/* + * SysML v2 API and Services + * REST/HTTP binding (PSM) for the SysML v2 standard API. + * + * 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 org.omg.sysml.model; + +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.ArrayList; +import java.util.List; +import org.omg.sysml.model.Identified; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for RelationshipAllOf + */ +public class RelationshipAllOfTest { + private final RelationshipAllOf model = new RelationshipAllOf(); + + /** + * Model tests for RelationshipAllOf + */ + @Test + public void testRelationshipAllOf() { + // TODO: test RelationshipAllOf + } + + /** + * Test the property 'source' + */ + @Test + public void sourceTest() { + // TODO: test source + } + + /** + * Test the property 'target' + */ + @Test + public void targetTest() { + // TODO: test target + } + +} diff --git a/src/test/java/org/omg/sysml/model/RelationshipTest.java b/src/test/java/org/omg/sysml/model/RelationshipTest.java new file mode 100644 index 0000000..b35bb34 --- /dev/null +++ b/src/test/java/org/omg/sysml/model/RelationshipTest.java @@ -0,0 +1,89 @@ +/* + * SysML v2 API and Services + * REST/HTTP binding (PSM) for the SysML v2 standard API. + * + * 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 org.omg.sysml.model; + +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.ArrayList; +import java.util.List; +import java.util.UUID; +import org.omg.sysml.model.Element; +import org.omg.sysml.model.Identified; +import org.omg.sysml.model.RelationshipAllOf; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Relationship + */ +public class RelationshipTest { + private final Relationship model = new Relationship(); + + /** + * Model tests for Relationship + */ + @Test + public void testRelationship() { + // TODO: test Relationship + } + + /** + * Test the property 'atType' + */ + @Test + public void atTypeTest() { + // TODO: test atType + } + + /** + * Test the property 'containingProject' + */ + @Test + public void containingProjectTest() { + // TODO: test containingProject + } + + /** + * Test the property 'identifier' + */ + @Test + public void identifierTest() { + // TODO: test identifier + } + + /** + * Test the property 'source' + */ + @Test + public void sourceTest() { + // TODO: test source + } + + /** + * Test the property 'target' + */ + @Test + public void targetTest() { + // TODO: test target + } + +}