Skip to content

Commit 344f546

Browse files
committed
Merge branch 'release/2020-05-rc1'
2 parents 2cdf4f4 + 2590943 commit 344f546

19 files changed

+271
-32
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ REST/HTTP binding (PSM) for the SysML v2 standard API.
44
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
55

66
- API version: 1.0.0
7-
- Package version: 2020-03-p1
7+
- Package version: 2020-05-rc1
88
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
99

1010
## Requirements.
@@ -82,6 +82,7 @@ Class | Method | HTTP request | Description
8282
*CommitApi* | [**post_commit_by_project**](docs/CommitApi.md#post_commit_by_project) | **POST** /projects/{projectId}/commits | Create commit by project
8383
*ElementApi* | [**get_element_by_project_commit_id**](docs/ElementApi.md#get_element_by_project_commit_id) | **GET** /projects/{projectId}/commits/{commitId}/elements/{elementId} | Get element by project, commit and ID
8484
*ElementApi* | [**get_elements_by_project_commit**](docs/ElementApi.md#get_elements_by_project_commit) | **GET** /projects/{projectId}/commits/{commitId}/elements | Get elements by project and commit
85+
*ElementApi* | [**get_roots_by_project_commit**](docs/ElementApi.md#get_roots_by_project_commit) | **GET** /projects/{projectId}/commits/{commitId}/roots | Get root elements by project and commit
8586
*ProjectApi* | [**get_project_by_id**](docs/ProjectApi.md#get_project_by_id) | **GET** /projects/{projectId} | Get project by ID
8687
*ProjectApi* | [**get_projects**](docs/ProjectApi.md#get_projects) | **GET** /projects | Get projects
8788
*ProjectApi* | [**post_project**](docs/ProjectApi.md#post_project) | **POST** /projects | Create project

docs/Element.md

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
66
**type** | **str** | | [optional]
7+
**id** | **str** | | [optional]
78
**identifier** | **str** | | [optional]
89

910
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

docs/ElementApi.md

+63-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Method | HTTP request | Description
66
------------- | ------------- | -------------
77
[**get_element_by_project_commit_id**](ElementApi.md#get_element_by_project_commit_id) | **GET** /projects/{projectId}/commits/{commitId}/elements/{elementId} | Get element by project, commit and ID
88
[**get_elements_by_project_commit**](ElementApi.md#get_elements_by_project_commit) | **GET** /projects/{projectId}/commits/{commitId}/elements | Get elements by project and commit
9+
[**get_roots_by_project_commit**](ElementApi.md#get_roots_by_project_commit) | **GET** /projects/{projectId}/commits/{commitId}/roots | Get root elements by project and commit
910

1011

1112
# **get_element_by_project_commit_id**
@@ -57,7 +58,7 @@ No authorization required
5758
### HTTP request headers
5859

5960
- **Content-Type**: Not defined
60-
- **Accept**: application/json
61+
- **Accept**: application/ld+json, application/json
6162

6263
### HTTP response details
6364
| Status code | Description | Response headers |
@@ -117,7 +118,67 @@ No authorization required
117118
### HTTP request headers
118119

119120
- **Content-Type**: Not defined
120-
- **Accept**: application/json
121+
- **Accept**: application/ld+json, application/json
122+
123+
### HTTP response details
124+
| Status code | Description | Response headers |
125+
|-------------|-------------|------------------|
126+
**200** | Ok | - |
127+
**404** | Not found. | - |
128+
**415** | The requested content type is not acceptable. | - |
129+
**500** | Internal server error. | - |
130+
**0** | Unexpected response. | - |
131+
132+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
133+
134+
# **get_roots_by_project_commit**
135+
> list[Element] get_roots_by_project_commit(project_id, commit_id)
136+
137+
Get root elements by project and commit
138+
139+
### Example
140+
141+
```python
142+
from __future__ import print_function
143+
import time
144+
import sysml_v2_api_client
145+
from sysml_v2_api_client.rest import ApiException
146+
from pprint import pprint
147+
148+
# Enter a context with an instance of the API client
149+
with sysml_v2_api_client.ApiClient() as api_client:
150+
# Create an instance of the API class
151+
api_instance = sysml_v2_api_client.ElementApi(api_client)
152+
project_id = 'project_id_example' # str | ID of the project
153+
commit_id = 'commit_id_example' # str | ID of the commit
154+
155+
try:
156+
# Get root elements by project and commit
157+
api_response = api_instance.get_roots_by_project_commit(project_id, commit_id)
158+
pprint(api_response)
159+
except ApiException as e:
160+
print("Exception when calling ElementApi->get_roots_by_project_commit: %s\n" % e)
161+
```
162+
163+
### Parameters
164+
165+
Name | Type | Description | Notes
166+
------------- | ------------- | ------------- | -------------
167+
**project_id** | [**str**](.md)| ID of the project |
168+
**commit_id** | [**str**](.md)| ID of the commit |
169+
170+
### Return type
171+
172+
[**list[Element]**](Element.md)
173+
174+
### Authorization
175+
176+
No authorization required
177+
178+
### HTTP request headers
179+
180+
- **Content-Type**: Not defined
181+
- **Accept**: application/ld+json, application/json
121182

122183
### HTTP response details
123184
| Status code | Description | Response headers |

docs/Identified.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Properties
44
Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
6-
**identifier** | **str** | | [optional]
6+
**id** | **str** | | [optional]
77

88
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
99

docs/Relationship.md

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
66
**type** | **str** | | [optional]
7+
**id** | **str** | | [optional]
78
**identifier** | **str** | | [optional]
89
**source** | [**list[Identified]**](Identified.md) | | [optional]
910
**target** | [**list[Identified]**](Identified.md) | | [optional]

docs/RelationshipApi.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ No authorization required
5656
### HTTP request headers
5757

5858
- **Content-Type**: Not defined
59-
- **Accept**: application/json
59+
- **Accept**: application/ld+json, application/json
6060

6161
### HTTP response details
6262
| Status code | Description | Response headers |

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from setuptools import setup, find_packages # noqa: H301
1414

1515
NAME = "sysml-v2-api-client"
16-
VERSION = "2020-03-p1"
16+
VERSION = "2020-05-rc1"
1717
# To install the library, run the following
1818
#
1919
# python setup.py install

sysml_v2_api_client/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
from __future__ import absolute_import
1616

17-
__version__ = "2020-03-p1"
17+
__version__ = "2020-05-rc1"
1818

1919
# import apis into sdk package
2020
from sysml_v2_api_client.api.commit_api import CommitApi

sysml_v2_api_client/api/element_api.py

+116-2
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def get_element_by_project_commit_id_with_http_info(self, project_id, commit_id,
137137
body_params = None
138138
# HTTP header `Accept`
139139
header_params['Accept'] = self.api_client.select_header_accept(
140-
['application/json']) # noqa: E501
140+
['application/ld+json', 'application/json']) # noqa: E501
141141

142142
# Authentication setting
143143
auth_settings = [] # noqa: E501
@@ -251,7 +251,7 @@ def get_elements_by_project_commit_with_http_info(self, project_id, commit_id, *
251251
body_params = None
252252
# HTTP header `Accept`
253253
header_params['Accept'] = self.api_client.select_header_accept(
254-
['application/json']) # noqa: E501
254+
['application/ld+json', 'application/json']) # noqa: E501
255255

256256
# Authentication setting
257257
auth_settings = [] # noqa: E501
@@ -271,3 +271,117 @@ def get_elements_by_project_commit_with_http_info(self, project_id, commit_id, *
271271
_preload_content=local_var_params.get('_preload_content', True),
272272
_request_timeout=local_var_params.get('_request_timeout'),
273273
collection_formats=collection_formats)
274+
275+
def get_roots_by_project_commit(self, project_id, commit_id, **kwargs): # noqa: E501
276+
"""Get root elements by project and commit # noqa: E501
277+
278+
This method makes a synchronous HTTP request by default. To make an
279+
asynchronous HTTP request, please pass async_req=True
280+
>>> thread = api.get_roots_by_project_commit(project_id, commit_id, async_req=True)
281+
>>> result = thread.get()
282+
283+
:param async_req bool: execute request asynchronously
284+
:param str project_id: ID of the project (required)
285+
:param str commit_id: ID of the commit (required)
286+
:param _preload_content: if False, the urllib3.HTTPResponse object will
287+
be returned without reading/decoding response
288+
data. Default is True.
289+
:param _request_timeout: timeout setting for this request. If one
290+
number provided, it will be total request
291+
timeout. It can also be a pair (tuple) of
292+
(connection, read) timeouts.
293+
:return: list[Element]
294+
If the method is called asynchronously,
295+
returns the request thread.
296+
"""
297+
kwargs['_return_http_data_only'] = True
298+
return self.get_roots_by_project_commit_with_http_info(project_id, commit_id, **kwargs) # noqa: E501
299+
300+
def get_roots_by_project_commit_with_http_info(self, project_id, commit_id, **kwargs): # noqa: E501
301+
"""Get root elements by project and commit # noqa: E501
302+
303+
This method makes a synchronous HTTP request by default. To make an
304+
asynchronous HTTP request, please pass async_req=True
305+
>>> thread = api.get_roots_by_project_commit_with_http_info(project_id, commit_id, async_req=True)
306+
>>> result = thread.get()
307+
308+
:param async_req bool: execute request asynchronously
309+
:param str project_id: ID of the project (required)
310+
:param str commit_id: ID of the commit (required)
311+
:param _return_http_data_only: response data without head status code
312+
and headers
313+
:param _preload_content: if False, the urllib3.HTTPResponse object will
314+
be returned without reading/decoding response
315+
data. Default is True.
316+
:param _request_timeout: timeout setting for this request. If one
317+
number provided, it will be total request
318+
timeout. It can also be a pair (tuple) of
319+
(connection, read) timeouts.
320+
:return: tuple(list[Element], status_code(int), headers(HTTPHeaderDict))
321+
If the method is called asynchronously,
322+
returns the request thread.
323+
"""
324+
325+
local_var_params = locals()
326+
327+
all_params = ['project_id', 'commit_id'] # noqa: E501
328+
all_params.append('async_req')
329+
all_params.append('_return_http_data_only')
330+
all_params.append('_preload_content')
331+
all_params.append('_request_timeout')
332+
333+
for key, val in six.iteritems(local_var_params['kwargs']):
334+
if key not in all_params:
335+
raise ApiTypeError(
336+
"Got an unexpected keyword argument '%s'"
337+
" to method get_roots_by_project_commit" % key
338+
)
339+
local_var_params[key] = val
340+
del local_var_params['kwargs']
341+
# verify the required parameter 'project_id' is set
342+
if self.api_client.client_side_validation and ('project_id' not in local_var_params or # noqa: E501
343+
local_var_params['project_id'] is None): # noqa: E501
344+
raise ApiValueError("Missing the required parameter `project_id` when calling `get_roots_by_project_commit`") # noqa: E501
345+
# verify the required parameter 'commit_id' is set
346+
if self.api_client.client_side_validation and ('commit_id' not in local_var_params or # noqa: E501
347+
local_var_params['commit_id'] is None): # noqa: E501
348+
raise ApiValueError("Missing the required parameter `commit_id` when calling `get_roots_by_project_commit`") # noqa: E501
349+
350+
collection_formats = {}
351+
352+
path_params = {}
353+
if 'project_id' in local_var_params:
354+
path_params['projectId'] = local_var_params['project_id'] # noqa: E501
355+
if 'commit_id' in local_var_params:
356+
path_params['commitId'] = local_var_params['commit_id'] # noqa: E501
357+
358+
query_params = []
359+
360+
header_params = {}
361+
362+
form_params = []
363+
local_var_files = {}
364+
365+
body_params = None
366+
# HTTP header `Accept`
367+
header_params['Accept'] = self.api_client.select_header_accept(
368+
['application/ld+json', 'application/json']) # noqa: E501
369+
370+
# Authentication setting
371+
auth_settings = [] # noqa: E501
372+
373+
return self.api_client.call_api(
374+
'/projects/{projectId}/commits/{commitId}/roots', 'GET',
375+
path_params,
376+
query_params,
377+
header_params,
378+
body=body_params,
379+
post_params=form_params,
380+
files=local_var_files,
381+
response_type='list[Element]', # noqa: E501
382+
auth_settings=auth_settings,
383+
async_req=local_var_params.get('async_req'),
384+
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
385+
_preload_content=local_var_params.get('_preload_content', True),
386+
_request_timeout=local_var_params.get('_request_timeout'),
387+
collection_formats=collection_formats)

sysml_v2_api_client/api/relationship_api.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def get_relationships_by_project_commit_related_element_with_http_info(self, pro
137137
body_params = None
138138
# HTTP header `Accept`
139139
header_params['Accept'] = self.api_client.select_header_accept(
140-
['application/json']) # noqa: E501
140+
['application/ld+json', 'application/json']) # noqa: E501
141141

142142
# Authentication setting
143143
auth_settings = [] # noqa: E501

sysml_v2_api_client/api_client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None,
7878
self.default_headers[header_name] = header_value
7979
self.cookie = cookie
8080
# Set default User-Agent.
81-
self.user_agent = 'OpenAPI-Generator/2020-03-p1/python'
81+
self.user_agent = 'OpenAPI-Generator/2020-05-rc1/python'
8282
self.client_side_validation = configuration.client_side_validation
8383

8484
def __enter__(self):

sysml_v2_api_client/configuration.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ def to_debug_report(self):
329329
"OS: {env}\n"\
330330
"Python Version: {pyversion}\n"\
331331
"Version of the API: 1.0.0\n"\
332-
"SDK Package Version: 2020-03-p1".\
332+
"SDK Package Version: 2020-05-rc1".\
333333
format(env=sys.platform, pyversion=sys.version)
334334

335335
def get_host_settings(self):

sysml_v2_api_client/models/element.py

+27-1
Original file line numberDiff line numberDiff line change
@@ -34,26 +34,31 @@ class Element(object):
3434
"""
3535
openapi_types = {
3636
'type': 'str',
37+
'id': 'str',
3738
'identifier': 'str'
3839
}
3940

4041
attribute_map = {
4142
'type': '@type',
43+
'id': '@id',
4244
'identifier': 'identifier'
4345
}
4446

45-
def __init__(self, type=None, identifier=None, local_vars_configuration=None): # noqa: E501
47+
def __init__(self, type=None, id=None, identifier=None, local_vars_configuration=None): # noqa: E501
4648
"""Element - a model defined in OpenAPI""" # noqa: E501
4749
if local_vars_configuration is None:
4850
local_vars_configuration = Configuration()
4951
self.local_vars_configuration = local_vars_configuration
5052

5153
self._type = None
54+
self._id = None
5255
self._identifier = None
5356
self.discriminator = None
5457

5558
if type is not None:
5659
self.type = type
60+
if id is not None:
61+
self.id = id
5762
if identifier is not None:
5863
self.identifier = identifier
5964

@@ -78,6 +83,27 @@ def type(self, type):
7883

7984
self._type = type
8085

86+
@property
87+
def id(self):
88+
"""Gets the id of this Element. # noqa: E501
89+
90+
91+
:return: The id of this Element. # noqa: E501
92+
:rtype: str
93+
"""
94+
return self._id
95+
96+
@id.setter
97+
def id(self, id):
98+
"""Sets the id of this Element.
99+
100+
101+
:param id: The id of this Element. # noqa: E501
102+
:type: str
103+
"""
104+
105+
self._id = id
106+
81107
@property
82108
def identifier(self):
83109
"""Gets the identifier of this Element. # noqa: E501

0 commit comments

Comments
 (0)