Skip to content

Commit 1ef4dd2

Browse files
author
Datata1
committed
refactor(filetree): reorganize files
1 parent 92eb69a commit 1ef4dd2

File tree

20 files changed

+32
-25
lines changed

20 files changed

+32
-25
lines changed

examples/metadata/get_workspace_base_image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
async def main():
99
"""Fetches base images."""
1010
async with CodesphereSDK() as sdk:
11-
images = await sdk.metadata.images()
11+
images = await sdk.metadata.list_images()
1212
for image in images:
1313
print(image.model_dump_json(indent=2))
1414

examples/metadata/get_workspace_plans.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
async def main():
99
"""Fetches workspace plans."""
1010
async with CodesphereSDK() as sdk:
11-
plans = await sdk.metadata.plans()
11+
plans = await sdk.metadata.list_plans()
1212

1313
for plan in plans:
1414
print(plan.model_dump_json(indent=2))

examples/teams/delete_team.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
async def main():
99
try:
1010
async with CodesphereSDK() as sdk:
11-
team_to_delete = await sdk.teams.get(team_id="<id>")
11+
team_to_delete = await sdk.teams.get(team_id=11111)
1212
print(team_to_delete.model_dump_json(indent=2))
1313
await team_to_delete.delete()
1414
print(f"Team with ID {team_to_delete.id} was successfully deleted.")

examples/teams/get_team.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
async def main():
99
try:
1010
async with CodesphereSDK() as sdk:
11-
team = await sdk.teams.get(team_id="<id>")
11+
team = await sdk.teams.get(team_id=12312)
1212
print(team.model_dump_json(indent=2))
1313

1414
except Exception as e:

src/codesphere/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222
import logging
2323
from .client import CodesphereSDK
2424

25-
from .cs_types.exceptions.exceptions import CodesphereError, AuthenticationError
26-
25+
from .exceptions import CodesphereError, AuthenticationError
2726
from .resources.team import Team, TeamCreate, TeamBase
2827
from .resources.workspace import (
2928
Workspace,

src/codesphere/client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
This module provides the main client class, CodesphereSDK.
55
"""
66

7-
from .cs_types.rest.http_client import APIHttpClient
8-
from .resources.metadata.resources import MetadataResource
9-
from .resources.team.resources import TeamsResource
10-
from .resources.workspace.resources import WorkspacesResource
7+
from .http_client import APIHttpClient
8+
from .resources.metadata import MetadataResource
9+
from .resources.team import TeamsResource
10+
from .resources.workspace import WorkspacesResource
1111

1212

1313
class CodesphereSDK:

src/codesphere/core/__init__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from .base import ResourceBase
2+
from .operations import APIOperation, AsyncCallable
3+
from .handler import _APIOperationExecutor, APIRequestHandler
4+
5+
__all__ = [
6+
"ResourceBase",
7+
"APIOperation",
8+
"_APIOperationExecutor",
9+
"APIRequestHandler",
10+
"AsyncCallable",
11+
]
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from ..cs_types.rest.http_client import APIHttpClient
2-
from ..cs_types.rest.handler import _APIOperationExecutor
1+
from ..http_client import APIHttpClient
2+
from .handler import _APIOperationExecutor
33

44

55
class ResourceBase(_APIOperationExecutor):
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import httpx
66
from pydantic import BaseModel, PrivateAttr, ValidationError
77

8-
from .http_client import APIHttpClient
8+
from ..http_client import APIHttpClient
99
from .operations import APIOperation
1010

1111
log = logging.getLogger(__name__)
File renamed without changes.

0 commit comments

Comments
 (0)