Skip to content

Commit a4e0bca

Browse files
committed
Initial commit
1 parent 1f3384c commit a4e0bca

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+6850
-0
lines changed

.gitignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
*.class
2+
3+
# Mobile Tools for Java (J2ME)
4+
.mtj.tmp/
5+
6+
# Package Files #
7+
*.jar
8+
*.war
9+
*.ear
10+
11+
# exclude jar for gradle wrapper
12+
!gradle/wrapper/*.jar
13+
14+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
15+
hs_err_pid*
16+
17+
# build files
18+
**/target
19+
target
20+
.gradle
21+
build
22+
*.iml
23+
.idea

.openapi-generator-ignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# OpenAPI Generator Ignore
2+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md

.openapi-generator/VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.3.4

.travis.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#
2+
# Generated by: https://openapi-generator.tech
3+
#
4+
language: java
5+
jdk:
6+
- oraclejdk8
7+
- oraclejdk7
8+
before_install:
9+
# ensure gradlew has proper permission
10+
- chmod a+x ./gradlew
11+
script:
12+
# test using maven
13+
- mvn test
14+
# uncomment below to test using gradle
15+
# - gradle test
16+
# uncomment below to test using sbt
17+
# - sbt test

README.md

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
# sysml-api-client
2+
3+
SysML v2 API and Services
4+
- API version: 1.0.0
5+
6+
REST/HTTP binding (PSM) for the SysML v2 standard API.
7+
8+
9+
*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)*
10+
11+
12+
## Requirements
13+
14+
Building the API client library requires:
15+
1. Java 1.7+
16+
2. Maven/Gradle
17+
18+
## Installation
19+
20+
To install the API client library to your local Maven repository, simply execute:
21+
22+
```shell
23+
mvn clean install
24+
```
25+
26+
To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
27+
28+
```shell
29+
mvn clean deploy
30+
```
31+
32+
Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information.
33+
34+
### Maven users
35+
36+
Add this dependency to your project's POM:
37+
38+
```xml
39+
<dependency>
40+
<groupId>org.omg.sysml</groupId>
41+
<artifactId>sysml-api-client</artifactId>
42+
<version>0.1.0</version>
43+
<scope>compile</scope>
44+
</dependency>
45+
```
46+
47+
### Gradle users
48+
49+
Add this dependency to your project's build file:
50+
51+
```groovy
52+
compile "org.omg.sysml:sysml-api-client:0.1.0"
53+
```
54+
55+
### Others
56+
57+
At first generate the JAR by executing:
58+
59+
```shell
60+
mvn clean package
61+
```
62+
63+
Then manually install the following JARs:
64+
65+
* `target/sysml-api-client-0.1.0.jar`
66+
* `target/lib/*.jar`
67+
68+
## Getting Started
69+
70+
Please follow the [installation](#installation) instruction and execute the following Java code:
71+
72+
```java
73+
74+
import org.omg.sysml.*;
75+
import org.omg.sysml.auth.*;
76+
import org.omg.sysml.model.*;
77+
import org.omg.sysml.api.ElementApi;
78+
79+
import java.io.File;
80+
import java.util.*;
81+
82+
public class ElementApiExample {
83+
84+
public static void main(String[] args) {
85+
86+
ElementApi apiInstance = new ElementApi();
87+
Element element = new Element(); // Element |
88+
try {
89+
Element result = apiInstance.createElement(element);
90+
System.out.println(result);
91+
} catch (ApiException e) {
92+
System.err.println("Exception when calling ElementApi#createElement");
93+
e.printStackTrace();
94+
}
95+
}
96+
}
97+
98+
```
99+
100+
## Documentation for API Endpoints
101+
102+
All URIs are relative to *http://localhost*
103+
104+
Class | Method | HTTP request | Description
105+
------------ | ------------- | ------------- | -------------
106+
*ElementApi* | [**createElement**](docs/ElementApi.md#createElement) | **POST** /element | Add a new element
107+
*ElementApi* | [**getElement**](docs/ElementApi.md#getElement) | **GET** /element/{id} | Get element by its ID
108+
*ElementApi* | [**getElements**](docs/ElementApi.md#getElements) | **GET** /element | Get all elements
109+
*ElementApi* | [**getElementsInModel**](docs/ElementApi.md#getElementsInModel) | **GET** /element/model/{model_id} | Get all elements in the model
110+
*ModelApi* | [**createModel**](docs/ModelApi.md#createModel) | **POST** /model | Add a new model
111+
*ModelApi* | [**getModel**](docs/ModelApi.md#getModel) | **GET** /model/{id} | Get model by its ID
112+
*ModelApi* | [**getModels**](docs/ModelApi.md#getModels) | **GET** /model | Get all models
113+
*RelationshipApi* | [**createRelationship**](docs/RelationshipApi.md#createRelationship) | **POST** /relationship | Add a new relationship
114+
*RelationshipApi* | [**getRelationship**](docs/RelationshipApi.md#getRelationship) | **GET** /relationship/{id} | Get relationship by its ID
115+
*RelationshipApi* | [**getRelationships**](docs/RelationshipApi.md#getRelationships) | **GET** /relationship | Get all relationships
116+
*RelationshipApi* | [**getRelationshipsByElement**](docs/RelationshipApi.md#getRelationshipsByElement) | **GET** /relationship/element/{element_id} | Get all relationships with the given element as either source or target
117+
*RelationshipApi* | [**getRelationshipsBySource**](docs/RelationshipApi.md#getRelationshipsBySource) | **GET** /relationship/source/{source_id} | Get all relationships with the given element as the source
118+
*RelationshipApi* | [**getRelationshipsByTarget**](docs/RelationshipApi.md#getRelationshipsByTarget) | **GET** /relationship/target/{target_id} | Get all relationships with the given element as the target
119+
120+
121+
## Documentation for Models
122+
123+
- [Element](docs/Element.md)
124+
- [Error](docs/Error.md)
125+
- [Model](docs/Model.md)
126+
- [Relationship](docs/Relationship.md)
127+
128+
129+
## Documentation for Authorization
130+
131+
All endpoints do not require authorization.
132+
Authentication schemes defined for the API:
133+
134+
## Recommendation
135+
136+
It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues.
137+
138+
## Author
139+
140+
141+

build.gradle

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
apply plugin: 'idea'
2+
apply plugin: 'eclipse'
3+
4+
group = 'org.omg.sysml'
5+
version = '0.1.0'
6+
7+
buildscript {
8+
repositories {
9+
jcenter()
10+
}
11+
dependencies {
12+
classpath 'com.android.tools.build:gradle:2.3.+'
13+
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
14+
}
15+
}
16+
17+
repositories {
18+
jcenter()
19+
}
20+
21+
22+
if(hasProperty('target') && target == 'android') {
23+
24+
apply plugin: 'com.android.library'
25+
apply plugin: 'com.github.dcendents.android-maven'
26+
27+
android {
28+
compileSdkVersion 25
29+
buildToolsVersion '25.0.2'
30+
defaultConfig {
31+
minSdkVersion 14
32+
targetSdkVersion 25
33+
}
34+
compileOptions {
35+
sourceCompatibility JavaVersion.VERSION_1_7
36+
targetCompatibility JavaVersion.VERSION_1_7
37+
}
38+
39+
// Rename the aar correctly
40+
libraryVariants.all { variant ->
41+
variant.outputs.each { output ->
42+
def outputFile = output.outputFile
43+
if (outputFile != null && outputFile.name.endsWith('.aar')) {
44+
def fileName = "${project.name}-${variant.baseName}-${version}.aar"
45+
output.outputFile = new File(outputFile.parent, fileName)
46+
}
47+
}
48+
}
49+
50+
dependencies {
51+
provided 'javax.annotation:jsr250-api:1.0'
52+
}
53+
}
54+
55+
afterEvaluate {
56+
android.libraryVariants.all { variant ->
57+
def task = project.tasks.create "jar${variant.name.capitalize()}", Jar
58+
task.description = "Create jar artifact for ${variant.name}"
59+
task.dependsOn variant.javaCompile
60+
task.from variant.javaCompile.destinationDir
61+
task.destinationDir = project.file("${project.buildDir}/outputs/jar")
62+
task.archiveName = "${project.name}-${variant.baseName}-${version}.jar"
63+
artifacts.add('archives', task);
64+
}
65+
}
66+
67+
task sourcesJar(type: Jar) {
68+
from android.sourceSets.main.java.srcDirs
69+
classifier = 'sources'
70+
}
71+
72+
artifacts {
73+
archives sourcesJar
74+
}
75+
76+
} else {
77+
78+
apply plugin: 'java'
79+
apply plugin: 'maven'
80+
81+
sourceCompatibility = JavaVersion.VERSION_1_7
82+
targetCompatibility = JavaVersion.VERSION_1_7
83+
84+
install {
85+
repositories.mavenInstaller {
86+
pom.artifactId = 'sysml-api-client'
87+
}
88+
}
89+
90+
task execute(type:JavaExec) {
91+
main = System.getProperty('mainClass')
92+
classpath = sourceSets.main.runtimeClasspath
93+
}
94+
}
95+
96+
dependencies {
97+
compile 'io.swagger:swagger-annotations:1.5.17'
98+
compile 'com.squareup.okhttp:okhttp:2.7.5'
99+
compile 'com.squareup.okhttp:logging-interceptor:2.7.5'
100+
compile 'com.google.code.gson:gson:2.8.1'
101+
compile 'io.gsonfire:gson-fire:1.8.0'
102+
compile group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.1'
103+
compile 'org.threeten:threetenbp:1.3.5'
104+
testCompile 'junit:junit:4.12'
105+
}

build.sbt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
lazy val root = (project in file(".")).
2+
settings(
3+
organization := "org.omg.sysml",
4+
name := "sysml-api-client",
5+
version := "0.1.0",
6+
scalaVersion := "2.11.4",
7+
scalacOptions ++= Seq("-feature"),
8+
javacOptions in compile ++= Seq("-Xlint:deprecation"),
9+
publishArtifact in (Compile, packageDoc) := false,
10+
resolvers += Resolver.mavenLocal,
11+
libraryDependencies ++= Seq(
12+
"io.swagger" % "swagger-annotations" % "1.5.17",
13+
"com.squareup.okhttp" % "okhttp" % "2.7.5",
14+
"com.squareup.okhttp" % "logging-interceptor" % "2.7.5",
15+
"com.google.code.gson" % "gson" % "2.8.1",
16+
"org.threeten" % "threetenbp" % "1.3.5" % "compile",
17+
"io.gsonfire" % "gson-fire" % "1.8.0" % "compile",
18+
"junit" % "junit" % "4.12" % "test",
19+
"com.novocode" % "junit-interface" % "0.10" % "test"
20+
)
21+
)

docs/Element.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
# Element
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**identifier** | [**UUID**](UUID.md) | | [optional]
8+
**name** | **String** | | [optional]
9+
**description** | **String** | | [optional]
10+
**parentModel** | [**UUID**](UUID.md) | | [optional]
11+
**type** | **String** | | [optional]
12+
13+
14+

0 commit comments

Comments
 (0)