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

@@ -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