Skip to content

Commit e20b096

Browse files
authored
feat(domain): add domains resource (#33)
* feat(domain): add domains resource * feat(domain): stash changes for later * feat(domain): implement endpoints * feat(xyz): dasdasd --------- Co-authored-by: Datata1 <>
1 parent 28d56b5 commit e20b096

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+890
-514
lines changed

examples/domains/delete_domain.py

Whitespace-only changes.

examples/domains/get_domain.py

Whitespace-only changes.

examples/domains/list_domains.py

Whitespace-only changes.

examples/domains/update_domain.py

Whitespace-only changes.

examples/domains/update_workspace_connections.py

Whitespace-only changes.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import asyncio
2+
import logging
3+
from codesphere import CodesphereSDK
4+
5+
logging.basicConfig(level=logging.INFO)
6+
7+
8+
async def main():
9+
async with CodesphereSDK() as sdk:
10+
team = await sdk.teams.get(team_id=35663)
11+
domain = await team.domains.create(domain_name="test.com")
12+
13+
print(f"Domain created: {domain.name}")
14+
print(domain.model_dump_json(indent=2))
15+
16+
17+
if __name__ == "__main__":
18+
asyncio.run(main())
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import asyncio
2+
import logging
3+
from codesphere import CodesphereSDK
4+
5+
logging.basicConfig(level=logging.INFO)
6+
7+
8+
async def main():
9+
async with CodesphereSDK() as sdk:
10+
team = await sdk.teams.get(team_id=35663)
11+
domain = await team.domains.delete(domain_name="test.com")
12+
13+
print(f"Domain created: {domain.name}")
14+
print(domain.model_dump_json(indent=2))
15+
16+
17+
if __name__ == "__main__":
18+
asyncio.run(main())
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import asyncio
2+
import logging
3+
from codesphere import CodesphereSDK
4+
5+
logging.basicConfig(level=logging.INFO)
6+
7+
8+
async def main():
9+
async with CodesphereSDK() as sdk:
10+
team = await sdk.teams.get(team_id=35663)
11+
logging.info(f"Working with team: {team.name}")
12+
domain = await team.domains.get("test.com")
13+
14+
print(domain.model_dump_json(indent=2))
15+
16+
17+
if __name__ == "__main__":
18+
asyncio.run(main())
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import asyncio
2+
import logging
3+
from codesphere import CodesphereSDK
4+
5+
logging.basicConfig(level=logging.INFO)
6+
7+
8+
async def main():
9+
async with CodesphereSDK() as sdk:
10+
team = await sdk.teams.get(team_id=35663)
11+
domains = await team.domains.list()
12+
13+
for domain in domains:
14+
print(f"Domain: {domain.name}")
15+
print(domain.model_dump_json(indent=2))
16+
17+
18+
if __name__ == "__main__":
19+
asyncio.run(main())
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import asyncio
2+
import logging
3+
from codesphere import CodesphereSDK, CustomDomainConfig
4+
5+
logging.basicConfig(level=logging.INFO)
6+
7+
8+
async def main():
9+
async with CodesphereSDK() as sdk:
10+
team = await sdk.teams.get(team_id=35663)
11+
domain = await team.domains.get(domain_name="test.com")
12+
13+
new_config_data = CustomDomainConfig(
14+
max_body_size_mb=24, max_connection_timeout_s=500, use_regex=False
15+
)
16+
await domain.update(new_config_data)
17+
18+
19+
if __name__ == "__main__":
20+
asyncio.run(main())

0 commit comments

Comments
 (0)