Skip to content

Commit

Permalink
Merge branch 'release/2020-05-rc1'
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-gomes committed May 28, 2020
2 parents 2cdf4f4 + 2590943 commit 344f546
Show file tree
Hide file tree
Showing 19 changed files with 271 additions and 32 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ REST/HTTP binding (PSM) for the SysML v2 standard API.
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 1.0.0
- Package version: 2020-03-p1
- Package version: 2020-05-rc1
- Build package: org.openapitools.codegen.languages.PythonClientCodegen

## Requirements.
Expand Down Expand Up @@ -82,6 +82,7 @@ Class | Method | HTTP request | Description
*CommitApi* | [**post_commit_by_project**](docs/CommitApi.md#post_commit_by_project) | **POST** /projects/{projectId}/commits | Create commit by project
*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
*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
*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
*ProjectApi* | [**get_project_by_id**](docs/ProjectApi.md#get_project_by_id) | **GET** /projects/{projectId} | Get project by ID
*ProjectApi* | [**get_projects**](docs/ProjectApi.md#get_projects) | **GET** /projects | Get projects
*ProjectApi* | [**post_project**](docs/ProjectApi.md#post_project) | **POST** /projects | Create project
Expand Down
1 change: 1 addition & 0 deletions docs/Element.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**type** | **str** | | [optional]
**id** | **str** | | [optional]
**identifier** | **str** | | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
Expand Down
65 changes: 63 additions & 2 deletions docs/ElementApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Method | HTTP request | Description
------------- | ------------- | -------------
[**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
[**get_elements_by_project_commit**](ElementApi.md#get_elements_by_project_commit) | **GET** /projects/{projectId}/commits/{commitId}/elements | Get elements by project and commit
[**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


# **get_element_by_project_commit_id**
Expand Down Expand Up @@ -57,7 +58,7 @@ No authorization required
### HTTP request headers

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

### HTTP response details
| Status code | Description | Response headers |
Expand Down Expand Up @@ -117,7 +118,67 @@ No authorization required
### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json
- **Accept**: application/ld+json, 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. | - |

[[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)

# **get_roots_by_project_commit**
> list[Element] get_roots_by_project_commit(project_id, commit_id)
Get root elements by project and commit

### Example

```python
from __future__ import print_function
import time
import sysml_v2_api_client
from sysml_v2_api_client.rest import ApiException
from pprint import pprint

# Enter a context with an instance of the API client
with sysml_v2_api_client.ApiClient() as api_client:
# Create an instance of the API class
api_instance = sysml_v2_api_client.ElementApi(api_client)
project_id = 'project_id_example' # str | ID of the project
commit_id = 'commit_id_example' # str | ID of the commit

try:
# Get root elements by project and commit
api_response = api_instance.get_roots_by_project_commit(project_id, commit_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling ElementApi->get_roots_by_project_commit: %s\n" % e)
```

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**project_id** | [**str**](.md)| ID of the project |
**commit_id** | [**str**](.md)| ID of the commit |

### Return type

[**list[Element]**](Element.md)

### Authorization

No authorization required

### HTTP request headers

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

### HTTP response details
| Status code | Description | Response headers |
Expand Down
2 changes: 1 addition & 1 deletion docs/Identified.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**identifier** | **str** | | [optional]
**id** | **str** | | [optional]

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

Expand Down
1 change: 1 addition & 0 deletions docs/Relationship.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**type** | **str** | | [optional]
**id** | **str** | | [optional]
**identifier** | **str** | | [optional]
**source** | [**list[Identified]**](Identified.md) | | [optional]
**target** | [**list[Identified]**](Identified.md) | | [optional]
Expand Down
2 changes: 1 addition & 1 deletion docs/RelationshipApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ No authorization required
### HTTP request headers

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

### HTTP response details
| Status code | Description | Response headers |
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from setuptools import setup, find_packages # noqa: H301

NAME = "sysml-v2-api-client"
VERSION = "2020-03-p1"
VERSION = "2020-05-rc1"
# To install the library, run the following
#
# python setup.py install
Expand Down
2 changes: 1 addition & 1 deletion sysml_v2_api_client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from __future__ import absolute_import

__version__ = "2020-03-p1"
__version__ = "2020-05-rc1"

# import apis into sdk package
from sysml_v2_api_client.api.commit_api import CommitApi
Expand Down
118 changes: 116 additions & 2 deletions sysml_v2_api_client/api/element_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def get_element_by_project_commit_id_with_http_info(self, project_id, commit_id,
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
['application/ld+json', 'application/json']) # noqa: E501

# Authentication setting
auth_settings = [] # noqa: E501
Expand Down Expand Up @@ -251,7 +251,7 @@ def get_elements_by_project_commit_with_http_info(self, project_id, commit_id, *
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
['application/ld+json', 'application/json']) # noqa: E501

# Authentication setting
auth_settings = [] # noqa: E501
Expand All @@ -271,3 +271,117 @@ def get_elements_by_project_commit_with_http_info(self, project_id, commit_id, *
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
collection_formats=collection_formats)

def get_roots_by_project_commit(self, project_id, commit_id, **kwargs): # noqa: E501
"""Get root elements by project and commit # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_roots_by_project_commit(project_id, commit_id, async_req=True)
>>> result = thread.get()
:param async_req bool: execute request asynchronously
:param str project_id: ID of the project (required)
:param str commit_id: ID of the commit (required)
:param _preload_content: if False, the urllib3.HTTPResponse object will
be returned without reading/decoding response
data. Default is True.
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:return: list[Element]
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
return self.get_roots_by_project_commit_with_http_info(project_id, commit_id, **kwargs) # noqa: E501

def get_roots_by_project_commit_with_http_info(self, project_id, commit_id, **kwargs): # noqa: E501
"""Get root elements by project and commit # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_roots_by_project_commit_with_http_info(project_id, commit_id, async_req=True)
>>> result = thread.get()
:param async_req bool: execute request asynchronously
:param str project_id: ID of the project (required)
:param str commit_id: ID of the commit (required)
:param _return_http_data_only: response data without head status code
and headers
:param _preload_content: if False, the urllib3.HTTPResponse object will
be returned without reading/decoding response
data. Default is True.
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:return: tuple(list[Element], status_code(int), headers(HTTPHeaderDict))
If the method is called asynchronously,
returns the request thread.
"""

local_var_params = locals()

all_params = ['project_id', 'commit_id'] # noqa: E501
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')

for key, val in six.iteritems(local_var_params['kwargs']):
if key not in all_params:
raise ApiTypeError(
"Got an unexpected keyword argument '%s'"
" to method get_roots_by_project_commit" % key
)
local_var_params[key] = val
del local_var_params['kwargs']
# verify the required parameter 'project_id' is set
if self.api_client.client_side_validation and ('project_id' not in local_var_params or # noqa: E501
local_var_params['project_id'] is None): # noqa: E501
raise ApiValueError("Missing the required parameter `project_id` when calling `get_roots_by_project_commit`") # noqa: E501
# verify the required parameter 'commit_id' is set
if self.api_client.client_side_validation and ('commit_id' not in local_var_params or # noqa: E501
local_var_params['commit_id'] is None): # noqa: E501
raise ApiValueError("Missing the required parameter `commit_id` when calling `get_roots_by_project_commit`") # noqa: E501

collection_formats = {}

path_params = {}
if 'project_id' in local_var_params:
path_params['projectId'] = local_var_params['project_id'] # noqa: E501
if 'commit_id' in local_var_params:
path_params['commitId'] = local_var_params['commit_id'] # noqa: E501

query_params = []

header_params = {}

form_params = []
local_var_files = {}

body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/ld+json', 'application/json']) # noqa: E501

# Authentication setting
auth_settings = [] # noqa: E501

return self.api_client.call_api(
'/projects/{projectId}/commits/{commitId}/roots', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='list[Element]', # noqa: E501
auth_settings=auth_settings,
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
collection_formats=collection_formats)
2 changes: 1 addition & 1 deletion sysml_v2_api_client/api/relationship_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def get_relationships_by_project_commit_related_element_with_http_info(self, pro
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
['application/ld+json', 'application/json']) # noqa: E501

# Authentication setting
auth_settings = [] # noqa: E501
Expand Down
2 changes: 1 addition & 1 deletion sysml_v2_api_client/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None,
self.default_headers[header_name] = header_value
self.cookie = cookie
# Set default User-Agent.
self.user_agent = 'OpenAPI-Generator/2020-03-p1/python'
self.user_agent = 'OpenAPI-Generator/2020-05-rc1/python'
self.client_side_validation = configuration.client_side_validation

def __enter__(self):
Expand Down
2 changes: 1 addition & 1 deletion sysml_v2_api_client/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ def to_debug_report(self):
"OS: {env}\n"\
"Python Version: {pyversion}\n"\
"Version of the API: 1.0.0\n"\
"SDK Package Version: 2020-03-p1".\
"SDK Package Version: 2020-05-rc1".\
format(env=sys.platform, pyversion=sys.version)

def get_host_settings(self):
Expand Down
28 changes: 27 additions & 1 deletion sysml_v2_api_client/models/element.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,26 +34,31 @@ class Element(object):
"""
openapi_types = {
'type': 'str',
'id': 'str',
'identifier': 'str'
}

attribute_map = {
'type': '@type',
'id': '@id',
'identifier': 'identifier'
}

def __init__(self, type=None, identifier=None, local_vars_configuration=None): # noqa: E501
def __init__(self, type=None, id=None, identifier=None, local_vars_configuration=None): # noqa: E501
"""Element - a model defined in OpenAPI""" # noqa: E501
if local_vars_configuration is None:
local_vars_configuration = Configuration()
self.local_vars_configuration = local_vars_configuration

self._type = None
self._id = None
self._identifier = None
self.discriminator = None

if type is not None:
self.type = type
if id is not None:
self.id = id
if identifier is not None:
self.identifier = identifier

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

self._type = type

@property
def id(self):
"""Gets the id of this Element. # noqa: E501
:return: The id of this Element. # noqa: E501
:rtype: str
"""
return self._id

@id.setter
def id(self, id):
"""Sets the id of this Element.
:param id: The id of this Element. # noqa: E501
:type: str
"""

self._id = id

@property
def identifier(self):
"""Gets the identifier of this Element. # noqa: E501
Expand Down
Loading

0 comments on commit 344f546

Please sign in to comment.