diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 8e70263c..2b77b227 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -585,6 +585,4 @@ setup.cfg setup.py test-requirements.txt test/__init__.py -test/test_resource_catalog_service_api.py -test/test_service_catalog_service_api.py tox.ini diff --git a/docs/ServiceCatalog.md b/docs/ServiceCatalog.md index 04aa9cb8..06a0850f 100644 --- a/docs/ServiceCatalog.md +++ b/docs/ServiceCatalog.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **product_code** | **str** | | **display_name** | **str** | | **description** | **str** | | -**resource_types** | [**Dict[str, ResourceTypes]**](ResourceTypes.md) | | +**resource_types** | [**List[ResourceTypes]**](ResourceTypes.md) | | **features** | [**Features**](Features.md) | | ## Example diff --git a/onelens_backend_client/models/service_catalog.py b/onelens_backend_client/models/service_catalog.py index 54b1868c..f54370c5 100644 --- a/onelens_backend_client/models/service_catalog.py +++ b/onelens_backend_client/models/service_catalog.py @@ -33,7 +33,7 @@ class ServiceCatalog(BaseModel): product_code: StrictStr display_name: StrictStr description: StrictStr - resource_types: Dict[str, ResourceTypes] + resource_types: List[ResourceTypes] features: Features __properties: ClassVar[List[str]] = ["id", "name", "product_code", "display_name", "description", "resource_types", "features"] @@ -76,6 +76,13 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of each item in resource_types (list) + _items = [] + if self.resource_types: + for _item in self.resource_types: + if _item: + _items.append(_item.to_dict()) + _dict['resource_types'] = _items # override the default output from pydantic by calling `to_dict()` of features if self.features: _dict['features'] = self.features.to_dict() @@ -96,6 +103,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "product_code": obj.get("product_code"), "display_name": obj.get("display_name"), "description": obj.get("description"), + "resource_types": [ResourceTypes.from_dict(_item) for _item in obj["resource_types"]] if obj.get("resource_types") is not None else None, "features": Features.from_dict(obj["features"]) if obj.get("features") is not None else None }) return _obj