Skip to content

Conversation

alexandrujircan
Copy link
Collaborator

Comment on lines +51 to +58
def _get_project_tags(self, project_id: str) -> List[str]:
response = self.request(
"GET",
url=Endpoint(f"/du_/api/framework/projects/{project_id}/tags"),
params={"api-version": 1.1},
headers={"X-UiPath-Internal-Agents-Integration": "true"},
)
return [tag["name"] for tag in response.json().get("tags", [])]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def _get_project_tags(self, project_id: str) -> List[str]:
response = self.request(
"GET",
url=Endpoint(f"/du_/api/framework/projects/{project_id}/tags"),
params={"api-version": 1.1},
headers={"X-UiPath-Internal-Agents-Integration": "true"},
)
return [tag["name"] for tag in response.json().get("tags", [])]
def _get_project_tags(self, project_id: str) -> Set[str]:
response = self.request(
"GET",
url=Endpoint(f"/du_/api/framework/projects/{project_id}/tags"),
params={"api-version": 1.1},
headers={"X-UiPath-Internal-Agents-Integration": "true"},
)
return {tag["name"] for tag in response.json().get("tags", [])}

nit: make this a set since we shouldn't have duplicates

return self.request(
"POST",
url=Endpoint(
f"/du_/api/framework/projects/{project_id}/{tag}/document-types/{UUID(int=0)}/extraction/start"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When do we use UUID(int=0) vs a real document type id?

headers={"X-UiPath-Internal-Agents-Integration": "true"},
).json()

def _wait_for_validation(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe rename this to _wait_for_validation_creation (or maybe _wait_for_validation_start) and create another method _wait_for_validation_completion that contains the code which is now in get_validation_result. I feel like this naming would make it clearer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants