From 99f753fdb8f42a20e560649445010ba7116215d1 Mon Sep 17 00:00:00 2001 From: Miyako Wilson Date: Fri, 30 Apr 2021 13:15:49 -0400 Subject: [PATCH 1/9] add some test for Projects --- .../org/omg/sysml/api/ProjectApiTest.java | 168 +++++++++++++++--- 1 file changed, 146 insertions(+), 22 deletions(-) diff --git a/src/test/java/org/omg/sysml/api/ProjectApiTest.java b/src/test/java/org/omg/sysml/api/ProjectApiTest.java index dd66df2..1d83ce3 100644 --- a/src/test/java/org/omg/sysml/api/ProjectApiTest.java +++ b/src/test/java/org/omg/sysml/api/ProjectApiTest.java @@ -13,29 +13,45 @@ package org.omg.sysml.api; +import org.omg.sysml.ApiClient; import org.omg.sysml.ApiException; +import org.omg.sysml.Configuration; import org.omg.sysml.model.Error; import org.omg.sysml.model.Project; +import org.omg.sysml.model.Project.AtTypeEnum; + import java.util.UUID; import org.junit.Test; +import org.junit.BeforeClass; import org.junit.Ignore; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Random; /** * API tests for ProjectApi */ -@Ignore + public class ProjectApiTest { - private final ProjectApi api = new ProjectApi(); + private final static ProjectApi api = new ProjectApi(); + @BeforeClass + public static void setUp() { + ApiClient apiClient = Configuration.getDefaultApiClient(); + apiClient.setBasePath("http://sysml2-sst.intercax.com:9000"); + api.setApiClient(apiClient); + } /** - * Get project by ID + * Get projects * * * @@ -43,15 +59,39 @@ public class ProjectApiTest { * if the Api call fails */ @Test - public void getProjectByIdTest() throws ApiException { - UUID projectId = null; - Project response = api.getProjectById(projectId); - - // TODO: test validations + public void getProjectsTest() { + + List response; + try { + response = api.getProjects(null, null, null); + assertTrue(response.size() >= 0); //no project then size = 0? + } catch (ApiException e) { + fail("getProjectsTest failed: not expecting ApiException"); + } + } + + @Test + public void getProjectsTest_0() { + + ApiClient apiClient = Configuration.getDefaultApiClient(); + apiClient.setBasePath("http://sysml2-sst.intercaxxxxxxx.com:9000"); + ProjectApi api = new ProjectApi(); + api.setApiClient(apiClient); + + try { + List response = api.getProjects(null, null, null); + fail("getProjectsTest_0 failed: expecting ApiException"); + System.out.println(response); + } + catch( ApiException e) { + assertEquals("0", Integer.toString(e.getCode())); + assertEquals("java.net.UnknownHostException: This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server (sysml2-sst.intercaxxxxxxx.com)", e.getMessage()); + } + } /** - * Get projects + * Get project by ID * * * @@ -59,29 +99,113 @@ public void getProjectByIdTest() throws ApiException { * if the Api call fails */ @Test - public void getProjectsTest() throws ApiException { - String pageAfter = null; - String pageBefore = null; - Integer pageSize = null; - List response = api.getProjects(pageAfter, pageBefore, pageSize); + public void getProjectByIdTest() { - // TODO: test validations + try { + List result = api.getProjects(null, null, null); + if ( result.size() > 0) { + UUID projectId = result.get(0).getId(); + Project response = api.getProjectById(projectId); + assertEquals(projectId, response.getId()); + assertEquals(projectId.toString(), response.getId().toString()); + } + else + fail("getProjectByIdTest failed: No project available to test"); + } catch (ApiException e) { + fail("getProjectByIdTest failed: not expecting ApiException"); + } } /** - * Create project + * Get project by ID when when ID is null * - * + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getProjectByIdTest_0() throws ApiException { + + try { + UUID projectId = null; + api.getProjectById(projectId); + fail("getProjectByIdTest_0 failed: expecting ApiException"); //did not throw an ApiException + + } catch (ApiException e) { + assertEquals("0", Integer.toString(e.getCode())); + assertEquals("Missing the required parameter 'projectId' when calling getProjectById(Async)", e.getMessage()); + } + } + /** + * Get project by ID when randomly created ID (ID Not Found) * * @throws ApiException * if the Api call fails */ @Test - public void postProjectTest() throws ApiException { - Project body = null; - Project response = api.postProject(body); - - // TODO: test validations + public void getProjectByIdTest_404() throws ApiException { + + try { + //create uuid not likely existing in the server + UUID projectId = UUID.fromString("11345678-9012-3456-7890-123456789012"); + api.getProjectById(projectId); + fail("getProjectByIdTest_404 failed: expecting ApiException"); //did not throw an ApiException + + } catch (ApiException e) { + assertEquals("404", Integer.toString(e.getCode())); + assertEquals("Not Found", e.getMessage()); + } + } + + /** + * Create project using ramdom uuid + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void postProjectTest() { + + UUID id = UUID.randomUUID(); + String description = "desc"+ Math.random(); + String name = "name" + Math.random(); + + Project body = new Project(); + body.setId(id); + body.setDescription(description); + body.setName(name); + Project response; + try { + response = api.postProject(body); + System.out.println(response); + assertEquals(id.toString(), response.getId().toString()); + assertEquals(description, response.getDescription()); + assertEquals(name, response.getName()); + assertEquals(AtTypeEnum.PROJECT, response.getAtType()); + } catch (ApiException e) { + fail("getProjectByIdTest_404 failed: not expecting ApiException"); + } } + //? if the UUID exist in post, the response is the same as new creation. + // and able to change its attribute ... Is this supposed to be like that? I thought return 415. + /*@Test + public void postProjectTest_415() throws ApiException { + + UUID id = UUID.fromString("90ac8d42-90bf-481d-a484-67491285a3d3"); + String description = "postProjectTestDescription"; + String name = "postProjectTestName!!!!!!!"; + + Project body = new Project(); + body.setId(id); + body.setDescription(description); + body.setName(name); + Project response = api.postProject(body); + System.out.println(response); + assertEquals(id.toString(), response.getId().toString()); + assertEquals(description, response.getDescription()); + assertEquals(name, response.getName()); + assertEquals(AtTypeEnum.PROJECT, response.getAtType()); + + }*/ } From f3588a69b332e02f84aef8d8df1a791a7c8dc339 Mon Sep 17 00:00:00 2001 From: Miyako Wilson Date: Thu, 13 May 2021 21:56:19 -0400 Subject: [PATCH 2/9] wip - failing postCommitByProjectTest() --- .../java/org/omg/sysml/api/CommitApiTest.java | 179 ++++++++++++++---- 1 file changed, 138 insertions(+), 41 deletions(-) diff --git a/src/test/java/org/omg/sysml/api/CommitApiTest.java b/src/test/java/org/omg/sysml/api/CommitApiTest.java index 921ab6b..58b0eeb 100644 --- a/src/test/java/org/omg/sysml/api/CommitApiTest.java +++ b/src/test/java/org/omg/sysml/api/CommitApiTest.java @@ -13,94 +13,191 @@ package org.omg.sysml.api; +import org.omg.sysml.ApiClient; import org.omg.sysml.ApiException; +import org.omg.sysml.Configuration; import org.omg.sysml.model.Commit; -import org.omg.sysml.model.Error; +import org.omg.sysml.model.CommitContainingProject; +import org.omg.sysml.model.Element; +import org.omg.sysml.model.ElementVersion; +import org.omg.sysml.model.Project; +import org.omg.sysml.model.Record; + import java.util.UUID; import org.junit.Test; -import org.junit.Ignore; +import org.junit.BeforeClass; +import org.junit.FixMethodOrder; +import org.junit.runners.MethodSorters; + +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; -import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; /** * API tests for CommitApi */ -@Ignore +@FixMethodOrder(MethodSorters.NAME_ASCENDING) public class CommitApiTest { - private final CommitApi api = new CommitApi(); - + private final static CommitApi api = new CommitApi(); + private final static ProjectApi projectApi = new ProjectApi(); + private static UUID projectId; + //private static UUID commitId; + private static Commit commit; + + @BeforeClass + public static void setUp() { + ApiClient apiClient = Configuration.getDefaultApiClient(); + apiClient.setBasePath("http://sysml2-sst.intercax.com:9000"); + api.setApiClient(apiClient); + projectApi.setApiClient(apiClient); + + List result = null; + try { + result = projectApi.getProjects(null, null, null); + projectId = result.get(0).getId(); + } catch (ApiException e) { + e.printStackTrace(); + fail("Failed to check GET /projects/{projectId}/commits - no project is available."); + } + + } /** - * Get commit by project and ID - * - * + * Get head commit by project * * @throws ApiException * if the Api call fails */ @Test - public void getCommitByProjectAndIdTest() throws ApiException { - UUID projectId = null; - UUID commitId = null; - Commit response = api.getCommitByProjectAndId(projectId, commitId); - - // TODO: test validations + public void get1HeadCommitByProjectTest() { + if (projectId == null) + fail("Failed - no project is available."); + else { + try { + Commit response = api.getHeadCommitByProject(projectId); + System.out.println("=== getHeadCommitByProjectTest() ===\n" + response); + assertTrue(response != null); + } catch (ApiException e) { + e.printStackTrace(); + fail("Failed - response(Commit) is null"); + } + } } + /** * Get commits by project * - * - * + * Using the setup to projectId * @throws ApiException * if the Api call fails */ @Test - public void getCommitsByProjectTest() throws ApiException { - UUID projectId = null; - String pageAfter = null; - String pageBefore = null; - Integer pageSize = null; - List response = api.getCommitsByProject(projectId, pageAfter, pageBefore, pageSize); - - // TODO: test validations + public void get2CommitsByProjectTest() { + + if (projectId == null) + fail("Failed - no project is available."); + else { + List response = null; + try { + response = api.getCommitsByProject(projectId, null, null, null); + System.out.println("=== getCommitsByProjectTest() ===\n" + response); + assertTrue(response.size() > 0); + commit = response.get(0); + } catch (ApiException e) { + e.printStackTrace(); + fail("Failed - no project available to query commit."); + } + } + } + + /** - * Get head commit by project + * Get commit by project and ID * - * + * Using the previously run test get2CommitsByProjectTest to get commitId * * @throws ApiException * if the Api call fails */ @Test - public void getHeadCommitByProjectTest() throws ApiException { - UUID projectId = null; - Commit response = api.getHeadCommitByProject(projectId); - - // TODO: test validations + public void get3CommitByProjectAndIdTest() { + UUID commitId; + if (projectId == null) + fail("Failed - no project is available."); + else if ((commitId = commit.getId()) == null) + fail("Failed - no commit is available."); + else { + try { + Commit response = api.getCommitByProjectAndId(projectId, commitId); + System.out.println("=== getCommitByProjectAndIdTest() ===\n" + response); + assertTrue(response != null); + } catch (ApiException e) { + e.printStackTrace(); + fail("Failed - response(Commit) is null"); + } + } } + /** * Create commit by project - * + * Using the previously run test get2CommitsByProjectTest to get commitId * * * @throws ApiException * if the Api call fails */ @Test - public void postCommitByProjectTest() throws ApiException { - UUID projectId = null; - Commit body = null; - Commit response = api.postCommitByProject(projectId, body); - - // TODO: test validations + public void postCommitByProjectTest() { + if (projectId == null) + fail("Failed - no project is available."); + else { + Commit body = new Commit(); + body.setAtType(org.omg.sysml.model.Commit.AtTypeEnum.COMMIT); + + Element element = new Element(); + element.setAtType("Package"); + element.setAtId(UUID.randomUUID()); + + //element.setIdentifier(); + + ElementVersion elementVersion = new ElementVersion(); + elementVersion.setAtType(org.omg.sysml.model.ElementVersion.AtTypeEnum.ELEMENTVERSION); + elementVersion.setData(element); + elementVersion.setId(UUID.randomUUID()); + //elementVersion.setIdentity(identity); + + CommitContainingProject containingProject = new CommitContainingProject(); + containingProject.setId(UUID.randomUUID()); + + body.addChangeItem(elementVersion); + body.setContainingProject(containingProject); + body.setId(UUID.randomUUID()); + //body.setPreviousCommit(null); + Record previousCommit = new Record(); + previousCommit.setId(commit.getId()); + body.setPreviousCommit(previousCommit); + + Commit response; + try { + response = api.postCommitByProject(projectId, body); + System.out.println("=== postCommitByProjectTest() ===\n" + response); + assertTrue(response != null); + } catch (ApiException e) { + System.out.println("=== ApiException: postCommitByProjectTest() ===\n"); + System.out.println(e.getCode()); + System.out.println(e.getMessage()); + e.printStackTrace(); + fail("Failed - response(Commit) is null"); + + } + + } } } From b43f0ddcb3e989836953fcae9e45cf43d495637e Mon Sep 17 00:00:00 2001 From: Miyako Wilson Date: Thu, 13 May 2021 21:58:16 -0400 Subject: [PATCH 3/9] clean up --- src/test/java/org/omg/sysml/api/ProjectApiTest.java | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/test/java/org/omg/sysml/api/ProjectApiTest.java b/src/test/java/org/omg/sysml/api/ProjectApiTest.java index 1d83ce3..1fbd8af 100644 --- a/src/test/java/org/omg/sysml/api/ProjectApiTest.java +++ b/src/test/java/org/omg/sysml/api/ProjectApiTest.java @@ -16,24 +16,18 @@ import org.omg.sysml.ApiClient; import org.omg.sysml.ApiException; import org.omg.sysml.Configuration; -import org.omg.sysml.model.Error; import org.omg.sysml.model.Project; import org.omg.sysml.model.Project.AtTypeEnum; import java.util.UUID; import org.junit.Test; import org.junit.BeforeClass; -import org.junit.Ignore; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; -import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; -import java.util.Random; /** * API tests for ProjectApi @@ -93,8 +87,6 @@ public void getProjectsTest_0() { /** * Get project by ID * - * - * * @throws ApiException * if the Api call fails */ From 3bc7c3509cd46d3ffd99b9f6057ecbff399fe219 Mon Sep 17 00:00:00 2001 From: Miyako Wilson Date: Tue, 29 Jun 2021 23:10:49 -0400 Subject: [PATCH 4/9] updated --- .../java/org/omg/sysml/api/CommitApiTest.java | 2 +- .../org/omg/sysml/api/ElementApiTest.java | 161 +++++++++++++++--- .../org/omg/sysml/api/ProjectApiTest.java | 1 + .../java/org/omg/sysml/api/QueryApiTest.java | 141 ++++++++++++--- 4 files changed, 259 insertions(+), 46 deletions(-) diff --git a/src/test/java/org/omg/sysml/api/CommitApiTest.java b/src/test/java/org/omg/sysml/api/CommitApiTest.java index 58b0eeb..003667a 100644 --- a/src/test/java/org/omg/sysml/api/CommitApiTest.java +++ b/src/test/java/org/omg/sysml/api/CommitApiTest.java @@ -152,7 +152,7 @@ else if ((commitId = commit.getId()) == null) * @throws ApiException * if the Api call fails */ - @Test + public void postCommitByProjectTest() { if (projectId == null) fail("Failed - no project is available."); diff --git a/src/test/java/org/omg/sysml/api/ElementApiTest.java b/src/test/java/org/omg/sysml/api/ElementApiTest.java index 915c0cf..040d952 100644 --- a/src/test/java/org/omg/sysml/api/ElementApiTest.java +++ b/src/test/java/org/omg/sysml/api/ElementApiTest.java @@ -13,13 +13,22 @@ package org.omg.sysml.api; +import org.omg.sysml.ApiClient; import org.omg.sysml.ApiException; +import org.omg.sysml.Configuration; +import org.omg.sysml.model.Commit; import org.omg.sysml.model.Element; import org.omg.sysml.model.Error; +import org.omg.sysml.model.Project; + import java.util.UUID; import org.junit.Test; +import org.junit.BeforeClass; import org.junit.Ignore; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -28,14 +37,52 @@ /** * API tests for ElementApi */ -@Ignore + public class ElementApiTest { - private final ElementApi api = new ElementApi(); + private final static ProjectApi project_api = new ProjectApi(); + private final static CommitApi commit_api = new CommitApi(); + private final static ElementApi api = new ElementApi(); + + private static UUID projectId; + private static UUID commitId; + private static UUID elementId; + @BeforeClass + public static void setUp() { + ApiClient apiClient = Configuration.getDefaultApiClient(); + apiClient.setBasePath("http://sysml2-sst.intercax.com:9000"); + api.setApiClient(apiClient); + project_api.setApiClient(apiClient); + commit_api.setApiClient(apiClient); + List project_response; + try { + project_response = project_api.getProjects(null, null, null); + assertTrue(project_response.size() >= 0); //no project then size = 0? + System.out.println(project_response); + projectId = project_response.get(0).getId(); + + List commit_response = null; + try { + commit_response = commit_api.getCommitsByProject(projectId, null, null, null); + System.out.println("=== getCommitsByProjectTest() ===\n" + commit_response); + assertTrue(commit_response.size() > 0); + Commit commit = commit_response.get(0); + commitId = commit.getId(); + } catch (ApiException e) { + e.printStackTrace(); + fail("Failed - no commitId."); + } + } catch (ApiException e) { + e.printStackTrace(); + fail("Failed - no project available."); + } + } /** - * Get element by project, commit and ID + * WIP - response size = 0 + * WIP Element does not have getId method + * Get root elements by project and commit * * * @@ -43,16 +90,40 @@ public class ElementApiTest { * if the Api call fails */ @Test - public void getElementByProjectCommitIdTest() throws ApiException { - UUID projectId = null; - UUID commitId = null; - UUID elementId = null; - Element response = api.getElementByProjectCommitId(projectId, commitId, elementId); - - // TODO: test validations + public void getRootsByProjectCommitTest() throws ApiException { + + if (projectId == null) { + fail("Failed - no project is available."); + return; + } + if (commitId == null) { + fail("Failed - no commit is available."); + return; + } + + String pageAfter = null; + String pageBefore = null; + Integer pageSize = null; + + try { + List response = api.getRootsByProjectCommit(projectId, commitId, pageAfter, pageBefore, pageSize); + System.out.println("=== getRootsByProjectCommitTest() ===\n" + response.size()); + assertTrue(response.size() > 0); + Element element = response.get(0); + System.out.println(element); + assertTrue(element.getIdentifier() != null); + //elementId = element.getId(); + //System.out.println("elementId: " + elementId); + + } catch (ApiException e) { + e.printStackTrace(); + fail("Failed - getRootsByProjectCommitTest - no element"); + } } + /** + * WIP - response size = 0 * Get elements by project and commit * * @@ -62,18 +133,37 @@ public void getElementByProjectCommitIdTest() throws ApiException { */ @Test public void getElementsByProjectCommitTest() throws ApiException { - UUID projectId = null; - UUID commitId = null; + + if (projectId == null) { + fail("Failed - no project is available."); + return; + } + if (commitId == null) { + fail("Failed - no commit is available."); + return; + } String pageAfter = null; String pageBefore = null; Integer pageSize = null; - List response = api.getElementsByProjectCommit(projectId, commitId, pageAfter, pageBefore, pageSize); - - // TODO: test validations + try { + List response = api.getElementsByProjectCommit(projectId, commitId, pageAfter, pageBefore, pageSize); + System.out.println("=== getElementsByProjectCommitTest() ===\n" + response.size()); + assertTrue(response.size() > 0); + Element element = response.get(0); + System.out.println(element); + assertTrue(element.getIdentifier() != null); + //elementId = element.getId(); + //System.out.println("elementId: " + elementId); + } catch (ApiException e) { + e.printStackTrace(); + fail("Failed - getElementsByProjectCommitTest. no element."); + } } + /** - * Get root elements by project and commit + * WIP - no elementId available from previous test + * Get element by project, commit and ID * * * @@ -81,15 +171,38 @@ public void getElementsByProjectCommitTest() throws ApiException { * if the Api call fails */ @Test - public void getRootsByProjectCommitTest() throws ApiException { - UUID projectId = null; - UUID commitId = null; - String pageAfter = null; - String pageBefore = null; - Integer pageSize = null; - List response = api.getRootsByProjectCommit(projectId, commitId, pageAfter, pageBefore, pageSize); - + public void getElementByProjectCommitIdTest() { + if (projectId == null) { + fail("Failed - no project available."); + return; + } + if (commitId == null) { + fail("Failed - no commit available."); + return; + } + if (elementId == null) { + fail("Failed - no element available."); + return; + } + + + try { + Element response = api.getElementByProjectCommitId(projectId, commitId, elementId); + assertTrue(response != null); + System.out.println("=== getElementByProjectCommitIdTest() ===\n" + response); + + } catch (ApiException e) { + e.printStackTrace(); + fail("Failed - no element for elementId \'"+ elementId + "\' returned."); + } + + + + // 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 1fbd8af..ef861b7 100644 --- a/src/test/java/org/omg/sysml/api/ProjectApiTest.java +++ b/src/test/java/org/omg/sysml/api/ProjectApiTest.java @@ -175,6 +175,7 @@ public void postProjectTest() { assertEquals(name, response.getName()); assertEquals(AtTypeEnum.PROJECT, response.getAtType()); } catch (ApiException e) { + e.printStackTrace(); fail("getProjectByIdTest_404 failed: not expecting ApiException"); } } diff --git a/src/test/java/org/omg/sysml/api/QueryApiTest.java b/src/test/java/org/omg/sysml/api/QueryApiTest.java index 0c633c5..5728aba 100644 --- a/src/test/java/org/omg/sysml/api/QueryApiTest.java +++ b/src/test/java/org/omg/sysml/api/QueryApiTest.java @@ -13,14 +13,22 @@ package org.omg.sysml.api; +import org.omg.sysml.ApiClient; import org.omg.sysml.ApiException; +import org.omg.sysml.Configuration; +import org.omg.sysml.model.Commit; import org.omg.sysml.model.Element; import org.omg.sysml.model.Error; +import org.omg.sysml.model.Project; import org.omg.sysml.model.Query; import java.util.UUID; import org.junit.Test; +import org.junit.BeforeClass; import org.junit.Ignore; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -29,12 +37,34 @@ /** * API tests for QueryApi */ -@Ignore public class QueryApiTest { - private final QueryApi api = new QueryApi(); + private final static ProjectApi project_api = new ProjectApi(); + private final static QueryApi api = new QueryApi(); + private static UUID projectId; + private static UUID queryId; + private static Query body; + @BeforeClass + public static void setUp() { + ApiClient apiClient = Configuration.getDefaultApiClient(); + apiClient.setBasePath("http://sysml2-sst.intercax.com:9000"); + api.setApiClient(apiClient); + project_api.setApiClient(apiClient); + + List project_response; + try { + project_response = project_api.getProjects(null, null, null); + assertTrue(project_response.size() >= 0); //no project then size = 0? + System.out.println(project_response); + projectId = project_response.get(0).getId(); + + } catch (ApiException e) { + e.printStackTrace(); + fail("Failed - no project available."); + } + } /** * Get queries by project * @@ -45,13 +75,31 @@ public class QueryApiTest { */ @Test public void getQueriesByProjectTest() throws ApiException { - UUID projectId = null; - String pageAfter = null; + + if (projectId == null) { + fail("Failed - no project available."); + return; + } + String pageAfter = null; String pageBefore = null; Integer pageSize = null; - List response = api.getQueriesByProject(projectId, pageAfter, pageBefore, pageSize); - // TODO: test validations + + try { + List response = api.getQueriesByProject(projectId, pageAfter, pageBefore, pageSize); + System.out.println("=== getQueriesByProjectTest() === " + response.size()); + assertTrue(response.size() > 0); //no query + System.out.println(response); + queryId = response.get(0).getId(); + + + } catch (ApiException e) { + e.printStackTrace(); + fail("getQueriesByProjectTest failed: not expecting ApiException"); + } + + + } /** @@ -64,14 +112,31 @@ public void getQueriesByProjectTest() throws ApiException { */ @Test public void getQueryByProjectAndIdTest() throws ApiException { - UUID projectId = null; - UUID queryId = null; - Query response = api.getQueryByProjectAndId(projectId, queryId); - - // TODO: test validations + + if (projectId == null) { + fail("Failed - no project available."); + return; + } + if (queryId == null) { + fail("Failed - no queryId available"); + } + try { + Query response = api.getQueryByProjectAndId(projectId, queryId); + System.out.println("=== getQueryByProjectAndIdTest() ===\n"); + assertTrue(response != null); + System.out.println(response); + + } catch (ApiException e) { + e.printStackTrace(); + fail("getQueriesByProjectTest failed: not expecting ApiException"); + } + } /** + * WIP - response size must be > 0? + * no element returning + * * Get query results by project and query definition * * @@ -81,15 +146,34 @@ public void getQueryByProjectAndIdTest() throws ApiException { */ @Test public void getQueryResultsByProjectIdQueryTest() throws ApiException { - UUID projectId = null; - Query body = null; - UUID commitId = null; - List response = api.getQueryResultsByProjectIdQuery(projectId, body, commitId); + + if (projectId == null) { + fail("Failed - no project available."); + return; + } + if (body == null) { + fail("Failed - no query available"); + } + try { + UUID commitId = null; + List response = api.getQueryResultsByProjectIdQuery(projectId, body, commitId); + System.out.println("=== getQueryResultsByProjectIdQueryTest() === " + response.size()); + assertTrue(response.size() > 0); //no returned element ok? + System.out.println(response); + + //Element element = response.get(0).getId() + + } catch (ApiException e) { + e.printStackTrace(); + fail("getQueryResultsByProjectIdQueryTest failed: not expecting ApiException"); + } - // TODO: test validations } /** + * WIP no queryId available for test + * WIP response size should be always > 0? + * * Get query results by project and query * * @@ -99,12 +183,27 @@ public void getQueryResultsByProjectIdQueryTest() throws ApiException { */ @Test public void getQueryResultsByProjectIdQueryIdTest() throws ApiException { - UUID projectId = null; - UUID queryId = null; - UUID commitId = null; - List response = api.getQueryResultsByProjectIdQueryId(projectId, queryId, commitId); + if (projectId == null) { + fail("Failed - no project available."); + return; + } + if (queryId == null) { + fail("Failed - no query available"); + } + try { + UUID commitId = null; + List response = api.getQueryResultsByProjectIdQueryId(projectId, queryId, commitId); + System.out.println("=== getQueryResultsByProjectIdQueryIdTest() === " + response.size()); + assertTrue(response.size() > 0); //no returned element ok? + System.out.println(response); + + //Element element = response.get(0).getId() + + } catch (ApiException e) { + e.printStackTrace(); + fail("getQueryResultsByProjectIdQueryTest failed: not expecting ApiException"); + } - // TODO: test validations } /** From 33339ea988925f58a277731d46e8a98d2b916803 Mon Sep 17 00:00:00 2001 From: Miyako Wilson Date: Wed, 30 Jun 2021 09:43:54 -0400 Subject: [PATCH 5/9] Update CommitApiTest.java getByProject success but using the commitId to getByProjectAndId fails (timeout). Post is not tested yet. --- .../java/org/omg/sysml/api/CommitApiTest.java | 99 ++++++++----------- 1 file changed, 43 insertions(+), 56 deletions(-) diff --git a/src/test/java/org/omg/sysml/api/CommitApiTest.java b/src/test/java/org/omg/sysml/api/CommitApiTest.java index 5af25f0..ea2d1b9 100644 --- a/src/test/java/org/omg/sysml/api/CommitApiTest.java +++ b/src/test/java/org/omg/sysml/api/CommitApiTest.java @@ -17,11 +17,9 @@ import org.omg.sysml.ApiException; import org.omg.sysml.Configuration; import org.omg.sysml.model.Commit; -import org.omg.sysml.model.CommitContainingProject; import org.omg.sysml.model.Element; import org.omg.sysml.model.ElementVersion; import org.omg.sysml.model.Project; -import org.omg.sysml.model.Record; import java.util.UUID; import org.junit.Test; @@ -35,6 +33,10 @@ import java.util.List; /** + * test name is prefixed with alphabet to control order + * using @FixMethodOrder(MethodSorters.NAME_ASCENDING) + * WIP - getByproject return but using the commitId to get the Commit failed + * WIP - post * API tests for CommitApi */ @FixMethodOrder(MethodSorters.NAME_ASCENDING) @@ -43,8 +45,8 @@ public class CommitApiTest { private final static CommitApi api = new CommitApi(); private final static ProjectApi projectApi = new ProjectApi(); private static UUID projectId; - //private static UUID commitId; - private static Commit commit; + private static UUID commitId; + //private static Commit commit; @BeforeClass public static void setUp() { @@ -64,22 +66,6 @@ public static void setUp() { } - /** - * Get commit by project and ID - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void getCommitByProjectAndIdTest() throws ApiException { - UUID projectId = null; - UUID commitId = null; - Commit response = api.getCommitByProjectAndId(projectId, commitId); - - // TODO: test validations - } /** * Get commits by project * @@ -88,29 +74,28 @@ public void getCommitByProjectAndIdTest() throws ApiException { * if the Api call fails */ @Test - public void get2CommitsByProjectTest() { + public void a_getCommitsByProjectTest() { - if (projectId == null) - fail("Failed - no project is available."); - else { - String pageAfter = null; - String pageBefore = null; - Integer pageSize = null; - try { - List response = api.getCommitsByProject(projectId, pageAfter, pageBefore, pageSize); - System.out.println("=== getCommitsByProjectTest() ===\n" + response); - assertTrue(response.size() > 0); - commit = response.get(0); - } catch (ApiException e) { - e.printStackTrace(); - fail("Failed - no project available to query commit."); - } + if (projectId == null) { + fail("Failed - no project available."); + return; } + + String pageAfter = null; + String pageBefore = null; + Integer pageSize = null; + try { + List response = api.getCommitsByProject(projectId, pageAfter, pageBefore, pageSize); + System.out.println("=== getCommitsByProjectTest() ===\n" + response); + assertTrue(response.size() > 0); + commitId = response.get(0).getId(); + } catch (ApiException e) { + e.printStackTrace(); + fail("Failed - no Commit returned."); + } } - - - + /** * Get commit by project and ID * @@ -120,21 +105,23 @@ public void get2CommitsByProjectTest() { * if the Api call fails */ @Test - public void get3CommitByProjectAndIdTest() { - UUID commitId; - if (projectId == null) - fail("Failed - no project is available."); - else if ((commitId = commit.getId()) == null) - fail("Failed - no commit is available."); - else { - try { - Commit response = api.getCommitByProjectAndId(projectId, commitId); - System.out.println("=== getCommitByProjectAndIdTest() ===\n" + response); - assertTrue(response != null); - } catch (ApiException e) { - e.printStackTrace(); - fail("Failed - response(Commit) is null"); - } + public void b_getCommitByProjectAndIdTest() { + + if (projectId == null) { + fail("Failed - no project available."); + return; + } + if (commitId == null) { + fail("Failed - no commitId available"); + } + + try { + Commit response = api.getCommitByProjectAndId(projectId, commitId); + System.out.println("=== b_getCommitByProjectAndIdTest() ===\n" + response); + assertTrue(response != null); + } catch (ApiException e) { + e.printStackTrace(); + fail("Failed - response(Commit) is null"); } } @@ -168,7 +155,7 @@ public void postCommitByProjectTest() { elementVersion.setId(UUID.randomUUID()); //elementVersion.setIdentity(identity); - CommitContainingProject containingProject = new CommitContainingProject(); + /*CommitContainingProject containingProject = new CommitContainingProject(); containingProject.setId(UUID.randomUUID()); body.addChangeItem(elementVersion); @@ -178,7 +165,7 @@ public void postCommitByProjectTest() { Record previousCommit = new Record(); previousCommit.setId(commit.getId()); body.setPreviousCommit(previousCommit); - + */ UUID branchId = null; try { From 7420e2daca4a755221a05bbe7a822aad94b0ca42 Mon Sep 17 00:00:00 2001 From: Miyako Wilson Date: Wed, 30 Jun 2021 09:45:24 -0400 Subject: [PATCH 6/9] WIP - element has no Id getByProject and Commit return List of elements but the element has getId method and not able to test requires elementId --- src/test/java/org/omg/sysml/api/ElementApiTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/omg/sysml/api/ElementApiTest.java b/src/test/java/org/omg/sysml/api/ElementApiTest.java index 040d952..41ec25e 100644 --- a/src/test/java/org/omg/sysml/api/ElementApiTest.java +++ b/src/test/java/org/omg/sysml/api/ElementApiTest.java @@ -35,6 +35,7 @@ import java.util.Map; /** + * wip - test returns list contains element but without Id, then no able to test API requires elementId * API tests for ElementApi */ @@ -123,7 +124,8 @@ public void getRootsByProjectCommitTest() throws ApiException { /** - * WIP - response size = 0 + * WIP - response size > 0 but Element atType = null atId = null, identifer = null + * Is this ok? * Get elements by project and commit * * From faa12f676e7c78642df5385df2306163a3231ebb Mon Sep 17 00:00:00 2001 From: Miyako Wilson Date: Wed, 30 Jun 2021 09:46:10 -0400 Subject: [PATCH 7/9] No Query object returned When the test returns List empty list returned. --- src/test/java/org/omg/sysml/api/QueryApiTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/omg/sysml/api/QueryApiTest.java b/src/test/java/org/omg/sysml/api/QueryApiTest.java index 5728aba..08a9c2f 100644 --- a/src/test/java/org/omg/sysml/api/QueryApiTest.java +++ b/src/test/java/org/omg/sysml/api/QueryApiTest.java @@ -35,6 +35,7 @@ import java.util.Map; /** + * wip - test returns list contains no Query object and no able to test API requires queryId * API tests for QueryApi */ public class QueryApiTest { @@ -154,7 +155,7 @@ public void getQueryResultsByProjectIdQueryTest() throws ApiException { if (body == null) { fail("Failed - no query available"); } - try { + try { UUID commitId = null; List response = api.getQueryResultsByProjectIdQuery(projectId, body, commitId); System.out.println("=== getQueryResultsByProjectIdQueryTest() === " + response.size()); From 90ae6e33a13db1bee16c9a21459b90464d4c249c Mon Sep 17 00:00:00 2001 From: Miyako Wilson Date: Wed, 30 Jun 2021 09:46:59 -0400 Subject: [PATCH 8/9] Post returns internal server error --- src/test/java/org/omg/sysml/api/ProjectApiTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/java/org/omg/sysml/api/ProjectApiTest.java b/src/test/java/org/omg/sysml/api/ProjectApiTest.java index ef861b7..10947c9 100644 --- a/src/test/java/org/omg/sysml/api/ProjectApiTest.java +++ b/src/test/java/org/omg/sysml/api/ProjectApiTest.java @@ -166,9 +166,9 @@ public void postProjectTest() { body.setId(id); body.setDescription(description); body.setName(name); - Project response; + try { - response = api.postProject(body); + Project response = api.postProject(body); System.out.println(response); assertEquals(id.toString(), response.getId().toString()); assertEquals(description, response.getDescription()); @@ -176,7 +176,7 @@ public void postProjectTest() { assertEquals(AtTypeEnum.PROJECT, response.getAtType()); } catch (ApiException e) { e.printStackTrace(); - fail("getProjectByIdTest_404 failed: not expecting ApiException"); + fail("postProjectTest failed: not expecting ApiException"); } } From 88bc3ea6f4860296fb9a8975101f9909eb392895 Mon Sep 17 00:00:00 2001 From: ivan-gomes Date: Thu, 14 Oct 2021 18:16:17 -0500 Subject: [PATCH 9/9] ST5AS-179 feat: regenerate for 2021-09 --- api/openapi.yaml | 538 ++++++++++++++- build.gradle | 2 +- build.sbt | 2 +- docs/Branch.md | 4 +- docs/BranchApi.md | 67 ++ docs/Commit.md | 2 +- docs/Data.md | 13 + docs/{ElementIdentity.md => DataIdentity.md} | 4 +- docs/{ElementVersion.md => DataVersion.md} | 8 +- docs/ProjectApi.md | 131 ++++ docs/Query.md | 2 +- docs/QueryApi.md | 67 ++ docs/Tag.md | 26 + docs/TagApi.md | 279 ++++++++ pom.xml | 2 +- src/main/java/org/omg/sysml/ApiClient.java | 2 +- src/main/java/org/omg/sysml/JSON.java | 9 + .../java/org/omg/sysml/api/BranchApi.java | 137 ++++ .../java/org/omg/sysml/api/ProjectApi.java | 254 +++++++ src/main/java/org/omg/sysml/api/QueryApi.java | 137 ++++ src/main/java/org/omg/sysml/api/TagApi.java | 617 ++++++++++++++++++ src/main/java/org/omg/sysml/model/Branch.java | 87 ++- src/main/java/org/omg/sysml/model/Commit.java | 14 +- src/main/java/org/omg/sysml/model/Data.java | 136 ++++ ...ElementIdentity.java => DataIdentity.java} | 18 +- .../{ElementVersion.java => DataVersion.java} | 60 +- src/main/java/org/omg/sysml/model/Query.java | 14 +- src/main/java/org/omg/sysml/model/Tag.java | 322 +++++++++ .../java/org/omg/sysml/api/BranchApiTest.java | 17 + .../java/org/omg/sysml/api/CommitApiTest.java | 167 +---- .../org/omg/sysml/api/ElementApiTest.java | 163 +---- .../org/omg/sysml/api/ProjectApiTest.java | 180 ++--- .../java/org/omg/sysml/api/QueryApiTest.java | 159 ++--- .../java/org/omg/sysml/api/TagApiTest.java | 108 +++ .../java/org/omg/sysml/model/BranchTest.java | 23 +- .../java/org/omg/sysml/model/CommitTest.java | 2 +- ...dentityTest.java => DataIdentityTest.java} | 12 +- .../java/org/omg/sysml/model/DataTest.java | 62 ++ ...tVersionTest.java => DataVersionTest.java} | 22 +- .../java/org/omg/sysml/model/QueryTest.java | 2 +- .../java/org/omg/sysml/model/TagTest.java | 103 +++ 41 files changed, 3324 insertions(+), 650 deletions(-) create mode 100644 docs/Data.md rename docs/{ElementIdentity.md => DataIdentity.md} (81%) rename docs/{ElementVersion.md => DataVersion.md} (59%) create mode 100644 docs/Tag.md create mode 100644 docs/TagApi.md create mode 100644 src/main/java/org/omg/sysml/api/TagApi.java create mode 100644 src/main/java/org/omg/sysml/model/Data.java rename src/main/java/org/omg/sysml/model/{ElementIdentity.java => DataIdentity.java} (89%) rename src/main/java/org/omg/sysml/model/{ElementVersion.java => DataVersion.java} (76%) create mode 100644 src/main/java/org/omg/sysml/model/Tag.java create mode 100644 src/test/java/org/omg/sysml/api/TagApiTest.java rename src/test/java/org/omg/sysml/model/{ElementIdentityTest.java => DataIdentityTest.java} (80%) create mode 100644 src/test/java/org/omg/sysml/model/DataTest.java rename src/test/java/org/omg/sysml/model/{ElementVersionTest.java => DataVersionTest.java} (74%) create mode 100644 src/test/java/org/omg/sysml/model/TagTest.java diff --git a/api/openapi.yaml b/api/openapi.yaml index ddf22b0..2781cac 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -8,6 +8,7 @@ servers: tags: - name: Project - name: Branch +- name: Tag - name: Commit - name: Element - name: Relationship @@ -117,6 +118,54 @@ paths: x-contentType: application/json x-accepts: application/json /projects/{projectId}: + delete: + operationId: deleteProjectById + parameters: + - description: ID of the project + in: path + name: projectId + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Project' + application/ld+json: + schema: + $ref: '#/components/schemas/Project' + description: Ok + "404": + content: {} + description: Not found. + "415": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + application/ld+json: + schema: + $ref: '#/components/schemas/Error' + description: The requested content type is not acceptable. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + application/ld+json: + schema: + $ref: '#/components/schemas/Error' + description: Internal server error. + default: + content: {} + description: Unexpected response. + summary: Delete project by ID + tags: + - Project + x-accepts: application/json get: operationId: getProjectById parameters: @@ -165,6 +214,59 @@ paths: tags: - Project x-accepts: application/json + put: + operationId: putProjectById + parameters: + - description: ID of the project + in: path + name: projectId + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Project' + required: false + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Project' + application/ld+json: + schema: + $ref: '#/components/schemas/Project' + description: Ok + "415": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + application/ld+json: + schema: + $ref: '#/components/schemas/Error' + description: The requested content type is not acceptable. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + application/ld+json: + schema: + $ref: '#/components/schemas/Error' + description: Internal server error. + default: + content: {} + description: Unexpected response. + summary: Update project by ID + tags: + - Project + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json /projects/{projectId}/branches: get: operationId: getBranchesByProject @@ -287,6 +389,61 @@ paths: x-contentType: application/json x-accepts: application/json /projects/{projectId}/branches/{branchId}: + delete: + operationId: deleteBranchByProjectAndId + parameters: + - description: ID of the project + in: path + name: projectId + required: true + schema: + format: uuid + type: string + - description: ID of the branch + in: path + name: branchId + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Branch' + application/ld+json: + schema: + $ref: '#/components/schemas/Branch' + description: Ok + "404": + content: {} + description: Not found. + "415": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + application/ld+json: + schema: + $ref: '#/components/schemas/Error' + description: The requested content type is not acceptable. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + application/ld+json: + schema: + $ref: '#/components/schemas/Error' + description: Internal server error. + default: + content: {} + description: Unexpected response. + summary: Delete branch by project and ID + tags: + - Branch + x-accepts: application/json get: operationId: getBranchesByProjectAndId parameters: @@ -342,6 +499,238 @@ paths: tags: - Branch x-accepts: application/json + /projects/{projectId}/tags: + get: + operationId: getTagsByProject + parameters: + - description: ID of the project + in: path + name: projectId + required: true + schema: + format: uuid + type: string + - description: Page after + in: query + name: page[after] + schema: + type: string + - description: Page before + in: query + name: page[before] + schema: + type: string + - description: Page size + in: query + name: page[size] + schema: + type: integer + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/Tag' + type: array + application/ld+json: + schema: + items: + $ref: '#/components/schemas/Tag' + type: array + description: Ok + "404": + content: {} + description: Not found. + "415": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + application/ld+json: + schema: + $ref: '#/components/schemas/Error' + description: The requested content type is not acceptable. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + application/ld+json: + schema: + $ref: '#/components/schemas/Error' + description: Internal server error. + default: + content: {} + description: Unexpected response. + summary: Get tags by project + tags: + - Tag + x-accepts: application/json + post: + operationId: postTagByProject + parameters: + - description: ID of the project + in: path + name: projectId + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Tag' + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/Branch' + application/ld+json: + schema: + $ref: '#/components/schemas/Branch' + description: Created + "415": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + application/ld+json: + schema: + $ref: '#/components/schemas/Error' + description: The requested content type is not acceptable. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + application/ld+json: + schema: + $ref: '#/components/schemas/Error' + description: Internal server error. + default: + content: {} + description: Unexpected response. + summary: Create tag by project + tags: + - Tag + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + /projects/{projectId}/tags/{tagId}: + delete: + operationId: deleteTagByProjectAndId + parameters: + - description: ID of the project + in: path + name: projectId + required: true + schema: + format: uuid + type: string + - description: ID of the tag + in: path + name: tagId + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Tag' + application/ld+json: + schema: + $ref: '#/components/schemas/Tag' + description: Ok + "404": + content: {} + description: Not found. + "415": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + application/ld+json: + schema: + $ref: '#/components/schemas/Error' + description: The requested content type is not acceptable. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + application/ld+json: + schema: + $ref: '#/components/schemas/Error' + description: Internal server error. + default: + content: {} + description: Unexpected response. + summary: Delete tag by project and ID + tags: + - Tag + x-accepts: application/json + get: + operationId: getTagByProjectAndId + parameters: + - description: ID of the project + in: path + name: projectId + required: true + schema: + format: uuid + type: string + - description: ID of the tag + in: path + name: tagId + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Tag' + application/ld+json: + schema: + $ref: '#/components/schemas/Tag' + description: Ok + "404": + content: {} + description: Not found. + "415": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + application/ld+json: + schema: + $ref: '#/components/schemas/Error' + description: The requested content type is not acceptable. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + application/ld+json: + schema: + $ref: '#/components/schemas/Error' + description: Internal server error. + default: + content: {} + description: Unexpected response. + summary: Get tag by project and ID + tags: + - Tag + x-accepts: application/json /projects/{projectId}/commits: get: operationId: getCommitsByProject @@ -930,6 +1319,52 @@ paths: x-contentType: application/json x-accepts: application/json /projects/{projectId}/queries/{queryId}: + delete: + operationId: deleteQueryByProjectAndId + parameters: + - description: ID of the project + in: path + name: projectId + required: true + schema: + format: uuid + type: string + - description: ID of the query + in: path + name: queryId + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Query' + description: Ok + "404": + content: {} + description: Not found. + "415": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: The requested content type is not acceptable. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal server error. + default: + content: {} + description: Unexpected response. + summary: Delete query by project and ID + tags: + - Query + x-accepts: application/json get: operationId: getQueryByProjectAndId parameters: @@ -1234,8 +1669,11 @@ components: '@type': Branch name: name '@id': 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + referencedCommit: + '@id': 046b6c7f-0b8a-43b9-b35d-6489e6daee91 owningProject: '@id': 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + timestamp: 2000-01-23T04:56:07.000+00:00 properties: '@id': format: uuid @@ -1246,31 +1684,66 @@ components: type: string head: $ref: '#/components/schemas/Branch_head' + name: + type: string owningProject: $ref: '#/components/schemas/Branch_owningProject' + referencedCommit: + $ref: '#/components/schemas/Branch_head' + timestamp: + format: date-time + type: string + type: object + Tag: + example: + '@type': Tag + taggedCommit: + '@id': 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + '@id': 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + referencedCommit: + '@id': 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + owningProject: + '@id': 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + timestamp: 2000-01-23T04:56:07.000+00:00 + properties: + '@id': + format: uuid + type: string + '@type': + enum: + - Tag + type: string name: type: string + owningProject: + $ref: '#/components/schemas/Branch_owningProject' + referencedCommit: + $ref: '#/components/schemas/Branch_head' + taggedCommit: + $ref: '#/components/schemas/Branch_head' + timestamp: + format: date-time + type: string type: object Commit: example: '@type': Commit change: - - data: - identifier: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + - payload: '@type': '@type' '@id': 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - '@type': ElementVersion + '@type': DataVersion identity: - '@type': ElementIdentity + '@type': DataIdentity '@id': 046b6c7f-0b8a-43b9-b35d-6489e6daee91 '@id': 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - - data: - identifier: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + - payload: '@type': '@type' '@id': 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - '@type': ElementVersion + '@type': DataVersion identity: - '@type': ElementIdentity + '@type': DataIdentity '@id': 046b6c7f-0b8a-43b9-b35d-6489e6daee91 '@id': 046b6c7f-0b8a-43b9-b35d-6489e6daee91 previousCommit: @@ -1288,22 +1761,21 @@ components: type: string change: items: - $ref: '#/components/schemas/ElementVersion' + $ref: '#/components/schemas/DataVersion' type: array owningProject: $ref: '#/components/schemas/Branch_owningProject' previousCommit: $ref: '#/components/schemas/Branch_head' type: object - ElementVersion: + DataVersion: example: - data: - identifier: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + payload: '@type': '@type' '@id': 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - '@type': ElementVersion + '@type': DataVersion identity: - '@type': ElementIdentity + '@type': DataIdentity '@id': 046b6c7f-0b8a-43b9-b35d-6489e6daee91 '@id': 046b6c7f-0b8a-43b9-b35d-6489e6daee91 properties: @@ -1312,16 +1784,16 @@ components: type: string '@type': enum: - - ElementVersion + - DataVersion type: string - data: - $ref: '#/components/schemas/Element' + payload: + $ref: '#/components/schemas/Data' identity: - $ref: '#/components/schemas/ElementIdentity' + $ref: '#/components/schemas/DataIdentity' type: object - ElementIdentity: + DataIdentity: example: - '@type': ElementIdentity + '@type': DataIdentity '@id': 046b6c7f-0b8a-43b9-b35d-6489e6daee91 properties: '@id': @@ -1329,9 +1801,27 @@ components: type: string '@type': enum: - - ElementIdentity + - DataIdentity type: string type: object + Data: + additionalProperties: + properties: {} + type: object + discriminator: + propertyName: '@type' + example: + '@type': '@type' + '@id': 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + properties: + '@id': + format: uuid + type: string + '@type': + type: string + required: + - '@type' + type: object Identified: example: '@id': 046b6c7f-0b8a-43b9-b35d-6489e6daee91 @@ -1394,9 +1884,9 @@ components: - select '@type': Query scope: - - '@type': ElementIdentity + - '@type': DataIdentity '@id': 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - - '@type': ElementIdentity + - '@type': DataIdentity '@id': 046b6c7f-0b8a-43b9-b35d-6489e6daee91 where: '@type': PrimitiveConstraint @@ -1415,7 +1905,7 @@ components: $ref: '#/components/schemas/Branch_owningProject' scope: items: - $ref: '#/components/schemas/ElementIdentity' + $ref: '#/components/schemas/DataIdentity' type: array select: items: diff --git a/build.gradle b/build.gradle index 52ca2df..d44280a 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,7 @@ apply plugin: 'eclipse' apply plugin: 'java' group = 'org.omg.sysml' -version = '2021-06' +version = '2021-09' buildscript { repositories { diff --git a/build.sbt b/build.sbt index 2e1da31..b128d46 100644 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,7 @@ lazy val root = (project in file(".")). settings( organization := "org.omg.sysml", name := "sysml-v2-api-client", - version := "2021-06", + version := "2021-09", scalaVersion := "2.11.4", scalacOptions ++= Seq("-feature"), javacOptions in compile ++= Seq("-Xlint:deprecation"), diff --git a/docs/Branch.md b/docs/Branch.md index f7f4fe3..442dfb7 100644 --- a/docs/Branch.md +++ b/docs/Branch.md @@ -9,8 +9,10 @@ Name | Type | Description | Notes **atId** | [**UUID**](UUID.md) | | [optional] **atType** | [**AtTypeEnum**](#AtTypeEnum) | | [optional] **head** | [**BranchHead**](BranchHead.md) | | [optional] -**owningProject** | [**BranchOwningProject**](BranchOwningProject.md) | | [optional] **name** | **String** | | [optional] +**owningProject** | [**BranchOwningProject**](BranchOwningProject.md) | | [optional] +**referencedCommit** | [**BranchHead**](BranchHead.md) | | [optional] +**timestamp** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] diff --git a/docs/BranchApi.md b/docs/BranchApi.md index acfa326..3d0e9de 100644 --- a/docs/BranchApi.md +++ b/docs/BranchApi.md @@ -4,11 +4,78 @@ All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- +[**deleteBranchByProjectAndId**](BranchApi.md#deleteBranchByProjectAndId) | **DELETE** /projects/{projectId}/branches/{branchId} | Delete branch by project and ID [**getBranchesByProject**](BranchApi.md#getBranchesByProject) | **GET** /projects/{projectId}/branches | Get branches by project [**getBranchesByProjectAndId**](BranchApi.md#getBranchesByProjectAndId) | **GET** /projects/{projectId}/branches/{branchId} | Get branch by project and ID [**postBranchByProject**](BranchApi.md#postBranchByProject) | **POST** /projects/{projectId}/branches | Create branch by project + +# **deleteBranchByProjectAndId** +> Branch deleteBranchByProjectAndId(projectId, branchId) + +Delete branch by project and ID + +### Example +```java +// 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.BranchApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + BranchApi apiInstance = new BranchApi(defaultClient); + UUID projectId = new UUID(); // UUID | ID of the project + UUID branchId = new UUID(); // UUID | ID of the branch + try { + Branch result = apiInstance.deleteBranchByProjectAndId(projectId, branchId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling BranchApi#deleteBranchByProjectAndId"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **projectId** | [**UUID**](.md)| ID of the project | + **branchId** | [**UUID**](.md)| ID of the branch | + +### Return type + +[**Branch**](Branch.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/ld+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. | - | + # **getBranchesByProject** > List<Branch> getBranchesByProject(projectId, pageAfter, pageBefore, pageSize) diff --git a/docs/Commit.md b/docs/Commit.md index 4417f05..33f1d9a 100644 --- a/docs/Commit.md +++ b/docs/Commit.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **atId** | [**UUID**](UUID.md) | | [optional] **atType** | [**AtTypeEnum**](#AtTypeEnum) | | [optional] -**change** | [**List<ElementVersion>**](ElementVersion.md) | | [optional] +**change** | [**List<DataVersion>**](DataVersion.md) | | [optional] **owningProject** | [**BranchOwningProject**](BranchOwningProject.md) | | [optional] **previousCommit** | [**BranchHead**](BranchHead.md) | | [optional] diff --git a/docs/Data.md b/docs/Data.md new file mode 100644 index 0000000..906b3e6 --- /dev/null +++ b/docs/Data.md @@ -0,0 +1,13 @@ + + +# Data + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**atId** | [**UUID**](UUID.md) | | [optional] +**atType** | **String** | | + + + diff --git a/docs/ElementIdentity.md b/docs/DataIdentity.md similarity index 81% rename from docs/ElementIdentity.md rename to docs/DataIdentity.md index ccb7be1..c150149 100644 --- a/docs/ElementIdentity.md +++ b/docs/DataIdentity.md @@ -1,6 +1,6 @@ -# ElementIdentity +# DataIdentity ## Properties @@ -15,7 +15,7 @@ Name | Type | Description | Notes Name | Value ---- | ----- -ELEMENTIDENTITY | "ElementIdentity" +DATAIDENTITY | "DataIdentity" diff --git a/docs/ElementVersion.md b/docs/DataVersion.md similarity index 59% rename from docs/ElementVersion.md rename to docs/DataVersion.md index ca3d1e5..b8fa219 100644 --- a/docs/ElementVersion.md +++ b/docs/DataVersion.md @@ -1,6 +1,6 @@ -# ElementVersion +# DataVersion ## Properties @@ -8,8 +8,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **atId** | [**UUID**](UUID.md) | | [optional] **atType** | [**AtTypeEnum**](#AtTypeEnum) | | [optional] -**data** | [**Element**](Element.md) | | [optional] -**identity** | [**ElementIdentity**](ElementIdentity.md) | | [optional] +**payload** | [**Data**](Data.md) | | [optional] +**identity** | [**DataIdentity**](DataIdentity.md) | | [optional] @@ -17,7 +17,7 @@ Name | Type | Description | Notes Name | Value ---- | ----- -ELEMENTVERSION | "ElementVersion" +DATAVERSION | "DataVersion" diff --git a/docs/ProjectApi.md b/docs/ProjectApi.md index 25e20d8..ffe0113 100644 --- a/docs/ProjectApi.md +++ b/docs/ProjectApi.md @@ -4,11 +4,77 @@ All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- +[**deleteProjectById**](ProjectApi.md#deleteProjectById) | **DELETE** /projects/{projectId} | Delete project by ID [**getProjectById**](ProjectApi.md#getProjectById) | **GET** /projects/{projectId} | Get project by ID [**getProjects**](ProjectApi.md#getProjects) | **GET** /projects | Get projects [**postProject**](ProjectApi.md#postProject) | **POST** /projects | Create project +[**putProjectById**](ProjectApi.md#putProjectById) | **PUT** /projects/{projectId} | Update project by ID + +# **deleteProjectById** +> Project deleteProjectById(projectId) + +Delete project by ID + +### Example +```java +// 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.ProjectApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + ProjectApi apiInstance = new ProjectApi(defaultClient); + UUID projectId = new UUID(); // UUID | ID of the project + try { + Project result = apiInstance.deleteProjectById(projectId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ProjectApi#deleteProjectById"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **projectId** | [**UUID**](.md)| ID of the project | + +### Return type + +[**Project**](Project.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/ld+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. | - | + # **getProjectById** > Project getProjectById(projectId) @@ -203,3 +269,68 @@ No authorization required **500** | Internal server error. | - | **0** | Unexpected response. | - | + +# **putProjectById** +> Project putProjectById(projectId, body) + +Update project by ID + +### Example +```java +// 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.ProjectApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + ProjectApi apiInstance = new ProjectApi(defaultClient); + UUID projectId = new UUID(); // UUID | ID of the project + Project body = new Project(); // Project | + try { + Project result = apiInstance.putProjectById(projectId, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ProjectApi#putProjectById"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **projectId** | [**UUID**](.md)| ID of the project | + **body** | [**Project**](Project.md)| | [optional] + +### Return type + +[**Project**](Project.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/ld+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/Query.md b/docs/Query.md index 19ad4ff..a19b102 100644 --- a/docs/Query.md +++ b/docs/Query.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **atId** | [**UUID**](UUID.md) | | [optional] **atType** | [**AtTypeEnum**](#AtTypeEnum) | | [optional] **owningProject** | [**BranchOwningProject**](BranchOwningProject.md) | | [optional] -**scope** | [**List<ElementIdentity>**](ElementIdentity.md) | | [optional] +**scope** | [**List<DataIdentity>**](DataIdentity.md) | | [optional] **select** | **List<String>** | | [optional] **where** | [**Constraint**](Constraint.md) | | [optional] diff --git a/docs/QueryApi.md b/docs/QueryApi.md index 26c252f..e40d410 100644 --- a/docs/QueryApi.md +++ b/docs/QueryApi.md @@ -4,6 +4,7 @@ All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- +[**deleteQueryByProjectAndId**](QueryApi.md#deleteQueryByProjectAndId) | **DELETE** /projects/{projectId}/queries/{queryId} | Delete query by project and ID [**getQueriesByProject**](QueryApi.md#getQueriesByProject) | **GET** /projects/{projectId}/queries | Get queries by project [**getQueryByProjectAndId**](QueryApi.md#getQueryByProjectAndId) | **GET** /projects/{projectId}/queries/{queryId} | Get query by project and ID [**getQueryResultsByProjectIdQuery**](QueryApi.md#getQueryResultsByProjectIdQuery) | **GET** /projects/{projectId}/query-results | Get query results by project and query definition @@ -12,6 +13,72 @@ Method | HTTP request | Description [**postQueryByProject**](QueryApi.md#postQueryByProject) | **POST** /projects/{projectId}/queries | Create query by project + +# **deleteQueryByProjectAndId** +> Query deleteQueryByProjectAndId(projectId, queryId) + +Delete query by project and ID + +### Example +```java +// 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.QueryApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + QueryApi apiInstance = new QueryApi(defaultClient); + UUID projectId = new UUID(); // UUID | ID of the project + UUID queryId = new UUID(); // UUID | ID of the query + try { + Query result = apiInstance.deleteQueryByProjectAndId(projectId, queryId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling QueryApi#deleteQueryByProjectAndId"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **projectId** | [**UUID**](.md)| ID of the project | + **queryId** | [**UUID**](.md)| ID of the query | + +### Return type + +[**Query**](Query.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **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. | - | + # **getQueriesByProject** > List<Query> getQueriesByProject(projectId, pageAfter, pageBefore, pageSize) diff --git a/docs/Tag.md b/docs/Tag.md new file mode 100644 index 0000000..e015082 --- /dev/null +++ b/docs/Tag.md @@ -0,0 +1,26 @@ + + +# Tag + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**atId** | [**UUID**](UUID.md) | | [optional] +**atType** | [**AtTypeEnum**](#AtTypeEnum) | | [optional] +**name** | **String** | | [optional] +**owningProject** | [**BranchOwningProject**](BranchOwningProject.md) | | [optional] +**referencedCommit** | [**BranchHead**](BranchHead.md) | | [optional] +**taggedCommit** | [**BranchHead**](BranchHead.md) | | [optional] +**timestamp** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] + + + +## Enum: AtTypeEnum + +Name | Value +---- | ----- +TAG | "Tag" + + + diff --git a/docs/TagApi.md b/docs/TagApi.md new file mode 100644 index 0000000..738b0b5 --- /dev/null +++ b/docs/TagApi.md @@ -0,0 +1,279 @@ +# TagApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteTagByProjectAndId**](TagApi.md#deleteTagByProjectAndId) | **DELETE** /projects/{projectId}/tags/{tagId} | Delete tag by project and ID +[**getTagByProjectAndId**](TagApi.md#getTagByProjectAndId) | **GET** /projects/{projectId}/tags/{tagId} | Get tag by project and ID +[**getTagsByProject**](TagApi.md#getTagsByProject) | **GET** /projects/{projectId}/tags | Get tags by project +[**postTagByProject**](TagApi.md#postTagByProject) | **POST** /projects/{projectId}/tags | Create tag by project + + + +# **deleteTagByProjectAndId** +> Tag deleteTagByProjectAndId(projectId, tagId) + +Delete tag by project and ID + +### Example +```java +// 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.TagApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + TagApi apiInstance = new TagApi(defaultClient); + UUID projectId = new UUID(); // UUID | ID of the project + UUID tagId = new UUID(); // UUID | ID of the tag + try { + Tag result = apiInstance.deleteTagByProjectAndId(projectId, tagId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TagApi#deleteTagByProjectAndId"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **projectId** | [**UUID**](.md)| ID of the project | + **tagId** | [**UUID**](.md)| ID of the tag | + +### Return type + +[**Tag**](Tag.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/ld+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. | - | + + +# **getTagByProjectAndId** +> Tag getTagByProjectAndId(projectId, tagId) + +Get tag by project and ID + +### Example +```java +// 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.TagApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + TagApi apiInstance = new TagApi(defaultClient); + UUID projectId = new UUID(); // UUID | ID of the project + UUID tagId = new UUID(); // UUID | ID of the tag + try { + Tag result = apiInstance.getTagByProjectAndId(projectId, tagId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TagApi#getTagByProjectAndId"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **projectId** | [**UUID**](.md)| ID of the project | + **tagId** | [**UUID**](.md)| ID of the tag | + +### Return type + +[**Tag**](Tag.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/ld+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. | - | + + +# **getTagsByProject** +> List<Tag> getTagsByProject(projectId, pageAfter, pageBefore, pageSize) + +Get tags by project + +### Example +```java +// 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.TagApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + TagApi apiInstance = new TagApi(defaultClient); + UUID projectId = new UUID(); // UUID | ID of the project + String pageAfter = "pageAfter_example"; // String | Page after + String pageBefore = "pageBefore_example"; // String | Page before + Integer pageSize = 56; // Integer | Page size + try { + List result = apiInstance.getTagsByProject(projectId, pageAfter, pageBefore, pageSize); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TagApi#getTagsByProject"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **projectId** | [**UUID**](.md)| ID of the project | + **pageAfter** | **String**| Page after | [optional] + **pageBefore** | **String**| Page before | [optional] + **pageSize** | **Integer**| Page size | [optional] + +### Return type + +[**List<Tag>**](Tag.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/ld+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. | - | + + +# **postTagByProject** +> Branch postTagByProject(projectId, body) + +Create tag by project + +### Example +```java +// 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.TagApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + TagApi apiInstance = new TagApi(defaultClient); + UUID projectId = new UUID(); // UUID | ID of the project + Tag body = new Tag(); // Tag | + try { + Branch result = apiInstance.postTagByProject(projectId, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TagApi#postTagByProject"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **projectId** | [**UUID**](.md)| ID of the project | + **body** | [**Tag**](Tag.md)| | + +### Return type + +[**Branch**](Branch.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/ld+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. | - | + diff --git a/pom.xml b/pom.xml index cb9009b..b62e2ec 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ sysml-v2-api-client jar sysml-v2-api-client - 2021-06 + 2021-09 https://github.com/openapitools/openapi-generator OpenAPI Java diff --git a/src/main/java/org/omg/sysml/ApiClient.java b/src/main/java/org/omg/sysml/ApiClient.java index eb5b6da..ac18355 100644 --- a/src/main/java/org/omg/sysml/ApiClient.java +++ b/src/main/java/org/omg/sysml/ApiClient.java @@ -108,7 +108,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("OpenAPI-Generator/2021-06/java"); + setUserAgent("OpenAPI-Generator/2021-09/java"); authentications = new HashMap(); } diff --git a/src/main/java/org/omg/sysml/JSON.java b/src/main/java/org/omg/sysml/JSON.java index 5d8894a..75dd951 100644 --- a/src/main/java/org/omg/sysml/JSON.java +++ b/src/main/java/org/omg/sysml/JSON.java @@ -60,6 +60,15 @@ public Class getClassForElement(JsonElement readElement) { return getClassByDiscriminator(classByDiscriminatorValue, getDiscriminatorValue(readElement, "@type")); } + }) + .registerTypeSelector(Data.class, new TypeSelector() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put("Data", Data.class); + return getClassByDiscriminator(classByDiscriminatorValue, + getDiscriminatorValue(readElement, "@type")); + } }) ; GsonBuilder builder = fireBuilder.createGsonBuilder(); diff --git a/src/main/java/org/omg/sysml/api/BranchApi.java b/src/main/java/org/omg/sysml/api/BranchApi.java index c7e678a..c2eca09 100644 --- a/src/main/java/org/omg/sysml/api/BranchApi.java +++ b/src/main/java/org/omg/sysml/api/BranchApi.java @@ -56,6 +56,143 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } + /** + * Build call for deleteBranchByProjectAndId + * @param projectId ID of the project (required) + * @param branchId ID of the branch (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
200 Ok -
404 Not found. -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
+ */ + public okhttp3.Call deleteBranchByProjectAndIdCall(UUID projectId, UUID branchId, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/projects/{projectId}/branches/{branchId}" + .replaceAll("\\{" + "projectId" + "\\}", localVarApiClient.escapeString(projectId.toString())) + .replaceAll("\\{" + "branchId" + "\\}", localVarApiClient.escapeString(branchId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + "application/json", "application/ld+json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteBranchByProjectAndIdValidateBeforeCall(UUID projectId, UUID branchId, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException("Missing the required parameter 'projectId' when calling deleteBranchByProjectAndId(Async)"); + } + + // verify the required parameter 'branchId' is set + if (branchId == null) { + throw new ApiException("Missing the required parameter 'branchId' when calling deleteBranchByProjectAndId(Async)"); + } + + + okhttp3.Call localVarCall = deleteBranchByProjectAndIdCall(projectId, branchId, _callback); + return localVarCall; + + } + + /** + * Delete branch by project and ID + * + * @param projectId ID of the project (required) + * @param branchId ID of the branch (required) + * @return Branch + * @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 Branch deleteBranchByProjectAndId(UUID projectId, UUID branchId) throws ApiException { + ApiResponse localVarResp = deleteBranchByProjectAndIdWithHttpInfo(projectId, branchId); + return localVarResp.getData(); + } + + /** + * Delete branch by project and ID + * + * @param projectId ID of the project (required) + * @param branchId ID of the branch (required) + * @return ApiResponse<Branch> + * @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 deleteBranchByProjectAndIdWithHttpInfo(UUID projectId, UUID branchId) throws ApiException { + okhttp3.Call localVarCall = deleteBranchByProjectAndIdValidateBeforeCall(projectId, branchId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete branch by project and ID (asynchronously) + * + * @param projectId ID of the project (required) + * @param branchId ID of the branch (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
200 Ok -
404 Not found. -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
+ */ + public okhttp3.Call deleteBranchByProjectAndIdAsync(UUID projectId, UUID branchId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteBranchByProjectAndIdValidateBeforeCall(projectId, branchId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for getBranchesByProject * @param projectId ID of the project (required) diff --git a/src/main/java/org/omg/sysml/api/ProjectApi.java b/src/main/java/org/omg/sysml/api/ProjectApi.java index 2a061bb..9c04a30 100644 --- a/src/main/java/org/omg/sysml/api/ProjectApi.java +++ b/src/main/java/org/omg/sysml/api/ProjectApi.java @@ -56,6 +56,133 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } + /** + * Build call for deleteProjectById + * @param projectId ID of the project (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
200 Ok -
404 Not found. -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
+ */ + public okhttp3.Call deleteProjectByIdCall(UUID projectId, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/projects/{projectId}" + .replaceAll("\\{" + "projectId" + "\\}", localVarApiClient.escapeString(projectId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + "application/json", "application/ld+json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteProjectByIdValidateBeforeCall(UUID projectId, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException("Missing the required parameter 'projectId' when calling deleteProjectById(Async)"); + } + + + okhttp3.Call localVarCall = deleteProjectByIdCall(projectId, _callback); + return localVarCall; + + } + + /** + * Delete project by ID + * + * @param projectId 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 deleteProjectById(UUID projectId) throws ApiException { + ApiResponse localVarResp = deleteProjectByIdWithHttpInfo(projectId); + return localVarResp.getData(); + } + + /** + * Delete project by ID + * + * @param projectId 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 deleteProjectByIdWithHttpInfo(UUID projectId) throws ApiException { + okhttp3.Call localVarCall = deleteProjectByIdValidateBeforeCall(projectId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete project by ID (asynchronously) + * + * @param projectId ID of the project (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
200 Ok -
404 Not found. -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
+ */ + public okhttp3.Call deleteProjectByIdAsync(UUID projectId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteProjectByIdValidateBeforeCall(projectId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for getProjectById * @param projectId ID of the project (required) @@ -437,4 +564,131 @@ public okhttp3.Call postProjectAsync(Project body, final ApiCallback _c localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for putProjectById + * @param projectId ID of the project (required) + * @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
200 Ok -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
+ */ + public okhttp3.Call putProjectByIdCall(UUID projectId, Project body, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/projects/{projectId}" + .replaceAll("\\{" + "projectId" + "\\}", localVarApiClient.escapeString(projectId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + "application/json", "application/ld+json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call putProjectByIdValidateBeforeCall(UUID projectId, Project body, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException("Missing the required parameter 'projectId' when calling putProjectById(Async)"); + } + + + okhttp3.Call localVarCall = putProjectByIdCall(projectId, body, _callback); + return localVarCall; + + } + + /** + * Update project by ID + * + * @param projectId ID of the project (required) + * @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
200 Ok -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
+ */ + public Project putProjectById(UUID projectId, Project body) throws ApiException { + ApiResponse localVarResp = putProjectByIdWithHttpInfo(projectId, body); + return localVarResp.getData(); + } + + /** + * Update project by ID + * + * @param projectId ID of the project (required) + * @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
200 Ok -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
+ */ + public ApiResponse putProjectByIdWithHttpInfo(UUID projectId, Project body) throws ApiException { + okhttp3.Call localVarCall = putProjectByIdValidateBeforeCall(projectId, body, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update project by ID (asynchronously) + * + * @param projectId ID of the project (required) + * @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
200 Ok -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
+ */ + public okhttp3.Call putProjectByIdAsync(UUID projectId, Project body, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = putProjectByIdValidateBeforeCall(projectId, body, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } } diff --git a/src/main/java/org/omg/sysml/api/QueryApi.java b/src/main/java/org/omg/sysml/api/QueryApi.java index c76ad59..eb4175d 100644 --- a/src/main/java/org/omg/sysml/api/QueryApi.java +++ b/src/main/java/org/omg/sysml/api/QueryApi.java @@ -57,6 +57,143 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } + /** + * Build call for deleteQueryByProjectAndId + * @param projectId ID of the project (required) + * @param queryId ID of the query (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
200 Ok -
404 Not found. -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
+ */ + public okhttp3.Call deleteQueryByProjectAndIdCall(UUID projectId, UUID queryId, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/projects/{projectId}/queries/{queryId}" + .replaceAll("\\{" + "projectId" + "\\}", localVarApiClient.escapeString(projectId.toString())) + .replaceAll("\\{" + "queryId" + "\\}", localVarApiClient.escapeString(queryId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteQueryByProjectAndIdValidateBeforeCall(UUID projectId, UUID queryId, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException("Missing the required parameter 'projectId' when calling deleteQueryByProjectAndId(Async)"); + } + + // verify the required parameter 'queryId' is set + if (queryId == null) { + throw new ApiException("Missing the required parameter 'queryId' when calling deleteQueryByProjectAndId(Async)"); + } + + + okhttp3.Call localVarCall = deleteQueryByProjectAndIdCall(projectId, queryId, _callback); + return localVarCall; + + } + + /** + * Delete query by project and ID + * + * @param projectId ID of the project (required) + * @param queryId ID of the query (required) + * @return Query + * @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 Query deleteQueryByProjectAndId(UUID projectId, UUID queryId) throws ApiException { + ApiResponse localVarResp = deleteQueryByProjectAndIdWithHttpInfo(projectId, queryId); + return localVarResp.getData(); + } + + /** + * Delete query by project and ID + * + * @param projectId ID of the project (required) + * @param queryId ID of the query (required) + * @return ApiResponse<Query> + * @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 deleteQueryByProjectAndIdWithHttpInfo(UUID projectId, UUID queryId) throws ApiException { + okhttp3.Call localVarCall = deleteQueryByProjectAndIdValidateBeforeCall(projectId, queryId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete query by project and ID (asynchronously) + * + * @param projectId ID of the project (required) + * @param queryId ID of the query (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
200 Ok -
404 Not found. -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
+ */ + public okhttp3.Call deleteQueryByProjectAndIdAsync(UUID projectId, UUID queryId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteQueryByProjectAndIdValidateBeforeCall(projectId, queryId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for getQueriesByProject * @param projectId ID of the project (required) diff --git a/src/main/java/org/omg/sysml/api/TagApi.java b/src/main/java/org/omg/sysml/api/TagApi.java new file mode 100644 index 0000000..a48cfbe --- /dev/null +++ b/src/main/java/org/omg/sysml/api/TagApi.java @@ -0,0 +1,617 @@ +/* + * 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.api; + +import org.omg.sysml.ApiCallback; +import org.omg.sysml.ApiClient; +import org.omg.sysml.ApiException; +import org.omg.sysml.ApiResponse; +import org.omg.sysml.Configuration; +import org.omg.sysml.Pair; +import org.omg.sysml.ProgressRequestBody; +import org.omg.sysml.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import org.omg.sysml.model.Branch; +import org.omg.sysml.model.Error; +import org.omg.sysml.model.Tag; +import java.util.UUID; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class TagApi { + private ApiClient localVarApiClient; + + public TagApi() { + this(Configuration.getDefaultApiClient()); + } + + public TagApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + /** + * Build call for deleteTagByProjectAndId + * @param projectId ID of the project (required) + * @param tagId ID of the tag (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
200 Ok -
404 Not found. -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
+ */ + public okhttp3.Call deleteTagByProjectAndIdCall(UUID projectId, UUID tagId, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/projects/{projectId}/tags/{tagId}" + .replaceAll("\\{" + "projectId" + "\\}", localVarApiClient.escapeString(projectId.toString())) + .replaceAll("\\{" + "tagId" + "\\}", localVarApiClient.escapeString(tagId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + "application/json", "application/ld+json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteTagByProjectAndIdValidateBeforeCall(UUID projectId, UUID tagId, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException("Missing the required parameter 'projectId' when calling deleteTagByProjectAndId(Async)"); + } + + // verify the required parameter 'tagId' is set + if (tagId == null) { + throw new ApiException("Missing the required parameter 'tagId' when calling deleteTagByProjectAndId(Async)"); + } + + + okhttp3.Call localVarCall = deleteTagByProjectAndIdCall(projectId, tagId, _callback); + return localVarCall; + + } + + /** + * Delete tag by project and ID + * + * @param projectId ID of the project (required) + * @param tagId ID of the tag (required) + * @return Tag + * @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 Tag deleteTagByProjectAndId(UUID projectId, UUID tagId) throws ApiException { + ApiResponse localVarResp = deleteTagByProjectAndIdWithHttpInfo(projectId, tagId); + return localVarResp.getData(); + } + + /** + * Delete tag by project and ID + * + * @param projectId ID of the project (required) + * @param tagId ID of the tag (required) + * @return ApiResponse<Tag> + * @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 deleteTagByProjectAndIdWithHttpInfo(UUID projectId, UUID tagId) throws ApiException { + okhttp3.Call localVarCall = deleteTagByProjectAndIdValidateBeforeCall(projectId, tagId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete tag by project and ID (asynchronously) + * + * @param projectId ID of the project (required) + * @param tagId ID of the tag (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
200 Ok -
404 Not found. -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
+ */ + public okhttp3.Call deleteTagByProjectAndIdAsync(UUID projectId, UUID tagId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteTagByProjectAndIdValidateBeforeCall(projectId, tagId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getTagByProjectAndId + * @param projectId ID of the project (required) + * @param tagId ID of the tag (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
200 Ok -
404 Not found. -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
+ */ + public okhttp3.Call getTagByProjectAndIdCall(UUID projectId, UUID tagId, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/projects/{projectId}/tags/{tagId}" + .replaceAll("\\{" + "projectId" + "\\}", localVarApiClient.escapeString(projectId.toString())) + .replaceAll("\\{" + "tagId" + "\\}", localVarApiClient.escapeString(tagId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + "application/json", "application/ld+json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getTagByProjectAndIdValidateBeforeCall(UUID projectId, UUID tagId, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException("Missing the required parameter 'projectId' when calling getTagByProjectAndId(Async)"); + } + + // verify the required parameter 'tagId' is set + if (tagId == null) { + throw new ApiException("Missing the required parameter 'tagId' when calling getTagByProjectAndId(Async)"); + } + + + okhttp3.Call localVarCall = getTagByProjectAndIdCall(projectId, tagId, _callback); + return localVarCall; + + } + + /** + * Get tag by project and ID + * + * @param projectId ID of the project (required) + * @param tagId ID of the tag (required) + * @return Tag + * @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 Tag getTagByProjectAndId(UUID projectId, UUID tagId) throws ApiException { + ApiResponse localVarResp = getTagByProjectAndIdWithHttpInfo(projectId, tagId); + return localVarResp.getData(); + } + + /** + * Get tag by project and ID + * + * @param projectId ID of the project (required) + * @param tagId ID of the tag (required) + * @return ApiResponse<Tag> + * @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 getTagByProjectAndIdWithHttpInfo(UUID projectId, UUID tagId) throws ApiException { + okhttp3.Call localVarCall = getTagByProjectAndIdValidateBeforeCall(projectId, tagId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get tag by project and ID (asynchronously) + * + * @param projectId ID of the project (required) + * @param tagId ID of the tag (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
200 Ok -
404 Not found. -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
+ */ + public okhttp3.Call getTagByProjectAndIdAsync(UUID projectId, UUID tagId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getTagByProjectAndIdValidateBeforeCall(projectId, tagId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getTagsByProject + * @param projectId ID of the project (required) + * @param pageAfter Page after (optional) + * @param pageBefore Page before (optional) + * @param pageSize Page size (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
200 Ok -
404 Not found. -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
+ */ + public okhttp3.Call getTagsByProjectCall(UUID projectId, String pageAfter, String pageBefore, Integer pageSize, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/projects/{projectId}/tags" + .replaceAll("\\{" + "projectId" + "\\}", localVarApiClient.escapeString(projectId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (pageAfter != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page[after]", pageAfter)); + } + + if (pageBefore != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page[before]", pageBefore)); + } + + if (pageSize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page[size]", pageSize)); + } + + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + "application/json", "application/ld+json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getTagsByProjectValidateBeforeCall(UUID projectId, String pageAfter, String pageBefore, Integer pageSize, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException("Missing the required parameter 'projectId' when calling getTagsByProject(Async)"); + } + + + okhttp3.Call localVarCall = getTagsByProjectCall(projectId, pageAfter, pageBefore, pageSize, _callback); + return localVarCall; + + } + + /** + * Get tags by project + * + * @param projectId ID of the project (required) + * @param pageAfter Page after (optional) + * @param pageBefore Page before (optional) + * @param pageSize Page size (optional) + * @return List<Tag> + * @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 List getTagsByProject(UUID projectId, String pageAfter, String pageBefore, Integer pageSize) throws ApiException { + ApiResponse> localVarResp = getTagsByProjectWithHttpInfo(projectId, pageAfter, pageBefore, pageSize); + return localVarResp.getData(); + } + + /** + * Get tags by project + * + * @param projectId ID of the project (required) + * @param pageAfter Page after (optional) + * @param pageBefore Page before (optional) + * @param pageSize Page size (optional) + * @return ApiResponse<List<Tag>> + * @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> getTagsByProjectWithHttpInfo(UUID projectId, String pageAfter, String pageBefore, Integer pageSize) throws ApiException { + okhttp3.Call localVarCall = getTagsByProjectValidateBeforeCall(projectId, pageAfter, pageBefore, pageSize, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get tags by project (asynchronously) + * + * @param projectId ID of the project (required) + * @param pageAfter Page after (optional) + * @param pageBefore Page before (optional) + * @param pageSize Page size (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
200 Ok -
404 Not found. -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -
+ */ + public okhttp3.Call getTagsByProjectAsync(UUID projectId, String pageAfter, String pageBefore, Integer pageSize, final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = getTagsByProjectValidateBeforeCall(projectId, pageAfter, pageBefore, pageSize, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for postTagByProject + * @param projectId ID of the project (required) + * @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 okhttp3.Call postTagByProjectCall(UUID projectId, Tag body, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/projects/{projectId}/tags" + .replaceAll("\\{" + "projectId" + "\\}", localVarApiClient.escapeString(projectId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + "application/json", "application/ld+json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call postTagByProjectValidateBeforeCall(UUID projectId, Tag body, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException("Missing the required parameter 'projectId' when calling postTagByProject(Async)"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException("Missing the required parameter 'body' when calling postTagByProject(Async)"); + } + + + okhttp3.Call localVarCall = postTagByProjectCall(projectId, body, _callback); + return localVarCall; + + } + + /** + * Create tag by project + * + * @param projectId ID of the project (required) + * @param body (required) + * @return Branch + * @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 Branch postTagByProject(UUID projectId, Tag body) throws ApiException { + ApiResponse localVarResp = postTagByProjectWithHttpInfo(projectId, body); + return localVarResp.getData(); + } + + /** + * Create tag by project + * + * @param projectId ID of the project (required) + * @param body (required) + * @return ApiResponse<Branch> + * @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 postTagByProjectWithHttpInfo(UUID projectId, Tag body) throws ApiException { + okhttp3.Call localVarCall = postTagByProjectValidateBeforeCall(projectId, body, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create tag by project (asynchronously) + * + * @param projectId ID of the project (required) + * @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 okhttp3.Call postTagByProjectAsync(UUID projectId, Tag body, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = postTagByProjectValidateBeforeCall(projectId, body, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/org/omg/sysml/model/Branch.java b/src/main/java/org/omg/sysml/model/Branch.java index 7bd782a..fe05447 100644 --- a/src/main/java/org/omg/sysml/model/Branch.java +++ b/src/main/java/org/omg/sysml/model/Branch.java @@ -26,6 +26,7 @@ import java.util.UUID; import org.omg.sysml.model.BranchHead; import org.omg.sysml.model.BranchOwningProject; +import org.threeten.bp.OffsetDateTime; /** * Branch @@ -89,13 +90,21 @@ public AtTypeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_HEAD) private BranchHead head; + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + public static final String SERIALIZED_NAME_OWNING_PROJECT = "owningProject"; @SerializedName(SERIALIZED_NAME_OWNING_PROJECT) private BranchOwningProject owningProject; - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; + public static final String SERIALIZED_NAME_REFERENCED_COMMIT = "referencedCommit"; + @SerializedName(SERIALIZED_NAME_REFERENCED_COMMIT) + private BranchHead referencedCommit; + + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + private OffsetDateTime timestamp; public Branch atId(UUID atId) { @@ -167,6 +176,29 @@ public void setHead(BranchHead head) { } + public Branch name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + public Branch owningProject(BranchOwningProject owningProject) { this.owningProject = owningProject; @@ -190,26 +222,49 @@ public void setOwningProject(BranchOwningProject owningProject) { } - public Branch name(String name) { + public Branch referencedCommit(BranchHead referencedCommit) { - this.name = name; + this.referencedCommit = referencedCommit; return this; } /** - * Get name - * @return name + * Get referencedCommit + * @return referencedCommit **/ @javax.annotation.Nullable @ApiModelProperty(value = "") - public String getName() { - return name; + public BranchHead getReferencedCommit() { + return referencedCommit; } - public void setName(String name) { - this.name = name; + public void setReferencedCommit(BranchHead referencedCommit) { + this.referencedCommit = referencedCommit; + } + + + public Branch timestamp(OffsetDateTime timestamp) { + + this.timestamp = timestamp; + return this; + } + + /** + * Get timestamp + * @return timestamp + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public OffsetDateTime getTimestamp() { + return timestamp; + } + + + public void setTimestamp(OffsetDateTime timestamp) { + this.timestamp = timestamp; } @@ -225,13 +280,15 @@ public boolean equals(java.lang.Object o) { return Objects.equals(this.atId, branch.atId) && Objects.equals(this.atType, branch.atType) && Objects.equals(this.head, branch.head) && + Objects.equals(this.name, branch.name) && Objects.equals(this.owningProject, branch.owningProject) && - Objects.equals(this.name, branch.name); + Objects.equals(this.referencedCommit, branch.referencedCommit) && + Objects.equals(this.timestamp, branch.timestamp); } @Override public int hashCode() { - return Objects.hash(atId, atType, head, owningProject, name); + return Objects.hash(atId, atType, head, name, owningProject, referencedCommit, timestamp); } @@ -242,8 +299,10 @@ public String toString() { sb.append(" atId: ").append(toIndentedString(atId)).append("\n"); sb.append(" atType: ").append(toIndentedString(atType)).append("\n"); sb.append(" head: ").append(toIndentedString(head)).append("\n"); - sb.append(" owningProject: ").append(toIndentedString(owningProject)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" owningProject: ").append(toIndentedString(owningProject)).append("\n"); + sb.append(" referencedCommit: ").append(toIndentedString(referencedCommit)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/org/omg/sysml/model/Commit.java b/src/main/java/org/omg/sysml/model/Commit.java index e688eb6..f3aa3f0 100644 --- a/src/main/java/org/omg/sysml/model/Commit.java +++ b/src/main/java/org/omg/sysml/model/Commit.java @@ -28,7 +28,7 @@ import java.util.UUID; import org.omg.sysml.model.BranchHead; import org.omg.sysml.model.BranchOwningProject; -import org.omg.sysml.model.ElementVersion; +import org.omg.sysml.model.DataVersion; /** * Commit @@ -90,7 +90,7 @@ public AtTypeEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_CHANGE = "change"; @SerializedName(SERIALIZED_NAME_CHANGE) - private List change = null; + private List change = null; public static final String SERIALIZED_NAME_OWNING_PROJECT = "owningProject"; @SerializedName(SERIALIZED_NAME_OWNING_PROJECT) @@ -147,15 +147,15 @@ public void setAtType(AtTypeEnum atType) { } - public Commit change(List change) { + public Commit change(List change) { this.change = change; return this; } - public Commit addChangeItem(ElementVersion changeItem) { + public Commit addChangeItem(DataVersion changeItem) { if (this.change == null) { - this.change = new ArrayList(); + this.change = new ArrayList(); } this.change.add(changeItem); return this; @@ -168,12 +168,12 @@ public Commit addChangeItem(ElementVersion changeItem) { @javax.annotation.Nullable @ApiModelProperty(value = "") - public List getChange() { + public List getChange() { return change; } - public void setChange(List change) { + public void setChange(List change) { this.change = change; } diff --git a/src/main/java/org/omg/sysml/model/Data.java b/src/main/java/org/omg/sysml/model/Data.java new file mode 100644 index 0000000..66d1748 --- /dev/null +++ b/src/main/java/org/omg/sysml/model/Data.java @@ -0,0 +1,136 @@ +/* + * 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.HashMap; +import java.util.Map; +import java.util.UUID; + +/** + * Data + */ + + +public class Data extends HashMap { + public static final String SERIALIZED_NAME_AT_ID = "@id"; + @SerializedName(SERIALIZED_NAME_AT_ID) + private UUID atId; + + public static final String SERIALIZED_NAME_AT_TYPE = "@type"; + @SerializedName(SERIALIZED_NAME_AT_TYPE) + protected String atType; + + public Data() { + this.atType = this.getClass().getSimpleName(); + } + + public Data atId(UUID atId) { + + this.atId = atId; + return this; + } + + /** + * Get atId + * @return atId + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public UUID getAtId() { + return atId; + } + + + public void setAtId(UUID atId) { + this.atId = atId; + } + + + public Data atType(String atType) { + + this.atType = atType; + return this; + } + + /** + * Get atType + * @return atType + **/ + @ApiModelProperty(required = true, value = "") + + public String getAtType() { + return atType; + } + + + public void setAtType(String atType) { + this.atType = atType; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Data data = (Data) o; + return Objects.equals(this.atId, data.atId) && + Objects.equals(this.atType, data.atType) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(atId, atType, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Data {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" atId: ").append(toIndentedString(atId)).append("\n"); + sb.append(" atType: ").append(toIndentedString(atType)).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/main/java/org/omg/sysml/model/ElementIdentity.java b/src/main/java/org/omg/sysml/model/DataIdentity.java similarity index 89% rename from src/main/java/org/omg/sysml/model/ElementIdentity.java rename to src/main/java/org/omg/sysml/model/DataIdentity.java index 90e5d53..291c911 100644 --- a/src/main/java/org/omg/sysml/model/ElementIdentity.java +++ b/src/main/java/org/omg/sysml/model/DataIdentity.java @@ -26,10 +26,10 @@ import java.util.UUID; /** - * ElementIdentity + * DataIdentity */ -public class ElementIdentity { +public class DataIdentity { public static final String SERIALIZED_NAME_AT_ID = "@id"; @SerializedName(SERIALIZED_NAME_AT_ID) private UUID atId; @@ -39,7 +39,7 @@ public class ElementIdentity { */ @JsonAdapter(AtTypeEnum.Adapter.class) public enum AtTypeEnum { - ELEMENTIDENTITY("ElementIdentity"); + DATAIDENTITY("DataIdentity"); private String value; @@ -84,7 +84,7 @@ public AtTypeEnum read(final JsonReader jsonReader) throws IOException { private AtTypeEnum atType; - public ElementIdentity atId(UUID atId) { + public DataIdentity atId(UUID atId) { this.atId = atId; return this; @@ -107,7 +107,7 @@ public void setAtId(UUID atId) { } - public ElementIdentity atType(AtTypeEnum atType) { + public DataIdentity atType(AtTypeEnum atType) { this.atType = atType; return this; @@ -138,9 +138,9 @@ public boolean equals(java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - ElementIdentity elementIdentity = (ElementIdentity) o; - return Objects.equals(this.atId, elementIdentity.atId) && - Objects.equals(this.atType, elementIdentity.atType); + DataIdentity dataIdentity = (DataIdentity) o; + return Objects.equals(this.atId, dataIdentity.atId) && + Objects.equals(this.atType, dataIdentity.atType); } @Override @@ -152,7 +152,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class ElementIdentity {\n"); + sb.append("class DataIdentity {\n"); sb.append(" atId: ").append(toIndentedString(atId)).append("\n"); sb.append(" atType: ").append(toIndentedString(atType)).append("\n"); sb.append("}"); diff --git a/src/main/java/org/omg/sysml/model/ElementVersion.java b/src/main/java/org/omg/sysml/model/DataVersion.java similarity index 76% rename from src/main/java/org/omg/sysml/model/ElementVersion.java rename to src/main/java/org/omg/sysml/model/DataVersion.java index d84fa12..584ee3b 100644 --- a/src/main/java/org/omg/sysml/model/ElementVersion.java +++ b/src/main/java/org/omg/sysml/model/DataVersion.java @@ -24,14 +24,14 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.UUID; -import org.omg.sysml.model.Element; -import org.omg.sysml.model.ElementIdentity; +import org.omg.sysml.model.Data; +import org.omg.sysml.model.DataIdentity; /** - * ElementVersion + * DataVersion */ -public class ElementVersion { +public class DataVersion { public static final String SERIALIZED_NAME_AT_ID = "@id"; @SerializedName(SERIALIZED_NAME_AT_ID) private UUID atId; @@ -41,7 +41,7 @@ public class ElementVersion { */ @JsonAdapter(AtTypeEnum.Adapter.class) public enum AtTypeEnum { - ELEMENTVERSION("ElementVersion"); + DATAVERSION("DataVersion"); private String value; @@ -85,16 +85,16 @@ public AtTypeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_AT_TYPE) private AtTypeEnum atType; - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private Element data; + public static final String SERIALIZED_NAME_PAYLOAD = "payload"; + @SerializedName(SERIALIZED_NAME_PAYLOAD) + private Data payload; public static final String SERIALIZED_NAME_IDENTITY = "identity"; @SerializedName(SERIALIZED_NAME_IDENTITY) - private ElementIdentity identity; + private DataIdentity identity; - public ElementVersion atId(UUID atId) { + public DataVersion atId(UUID atId) { this.atId = atId; return this; @@ -117,7 +117,7 @@ public void setAtId(UUID atId) { } - public ElementVersion atType(AtTypeEnum atType) { + public DataVersion atType(AtTypeEnum atType) { this.atType = atType; return this; @@ -140,30 +140,30 @@ public void setAtType(AtTypeEnum atType) { } - public ElementVersion data(Element data) { + public DataVersion payload(Data payload) { - this.data = data; + this.payload = payload; return this; } /** - * Get data - * @return data + * Get payload + * @return payload **/ @javax.annotation.Nullable @ApiModelProperty(value = "") - public Element getData() { - return data; + public Data getPayload() { + return payload; } - public void setData(Element data) { - this.data = data; + public void setPayload(Data payload) { + this.payload = payload; } - public ElementVersion identity(ElementIdentity identity) { + public DataVersion identity(DataIdentity identity) { this.identity = identity; return this; @@ -176,12 +176,12 @@ public ElementVersion identity(ElementIdentity identity) { @javax.annotation.Nullable @ApiModelProperty(value = "") - public ElementIdentity getIdentity() { + public DataIdentity getIdentity() { return identity; } - public void setIdentity(ElementIdentity identity) { + public void setIdentity(DataIdentity identity) { this.identity = identity; } @@ -194,26 +194,26 @@ public boolean equals(java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - ElementVersion elementVersion = (ElementVersion) o; - return Objects.equals(this.atId, elementVersion.atId) && - Objects.equals(this.atType, elementVersion.atType) && - Objects.equals(this.data, elementVersion.data) && - Objects.equals(this.identity, elementVersion.identity); + DataVersion dataVersion = (DataVersion) o; + return Objects.equals(this.atId, dataVersion.atId) && + Objects.equals(this.atType, dataVersion.atType) && + Objects.equals(this.payload, dataVersion.payload) && + Objects.equals(this.identity, dataVersion.identity); } @Override public int hashCode() { - return Objects.hash(atId, atType, data, identity); + return Objects.hash(atId, atType, payload, identity); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class ElementVersion {\n"); + sb.append("class DataVersion {\n"); sb.append(" atId: ").append(toIndentedString(atId)).append("\n"); sb.append(" atType: ").append(toIndentedString(atType)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" payload: ").append(toIndentedString(payload)).append("\n"); sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/src/main/java/org/omg/sysml/model/Query.java b/src/main/java/org/omg/sysml/model/Query.java index a1754c0..5e7b0a0 100644 --- a/src/main/java/org/omg/sysml/model/Query.java +++ b/src/main/java/org/omg/sysml/model/Query.java @@ -28,7 +28,7 @@ import java.util.UUID; import org.omg.sysml.model.BranchOwningProject; import org.omg.sysml.model.Constraint; -import org.omg.sysml.model.ElementIdentity; +import org.omg.sysml.model.DataIdentity; /** * Query @@ -94,7 +94,7 @@ public AtTypeEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_SCOPE = "scope"; @SerializedName(SERIALIZED_NAME_SCOPE) - private List scope = null; + private List scope = null; public static final String SERIALIZED_NAME_SELECT = "select"; @SerializedName(SERIALIZED_NAME_SELECT) @@ -174,15 +174,15 @@ public void setOwningProject(BranchOwningProject owningProject) { } - public Query scope(List scope) { + public Query scope(List scope) { this.scope = scope; return this; } - public Query addScopeItem(ElementIdentity scopeItem) { + public Query addScopeItem(DataIdentity scopeItem) { if (this.scope == null) { - this.scope = new ArrayList(); + this.scope = new ArrayList(); } this.scope.add(scopeItem); return this; @@ -195,12 +195,12 @@ public Query addScopeItem(ElementIdentity scopeItem) { @javax.annotation.Nullable @ApiModelProperty(value = "") - public List getScope() { + public List getScope() { return scope; } - public void setScope(List scope) { + public void setScope(List scope) { this.scope = scope; } diff --git a/src/main/java/org/omg/sysml/model/Tag.java b/src/main/java/org/omg/sysml/model/Tag.java new file mode 100644 index 0000000..98d1e7d --- /dev/null +++ b/src/main/java/org/omg/sysml/model/Tag.java @@ -0,0 +1,322 @@ +/* + * 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.UUID; +import org.omg.sysml.model.BranchHead; +import org.omg.sysml.model.BranchOwningProject; +import org.threeten.bp.OffsetDateTime; + +/** + * Tag + */ + +public class Tag { + public static final String SERIALIZED_NAME_AT_ID = "@id"; + @SerializedName(SERIALIZED_NAME_AT_ID) + private UUID atId; + + /** + * Gets or Sets atType + */ + @JsonAdapter(AtTypeEnum.Adapter.class) + public enum AtTypeEnum { + TAG("Tag"); + + private String value; + + AtTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AtTypeEnum fromValue(String value) { + for (AtTypeEnum b : AtTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AtTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AtTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AtTypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_AT_TYPE = "@type"; + @SerializedName(SERIALIZED_NAME_AT_TYPE) + private AtTypeEnum atType; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_OWNING_PROJECT = "owningProject"; + @SerializedName(SERIALIZED_NAME_OWNING_PROJECT) + private BranchOwningProject owningProject; + + public static final String SERIALIZED_NAME_REFERENCED_COMMIT = "referencedCommit"; + @SerializedName(SERIALIZED_NAME_REFERENCED_COMMIT) + private BranchHead referencedCommit; + + public static final String SERIALIZED_NAME_TAGGED_COMMIT = "taggedCommit"; + @SerializedName(SERIALIZED_NAME_TAGGED_COMMIT) + private BranchHead taggedCommit; + + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + private OffsetDateTime timestamp; + + + public Tag atId(UUID atId) { + + this.atId = atId; + return this; + } + + /** + * Get atId + * @return atId + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public UUID getAtId() { + return atId; + } + + + public void setAtId(UUID atId) { + this.atId = atId; + } + + + public Tag atType(AtTypeEnum atType) { + + this.atType = atType; + return this; + } + + /** + * Get atType + * @return atType + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public AtTypeEnum getAtType() { + return atType; + } + + + public void setAtType(AtTypeEnum atType) { + this.atType = atType; + } + + + public Tag name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public Tag owningProject(BranchOwningProject owningProject) { + + this.owningProject = owningProject; + return this; + } + + /** + * Get owningProject + * @return owningProject + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public BranchOwningProject getOwningProject() { + return owningProject; + } + + + public void setOwningProject(BranchOwningProject owningProject) { + this.owningProject = owningProject; + } + + + public Tag referencedCommit(BranchHead referencedCommit) { + + this.referencedCommit = referencedCommit; + return this; + } + + /** + * Get referencedCommit + * @return referencedCommit + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public BranchHead getReferencedCommit() { + return referencedCommit; + } + + + public void setReferencedCommit(BranchHead referencedCommit) { + this.referencedCommit = referencedCommit; + } + + + public Tag taggedCommit(BranchHead taggedCommit) { + + this.taggedCommit = taggedCommit; + return this; + } + + /** + * Get taggedCommit + * @return taggedCommit + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public BranchHead getTaggedCommit() { + return taggedCommit; + } + + + public void setTaggedCommit(BranchHead taggedCommit) { + this.taggedCommit = taggedCommit; + } + + + public Tag timestamp(OffsetDateTime timestamp) { + + this.timestamp = timestamp; + return this; + } + + /** + * Get timestamp + * @return timestamp + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public OffsetDateTime getTimestamp() { + return timestamp; + } + + + public void setTimestamp(OffsetDateTime timestamp) { + this.timestamp = timestamp; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Tag tag = (Tag) o; + return Objects.equals(this.atId, tag.atId) && + Objects.equals(this.atType, tag.atType) && + Objects.equals(this.name, tag.name) && + Objects.equals(this.owningProject, tag.owningProject) && + Objects.equals(this.referencedCommit, tag.referencedCommit) && + Objects.equals(this.taggedCommit, tag.taggedCommit) && + Objects.equals(this.timestamp, tag.timestamp); + } + + @Override + public int hashCode() { + return Objects.hash(atId, atType, name, owningProject, referencedCommit, taggedCommit, timestamp); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + sb.append(" atId: ").append(toIndentedString(atId)).append("\n"); + sb.append(" atType: ").append(toIndentedString(atType)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" owningProject: ").append(toIndentedString(owningProject)).append("\n"); + sb.append(" referencedCommit: ").append(toIndentedString(referencedCommit)).append("\n"); + sb.append(" taggedCommit: ").append(toIndentedString(taggedCommit)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).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/BranchApiTest.java b/src/test/java/org/omg/sysml/api/BranchApiTest.java index ded4f12..1fd548b 100644 --- a/src/test/java/org/omg/sysml/api/BranchApiTest.java +++ b/src/test/java/org/omg/sysml/api/BranchApiTest.java @@ -34,6 +34,23 @@ public class BranchApiTest { private final BranchApi api = new BranchApi(); + /** + * Delete branch by project and ID + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void deleteBranchByProjectAndIdTest() throws ApiException { + UUID projectId = null; + UUID branchId = null; + Branch response = api.deleteBranchByProjectAndId(projectId, branchId); + + // TODO: test validations + } + /** * Get branches by project * diff --git a/src/test/java/org/omg/sysml/api/CommitApiTest.java b/src/test/java/org/omg/sysml/api/CommitApiTest.java index ea2d1b9..fc64993 100644 --- a/src/test/java/org/omg/sysml/api/CommitApiTest.java +++ b/src/test/java/org/omg/sysml/api/CommitApiTest.java @@ -13,176 +13,79 @@ package org.omg.sysml.api; -import org.omg.sysml.ApiClient; import org.omg.sysml.ApiException; -import org.omg.sysml.Configuration; import org.omg.sysml.model.Commit; -import org.omg.sysml.model.Element; -import org.omg.sysml.model.ElementVersion; -import org.omg.sysml.model.Project; - +import org.omg.sysml.model.Error; import java.util.UUID; import org.junit.Test; -import org.junit.BeforeClass; -import org.junit.FixMethodOrder; -import org.junit.runners.MethodSorters; - -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import org.junit.Ignore; +import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; /** - * test name is prefixed with alphabet to control order - * using @FixMethodOrder(MethodSorters.NAME_ASCENDING) - * WIP - getByproject return but using the commitId to get the Commit failed - * WIP - post * API tests for CommitApi */ -@FixMethodOrder(MethodSorters.NAME_ASCENDING) +@Ignore public class CommitApiTest { - private final static CommitApi api = new CommitApi(); - private final static ProjectApi projectApi = new ProjectApi(); - private static UUID projectId; - private static UUID commitId; - //private static Commit commit; - - @BeforeClass - public static void setUp() { - ApiClient apiClient = Configuration.getDefaultApiClient(); - apiClient.setBasePath("http://sysml2-sst.intercax.com:9000"); - api.setApiClient(apiClient); - projectApi.setApiClient(apiClient); - - List result = null; - try { - result = projectApi.getProjects(null, null, null); - projectId = result.get(0).getId(); - } catch (ApiException e) { - e.printStackTrace(); - fail("Failed to check GET /projects/{projectId}/commits - no project is available."); - } - - } + private final CommitApi api = new CommitApi(); + /** - * Get commits by project + * Get commit by project and ID + * + * * - * Using the setup to projectId * @throws ApiException * if the Api call fails */ @Test - public void a_getCommitsByProjectTest() { - - if (projectId == null) { - fail("Failed - no project available."); - return; - } + public void getCommitByProjectAndIdTest() throws ApiException { + UUID projectId = null; + UUID commitId = null; + Commit response = api.getCommitByProjectAndId(projectId, commitId); - String pageAfter = null; - String pageBefore = null; - Integer pageSize = null; - try { - List response = api.getCommitsByProject(projectId, pageAfter, pageBefore, pageSize); - System.out.println("=== getCommitsByProjectTest() ===\n" + response); - assertTrue(response.size() > 0); - commitId = response.get(0).getId(); - } catch (ApiException e) { - e.printStackTrace(); - fail("Failed - no Commit returned."); - } - + // TODO: test validations } - + /** - * Get commit by project and ID + * Get commits by project * - * Using the previously run test get2CommitsByProjectTest to get commitId + * * * @throws ApiException * if the Api call fails */ @Test - public void b_getCommitByProjectAndIdTest() { - - if (projectId == null) { - fail("Failed - no project available."); - return; - } - if (commitId == null) { - fail("Failed - no commitId available"); - } - - try { - Commit response = api.getCommitByProjectAndId(projectId, commitId); - System.out.println("=== b_getCommitByProjectAndIdTest() ===\n" + response); - assertTrue(response != null); - } catch (ApiException e) { - e.printStackTrace(); - fail("Failed - response(Commit) is null"); - } + public void getCommitsByProjectTest() throws ApiException { + UUID projectId = null; + String pageAfter = null; + String pageBefore = null; + Integer pageSize = null; + List response = api.getCommitsByProject(projectId, pageAfter, pageBefore, pageSize); + + // TODO: test validations } - /** * Create commit by project - * Using the previously run test get2CommitsByProjectTest to get commitId + * * * * @throws ApiException * if the Api call fails */ + @Test + public void postCommitByProjectTest() throws ApiException { + UUID projectId = null; + Commit body = null; + UUID branchId = null; + Commit response = api.postCommitByProject(projectId, body, branchId); - - public void postCommitByProjectTest() { - if (projectId == null) - fail("Failed - no project is available."); - else { - Commit body = new Commit(); - body.setAtType(org.omg.sysml.model.Commit.AtTypeEnum.COMMIT); - - Element element = new Element(); - element.setAtType("Package"); - element.setAtId(UUID.randomUUID()); - - //element.setIdentifier(); - - ElementVersion elementVersion = new ElementVersion(); - elementVersion.setAtType(org.omg.sysml.model.ElementVersion.AtTypeEnum.ELEMENTVERSION); - elementVersion.setData(element); - elementVersion.setId(UUID.randomUUID()); - //elementVersion.setIdentity(identity); - - /*CommitContainingProject containingProject = new CommitContainingProject(); - containingProject.setId(UUID.randomUUID()); - - body.addChangeItem(elementVersion); - body.setContainingProject(containingProject); - body.setId(UUID.randomUUID()); - //body.setPreviousCommit(null); - Record previousCommit = new Record(); - previousCommit.setId(commit.getId()); - body.setPreviousCommit(previousCommit); - */ - UUID branchId = null; - - try { - - Commit response = api.postCommitByProject(projectId, body, branchId); - System.out.println("=== postCommitByProjectTest() ===\n" + response); - assertTrue(response != null); - } catch (ApiException e) { - System.out.println("=== ApiException: postCommitByProjectTest() ===\n"); - System.out.println(e.getCode()); - System.out.println(e.getMessage()); - e.printStackTrace(); - fail("Failed - response(Commit) is null"); - - } - - } + // TODO: test validations } } diff --git a/src/test/java/org/omg/sysml/api/ElementApiTest.java b/src/test/java/org/omg/sysml/api/ElementApiTest.java index 41ec25e..915c0cf 100644 --- a/src/test/java/org/omg/sysml/api/ElementApiTest.java +++ b/src/test/java/org/omg/sysml/api/ElementApiTest.java @@ -13,77 +13,29 @@ package org.omg.sysml.api; -import org.omg.sysml.ApiClient; import org.omg.sysml.ApiException; -import org.omg.sysml.Configuration; -import org.omg.sysml.model.Commit; import org.omg.sysml.model.Element; import org.omg.sysml.model.Error; -import org.omg.sysml.model.Project; - import java.util.UUID; import org.junit.Test; -import org.junit.BeforeClass; import org.junit.Ignore; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** - * wip - test returns list contains element but without Id, then no able to test API requires elementId * API tests for ElementApi */ - +@Ignore public class ElementApiTest { - private final static ProjectApi project_api = new ProjectApi(); - private final static CommitApi commit_api = new CommitApi(); - private final static ElementApi api = new ElementApi(); - - private static UUID projectId; - private static UUID commitId; - private static UUID elementId; + private final ElementApi api = new ElementApi(); - @BeforeClass - public static void setUp() { - ApiClient apiClient = Configuration.getDefaultApiClient(); - apiClient.setBasePath("http://sysml2-sst.intercax.com:9000"); - api.setApiClient(apiClient); - project_api.setApiClient(apiClient); - commit_api.setApiClient(apiClient); - List project_response; - try { - project_response = project_api.getProjects(null, null, null); - assertTrue(project_response.size() >= 0); //no project then size = 0? - System.out.println(project_response); - projectId = project_response.get(0).getId(); - - List commit_response = null; - try { - commit_response = commit_api.getCommitsByProject(projectId, null, null, null); - System.out.println("=== getCommitsByProjectTest() ===\n" + commit_response); - assertTrue(commit_response.size() > 0); - Commit commit = commit_response.get(0); - commitId = commit.getId(); - } catch (ApiException e) { - e.printStackTrace(); - fail("Failed - no commitId."); - } - } catch (ApiException e) { - e.printStackTrace(); - fail("Failed - no project available."); - } - } /** - * WIP - response size = 0 - * WIP Element does not have getId method - * Get root elements by project and commit + * Get element by project, commit and ID * * * @@ -91,41 +43,16 @@ public static void setUp() { * if the Api call fails */ @Test - public void getRootsByProjectCommitTest() throws ApiException { - - if (projectId == null) { - fail("Failed - no project is available."); - return; - } - if (commitId == null) { - fail("Failed - no commit is available."); - return; - } - - String pageAfter = null; - String pageBefore = null; - Integer pageSize = null; - - try { - List response = api.getRootsByProjectCommit(projectId, commitId, pageAfter, pageBefore, pageSize); - System.out.println("=== getRootsByProjectCommitTest() ===\n" + response.size()); - assertTrue(response.size() > 0); - Element element = response.get(0); - System.out.println(element); - assertTrue(element.getIdentifier() != null); - //elementId = element.getId(); - //System.out.println("elementId: " + elementId); - - } catch (ApiException e) { - e.printStackTrace(); - fail("Failed - getRootsByProjectCommitTest - no element"); - } - } + public void getElementByProjectCommitIdTest() throws ApiException { + UUID projectId = null; + UUID commitId = null; + UUID elementId = null; + Element response = api.getElementByProjectCommitId(projectId, commitId, elementId); + // TODO: test validations + } /** - * WIP - response size > 0 but Element atType = null atId = null, identifer = null - * Is this ok? * Get elements by project and commit * * @@ -135,37 +62,18 @@ public void getRootsByProjectCommitTest() throws ApiException { */ @Test public void getElementsByProjectCommitTest() throws ApiException { - - if (projectId == null) { - fail("Failed - no project is available."); - return; - } - if (commitId == null) { - fail("Failed - no commit is available."); - return; - } + UUID projectId = null; + UUID commitId = null; String pageAfter = null; String pageBefore = null; Integer pageSize = null; - try { - List response = api.getElementsByProjectCommit(projectId, commitId, pageAfter, pageBefore, pageSize); - System.out.println("=== getElementsByProjectCommitTest() ===\n" + response.size()); - assertTrue(response.size() > 0); - Element element = response.get(0); - System.out.println(element); - assertTrue(element.getIdentifier() != null); - //elementId = element.getId(); - //System.out.println("elementId: " + elementId); - } catch (ApiException e) { - e.printStackTrace(); - fail("Failed - getElementsByProjectCommitTest. no element."); - } + List response = api.getElementsByProjectCommit(projectId, commitId, pageAfter, pageBefore, pageSize); + + // TODO: test validations } - /** - * WIP - no elementId available from previous test - * Get element by project, commit and ID + * Get root elements by project and commit * * * @@ -173,38 +81,15 @@ public void getElementsByProjectCommitTest() throws ApiException { * if the Api call fails */ @Test - public void getElementByProjectCommitIdTest() { - if (projectId == null) { - fail("Failed - no project available."); - return; - } - if (commitId == null) { - fail("Failed - no commit available."); - return; - } - if (elementId == null) { - fail("Failed - no element available."); - return; - } - - - try { - Element response = api.getElementByProjectCommitId(projectId, commitId, elementId); - assertTrue(response != null); - System.out.println("=== getElementByProjectCommitIdTest() ===\n" + response); - - } catch (ApiException e) { - e.printStackTrace(); - fail("Failed - no element for elementId \'"+ elementId + "\' returned."); - } - - - - + public void getRootsByProjectCommitTest() throws ApiException { + UUID projectId = null; + UUID commitId = null; + String pageAfter = null; + String pageBefore = null; + Integer pageSize = null; + List response = api.getRootsByProjectCommit(projectId, commitId, pageAfter, pageBefore, pageSize); + // 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 10947c9..753af64 100644 --- a/src/test/java/org/omg/sysml/api/ProjectApiTest.java +++ b/src/test/java/org/omg/sysml/api/ProjectApiTest.java @@ -13,39 +13,29 @@ package org.omg.sysml.api; -import org.omg.sysml.ApiClient; import org.omg.sysml.ApiException; -import org.omg.sysml.Configuration; +import org.omg.sysml.model.Error; import org.omg.sysml.model.Project; -import org.omg.sysml.model.Project.AtTypeEnum; - import java.util.UUID; import org.junit.Test; -import org.junit.BeforeClass; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import org.junit.Ignore; +import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; /** * API tests for ProjectApi */ - +@Ignore public class ProjectApiTest { - private final static ProjectApi api = new ProjectApi(); + private final ProjectApi api = new ProjectApi(); - @BeforeClass - public static void setUp() { - ApiClient apiClient = Configuration.getDefaultApiClient(); - apiClient.setBasePath("http://sysml2-sst.intercax.com:9000"); - api.setApiClient(apiClient); - } /** - * Get projects + * Delete project by ID * * * @@ -53,152 +43,78 @@ public static void setUp() { * if the Api call fails */ @Test - public void getProjectsTest() { - - List response; - try { - response = api.getProjects(null, null, null); - assertTrue(response.size() >= 0); //no project then size = 0? - } catch (ApiException e) { - fail("getProjectsTest failed: not expecting ApiException"); - } - } - - @Test - public void getProjectsTest_0() { - - ApiClient apiClient = Configuration.getDefaultApiClient(); - apiClient.setBasePath("http://sysml2-sst.intercaxxxxxxx.com:9000"); - ProjectApi api = new ProjectApi(); - api.setApiClient(apiClient); - - try { - List response = api.getProjects(null, null, null); - fail("getProjectsTest_0 failed: expecting ApiException"); - System.out.println(response); - } - catch( ApiException e) { - assertEquals("0", Integer.toString(e.getCode())); - assertEquals("java.net.UnknownHostException: This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server (sysml2-sst.intercaxxxxxxx.com)", e.getMessage()); - } - + public void deleteProjectByIdTest() throws ApiException { + UUID projectId = null; + Project response = api.deleteProjectById(projectId); + + // TODO: test validations } /** * Get project by ID * + * + * * @throws ApiException * if the Api call fails */ @Test - public void getProjectByIdTest() { + public void getProjectByIdTest() throws ApiException { + UUID projectId = null; + Project response = api.getProjectById(projectId); - try { - List result = api.getProjects(null, null, null); - if ( result.size() > 0) { - UUID projectId = result.get(0).getId(); - Project response = api.getProjectById(projectId); - assertEquals(projectId, response.getId()); - assertEquals(projectId.toString(), response.getId().toString()); - } - else - fail("getProjectByIdTest failed: No project available to test"); - } catch (ApiException e) { - fail("getProjectByIdTest failed: not expecting ApiException"); - } + // TODO: test validations } /** - * Get project by ID when when ID is null + * Get projects + * + * * * @throws ApiException * if the Api call fails */ - @Test - public void getProjectByIdTest_0() throws ApiException { - - try { - UUID projectId = null; - api.getProjectById(projectId); - fail("getProjectByIdTest_0 failed: expecting ApiException"); //did not throw an ApiException - - } catch (ApiException e) { - assertEquals("0", Integer.toString(e.getCode())); - assertEquals("Missing the required parameter 'projectId' when calling getProjectById(Async)", e.getMessage()); - } + public void getProjectsTest() throws ApiException { + String pageAfter = null; + String pageBefore = null; + Integer pageSize = null; + List response = api.getProjects(pageAfter, pageBefore, pageSize); + + // TODO: test validations } + /** - * Get project by ID when randomly created ID (ID Not Found) + * Create project + * + * * * @throws ApiException * if the Api call fails */ @Test - public void getProjectByIdTest_404() throws ApiException { - - try { - //create uuid not likely existing in the server - UUID projectId = UUID.fromString("11345678-9012-3456-7890-123456789012"); - api.getProjectById(projectId); - fail("getProjectByIdTest_404 failed: expecting ApiException"); //did not throw an ApiException - - } catch (ApiException e) { - assertEquals("404", Integer.toString(e.getCode())); - assertEquals("Not Found", e.getMessage()); - } + public void postProjectTest() throws ApiException { + Project body = null; + Project response = api.postProject(body); + + // TODO: test validations } /** - * Create project using ramdom uuid + * Update project by ID + * + * * * @throws ApiException - * if the Api call fails + * if the Api call fails */ @Test - public void postProjectTest() { - - UUID id = UUID.randomUUID(); - String description = "desc"+ Math.random(); - String name = "name" + Math.random(); - - Project body = new Project(); - body.setId(id); - body.setDescription(description); - body.setName(name); - - try { - Project response = api.postProject(body); - System.out.println(response); - assertEquals(id.toString(), response.getId().toString()); - assertEquals(description, response.getDescription()); - assertEquals(name, response.getName()); - assertEquals(AtTypeEnum.PROJECT, response.getAtType()); - } catch (ApiException e) { - e.printStackTrace(); - fail("postProjectTest failed: not expecting ApiException"); - } + public void putProjectByIdTest() throws ApiException { + UUID projectId = null; + Project body = null; + Project response = api.putProjectById(projectId, body); + + // TODO: test validations } - //? if the UUID exist in post, the response is the same as new creation. - // and able to change its attribute ... Is this supposed to be like that? I thought return 415. - /*@Test - public void postProjectTest_415() throws ApiException { - - UUID id = UUID.fromString("90ac8d42-90bf-481d-a484-67491285a3d3"); - String description = "postProjectTestDescription"; - String name = "postProjectTestName!!!!!!!"; - - Project body = new Project(); - body.setId(id); - body.setDescription(description); - body.setName(name); - Project response = api.postProject(body); - System.out.println(response); - assertEquals(id.toString(), response.getId().toString()); - assertEquals(description, response.getDescription()); - assertEquals(name, response.getName()); - assertEquals(AtTypeEnum.PROJECT, response.getAtType()); - - }*/ } diff --git a/src/test/java/org/omg/sysml/api/QueryApiTest.java b/src/test/java/org/omg/sysml/api/QueryApiTest.java index 08a9c2f..343fc1a 100644 --- a/src/test/java/org/omg/sysml/api/QueryApiTest.java +++ b/src/test/java/org/omg/sysml/api/QueryApiTest.java @@ -13,59 +13,45 @@ package org.omg.sysml.api; -import org.omg.sysml.ApiClient; import org.omg.sysml.ApiException; -import org.omg.sysml.Configuration; -import org.omg.sysml.model.Commit; import org.omg.sysml.model.Element; import org.omg.sysml.model.Error; -import org.omg.sysml.model.Project; import org.omg.sysml.model.Query; import java.util.UUID; import org.junit.Test; -import org.junit.BeforeClass; import org.junit.Ignore; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** - * wip - test returns list contains no Query object and no able to test API requires queryId * API tests for QueryApi */ +@Ignore public class QueryApiTest { - private final static ProjectApi project_api = new ProjectApi(); - private final static QueryApi api = new QueryApi(); + private final QueryApi api = new QueryApi(); - private static UUID projectId; - private static UUID queryId; - private static Query body; - @BeforeClass - public static void setUp() { - ApiClient apiClient = Configuration.getDefaultApiClient(); - apiClient.setBasePath("http://sysml2-sst.intercax.com:9000"); - api.setApiClient(apiClient); - project_api.setApiClient(apiClient); - - List project_response; - try { - project_response = project_api.getProjects(null, null, null); - assertTrue(project_response.size() >= 0); //no project then size = 0? - System.out.println(project_response); - projectId = project_response.get(0).getId(); - - } catch (ApiException e) { - e.printStackTrace(); - fail("Failed - no project available."); - } - } + /** + * Delete query by project and ID + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void deleteQueryByProjectAndIdTest() throws ApiException { + UUID projectId = null; + UUID queryId = null; + Query response = api.deleteQueryByProjectAndId(projectId, queryId); + + // TODO: test validations + } + /** * Get queries by project * @@ -76,31 +62,13 @@ public static void setUp() { */ @Test public void getQueriesByProjectTest() throws ApiException { - - if (projectId == null) { - fail("Failed - no project available."); - return; - } - String pageAfter = null; + UUID projectId = null; + String pageAfter = null; String pageBefore = null; Integer pageSize = null; + List response = api.getQueriesByProject(projectId, pageAfter, pageBefore, pageSize); - - try { - List response = api.getQueriesByProject(projectId, pageAfter, pageBefore, pageSize); - System.out.println("=== getQueriesByProjectTest() === " + response.size()); - assertTrue(response.size() > 0); //no query - System.out.println(response); - queryId = response.get(0).getId(); - - - } catch (ApiException e) { - e.printStackTrace(); - fail("getQueriesByProjectTest failed: not expecting ApiException"); - } - - - + // TODO: test validations } /** @@ -113,31 +81,14 @@ public void getQueriesByProjectTest() throws ApiException { */ @Test public void getQueryByProjectAndIdTest() throws ApiException { - - if (projectId == null) { - fail("Failed - no project available."); - return; - } - if (queryId == null) { - fail("Failed - no queryId available"); - } - try { - Query response = api.getQueryByProjectAndId(projectId, queryId); - System.out.println("=== getQueryByProjectAndIdTest() ===\n"); - assertTrue(response != null); - System.out.println(response); - - } catch (ApiException e) { - e.printStackTrace(); - fail("getQueriesByProjectTest failed: not expecting ApiException"); - } - + UUID projectId = null; + UUID queryId = null; + Query response = api.getQueryByProjectAndId(projectId, queryId); + + // TODO: test validations } /** - * WIP - response size must be > 0? - * no element returning - * * Get query results by project and query definition * * @@ -147,34 +98,15 @@ public void getQueryByProjectAndIdTest() throws ApiException { */ @Test public void getQueryResultsByProjectIdQueryTest() throws ApiException { - - if (projectId == null) { - fail("Failed - no project available."); - return; - } - if (body == null) { - fail("Failed - no query available"); - } - try { - UUID commitId = null; - List response = api.getQueryResultsByProjectIdQuery(projectId, body, commitId); - System.out.println("=== getQueryResultsByProjectIdQueryTest() === " + response.size()); - assertTrue(response.size() > 0); //no returned element ok? - System.out.println(response); - - //Element element = response.get(0).getId() - - } catch (ApiException e) { - e.printStackTrace(); - fail("getQueryResultsByProjectIdQueryTest failed: not expecting ApiException"); - } + UUID projectId = null; + Query body = null; + UUID commitId = null; + List response = api.getQueryResultsByProjectIdQuery(projectId, body, commitId); + // TODO: test validations } /** - * WIP no queryId available for test - * WIP response size should be always > 0? - * * Get query results by project and query * * @@ -184,27 +116,12 @@ public void getQueryResultsByProjectIdQueryTest() throws ApiException { */ @Test public void getQueryResultsByProjectIdQueryIdTest() throws ApiException { - if (projectId == null) { - fail("Failed - no project available."); - return; - } - if (queryId == null) { - fail("Failed - no query available"); - } - try { - UUID commitId = null; - List response = api.getQueryResultsByProjectIdQueryId(projectId, queryId, commitId); - System.out.println("=== getQueryResultsByProjectIdQueryIdTest() === " + response.size()); - assertTrue(response.size() > 0); //no returned element ok? - System.out.println(response); - - //Element element = response.get(0).getId() - - } catch (ApiException e) { - e.printStackTrace(); - fail("getQueryResultsByProjectIdQueryTest failed: not expecting ApiException"); - } + UUID projectId = null; + UUID queryId = null; + UUID commitId = null; + List response = api.getQueryResultsByProjectIdQueryId(projectId, queryId, commitId); + // TODO: test validations } /** diff --git a/src/test/java/org/omg/sysml/api/TagApiTest.java b/src/test/java/org/omg/sysml/api/TagApiTest.java new file mode 100644 index 0000000..d2e7f96 --- /dev/null +++ b/src/test/java/org/omg/sysml/api/TagApiTest.java @@ -0,0 +1,108 @@ +/* + * 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.api; + +import org.omg.sysml.ApiException; +import org.omg.sysml.model.Branch; +import org.omg.sysml.model.Error; +import org.omg.sysml.model.Tag; +import java.util.UUID; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for TagApi + */ +@Ignore +public class TagApiTest { + + private final TagApi api = new TagApi(); + + + /** + * Delete tag by project and ID + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void deleteTagByProjectAndIdTest() throws ApiException { + UUID projectId = null; + UUID tagId = null; + Tag response = api.deleteTagByProjectAndId(projectId, tagId); + + // TODO: test validations + } + + /** + * Get tag by project and ID + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getTagByProjectAndIdTest() throws ApiException { + UUID projectId = null; + UUID tagId = null; + Tag response = api.getTagByProjectAndId(projectId, tagId); + + // TODO: test validations + } + + /** + * Get tags by project + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getTagsByProjectTest() throws ApiException { + UUID projectId = null; + String pageAfter = null; + String pageBefore = null; + Integer pageSize = null; + List response = api.getTagsByProject(projectId, pageAfter, pageBefore, pageSize); + + // TODO: test validations + } + + /** + * Create tag by project + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void postTagByProjectTest() throws ApiException { + UUID projectId = null; + Tag body = null; + Branch response = api.postTagByProject(projectId, body); + + // TODO: test validations + } + +} diff --git a/src/test/java/org/omg/sysml/model/BranchTest.java b/src/test/java/org/omg/sysml/model/BranchTest.java index 035d194..390aa53 100644 --- a/src/test/java/org/omg/sysml/model/BranchTest.java +++ b/src/test/java/org/omg/sysml/model/BranchTest.java @@ -24,6 +24,7 @@ import java.util.UUID; import org.omg.sysml.model.BranchHead; import org.omg.sysml.model.BranchOwningProject; +import org.threeten.bp.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; @@ -67,6 +68,14 @@ public void headTest() { // TODO: test head } + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + /** * Test the property 'owningProject' */ @@ -76,11 +85,19 @@ public void owningProjectTest() { } /** - * Test the property 'name' + * Test the property 'referencedCommit' */ @Test - public void nameTest() { - // TODO: test name + public void referencedCommitTest() { + // TODO: test referencedCommit + } + + /** + * Test the property 'timestamp' + */ + @Test + public void timestampTest() { + // TODO: test timestamp } } diff --git a/src/test/java/org/omg/sysml/model/CommitTest.java b/src/test/java/org/omg/sysml/model/CommitTest.java index 2e243bd..c17298f 100644 --- a/src/test/java/org/omg/sysml/model/CommitTest.java +++ b/src/test/java/org/omg/sysml/model/CommitTest.java @@ -26,7 +26,7 @@ import java.util.UUID; import org.omg.sysml.model.BranchHead; import org.omg.sysml.model.BranchOwningProject; -import org.omg.sysml.model.ElementVersion; +import org.omg.sysml.model.DataVersion; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/src/test/java/org/omg/sysml/model/ElementIdentityTest.java b/src/test/java/org/omg/sysml/model/DataIdentityTest.java similarity index 80% rename from src/test/java/org/omg/sysml/model/ElementIdentityTest.java rename to src/test/java/org/omg/sysml/model/DataIdentityTest.java index 6553801..f8297d8 100644 --- a/src/test/java/org/omg/sysml/model/ElementIdentityTest.java +++ b/src/test/java/org/omg/sysml/model/DataIdentityTest.java @@ -28,17 +28,17 @@ /** - * Model tests for ElementIdentity + * Model tests for DataIdentity */ -public class ElementIdentityTest { - private final ElementIdentity model = new ElementIdentity(); +public class DataIdentityTest { + private final DataIdentity model = new DataIdentity(); /** - * Model tests for ElementIdentity + * Model tests for DataIdentity */ @Test - public void testElementIdentity() { - // TODO: test ElementIdentity + public void testDataIdentity() { + // TODO: test DataIdentity } /** diff --git a/src/test/java/org/omg/sysml/model/DataTest.java b/src/test/java/org/omg/sysml/model/DataTest.java new file mode 100644 index 0000000..309797b --- /dev/null +++ b/src/test/java/org/omg/sysml/model/DataTest.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.HashMap; +import java.util.Map; +import java.util.UUID; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Data + */ +public class DataTest { + private final Data model = new Data(); + + /** + * Model tests for Data + */ + @Test + public void testData() { + // TODO: test Data + } + + /** + * Test the property 'atId' + */ + @Test + public void atIdTest() { + // TODO: test atId + } + + /** + * Test the property 'atType' + */ + @Test + public void atTypeTest() { + // TODO: test atType + } + +} diff --git a/src/test/java/org/omg/sysml/model/ElementVersionTest.java b/src/test/java/org/omg/sysml/model/DataVersionTest.java similarity index 74% rename from src/test/java/org/omg/sysml/model/ElementVersionTest.java rename to src/test/java/org/omg/sysml/model/DataVersionTest.java index 1662ab1..57a18ca 100644 --- a/src/test/java/org/omg/sysml/model/ElementVersionTest.java +++ b/src/test/java/org/omg/sysml/model/DataVersionTest.java @@ -22,25 +22,25 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.UUID; -import org.omg.sysml.model.Element; -import org.omg.sysml.model.ElementIdentity; +import org.omg.sysml.model.Data; +import org.omg.sysml.model.DataIdentity; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; /** - * Model tests for ElementVersion + * Model tests for DataVersion */ -public class ElementVersionTest { - private final ElementVersion model = new ElementVersion(); +public class DataVersionTest { + private final DataVersion model = new DataVersion(); /** - * Model tests for ElementVersion + * Model tests for DataVersion */ @Test - public void testElementVersion() { - // TODO: test ElementVersion + public void testDataVersion() { + // TODO: test DataVersion } /** @@ -60,11 +60,11 @@ public void atTypeTest() { } /** - * Test the property 'data' + * Test the property 'payload' */ @Test - public void dataTest() { - // TODO: test data + public void payloadTest() { + // TODO: test payload } /** diff --git a/src/test/java/org/omg/sysml/model/QueryTest.java b/src/test/java/org/omg/sysml/model/QueryTest.java index 0b9207c..d8ad879 100644 --- a/src/test/java/org/omg/sysml/model/QueryTest.java +++ b/src/test/java/org/omg/sysml/model/QueryTest.java @@ -26,7 +26,7 @@ import java.util.UUID; import org.omg.sysml.model.BranchOwningProject; import org.omg.sysml.model.Constraint; -import org.omg.sysml.model.ElementIdentity; +import org.omg.sysml.model.DataIdentity; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/src/test/java/org/omg/sysml/model/TagTest.java b/src/test/java/org/omg/sysml/model/TagTest.java new file mode 100644 index 0000000..1d0cba1 --- /dev/null +++ b/src/test/java/org/omg/sysml/model/TagTest.java @@ -0,0 +1,103 @@ +/* + * 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.omg.sysml.model.BranchHead; +import org.omg.sysml.model.BranchOwningProject; +import org.threeten.bp.OffsetDateTime; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Tag + */ +public class TagTest { + private final Tag model = new Tag(); + + /** + * Model tests for Tag + */ + @Test + public void testTag() { + // TODO: test Tag + } + + /** + * Test the property 'atId' + */ + @Test + public void atIdTest() { + // TODO: test atId + } + + /** + * 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 'owningProject' + */ + @Test + public void owningProjectTest() { + // TODO: test owningProject + } + + /** + * Test the property 'referencedCommit' + */ + @Test + public void referencedCommitTest() { + // TODO: test referencedCommit + } + + /** + * Test the property 'taggedCommit' + */ + @Test + public void taggedCommitTest() { + // TODO: test taggedCommit + } + + /** + * Test the property 'timestamp' + */ + @Test + public void timestampTest() { + // TODO: test timestamp + } + +}