Stash changes

This commit is contained in:
2024-01-07 13:35:22 +01:00
parent aa664dfce1
commit bd30682092
38 changed files with 661 additions and 446 deletions

View File

@@ -45,13 +45,13 @@ class ClientsApi:
self.api_client = api_client
@validate_arguments
def get_all_clients(self, entity_did : StrictStr, skip : Optional[StrictInt] = None, limit : Optional[StrictInt] = None, **kwargs) -> List[Service]: # noqa: E501
"""Get All Clients # noqa: E501
def get_clients_by_did(self, entity_did : StrictStr, skip : Optional[StrictInt] = None, limit : Optional[StrictInt] = None, **kwargs) -> List[Service]: # noqa: E501
"""Get Clients By Did # 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_all_clients(entity_did, skip, limit, async_req=True)
>>> thread = api.get_clients_by_did(entity_did, skip, limit, async_req=True)
>>> result = thread.get()
:param entity_did: (required)
@@ -73,18 +73,18 @@ class ClientsApi:
"""
kwargs['_return_http_data_only'] = True
if '_preload_content' in kwargs:
message = "Error! Please call the get_all_clients_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
message = "Error! Please call the get_clients_by_did_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
raise ValueError(message)
return self.get_all_clients_with_http_info(entity_did, skip, limit, **kwargs) # noqa: E501
return self.get_clients_by_did_with_http_info(entity_did, skip, limit, **kwargs) # noqa: E501
@validate_arguments
def get_all_clients_with_http_info(self, entity_did : StrictStr, skip : Optional[StrictInt] = None, limit : Optional[StrictInt] = None, **kwargs) -> ApiResponse: # noqa: E501
"""Get All Clients # noqa: E501
def get_clients_by_did_with_http_info(self, entity_did : StrictStr, skip : Optional[StrictInt] = None, limit : Optional[StrictInt] = None, **kwargs) -> ApiResponse: # noqa: E501
"""Get Clients By Did # 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_all_clients_with_http_info(entity_did, skip, limit, async_req=True)
>>> thread = api.get_clients_by_did_with_http_info(entity_did, skip, limit, async_req=True)
>>> result = thread.get()
:param entity_did: (required)
@@ -142,7 +142,7 @@ class ClientsApi:
if _key not in _all_params:
raise ApiTypeError(
"Got an unexpected keyword argument '%s'"
" to method get_all_clients" % _key
" to method get_clients_by_did" % _key
)
_params[_key] = _val
del _params['kwargs']

View File

@@ -1072,3 +1072,142 @@ class EntitiesApi:
_request_timeout=_params.get('_request_timeout'),
collection_formats=_collection_formats,
_request_auth=_params.get('_request_auth'))
@validate_arguments
def get_entity_by_name(self, entity_name : StrictStr, **kwargs) -> Entity: # noqa: E501
"""Get Entity By Name # 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_entity_by_name(entity_name, async_req=True)
>>> result = thread.get()
:param entity_name: (required)
:type entity_name: str
:param async_req: Whether to execute the request asynchronously.
:type async_req: bool, optional
: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: Returns the result object.
If the method is called asynchronously,
returns the request thread.
:rtype: Entity
"""
kwargs['_return_http_data_only'] = True
if '_preload_content' in kwargs:
message = "Error! Please call the get_entity_by_name_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
raise ValueError(message)
return self.get_entity_by_name_with_http_info(entity_name, **kwargs) # noqa: E501
@validate_arguments
def get_entity_by_name_with_http_info(self, entity_name : StrictStr, **kwargs) -> ApiResponse: # noqa: E501
"""Get Entity By Name # 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_entity_by_name_with_http_info(entity_name, async_req=True)
>>> result = thread.get()
:param entity_name: (required)
:type entity_name: str
:param async_req: Whether to execute the request asynchronously.
:type async_req: bool, optional
:param _preload_content: if False, the ApiResponse.data will
be set to none and raw_data will store the
HTTP response body without reading/decoding.
Default is True.
:type _preload_content: bool, optional
:param _return_http_data_only: response data instead of ApiResponse
object with status code, headers, etc
:type _return_http_data_only: bool, optional
: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.
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the authentication
in the spec for a single request.
:type _request_auth: dict, optional
:type _content_type: string, optional: force content-type for the request
:return: Returns the result object.
If the method is called asynchronously,
returns the request thread.
:rtype: tuple(Entity, status_code(int), headers(HTTPHeaderDict))
"""
_params = locals()
_all_params = [
'entity_name'
]
_all_params.extend(
[
'async_req',
'_return_http_data_only',
'_preload_content',
'_request_timeout',
'_request_auth',
'_content_type',
'_headers'
]
)
# validate the arguments
for _key, _val in _params['kwargs'].items():
if _key not in _all_params:
raise ApiTypeError(
"Got an unexpected keyword argument '%s'"
" to method get_entity_by_name" % _key
)
_params[_key] = _val
del _params['kwargs']
_collection_formats = {}
# process the path parameters
_path_params = {}
# process the query parameters
_query_params = []
if _params.get('entity_name') is not None: # noqa: E501
_query_params.append(('entity_name', _params['entity_name']))
# process the header parameters
_header_params = dict(_params.get('_headers', {}))
# process the form parameters
_form_params = []
_files = {}
# process the body parameter
_body_params = None
# set the HTTP header `Accept`
_header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# authentication setting
_auth_settings = [] # noqa: E501
_response_types_map = {
'200': "Entity",
'422': "HTTPValidationError",
}
return self.api_client.call_api(
'/api/v1/entity_by_name', 'GET',
_path_params,
_query_params,
_header_params,
body=_body_params,
post_params=_form_params,
files=_files,
response_types_map=_response_types_map,
auth_settings=_auth_settings,
async_req=_params.get('async_req'),
_return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
_preload_content=_params.get('_preload_content', True),
_request_timeout=_params.get('_request_timeout'),
collection_formats=_collection_formats,
_request_auth=_params.get('_request_auth'))

View File

@@ -2,15 +2,15 @@
All URIs are relative to _http://localhost_
| Method | HTTP request | Description |
| ---------------------------------------------------- | ------------------------------------ | --------------- |
| [**get_all_clients**](ClientsApi.md#get_all_clients) | **GET** /api/v1/{entity_did}/clients | Get All Clients |
| Method | HTTP request | Description |
| ---------------------------------------------------------- | ------------------------------------ | ------------------ |
| [**get_clients_by_did**](ClientsApi.md#get_clients_by_did) | **GET** /api/v1/{entity_did}/clients | Get Clients By Did |
# **get_all_clients**
# **get_clients_by_did**
> List[Service] get_all_clients(entity_did, skip=skip, limit=limit)
> List[Service] get_clients_by_did(entity_did, skip=skip, limit=limit)
Get All Clients
Get Clients By Did
### Example
@@ -38,12 +38,12 @@ with openapi_client.ApiClient(configuration) as api_client:
limit = 100 # int | (optional) (default to 100)
try:
# Get All Clients
api_response = api_instance.get_all_clients(entity_did, skip=skip, limit=limit)
print("The response of ClientsApi->get_all_clients:\n")
# Get Clients By Did
api_response = api_instance.get_clients_by_did(entity_did, skip=skip, limit=limit)
print("The response of ClientsApi->get_clients_by_did:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ClientsApi->get_all_clients: %s\n" % e)
print("Exception when calling ClientsApi->get_clients_by_did: %s\n" % e)
```
### Parameters

View File

@@ -11,6 +11,7 @@ All URIs are relative to _http://localhost_
| [**get_all_entities**](EntitiesApi.md#get_all_entities) | **GET** /api/v1/entities | Get All Entities |
| [**get_attached_entities**](EntitiesApi.md#get_attached_entities) | **GET** /api/v1/attached_entities | Get Attached Entities |
| [**get_entity_by_did**](EntitiesApi.md#get_entity_by_did) | **GET** /api/v1/{entity_did}/entity | Get Entity By Did |
| [**get_entity_by_name**](EntitiesApi.md#get_entity_by_name) | **GET** /api/v1/entity_by_name | Get Entity By Name |
# **attach_entity**
@@ -484,3 +485,69 @@ No authorization required
| **422** | Validation Error | - |
[[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_entity_by_name**
> Entity get_entity_by_name(entity_name)
Get Entity By Name
### Example
```python
import time
import os
import openapi_client
from openapi_client.models.entity import Entity
from openapi_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 = openapi_client.Configuration(
host = "http://localhost"
)
# Enter a context with an instance of the API client
with openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = openapi_client.EntitiesApi(api_client)
entity_name = 'entity_name_example' # str |
try:
# Get Entity By Name
api_response = api_instance.get_entity_by_name(entity_name)
print("The response of EntitiesApi->get_entity_by_name:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling EntitiesApi->get_entity_by_name: %s\n" % e)
```
### Parameters
| Name | Type | Description | Notes |
| --------------- | ------- | ----------- | ----- |
| **entity_name** | **str** | |
### Return type
[**Entity**](Entity.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
| ----------- | ------------------- | ---------------- |
| **200** | Successful Response | - |
| **422** | Validation Error | - |
[[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)

View File

@@ -2,13 +2,13 @@
## Properties
| Name | Type | Description | Notes |
| ------------ | ---------- | ----------- | ------------------------------------------- |
| **did** | **str** | | [optional] [default to 'did:sov:test:1234'] |
| **name** | **str** | | [optional] [default to 'C1'] |
| **ip** | **str** | | [optional] [default to '127.0.0.1'] |
| **visible** | **bool** | | [optional] [default to True] |
| **other** | **object** | | [optional] |
| Name | Type | Description | Notes |
| ------------ | ---------- | ----------- | ----- |
| **did** | **str** | |
| **name** | **str** | |
| **ip** | **str** | |
| **visible** | **bool** | |
| **other** | **object** | |
| **attached** | **bool** | |
## Example

View File

@@ -2,13 +2,13 @@
## Properties
| Name | Type | Description | Notes |
| ----------- | ---------- | ----------- | ------------------------------------------- |
| **did** | **str** | | [optional] [default to 'did:sov:test:1234'] |
| **name** | **str** | | [optional] [default to 'C1'] |
| **ip** | **str** | | [optional] [default to '127.0.0.1'] |
| **visible** | **bool** | | [optional] [default to True] |
| **other** | **object** | | [optional] |
| Name | Type | Description | Notes |
| ----------- | ---------- | ----------- | ----- |
| **did** | **str** | |
| **name** | **str** | |
| **ip** | **str** | |
| **visible** | **bool** | |
| **other** | **object** | |
## Example

View File

@@ -2,12 +2,12 @@
## Properties
| Name | Type | Description | Notes |
| ------------------ | ------------ | ----------- | ------------------------------------------- |
| **requester_name** | **str** | | [optional] [default to 'C1'] |
| **requester_did** | **str** | | [optional] [default to 'did:sov:test:1122'] |
| **resolved_did** | **str** | | [optional] [default to 'did:sov:test:1234'] |
| **other** | **object** | | [optional] |
| Name | Type | Description | Notes |
| ------------------ | ------------ | ----------- | ----- |
| **requester_name** | **str** | |
| **requester_did** | **str** | |
| **resolved_did** | **str** | |
| **other** | **object** | |
| **timestamp** | **datetime** | |
| **id** | **int** | |

View File

@@ -2,15 +2,16 @@
## Properties
| Name | Type | Description | Notes |
| ---------------- | ---------- | ----------- | -------------------------------------------------------------- |
| **uuid** | **str** | | [optional] [default to '8e285c0c-4e40-430a-a477-26b3b81e30df'] |
| **service_name** | **str** | | [optional] [default to 'Carlos Printing'] |
| **service_type** | **str** | | [optional] [default to '3D Printing'] |
| **endpoint_url** | **str** | | [optional] [default to 'http://127.0.0.1:8000'] |
| **status** | **str** | | [optional] [default to 'unknown'] |
| **other** | **object** | | [optional] |
| **entity_did** | **str** | | [optional] [default to 'did:sov:test:1234'] |
| Name | Type | Description | Notes |
| ---------------- | ----------------------- | ----------- | ----- |
| **uuid** | **str** | |
| **service_name** | **str** | |
| **service_type** | **str** | |
| **endpoint_url** | **str** | |
| **status** | **str** | |
| **other** | **object** | |
| **entity_did** | **str** | |
| **entity** | [**Entity**](Entity.md) | |
## Example

View File

@@ -2,15 +2,15 @@
## Properties
| Name | Type | Description | Notes |
| ---------------- | ---------- | ----------- | -------------------------------------------------------------- |
| **uuid** | **str** | | [optional] [default to '8e285c0c-4e40-430a-a477-26b3b81e30df'] |
| **service_name** | **str** | | [optional] [default to 'Carlos Printing'] |
| **service_type** | **str** | | [optional] [default to '3D Printing'] |
| **endpoint_url** | **str** | | [optional] [default to 'http://127.0.0.1:8000'] |
| **status** | **str** | | [optional] [default to 'unknown'] |
| **other** | **object** | | [optional] |
| **entity_did** | **str** | | [optional] [default to 'did:sov:test:1234'] |
| Name | Type | Description | Notes |
| ---------------- | ---------- | ----------- | ----- |
| **uuid** | **str** | |
| **service_name** | **str** | |
| **service_type** | **str** | |
| **endpoint_url** | **str** | |
| **status** | **str** | |
| **other** | **object** | |
| **entity_did** | **str** | |
## Example

View File

@@ -18,18 +18,18 @@ import re # noqa: F401
import json
from typing import Any, Dict, Optional
from typing import Any, Dict
from pydantic import BaseModel, Field, StrictBool, StrictStr
class Entity(BaseModel):
"""
Entity
"""
did: Optional[StrictStr] = 'did:sov:test:1234'
name: Optional[StrictStr] = 'C1'
ip: Optional[StrictStr] = '127.0.0.1'
visible: Optional[StrictBool] = True
other: Optional[Dict[str, Any]] = None
did: StrictStr = Field(...)
name: StrictStr = Field(...)
ip: StrictStr = Field(...)
visible: StrictBool = Field(...)
other: Dict[str, Any] = Field(...)
attached: StrictBool = Field(...)
__properties = ["did", "name", "ip", "visible", "other", "attached"]
@@ -69,10 +69,10 @@ class Entity(BaseModel):
return Entity.parse_obj(obj)
_obj = Entity.parse_obj({
"did": obj.get("did") if obj.get("did") is not None else 'did:sov:test:1234',
"name": obj.get("name") if obj.get("name") is not None else 'C1',
"ip": obj.get("ip") if obj.get("ip") is not None else '127.0.0.1',
"visible": obj.get("visible") if obj.get("visible") is not None else True,
"did": obj.get("did"),
"name": obj.get("name"),
"ip": obj.get("ip"),
"visible": obj.get("visible"),
"other": obj.get("other"),
"attached": obj.get("attached")
})

View File

@@ -18,18 +18,18 @@ import re # noqa: F401
import json
from typing import Any, Dict, Optional
from pydantic import BaseModel, StrictBool, StrictStr
from typing import Any, Dict
from pydantic import BaseModel, Field, StrictBool, StrictStr
class EntityCreate(BaseModel):
"""
EntityCreate
"""
did: Optional[StrictStr] = 'did:sov:test:1234'
name: Optional[StrictStr] = 'C1'
ip: Optional[StrictStr] = '127.0.0.1'
visible: Optional[StrictBool] = True
other: Optional[Dict[str, Any]] = None
did: StrictStr = Field(...)
name: StrictStr = Field(...)
ip: StrictStr = Field(...)
visible: StrictBool = Field(...)
other: Dict[str, Any] = Field(...)
__properties = ["did", "name", "ip", "visible", "other"]
class Config:
@@ -68,10 +68,10 @@ class EntityCreate(BaseModel):
return EntityCreate.parse_obj(obj)
_obj = EntityCreate.parse_obj({
"did": obj.get("did") if obj.get("did") is not None else 'did:sov:test:1234',
"name": obj.get("name") if obj.get("name") is not None else 'C1',
"ip": obj.get("ip") if obj.get("ip") is not None else '127.0.0.1',
"visible": obj.get("visible") if obj.get("visible") is not None else True,
"did": obj.get("did"),
"name": obj.get("name"),
"ip": obj.get("ip"),
"visible": obj.get("visible"),
"other": obj.get("other")
})
return _obj

View File

@@ -18,17 +18,17 @@ import re # noqa: F401
import json
from datetime import datetime
from typing import Any, Dict, Optional
from typing import Any, Dict
from pydantic import BaseModel, Field, StrictInt, StrictStr
class Resolution(BaseModel):
"""
Resolution
"""
requester_name: Optional[StrictStr] = 'C1'
requester_did: Optional[StrictStr] = 'did:sov:test:1122'
resolved_did: Optional[StrictStr] = 'did:sov:test:1234'
other: Optional[Dict[str, Any]] = None
requester_name: StrictStr = Field(...)
requester_did: StrictStr = Field(...)
resolved_did: StrictStr = Field(...)
other: Dict[str, Any] = Field(...)
timestamp: datetime = Field(...)
id: StrictInt = Field(...)
__properties = ["requester_name", "requester_did", "resolved_did", "other", "timestamp", "id"]
@@ -69,9 +69,9 @@ class Resolution(BaseModel):
return Resolution.parse_obj(obj)
_obj = Resolution.parse_obj({
"requester_name": obj.get("requester_name") if obj.get("requester_name") is not None else 'C1',
"requester_did": obj.get("requester_did") if obj.get("requester_did") is not None else 'did:sov:test:1122',
"resolved_did": obj.get("resolved_did") if obj.get("resolved_did") is not None else 'did:sov:test:1234',
"requester_name": obj.get("requester_name"),
"requester_did": obj.get("requester_did"),
"resolved_did": obj.get("resolved_did"),
"other": obj.get("other"),
"timestamp": obj.get("timestamp"),
"id": obj.get("id")

View File

@@ -18,21 +18,23 @@ import re # noqa: F401
import json
from typing import Any, Dict, Optional
from pydantic import BaseModel, StrictStr
from typing import Any, Dict
from pydantic import BaseModel, Field, StrictStr
from openapi_client.models.entity import Entity
class Service(BaseModel):
"""
Service
"""
uuid: Optional[StrictStr] = '8e285c0c-4e40-430a-a477-26b3b81e30df'
service_name: Optional[StrictStr] = 'Carlos Printing'
service_type: Optional[StrictStr] = '3D Printing'
endpoint_url: Optional[StrictStr] = 'http://127.0.0.1:8000'
status: Optional[StrictStr] = 'unknown'
other: Optional[Dict[str, Any]] = None
entity_did: Optional[StrictStr] = 'did:sov:test:1234'
__properties = ["uuid", "service_name", "service_type", "endpoint_url", "status", "other", "entity_did"]
uuid: StrictStr = Field(...)
service_name: StrictStr = Field(...)
service_type: StrictStr = Field(...)
endpoint_url: StrictStr = Field(...)
status: StrictStr = Field(...)
other: Dict[str, Any] = Field(...)
entity_did: StrictStr = Field(...)
entity: Entity = Field(...)
__properties = ["uuid", "service_name", "service_type", "endpoint_url", "status", "other", "entity_did", "entity"]
class Config:
"""Pydantic configuration"""
@@ -58,6 +60,9 @@ class Service(BaseModel):
exclude={
},
exclude_none=True)
# override the default output from pydantic by calling `to_dict()` of entity
if self.entity:
_dict['entity'] = self.entity.to_dict()
return _dict
@classmethod
@@ -70,13 +75,14 @@ class Service(BaseModel):
return Service.parse_obj(obj)
_obj = Service.parse_obj({
"uuid": obj.get("uuid") if obj.get("uuid") is not None else '8e285c0c-4e40-430a-a477-26b3b81e30df',
"service_name": obj.get("service_name") if obj.get("service_name") is not None else 'Carlos Printing',
"service_type": obj.get("service_type") if obj.get("service_type") is not None else '3D Printing',
"endpoint_url": obj.get("endpoint_url") if obj.get("endpoint_url") is not None else 'http://127.0.0.1:8000',
"status": obj.get("status") if obj.get("status") is not None else 'unknown',
"uuid": obj.get("uuid"),
"service_name": obj.get("service_name"),
"service_type": obj.get("service_type"),
"endpoint_url": obj.get("endpoint_url"),
"status": obj.get("status"),
"other": obj.get("other"),
"entity_did": obj.get("entity_did") if obj.get("entity_did") is not None else 'did:sov:test:1234'
"entity_did": obj.get("entity_did"),
"entity": Entity.from_dict(obj.get("entity")) if obj.get("entity") is not None else None
})
return _obj

View File

@@ -18,20 +18,20 @@ import re # noqa: F401
import json
from typing import Any, Dict, Optional
from pydantic import BaseModel, StrictStr
from typing import Any, Dict
from pydantic import BaseModel, Field, StrictStr
class ServiceCreate(BaseModel):
"""
ServiceCreate
"""
uuid: Optional[StrictStr] = '8e285c0c-4e40-430a-a477-26b3b81e30df'
service_name: Optional[StrictStr] = 'Carlos Printing'
service_type: Optional[StrictStr] = '3D Printing'
endpoint_url: Optional[StrictStr] = 'http://127.0.0.1:8000'
status: Optional[StrictStr] = 'unknown'
other: Optional[Dict[str, Any]] = None
entity_did: Optional[StrictStr] = 'did:sov:test:1234'
uuid: StrictStr = Field(...)
service_name: StrictStr = Field(...)
service_type: StrictStr = Field(...)
endpoint_url: StrictStr = Field(...)
status: StrictStr = Field(...)
other: Dict[str, Any] = Field(...)
entity_did: StrictStr = Field(...)
__properties = ["uuid", "service_name", "service_type", "endpoint_url", "status", "other", "entity_did"]
class Config:
@@ -70,13 +70,13 @@ class ServiceCreate(BaseModel):
return ServiceCreate.parse_obj(obj)
_obj = ServiceCreate.parse_obj({
"uuid": obj.get("uuid") if obj.get("uuid") is not None else '8e285c0c-4e40-430a-a477-26b3b81e30df',
"service_name": obj.get("service_name") if obj.get("service_name") is not None else 'Carlos Printing',
"service_type": obj.get("service_type") if obj.get("service_type") is not None else '3D Printing',
"endpoint_url": obj.get("endpoint_url") if obj.get("endpoint_url") is not None else 'http://127.0.0.1:8000',
"status": obj.get("status") if obj.get("status") is not None else 'unknown',
"uuid": obj.get("uuid"),
"service_name": obj.get("service_name"),
"service_type": obj.get("service_type"),
"endpoint_url": obj.get("endpoint_url"),
"status": obj.get("status"),
"other": obj.get("other"),
"entity_did": obj.get("entity_did") if obj.get("entity_did") is not None else 'did:sov:test:1234'
"entity_did": obj.get("entity_did")
})
return _obj

View File

@@ -26,10 +26,10 @@ class TestClientsApi(unittest.TestCase):
def tearDown(self) -> None:
pass
def test_get_all_clients(self) -> None:
"""Test case for get_all_clients
def test_get_clients_by_did(self) -> None:
"""Test case for get_clients_by_did
Get All Clients # noqa: E501
Get Clients By Did # noqa: E501
"""
pass

