Skip to content

Commit a58c431

Browse files
author
nazarfil
committed
reuse type
1 parent a924cf1 commit a58c431

1 file changed

Lines changed: 3 additions & 16 deletions

File tree

openhexa/sdk/workspaces/current_workspace.py

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import os
77
from dataclasses import fields, make_dataclass
8+
from typing import List
89
from warnings import warn
910

1011
from openhexa.utils import stringcase
@@ -21,21 +22,7 @@
2122
S3Connection,
2223
)
2324
from openhexa.cli.api import OpenHexaClient
24-
25-
26-
class Country:
27-
"""Represents a country with its code, name, alpha3 code and flag."""
28-
29-
def __init__(self, code: str, name: str, alpha3: str, flag: str):
30-
"""Initialize a Country object."""
31-
self.code = code
32-
self.name = name
33-
self.alpha3 = alpha3
34-
self.flag = flag
35-
36-
def __repr__(self):
37-
"""Return a string representation of the Country object."""
38-
return f"Country(code={self.code}, name={self.name}, alpha3={self.alpha3}, flag={self.flag})"
25+
from ...cli.graphql.graphql_client import GetCountriesWorkspaceCountries
3926

4027

4128
class WorkspaceConfigError(Exception):
@@ -76,7 +63,7 @@ def slug(self) -> str:
7663
raise WorkspaceConfigError("The workspace slug is not available in this environment.")
7764

7865
@property
79-
def countries(self) -> list[Country]:
66+
def countries(self) -> List[GetCountriesWorkspaceCountries]:
8067
"""The countries of the workspace."""
8168
try:
8269
return OpenHexaClient().get_countries(workspace_slug=self.slug).workspace.countries

0 commit comments

Comments
 (0)