Skip to content

Commit

Permalink
regenerate models, fix resources issue
Browse files Browse the repository at this point in the history
  • Loading branch information
filippomc committed Feb 20, 2024
1 parent ad15ac2 commit 2c5c0be
Show file tree
Hide file tree
Showing 10 changed files with 289 additions and 261 deletions.
47 changes: 24 additions & 23 deletions applications/workspaces/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1413,34 +1413,35 @@ components:
$ref: '#/components/schemas/WorkspaceResourceBase'
-
x-tablename: Workspaceresource
properties:
origin:
description: Origin data JSON formatted of the WorkspaceResource
type: string
workspace_id:
description: workspace_id
type: integer
x-foreign-key: workspace.id
folder:
description: WorkspaceResource path where the resource will stored in the pvc.
type: string
example: repo/sample.nwb
properties:
origin:
description: Origin data JSON formatted of the WorkspaceResource
type: string
workspace_id:
description: workspace_id
type: integer
x-foreign-key: workspace.id
folder:
description: WorkspaceResource path where the resource will stored in the pvc.
type: string
example: repo/sample.nwb
WorkspaceResource:
description: Workspace Resource item of a Workspace
allOf:
-
$ref: '#/components/schemas/WorkspaceResourceBase'
properties:
workspace_id:
description: workspace_id
type: integer
origin:
$ref: '#/components/schemas/ResourceOrigin'
description: Origin Resource where the WorkspaceResource is build from
path:
description: WorkspaceResource path where the resource will stored in the pvc.
type: string
example: repo/sample.nwb
-
properties:
workspace_id:
description: workspace_id
type: integer
origin:
$ref: '#/components/schemas/ResourceOrigin'
description: Origin Resource where the WorkspaceResource is build from
path:
description: WorkspaceResource path where the resource will stored in the pvc.
type: string
example: repo/sample.nwb
OSBRepositoryBase:
description: OSB Repository Base model
required:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import six
import typing
import datetime

from workspaces import util

T = typing.TypeVar('T')
Expand All @@ -11,11 +11,11 @@
class Model(object):
# openapiTypes: The key is attribute name and the
# value is attribute type.
openapi_types: typing.Dict[str, type] = {}
openapi_types = {}

# attributeMap: The key is attribute name and the
# value is json key in definition.
attribute_map: typing.Dict[str, str] = {}
attribute_map = {}

@classmethod
def from_dict(cls: typing.Type[T], dikt) -> T:
Expand Down Expand Up @@ -44,8 +44,6 @@ def to_dict(self):
if hasattr(item[1], "to_dict") else item,
value.items()
))
elif isinstance(value, datetime.datetime):
result[attr] = value.isoformat()
else:
result[attr] = value

Expand Down
28 changes: 16 additions & 12 deletions applications/workspaces/server/workspaces/models/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,23 @@
from typing import List, Dict # noqa: F401

from workspaces.models.base_model_ import Model
from workspaces.models.tag import Tag
from workspaces.models.user import User
from workspaces.models.volume_storage import VolumeStorage
from workspaces.models.workspace_base_gallery_inner import WorkspaceBaseGalleryInner
from workspaces.models.workspace_base_tags_inner import WorkspaceBaseTagsInner
from workspaces.models.workspace_all_of import WorkspaceAllOf
from workspaces.models.workspace_base import WorkspaceBase
from workspaces.models.workspace_collaborator import WorkspaceCollaborator
from workspaces.models.workspace_image import WorkspaceImage
from workspaces.models.workspace_resource import WorkspaceResource
from workspaces import util

