diff --git a/README.md b/README.md index abafb1d..ad7fbce 100644 --- a/README.md +++ b/README.md @@ -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: 2021-03 +- Package version: 2021-04 - Build package: org.openapitools.codegen.languages.PythonClientCodegen ## Requirements. @@ -63,16 +63,18 @@ configuration = sysml_v2_api_client.Configuration( # Enter a context with an instance of the API client with sysml_v2_api_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = sysml_v2_api_client.CommitApi(api_client) + api_instance = sysml_v2_api_client.BranchApi(api_client) project_id = 'project_id_example' # str | ID of the project -commit_id = 'commit_id_example' # str | ID of the commit +page_after = 'page_after_example' # str | Page after (optional) +page_before = 'page_before_example' # str | Page before (optional) +page_size = 56 # int | Page size (optional) try: - # Get commit by project and ID - api_response = api_instance.get_commit_by_project_and_id(project_id, commit_id) + # Get branches by project + api_response = api_instance.get_branches_by_project(project_id, page_after=page_after, page_before=page_before, page_size=page_size) pprint(api_response) except ApiException as e: - print("Exception when calling CommitApi->get_commit_by_project_and_id: %s\n" % e) + print("Exception when calling BranchApi->get_branches_by_project: %s\n" % e) ``` @@ -82,9 +84,11 @@ All URIs are relative to *http://localhost* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*BranchApi* | [**get_branches_by_project**](docs/BranchApi.md#get_branches_by_project) | **GET** /projects/{projectId}/branches | Get branches by project +*BranchApi* | [**get_branches_by_project_and_id**](docs/BranchApi.md#get_branches_by_project_and_id) | **GET** /projects/{projectId}/branches/{branchId} | Get branch by project and ID +*BranchApi* | [**post_branch_by_project**](docs/BranchApi.md#post_branch_by_project) | **POST** /projects/{projectId}/branches | Create branch by project *CommitApi* | [**get_commit_by_project_and_id**](docs/CommitApi.md#get_commit_by_project_and_id) | **GET** /projects/{projectId}/commits/{commitId} | Get commit by project and ID *CommitApi* | [**get_commits_by_project**](docs/CommitApi.md#get_commits_by_project) | **GET** /projects/{projectId}/commits | Get commits by project -*CommitApi* | [**get_head_commit_by_project**](docs/CommitApi.md#get_head_commit_by_project) | **GET** /projects/{projectId}/head | Get head commit by project *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 @@ -103,8 +107,10 @@ Class | Method | HTTP request | Description ## Documentation For Models + - [Branch](docs/Branch.md) + - [BranchHead](docs/BranchHead.md) + - [BranchOwningProject](docs/BranchOwningProject.md) - [Commit](docs/Commit.md) - - [CommitContainingProject](docs/CommitContainingProject.md) - [CompositeConstraint](docs/CompositeConstraint.md) - [Constraint](docs/Constraint.md) - [Element](docs/Element.md) @@ -115,7 +121,6 @@ Class | Method | HTTP request | Description - [PrimitiveConstraint](docs/PrimitiveConstraint.md) - [Project](docs/Project.md) - [Query](docs/Query.md) - - [Record](docs/Record.md) - [Relationship](docs/Relationship.md) diff --git a/docs/Branch.md b/docs/Branch.md new file mode 100644 index 0000000..0d0b916 --- /dev/null +++ b/docs/Branch.md @@ -0,0 +1,14 @@ +# Branch + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | | [optional] +**head** | [**BranchHead**](BranchHead.md) | | [optional] +**owning_project** | [**BranchOwningProject**](BranchOwningProject.md) | | [optional] +**id** | **str** | | [optional] +**name** | **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) + + diff --git a/docs/BranchApi.md b/docs/BranchApi.md new file mode 100644 index 0000000..f8d5ec9 --- /dev/null +++ b/docs/BranchApi.md @@ -0,0 +1,212 @@ +# sysml_v2_api_client.BranchApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_branches_by_project**](BranchApi.md#get_branches_by_project) | **GET** /projects/{projectId}/branches | Get branches by project +[**get_branches_by_project_and_id**](BranchApi.md#get_branches_by_project_and_id) | **GET** /projects/{projectId}/branches/{branchId} | Get branch by project and ID +[**post_branch_by_project**](BranchApi.md#post_branch_by_project) | **POST** /projects/{projectId}/branches | Create branch by project + + +# **get_branches_by_project** +> list[Branch] get_branches_by_project(project_id, page_after=page_after, page_before=page_before, page_size=page_size) + +Get branches by project + +### 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 +# Defining the host is optional and defaults to http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = sysml_v2_api_client.Configuration( + host = "http://localhost" +) + + +# 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.BranchApi(api_client) + project_id = 'project_id_example' # str | ID of the project +page_after = 'page_after_example' # str | Page after (optional) +page_before = 'page_before_example' # str | Page before (optional) +page_size = 56 # int | Page size (optional) + + try: + # Get branches by project + api_response = api_instance.get_branches_by_project(project_id, page_after=page_after, page_before=page_before, page_size=page_size) + pprint(api_response) + except ApiException as e: + print("Exception when calling BranchApi->get_branches_by_project: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_id** | [**str**](.md)| ID of the project | + **page_after** | **str**| Page after | [optional] + **page_before** | **str**| Page before | [optional] + **page_size** | **int**| Page size | [optional] + +### Return type + +[**list[Branch]**](Branch.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. | - | + +[[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_branches_by_project_and_id** +> Branch get_branches_by_project_and_id(project_id, branch_id) + +Get branch by project and ID + +### 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 +# Defining the host is optional and defaults to http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = sysml_v2_api_client.Configuration( + host = "http://localhost" +) + + +# 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.BranchApi(api_client) + project_id = 'project_id_example' # str | ID of the project +branch_id = 'branch_id_example' # str | ID of the branch + + try: + # Get branch by project and ID + api_response = api_instance.get_branches_by_project_and_id(project_id, branch_id) + pprint(api_response) + except ApiException as e: + print("Exception when calling BranchApi->get_branches_by_project_and_id: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_id** | [**str**](.md)| ID of the project | + **branch_id** | [**str**](.md)| ID of the branch | + +### Return type + +[**Branch**](Branch.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. | - | + +[[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) + +# **post_branch_by_project** +> Branch post_branch_by_project(project_id, body) + +Create branch by project + +### 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 +# Defining the host is optional and defaults to http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = sysml_v2_api_client.Configuration( + host = "http://localhost" +) + + +# 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.BranchApi(api_client) + project_id = 'project_id_example' # str | ID of the project +body = sysml_v2_api_client.Branch() # Branch | + + try: + # Create branch by project + api_response = api_instance.post_branch_by_project(project_id, body) + pprint(api_response) + except ApiException as e: + print("Exception when calling BranchApi->post_branch_by_project: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_id** | [**str**](.md)| ID of the project | + **body** | [**Branch**](Branch.md)| | + +### Return type + +[**Branch**](Branch.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | - | +**415** | The requested content type is not acceptable. | - | +**500** | Internal server error. | - | +**0** | Unexpected response. | - | + +[[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) + diff --git a/docs/Record.md b/docs/BranchHead.md similarity index 93% rename from docs/Record.md rename to docs/BranchHead.md index 7e9dcbb..1fdbcd0 100644 --- a/docs/Record.md +++ b/docs/BranchHead.md @@ -1,5 +1,6 @@ -# Record +# BranchHead +Commit ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- diff --git a/docs/CommitContainingProject.md b/docs/BranchOwningProject.md similarity index 91% rename from docs/CommitContainingProject.md rename to docs/BranchOwningProject.md index d4823b6..d39cfff 100644 --- a/docs/CommitContainingProject.md +++ b/docs/BranchOwningProject.md @@ -1,5 +1,6 @@ -# CommitContainingProject +# BranchOwningProject +Project ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- diff --git a/docs/Commit.md b/docs/Commit.md index 7dc2fef..ea4c01e 100644 --- a/docs/Commit.md +++ b/docs/Commit.md @@ -5,9 +5,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | **str** | | [optional] **change** | [**list[ElementVersion]**](ElementVersion.md) | | [optional] -**containing_project** | [**CommitContainingProject**](CommitContainingProject.md) | | [optional] +**owning_project** | [**BranchOwningProject**](BranchOwningProject.md) | | [optional] **id** | **str** | | [optional] -**previous_commit** | [**Record**](Record.md) | | [optional] +**previous_commit** | [**BranchHead**](BranchHead.md) | | [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) diff --git a/docs/CommitApi.md b/docs/CommitApi.md index 63b6686..337a67f 100644 --- a/docs/CommitApi.md +++ b/docs/CommitApi.md @@ -6,7 +6,6 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**get_commit_by_project_and_id**](CommitApi.md#get_commit_by_project_and_id) | **GET** /projects/{projectId}/commits/{commitId} | Get commit by project and ID [**get_commits_by_project**](CommitApi.md#get_commits_by_project) | **GET** /projects/{projectId}/commits | Get commits by project -[**get_head_commit_by_project**](CommitApi.md#get_head_commit_by_project) | **GET** /projects/{projectId}/head | Get head commit by project [**post_commit_by_project**](CommitApi.md#post_commit_by_project) | **POST** /projects/{projectId}/commits | Create commit by project @@ -146,72 +145,8 @@ No authorization required [[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_head_commit_by_project** -> Commit get_head_commit_by_project(project_id) - -Get head commit by project - -### 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 -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = sysml_v2_api_client.Configuration( - host = "http://localhost" -) - - -# 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.CommitApi(api_client) - project_id = 'project_id_example' # str | ID of the project - - try: - # Get head commit by project - api_response = api_instance.get_head_commit_by_project(project_id) - pprint(api_response) - except ApiException as e: - print("Exception when calling CommitApi->get_head_commit_by_project: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **project_id** | [**str**](.md)| ID of the project | - -### Return type - -[**Commit**](Commit.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. | - | - -[[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) - # **post_commit_by_project** -> Commit post_commit_by_project(project_id, body) +> Commit post_commit_by_project(project_id, body, branch_id=branch_id) Create commit by project @@ -236,10 +171,11 @@ with sysml_v2_api_client.ApiClient() as api_client: api_instance = sysml_v2_api_client.CommitApi(api_client) project_id = 'project_id_example' # str | ID of the project body = sysml_v2_api_client.Commit() # Commit | +branch_id = 'branch_id_example' # str | ID of the branch - project's default branch if unspecified (optional) try: # Create commit by project - api_response = api_instance.post_commit_by_project(project_id, body) + api_response = api_instance.post_commit_by_project(project_id, body, branch_id=branch_id) pprint(api_response) except ApiException as e: print("Exception when calling CommitApi->post_commit_by_project: %s\n" % e) @@ -251,6 +187,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **project_id** | [**str**](.md)| ID of the project | **body** | [**Commit**](Commit.md)| | + **branch_id** | [**str**](.md)| ID of the branch - project's default branch if unspecified | [optional] ### Return type diff --git a/docs/Query.md b/docs/Query.md index 1932941..c80be76 100644 --- a/docs/Query.md +++ b/docs/Query.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | **str** | | [optional] -**containing_project** | [**CommitContainingProject**](CommitContainingProject.md) | | [optional] +**owning_project** | [**BranchOwningProject**](BranchOwningProject.md) | | [optional] **id** | **str** | | [optional] **scope** | [**list[ElementIdentity]**](ElementIdentity.md) | | [optional] **select** | **list[str]** | | [optional] diff --git a/setup.py b/setup.py index 2f5fe94..09d96f7 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ from setuptools import setup, find_packages # noqa: H301 NAME = "sysml-v2-api-client" -VERSION = "2021-03" +VERSION = "2021-04" # To install the library, run the following # # python setup.py install diff --git a/sysml_v2_api_client/__init__.py b/sysml_v2_api_client/__init__.py index 4f377a3..3c739d4 100644 --- a/sysml_v2_api_client/__init__.py +++ b/sysml_v2_api_client/__init__.py @@ -14,9 +14,10 @@ from __future__ import absolute_import -__version__ = "2021-03" +__version__ = "2021-04" # import apis into sdk package +from sysml_v2_api_client.api.branch_api import BranchApi from sysml_v2_api_client.api.commit_api import CommitApi from sysml_v2_api_client.api.element_api import ElementApi from sysml_v2_api_client.api.project_api import ProjectApi @@ -32,8 +33,10 @@ from sysml_v2_api_client.exceptions import ApiKeyError from sysml_v2_api_client.exceptions import ApiException # import models into sdk package +from sysml_v2_api_client.models.branch import Branch +from sysml_v2_api_client.models.branch_head import BranchHead +from sysml_v2_api_client.models.branch_owning_project import BranchOwningProject from sysml_v2_api_client.models.commit import Commit -from sysml_v2_api_client.models.commit_containing_project import CommitContainingProject from sysml_v2_api_client.models.composite_constraint import CompositeConstraint from sysml_v2_api_client.models.constraint import Constraint from sysml_v2_api_client.models.element import Element @@ -44,6 +47,5 @@ from sysml_v2_api_client.models.primitive_constraint import PrimitiveConstraint from sysml_v2_api_client.models.project import Project from sysml_v2_api_client.models.query import Query -from sysml_v2_api_client.models.record import Record from sysml_v2_api_client.models.relationship import Relationship diff --git a/sysml_v2_api_client/api/__init__.py b/sysml_v2_api_client/api/__init__.py index 79291df..1e2fc18 100644 --- a/sysml_v2_api_client/api/__init__.py +++ b/sysml_v2_api_client/api/__init__.py @@ -3,6 +3,7 @@ # flake8: noqa # import apis into api package +from sysml_v2_api_client.api.branch_api import BranchApi from sysml_v2_api_client.api.commit_api import CommitApi from sysml_v2_api_client.api.element_api import ElementApi from sysml_v2_api_client.api.project_api import ProjectApi diff --git a/sysml_v2_api_client/api/branch_api.py b/sysml_v2_api_client/api/branch_api.py new file mode 100644 index 0000000..83a2667 --- /dev/null +++ b/sysml_v2_api_client/api/branch_api.py @@ -0,0 +1,410 @@ +# coding: utf-8 + +""" + SysML v2 API and Services + + REST/HTTP binding (PSM) for the SysML v2 standard API. # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from sysml_v2_api_client.api_client import ApiClient +from sysml_v2_api_client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class BranchApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_branches_by_project(self, project_id, **kwargs): # noqa: E501 + """Get branches by project # 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_branches_by_project(project_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 page_after: Page after + :param str page_before: Page before + :param int page_size: Page size + :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[Branch] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_branches_by_project_with_http_info(project_id, **kwargs) # noqa: E501 + + def get_branches_by_project_with_http_info(self, project_id, **kwargs): # noqa: E501 + """Get branches by project # 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_branches_by_project_with_http_info(project_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 page_after: Page after + :param str page_before: Page before + :param int page_size: Page size + :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[Branch], status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'project_id', + 'page_after', + 'page_before', + 'page_size' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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_branches_by_project" % 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_branches_by_project`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in local_var_params: + path_params['projectId'] = local_var_params['project_id'] # noqa: E501 + + query_params = [] + if 'page_after' in local_var_params and local_var_params['page_after'] is not None: # noqa: E501 + query_params.append(('page[after]', local_var_params['page_after'])) # noqa: E501 + if 'page_before' in local_var_params and local_var_params['page_before'] is not None: # noqa: E501 + query_params.append(('page[before]', local_var_params['page_before'])) # noqa: E501 + if 'page_size' in local_var_params and local_var_params['page_size'] is not None: # noqa: E501 + query_params.append(('page[size]', local_var_params['page_size'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/projects/{projectId}/branches', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Branch]', # 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) + + def get_branches_by_project_and_id(self, project_id, branch_id, **kwargs): # noqa: E501 + """Get branch by project and ID # 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_branches_by_project_and_id(project_id, branch_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 branch_id: ID of the branch (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: Branch + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_branches_by_project_and_id_with_http_info(project_id, branch_id, **kwargs) # noqa: E501 + + def get_branches_by_project_and_id_with_http_info(self, project_id, branch_id, **kwargs): # noqa: E501 + """Get branch by project and ID # 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_branches_by_project_and_id_with_http_info(project_id, branch_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 branch_id: ID of the branch (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(Branch, status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'project_id', + 'branch_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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_branches_by_project_and_id" % 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_branches_by_project_and_id`") # noqa: E501 + # verify the required parameter 'branch_id' is set + if self.api_client.client_side_validation and ('branch_id' not in local_var_params or # noqa: E501 + local_var_params['branch_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `branch_id` when calling `get_branches_by_project_and_id`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in local_var_params: + path_params['projectId'] = local_var_params['project_id'] # noqa: E501 + if 'branch_id' in local_var_params: + path_params['branchId'] = local_var_params['branch_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/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/projects/{projectId}/branches/{branchId}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Branch', # 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) + + def post_branch_by_project(self, project_id, body, **kwargs): # noqa: E501 + """Create branch by project # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.post_branch_by_project(project_id, body, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str project_id: ID of the project (required) + :param Branch body: (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: Branch + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.post_branch_by_project_with_http_info(project_id, body, **kwargs) # noqa: E501 + + def post_branch_by_project_with_http_info(self, project_id, body, **kwargs): # noqa: E501 + """Create branch by project # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.post_branch_by_project_with_http_info(project_id, body, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str project_id: ID of the project (required) + :param Branch body: (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(Branch, status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'project_id', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 post_branch_by_project" % 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 `post_branch_by_project`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 + local_var_params['body'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `post_branch_by_project`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in local_var_params: + path_params['projectId'] = local_var_params['project_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in local_var_params: + body_params = local_var_params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/projects/{projectId}/branches', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Branch', # 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) diff --git a/sysml_v2_api_client/api/commit_api.py b/sysml_v2_api_client/api/commit_api.py index 3513acb..77edf15 100644 --- a/sysml_v2_api_client/api/commit_api.py +++ b/sysml_v2_api_client/api/commit_api.py @@ -284,118 +284,6 @@ def get_commits_by_project_with_http_info(self, project_id, **kwargs): # noqa: _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def get_head_commit_by_project(self, project_id, **kwargs): # noqa: E501 - """Get head commit by project # 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_head_commit_by_project(project_id, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - :param str project_id: ID of the project (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: Commit - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - return self.get_head_commit_by_project_with_http_info(project_id, **kwargs) # noqa: E501 - - def get_head_commit_by_project_with_http_info(self, project_id, **kwargs): # noqa: E501 - """Get head commit by project # 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_head_commit_by_project_with_http_info(project_id, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - :param str project_id: ID of the project (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(Commit, status_code(int), headers(HTTPHeaderDict)) - If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = [ - 'project_id' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_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_head_commit_by_project" % 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_head_commit_by_project`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'project_id' in local_var_params: - path_params['projectId'] = local_var_params['project_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/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/projects/{projectId}/head', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Commit', # 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) - def post_commit_by_project(self, project_id, body, **kwargs): # noqa: E501 """Create commit by project # noqa: E501 @@ -407,6 +295,7 @@ def post_commit_by_project(self, project_id, body, **kwargs): # noqa: E501 :param async_req bool: execute request asynchronously :param str project_id: ID of the project (required) :param Commit body: (required) + :param str branch_id: ID of the branch - project's default branch if unspecified :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -432,6 +321,7 @@ def post_commit_by_project_with_http_info(self, project_id, body, **kwargs): # :param async_req bool: execute request asynchronously :param str project_id: ID of the project (required) :param Commit body: (required) + :param str branch_id: ID of the branch - project's default branch if unspecified :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -450,7 +340,8 @@ def post_commit_by_project_with_http_info(self, project_id, body, **kwargs): # all_params = [ 'project_id', - 'body' + 'body', + 'branch_id' ] all_params.extend( [ @@ -485,6 +376,8 @@ def post_commit_by_project_with_http_info(self, project_id, body, **kwargs): # path_params['projectId'] = local_var_params['project_id'] # noqa: E501 query_params = [] + if 'branch_id' in local_var_params and local_var_params['branch_id'] is not None: # noqa: E501 + query_params.append(('branchId', local_var_params['branch_id'])) # noqa: E501 header_params = {} diff --git a/sysml_v2_api_client/api_client.py b/sysml_v2_api_client/api_client.py index efd5b7a..a729505 100644 --- a/sysml_v2_api_client/api_client.py +++ b/sysml_v2_api_client/api_client.py @@ -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/2021-03/python' + self.user_agent = 'OpenAPI-Generator/2021-04/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/sysml_v2_api_client/configuration.py b/sysml_v2_api_client/configuration.py index bc259fb..09aa984 100644 --- a/sysml_v2_api_client/configuration.py +++ b/sysml_v2_api_client/configuration.py @@ -325,7 +325,7 @@ def to_debug_report(self): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: 1.0.0\n"\ - "SDK Package Version: 2021-03".\ + "SDK Package Version: 2021-04".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self): diff --git a/sysml_v2_api_client/models/__init__.py b/sysml_v2_api_client/models/__init__.py index a957eb3..f742af3 100644 --- a/sysml_v2_api_client/models/__init__.py +++ b/sysml_v2_api_client/models/__init__.py @@ -14,8 +14,10 @@ from __future__ import absolute_import # import models into model package +from sysml_v2_api_client.models.branch import Branch +from sysml_v2_api_client.models.branch_head import BranchHead +from sysml_v2_api_client.models.branch_owning_project import BranchOwningProject from sysml_v2_api_client.models.commit import Commit -from sysml_v2_api_client.models.commit_containing_project import CommitContainingProject from sysml_v2_api_client.models.composite_constraint import CompositeConstraint from sysml_v2_api_client.models.constraint import Constraint from sysml_v2_api_client.models.element import Element @@ -26,5 +28,4 @@ from sysml_v2_api_client.models.primitive_constraint import PrimitiveConstraint from sysml_v2_api_client.models.project import Project from sysml_v2_api_client.models.query import Query -from sysml_v2_api_client.models.record import Record from sysml_v2_api_client.models.relationship import Relationship diff --git a/sysml_v2_api_client/models/branch.py b/sysml_v2_api_client/models/branch.py new file mode 100644 index 0000000..021f1dc --- /dev/null +++ b/sysml_v2_api_client/models/branch.py @@ -0,0 +1,230 @@ +# coding: utf-8 + +""" + SysML v2 API and Services + + REST/HTTP binding (PSM) for the SysML v2 standard API. # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from sysml_v2_api_client.configuration import Configuration + + +class Branch(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'type': 'str', + 'head': 'BranchHead', + 'owning_project': 'BranchOwningProject', + 'id': 'str', + 'name': 'str' + } + + attribute_map = { + 'type': '@type', + 'head': 'head', + 'owning_project': 'owningProject', + 'id': 'id', + 'name': 'name' + } + + def __init__(self, type=None, head=None, owning_project=None, id=None, name=None, local_vars_configuration=None): # noqa: E501 + """Branch - 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._head = None + self._owning_project = None + self._id = None + self._name = None + self.discriminator = None + + if type is not None: + self.type = type + if head is not None: + self.head = head + if owning_project is not None: + self.owning_project = owning_project + if id is not None: + self.id = id + if name is not None: + self.name = name + + @property + def type(self): + """Gets the type of this Branch. # noqa: E501 + + + :return: The type of this Branch. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this Branch. + + + :param type: The type of this Branch. # noqa: E501 + :type: str + """ + allowed_values = ["Branch"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and type not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + @property + def head(self): + """Gets the head of this Branch. # noqa: E501 + + + :return: The head of this Branch. # noqa: E501 + :rtype: BranchHead + """ + return self._head + + @head.setter + def head(self, head): + """Sets the head of this Branch. + + + :param head: The head of this Branch. # noqa: E501 + :type: BranchHead + """ + + self._head = head + + @property + def owning_project(self): + """Gets the owning_project of this Branch. # noqa: E501 + + + :return: The owning_project of this Branch. # noqa: E501 + :rtype: BranchOwningProject + """ + return self._owning_project + + @owning_project.setter + def owning_project(self, owning_project): + """Sets the owning_project of this Branch. + + + :param owning_project: The owning_project of this Branch. # noqa: E501 + :type: BranchOwningProject + """ + + self._owning_project = owning_project + + @property + def id(self): + """Gets the id of this Branch. # noqa: E501 + + + :return: The id of this Branch. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this Branch. + + + :param id: The id of this Branch. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def name(self): + """Gets the name of this Branch. # noqa: E501 + + + :return: The name of this Branch. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Branch. + + + :param name: The name of this Branch. # noqa: E501 + :type: str + """ + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Branch): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, Branch): + return True + + return self.to_dict() != other.to_dict() diff --git a/sysml_v2_api_client/models/record.py b/sysml_v2_api_client/models/branch_head.py similarity index 87% rename from sysml_v2_api_client/models/record.py rename to sysml_v2_api_client/models/branch_head.py index 39535be..304d926 100644 --- a/sysml_v2_api_client/models/record.py +++ b/sysml_v2_api_client/models/branch_head.py @@ -18,7 +18,7 @@ from sysml_v2_api_client.configuration import Configuration -class Record(object): +class BranchHead(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -41,7 +41,7 @@ class Record(object): } def __init__(self, id=None, local_vars_configuration=None): # noqa: E501 - """Record - a model defined in OpenAPI""" # noqa: E501 + """BranchHead - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() self.local_vars_configuration = local_vars_configuration @@ -54,20 +54,20 @@ def __init__(self, id=None, local_vars_configuration=None): # noqa: E501 @property def id(self): - """Gets the id of this Record. # noqa: E501 + """Gets the id of this BranchHead. # noqa: E501 - :return: The id of this Record. # noqa: E501 + :return: The id of this BranchHead. # noqa: E501 :rtype: str """ return self._id @id.setter def id(self, id): - """Sets the id of this Record. + """Sets the id of this BranchHead. - :param id: The id of this Record. # noqa: E501 + :param id: The id of this BranchHead. # noqa: E501 :type: str """ @@ -107,14 +107,14 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, Record): + if not isinstance(other, BranchHead): return False return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - if not isinstance(other, Record): + if not isinstance(other, BranchHead): return True return self.to_dict() != other.to_dict() diff --git a/sysml_v2_api_client/models/commit_containing_project.py b/sysml_v2_api_client/models/branch_owning_project.py similarity index 84% rename from sysml_v2_api_client/models/commit_containing_project.py rename to sysml_v2_api_client/models/branch_owning_project.py index 7982d86..8e8a7c3 100644 --- a/sysml_v2_api_client/models/commit_containing_project.py +++ b/sysml_v2_api_client/models/branch_owning_project.py @@ -18,7 +18,7 @@ from sysml_v2_api_client.configuration import Configuration -class CommitContainingProject(object): +class BranchOwningProject(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -41,7 +41,7 @@ class CommitContainingProject(object): } def __init__(self, id=None, local_vars_configuration=None): # noqa: E501 - """CommitContainingProject - a model defined in OpenAPI""" # noqa: E501 + """BranchOwningProject - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() self.local_vars_configuration = local_vars_configuration @@ -54,20 +54,20 @@ def __init__(self, id=None, local_vars_configuration=None): # noqa: E501 @property def id(self): - """Gets the id of this CommitContainingProject. # noqa: E501 + """Gets the id of this BranchOwningProject. # noqa: E501 - :return: The id of this CommitContainingProject. # noqa: E501 + :return: The id of this BranchOwningProject. # noqa: E501 :rtype: str """ return self._id @id.setter def id(self, id): - """Sets the id of this CommitContainingProject. + """Sets the id of this BranchOwningProject. - :param id: The id of this CommitContainingProject. # noqa: E501 + :param id: The id of this BranchOwningProject. # noqa: E501 :type: str """ @@ -107,14 +107,14 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, CommitContainingProject): + if not isinstance(other, BranchOwningProject): return False return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - if not isinstance(other, CommitContainingProject): + if not isinstance(other, BranchOwningProject): return True return self.to_dict() != other.to_dict() diff --git a/sysml_v2_api_client/models/commit.py b/sysml_v2_api_client/models/commit.py index bc97dad..95be4e5 100644 --- a/sysml_v2_api_client/models/commit.py +++ b/sysml_v2_api_client/models/commit.py @@ -35,20 +35,20 @@ class Commit(object): openapi_types = { 'type': 'str', 'change': 'list[ElementVersion]', - 'containing_project': 'CommitContainingProject', + 'owning_project': 'BranchOwningProject', 'id': 'str', - 'previous_commit': 'Record' + 'previous_commit': 'BranchHead' } attribute_map = { 'type': '@type', 'change': 'change', - 'containing_project': 'containingProject', + 'owning_project': 'owningProject', 'id': 'id', 'previous_commit': 'previousCommit' } - def __init__(self, type=None, change=None, containing_project=None, id=None, previous_commit=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, type=None, change=None, owning_project=None, id=None, previous_commit=None, local_vars_configuration=None): # noqa: E501 """Commit - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -56,7 +56,7 @@ def __init__(self, type=None, change=None, containing_project=None, id=None, pre self._type = None self._change = None - self._containing_project = None + self._owning_project = None self._id = None self._previous_commit = None self.discriminator = None @@ -65,8 +65,8 @@ def __init__(self, type=None, change=None, containing_project=None, id=None, pre self.type = type if change is not None: self.change = change - if containing_project is not None: - self.containing_project = containing_project + if owning_project is not None: + self.owning_project = owning_project if id is not None: self.id = id if previous_commit is not None: @@ -121,25 +121,25 @@ def change(self, change): self._change = change @property - def containing_project(self): - """Gets the containing_project of this Commit. # noqa: E501 + def owning_project(self): + """Gets the owning_project of this Commit. # noqa: E501 - :return: The containing_project of this Commit. # noqa: E501 - :rtype: CommitContainingProject + :return: The owning_project of this Commit. # noqa: E501 + :rtype: BranchOwningProject """ - return self._containing_project + return self._owning_project - @containing_project.setter - def containing_project(self, containing_project): - """Sets the containing_project of this Commit. + @owning_project.setter + def owning_project(self, owning_project): + """Sets the owning_project of this Commit. - :param containing_project: The containing_project of this Commit. # noqa: E501 - :type: CommitContainingProject + :param owning_project: The owning_project of this Commit. # noqa: E501 + :type: BranchOwningProject """ - self._containing_project = containing_project + self._owning_project = owning_project @property def id(self): @@ -168,7 +168,7 @@ def previous_commit(self): :return: The previous_commit of this Commit. # noqa: E501 - :rtype: Record + :rtype: BranchHead """ return self._previous_commit @@ -178,7 +178,7 @@ def previous_commit(self, previous_commit): :param previous_commit: The previous_commit of this Commit. # noqa: E501 - :type: Record + :type: BranchHead """ self._previous_commit = previous_commit diff --git a/sysml_v2_api_client/models/query.py b/sysml_v2_api_client/models/query.py index 418c2b9..eaec7c0 100644 --- a/sysml_v2_api_client/models/query.py +++ b/sysml_v2_api_client/models/query.py @@ -34,7 +34,7 @@ class Query(object): """ openapi_types = { 'type': 'str', - 'containing_project': 'CommitContainingProject', + 'owning_project': 'BranchOwningProject', 'id': 'str', 'scope': 'list[ElementIdentity]', 'select': 'list[str]', @@ -43,21 +43,21 @@ class Query(object): attribute_map = { 'type': '@type', - 'containing_project': 'containingProject', + 'owning_project': 'owningProject', 'id': 'id', 'scope': 'scope', 'select': 'select', 'where': 'where' } - def __init__(self, type=None, containing_project=None, id=None, scope=None, select=None, where=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, type=None, owning_project=None, id=None, scope=None, select=None, where=None, local_vars_configuration=None): # noqa: E501 """Query - 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._containing_project = None + self._owning_project = None self._id = None self._scope = None self._select = None @@ -66,8 +66,8 @@ def __init__(self, type=None, containing_project=None, id=None, scope=None, sele if type is not None: self.type = type - if containing_project is not None: - self.containing_project = containing_project + if owning_project is not None: + self.owning_project = owning_project if id is not None: self.id = id if scope is not None: @@ -105,25 +105,25 @@ def type(self, type): self._type = type @property - def containing_project(self): - """Gets the containing_project of this Query. # noqa: E501 + def owning_project(self): + """Gets the owning_project of this Query. # noqa: E501 - :return: The containing_project of this Query. # noqa: E501 - :rtype: CommitContainingProject + :return: The owning_project of this Query. # noqa: E501 + :rtype: BranchOwningProject """ - return self._containing_project + return self._owning_project - @containing_project.setter - def containing_project(self, containing_project): - """Sets the containing_project of this Query. + @owning_project.setter + def owning_project(self, owning_project): + """Sets the owning_project of this Query. - :param containing_project: The containing_project of this Query. # noqa: E501 - :type: CommitContainingProject + :param owning_project: The owning_project of this Query. # noqa: E501 + :type: BranchOwningProject """ - self._containing_project = containing_project + self._owning_project = owning_project @property def id(self): diff --git a/test/test_branch.py b/test/test_branch.py new file mode 100644 index 0000000..968ff20 --- /dev/null +++ b/test/test_branch.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + SysML v2 API and Services + + REST/HTTP binding (PSM) for the SysML v2 standard API. # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest +import datetime + +import sysml_v2_api_client +from sysml_v2_api_client.models.branch import Branch # noqa: E501 +from sysml_v2_api_client.rest import ApiException + +class TestBranch(unittest.TestCase): + """Branch unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test Branch + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # model = sysml_v2_api_client.models.branch.Branch() # noqa: E501 + if include_optional : + return Branch( + type = 'Branch', + head = sysml_v2_api_client.models.branch_head.Branch_head( + id = '0', ), + owning_project = sysml_v2_api_client.models.branch_owning_project.Branch_owningProject( + id = '0', ), + id = '0', + name = '0' + ) + else : + return Branch( + ) + + def testBranch(self): + """Test Branch""" + inst_req_only = self.make_instance(include_optional=False) + inst_req_and_optional = self.make_instance(include_optional=True) + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_branch_api.py b/test/test_branch_api.py new file mode 100644 index 0000000..ec12092 --- /dev/null +++ b/test/test_branch_api.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + SysML v2 API and Services + + REST/HTTP binding (PSM) for the SysML v2 standard API. # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import sysml_v2_api_client +from sysml_v2_api_client.api.branch_api import BranchApi # noqa: E501 +from sysml_v2_api_client.rest import ApiException + + +class TestBranchApi(unittest.TestCase): + """BranchApi unit test stubs""" + + def setUp(self): + self.api = sysml_v2_api_client.api.branch_api.BranchApi() # noqa: E501 + + def tearDown(self): + pass + + def test_get_branches_by_project(self): + """Test case for get_branches_by_project + + Get branches by project # noqa: E501 + """ + pass + + def test_get_branches_by_project_and_id(self): + """Test case for get_branches_by_project_and_id + + Get branch by project and ID # noqa: E501 + """ + pass + + def test_post_branch_by_project(self): + """Test case for post_branch_by_project + + Create branch by project # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_record.py b/test/test_branch_head.py similarity index 71% rename from test/test_record.py rename to test/test_branch_head.py index 0720767..dd2c7e9 100644 --- a/test/test_record.py +++ b/test/test_branch_head.py @@ -16,11 +16,11 @@ import datetime import sysml_v2_api_client -from sysml_v2_api_client.models.record import Record # noqa: E501 +from sysml_v2_api_client.models.branch_head import BranchHead # noqa: E501 from sysml_v2_api_client.rest import ApiException -class TestRecord(unittest.TestCase): - """Record unit test stubs""" +class TestBranchHead(unittest.TestCase): + """BranchHead unit test stubs""" def setUp(self): pass @@ -29,21 +29,21 @@ def tearDown(self): pass def make_instance(self, include_optional): - """Test Record + """Test BranchHead include_option is a boolean, when False only required params are included, when True both required and optional params are included """ - # model = sysml_v2_api_client.models.record.Record() # noqa: E501 + # model = sysml_v2_api_client.models.branch_head.BranchHead() # noqa: E501 if include_optional : - return Record( + return BranchHead( id = '0' ) else : - return Record( + return BranchHead( ) - def testRecord(self): - """Test Record""" + def testBranchHead(self): + """Test BranchHead""" inst_req_only = self.make_instance(include_optional=False) inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/test/test_commit_containing_project.py b/test/test_branch_owning_project.py similarity index 64% rename from test/test_commit_containing_project.py rename to test/test_branch_owning_project.py index 459740e..3196eca 100644 --- a/test/test_commit_containing_project.py +++ b/test/test_branch_owning_project.py @@ -16,11 +16,11 @@ import datetime import sysml_v2_api_client -from sysml_v2_api_client.models.commit_containing_project import CommitContainingProject # noqa: E501 +from sysml_v2_api_client.models.branch_owning_project import BranchOwningProject # noqa: E501 from sysml_v2_api_client.rest import ApiException -class TestCommitContainingProject(unittest.TestCase): - """CommitContainingProject unit test stubs""" +class TestBranchOwningProject(unittest.TestCase): + """BranchOwningProject unit test stubs""" def setUp(self): pass @@ -29,21 +29,21 @@ def tearDown(self): pass def make_instance(self, include_optional): - """Test CommitContainingProject + """Test BranchOwningProject include_option is a boolean, when False only required params are included, when True both required and optional params are included """ - # model = sysml_v2_api_client.models.commit_containing_project.CommitContainingProject() # noqa: E501 + # model = sysml_v2_api_client.models.branch_owning_project.BranchOwningProject() # noqa: E501 if include_optional : - return CommitContainingProject( + return BranchOwningProject( id = '0' ) else : - return CommitContainingProject( + return BranchOwningProject( ) - def testCommitContainingProject(self): - """Test CommitContainingProject""" + def testBranchOwningProject(self): + """Test BranchOwningProject""" inst_req_only = self.make_instance(include_optional=False) inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/test/test_commit.py b/test/test_commit.py index f5054c6..00d79e5 100644 --- a/test/test_commit.py +++ b/test/test_commit.py @@ -48,10 +48,10 @@ def make_instance(self, include_optional): @type = 'ElementIdentity', id = '0', ), ) ], - containing_project = sysml_v2_api_client.models.commit_containing_project.Commit_containingProject( + owning_project = sysml_v2_api_client.models.branch_owning_project.Branch_owningProject( id = '0', ), id = '0', - previous_commit = sysml_v2_api_client.models.record.Record( + previous_commit = sysml_v2_api_client.models.branch_head.Branch_head( id = '0', ) ) else : diff --git a/test/test_commit_api.py b/test/test_commit_api.py index 7bcb28a..a86986a 100644 --- a/test/test_commit_api.py +++ b/test/test_commit_api.py @@ -42,13 +42,6 @@ def test_get_commits_by_project(self): """ pass - def test_get_head_commit_by_project(self): - """Test case for get_head_commit_by_project - - Get head commit by project # noqa: E501 - """ - pass - def test_post_commit_by_project(self): """Test case for post_commit_by_project diff --git a/test/test_query.py b/test/test_query.py index acc1a2d..973eb82 100644 --- a/test/test_query.py +++ b/test/test_query.py @@ -37,7 +37,7 @@ def make_instance(self, include_optional): if include_optional : return Query( type = 'Query', - containing_project = sysml_v2_api_client.models.commit_containing_project.Commit_containingProject( + owning_project = sysml_v2_api_client.models.branch_owning_project.Branch_owningProject( id = '0', ), id = '0', scope = [