View File

@@ -75,6 +75,13 @@ class TestEntitiesApi(unittest.TestCase):
"""
pass
def test_get_entity_by_name(self) -> None:
"""Test case for get_entity_by_name
Get Entity By Name # noqa: E501
"""
pass
if __name__ == '__main__':
unittest.main()

View File

@@ -40,11 +40,16 @@ class TestEntity(unittest.TestCase):
name = 'C1',
ip = '127.0.0.1',
visible = True,
other = openapi_client.models.other.Other(),
other = {network=Carlos Home Network, roles=[service repository, service prosumer]},
attached = True
)
else:
return Entity(
did = 'did:sov:test:1234',
name = 'C1',
ip = '127.0.0.1',
visible = True,
other = {network=Carlos Home Network, roles=[service repository, service prosumer]},
attached = True,
)
"""

View File

@@ -40,10 +40,15 @@ class TestEntityCreate(unittest.TestCase):
name = 'C1',
ip = '127.0.0.1',
visible = True,
other = openapi_client.models.other.Other()
other = {network=Carlos Home Network, roles=[service repository, service prosumer]}
)
else:
return EntityCreate(
did = 'did:sov:test:1234',
name = 'C1',
ip = '127.0.0.1',
visible = True,
other = {network=Carlos Home Network, roles=[service repository, service prosumer]},
)
"""

View File

@@ -39,12 +39,16 @@ class TestResolution(unittest.TestCase):
requester_name = 'C1',
requester_did = 'did:sov:test:1122',
resolved_did = 'did:sov:test:1234',
other = openapi_client.models.other.Other(),
other = {test=test},
timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
id = 56
)
else:
return Resolution(
requester_name = 'C1',
requester_did = 'did:sov:test:1122',
resolved_did = 'did:sov:test:1234',
other = {test=test},
timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
id = 56,
)

View File

@@ -41,11 +41,32 @@ class TestService(unittest.TestCase):
service_type = '3D Printing',
endpoint_url = 'http://127.0.0.1:8000',
status = 'unknown',
other = openapi_client.models.other.Other(),
entity_did = 'did:sov:test:1234'
other = {action=[register, deregister, delete, create]},
entity_did = 'did:sov:test:1234',
entity = openapi_client.models.entity.Entity(
did = 'did:sov:test:1234',
name = 'C1',
ip = '127.0.0.1',
visible = True,
other = {network=Carlos Home Network, roles=[service repository, service prosumer]},
attached = True, )
)
else:
return Service(
uuid = '8e285c0c-4e40-430a-a477-26b3b81e30df',
service_name = 'Carlos Printing',
service_type = '3D Printing',
endpoint_url = 'http://127.0.0.1:8000',
status = 'unknown',
other = {action=[register, deregister, delete, create]},
entity_did = 'did:sov:test:1234',
entity = openapi_client.models.entity.Entity(
did = 'did:sov:test:1234',
name = 'C1',
ip = '127.0.0.1',
visible = True,
other = {network=Carlos Home Network, roles=[service repository, service prosumer]},
attached = True, ),
)
"""

View File

@@ -41,11 +41,18 @@ class TestServiceCreate(unittest.TestCase):
service_type = '3D Printing',
endpoint_url = 'http://127.0.0.1:8000',
status = 'unknown',
other = openapi_client.models.other.Other(),
other = {action=[register, deregister, delete, create]},
entity_did = 'did:sov:test:1234'
)
else:
return ServiceCreate(
uuid = '8e285c0c-4e40-430a-a477-26b3b81e30df',
service_name = 'Carlos Printing',
service_type = '3D Printing',
endpoint_url = 'http://127.0.0.1:8000',
status = 'unknown',
other = {action=[register, deregister, delete, create]},
entity_did = 'did:sov:test:1234',
)
"""