from workspaces.models.tag import Tag # noqa: E501
from workspaces.models.user import User # noqa: E501
from workspaces.models.volume_storage import VolumeStorage # noqa: E501
from workspaces.models.workspace_base_gallery_inner import WorkspaceBaseGalleryInner # noqa: E501
from workspaces.models.workspace_base_tags_inner import WorkspaceBaseTagsInner # noqa: E501
from workspaces.models.workspace_all_of import WorkspaceAllOf # noqa: E501
from workspaces.models.workspace_base import WorkspaceBase # noqa: E501
from workspaces.models.workspace_collaborator import WorkspaceCollaborator # noqa: E501
from workspaces.models.workspace_image import WorkspaceImage # noqa: E501
from workspaces.models.workspace_resource import WorkspaceResource # noqa: E501

class Workspace(Model):
Expand All @@ -45,7 +49,7 @@ def __init__(self, id=None, name=None, description=None, timestamp_created=None,
:param thumbnail: The thumbnail of this Workspace. # noqa: E501
:type thumbnail: str
:param gallery: The gallery of this Workspace. # noqa: E501
:type gallery: List[WorkspaceBaseGalleryInner]
:type gallery: List[WorkspaceImage]
:param user_id: The user_id of this Workspace. # noqa: E501
:type user_id: str
:param publicable: The publicable of this Workspace. # noqa: E501
Expand All @@ -59,7 +63,7 @@ def __init__(self, id=None, name=None, description=None, timestamp_created=None,
:param storage: The storage of this Workspace. # noqa: E501
:type storage: VolumeStorage
:param tags: The tags of this Workspace. # noqa: E501
:type tags: List[WorkspaceBaseTagsInner]
:type tags: List[Tag]
:param resources: The resources of this Workspace. # noqa: E501
:type resources: List[WorkspaceResource]
:param user: The user of this Workspace. # noqa: E501
Expand All @@ -73,14 +77,14 @@ def __init__(self, id=None, name=None, description=None, timestamp_created=None,
'timestamp_updated': datetime,
'last_opened_resource_id': int,
'thumbnail': str,
'gallery': List[WorkspaceBaseGalleryInner],
'gallery': List[WorkspaceImage],
'user_id': str,
'publicable': bool,
'featured': bool,
'license': str,
'collaborators': List[WorkspaceCollaborator],
'storage': VolumeStorage,
'tags': List[WorkspaceBaseTagsInner],
'tags': List[Tag],
'resources': List[WorkspaceResource],
'user': User
}
Expand Down Expand Up @@ -302,7 +306,7 @@ def gallery(self):
Gallery with images of the workspace # noqa: E501
:return: The gallery of this Workspace.
:rtype: List[WorkspaceBaseGalleryInner]
:rtype: List[WorkspaceImage]
"""
return self._gallery

Expand All @@ -313,7 +317,7 @@ def gallery(self, gallery):
Gallery with images of the workspace # noqa: E501
:param gallery: The gallery of this Workspace.
:type gallery: List[WorkspaceBaseGalleryInner]
:type gallery: List[WorkspaceImage]
"""

self._gallery = gallery
Expand Down Expand Up @@ -460,7 +464,7 @@ def tags(self):
:return: The tags of this Workspace.
:rtype: List[WorkspaceBaseTagsInner]
:rtype: List[Tag]
"""
return self._tags

Expand All @@ -470,7 +474,7 @@ def tags(self, tags):
:param tags: The tags of this Workspace.
:type tags: List[WorkspaceBaseTagsInner]
:type tags: List[Tag]
"""

self._tags = tags
Expand Down
24 changes: 12 additions & 12 deletions applications/workspaces/server/workspaces/models/workspace_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
from typing import List, Dict # noqa: F401

from workspaces.models.base_model_ import Model
from workspaces.models.tag import Tag
from workspaces.models.volume_storage import VolumeStorage
from workspaces.models.workspace_base_gallery_inner import WorkspaceBaseGalleryInner
from workspaces.models.workspace_base_tags_inner import WorkspaceBaseTagsInner
from workspaces.models.workspace_collaborator import WorkspaceCollaborator
from workspaces.models.workspace_image import WorkspaceImage
from workspaces import util

from workspaces.models.tag import Tag # noqa: E501
from workspaces.models.volume_storage import VolumeStorage # noqa: E501
from workspaces.models.workspace_base_gallery_inner import WorkspaceBaseGalleryInner # noqa: E501
from workspaces.models.workspace_base_tags_inner import WorkspaceBaseTagsInner # noqa: E501
from workspaces.models.workspace_collaborator import WorkspaceCollaborator # noqa: E501
from workspaces.models.workspace_image import WorkspaceImage # noqa: E501

class WorkspaceBase(Model):
"""NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand All @@ -41,7 +41,7 @@ def __init__(self, id=None, name=None, description=None, timestamp_created=None,
:param thumbnail: The thumbnail of this WorkspaceBase. # noqa: E501
:type thumbnail: str
:param gallery: The gallery of this WorkspaceBase. # noqa: E501
:type gallery: List[WorkspaceBaseGalleryInner]
:type gallery: List[WorkspaceImage]
:param user_id: The user_id of this WorkspaceBase. # noqa: E501
:type user_id: str
:param publicable: The publicable of this WorkspaceBase. # noqa: E501
Expand All @@ -55,7 +55,7 @@ def __init__(self, id=None, name=None, description=None, timestamp_created=None,
:param storage: The storage of this WorkspaceBase. # noqa: E501
:type storage: VolumeStorage
:param tags: The tags of this WorkspaceBase. # noqa: E501
:type tags: List[WorkspaceBaseTagsInner]
:type tags: List[Tag]
"""
self.openapi_types = {
'id': int,
Expand All @@ -65,14 +65,14 @@ def __init__(self, id=None, name=None, description=None, timestamp_created=None,
'timestamp_updated': datetime,
'last_opened_resource_id': int,
'thumbnail': str,
'gallery': List[WorkspaceBaseGalleryInner],
'gallery': List[WorkspaceImage],
'user_id': str,
'publicable': bool,
'featured': bool,
'license': str,
'collaborators': List[WorkspaceCollaborator],
'storage': VolumeStorage,
'tags': List[WorkspaceBaseTagsInner]
'tags': List[Tag]
}

self.attribute_map = {
Expand Down Expand Up @@ -288,7 +288,7 @@ def gallery(self):
Gallery with images of the workspace # noqa: E501
:return: The gallery of this WorkspaceBase.
:rtype: List[WorkspaceBaseGalleryInner]
:rtype: List[WorkspaceImage]
"""
return self._gallery

Expand All @@ -299,7 +299,7 @@ def gallery(self, gallery):
Gallery with images of the workspace # noqa: E501
:param gallery: The gallery of this WorkspaceBase.
:type gallery: List[WorkspaceBaseGalleryInner]
:type gallery: List[WorkspaceImage]
"""

self._gallery = gallery
Expand Down Expand Up @@ -446,7 +446,7 @@ def tags(self):
:return: The tags of this WorkspaceBase.
:rtype: List[WorkspaceBaseTagsInner]
:rtype: List[Tag]
"""
return self._tags

Expand All @@ -456,7 +456,7 @@ def tags(self, tags):
:param tags: The tags of this WorkspaceBase.
:type tags: List[WorkspaceBaseTagsInner]
:type tags: List[Tag]
"""

self._tags = tags
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,21 @@
from typing import List, Dict # noqa: F401

from workspaces.models.base_model_ import Model
from workspaces.models.tag import Tag
from workspaces.models.volume_storage import VolumeStorage
from workspaces.models.workspace_base_gallery_inner import WorkspaceBaseGalleryInner
from workspaces.models.workspace_base_tags_inner import WorkspaceBaseTagsInner
from workspaces.models.workspace_base import WorkspaceBase
from workspaces.models.workspace_collaborator import WorkspaceCollaborator
from workspaces.models.workspace_entity_all_of import WorkspaceEntityAllOf
from workspaces.models.workspace_image import WorkspaceImage
from workspaces.models.workspace_resource_entity import WorkspaceResourceEntity
from workspaces import util

from workspaces.models.tag import Tag # noqa: E501
from workspaces.models.volume_storage import VolumeStorage # noqa: E501
from workspaces.models.workspace_base_gallery_inner import WorkspaceBaseGalleryInner # noqa: E501
from workspaces.models.workspace_base_tags_inner import WorkspaceBaseTagsInner # noqa: E501
from workspaces.models.workspace_base import WorkspaceBase # noqa: E501
from workspaces.models.workspace_collaborator import WorkspaceCollaborator # noqa: E501
from workspaces.models.workspace_entity_all_of import WorkspaceEntityAllOf # noqa: E501
from workspaces.models.workspace_image import WorkspaceImage # noqa: E501
from workspaces.models.workspace_resource_entity import WorkspaceResourceEntity # noqa: E501

class WorkspaceEntity(Model):
Expand All @@ -43,7 +47,7 @@ def __init__(self, id=None, name=None, description=None, timestamp_created=None,
:param thumbnail: The thumbnail of this WorkspaceEntity. # noqa: E501
:type thumbnail: str
:param gallery: The gallery of this WorkspaceEntity. # noqa: E501
:type gallery: List[WorkspaceBaseGalleryInner]
:type gallery: List[WorkspaceImage]
:param user_id: The user_id of this WorkspaceEntity. # noqa: E501
:type user_id: str
:param publicable: The publicable of this WorkspaceEntity. # noqa: E501
Expand All @@ -57,7 +61,7 @@ def __init__(self, id=None, name=None, description=None, timestamp_created=None,
:param storage: The storage of this WorkspaceEntity. # noqa: E501
:type storage: VolumeStorage
:param tags: The tags of this WorkspaceEntity. # noqa: E501
:type tags: List[WorkspaceBaseTagsInner]
:type tags: List[Tag]
:param resources: The resources of this WorkspaceEntity. # noqa: E501
:type resources: List[WorkspaceResourceEntity]
"""
Expand All @@ -69,14 +73,14 @@ def __init__(self, id=None, name=None, description=None, timestamp_created=None,
'timestamp_updated': datetime,
'last_opened_resource_id': int,
'thumbnail': str,
'gallery': List[WorkspaceBaseGalleryInner],
'gallery': List[WorkspaceImage],
'user_id': str,
'publicable': bool,
'featured': bool,
'license': str,
'collaborators': List[WorkspaceCollaborator],
'storage': VolumeStorage,
'tags': List[WorkspaceBaseTagsInner],
'tags': List[Tag],
'resources': List[WorkspaceResourceEntity]
}

Expand Down Expand Up @@ -295,7 +299,7 @@ def gallery(self):
Gallery with images of the workspace # noqa: E501
:return: The gallery of this WorkspaceEntity.
:rtype: List[WorkspaceBaseGalleryInner]
:rtype: List[WorkspaceImage]
"""
return self._gallery

Expand All @@ -306,7 +310,7 @@ def gallery(self, gallery):
Gallery with images of the workspace # noqa: E501
:param gallery: The gallery of this WorkspaceEntity.
:type gallery: List[WorkspaceBaseGalleryInner]
:type gallery: List[WorkspaceImage]
"""

self._gallery = gallery
Expand Down Expand Up @@ -453,7 +457,7 @@ def tags(self):
:return: The tags of this WorkspaceEntity.
:rtype: List[WorkspaceBaseTagsInner]
:rtype: List[Tag]
"""
return self._tags

Expand All @@ -463,7 +467,7 @@ def tags(self, tags):
:param tags: The tags of this WorkspaceEntity.
:type tags: List[WorkspaceBaseTagsInner]
:type tags: List[Tag]
"""

self._tags = tags
Expand Down
Loading

0 comments on commit 2c5c0be

Please sign in to comment.