-
Notifications
You must be signed in to change notification settings - Fork 9
[SILO-1276] feat: add work item page links, page listing, intake status, and archive methods #36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
akhil-vamshi-konam
wants to merge
6
commits into
main
Choose a base branch
from
chore-page-to-work-item-attachment
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
dcd38b7
feat: add work item pages API and models
akhil-vamshi-konam 85b2800
feat: add methods to list workspace and project pages
akhil-vamshi-konam 7c55f54
fix: update params type in WorkItemPages to use Mapping for better ty…
akhil-vamshi-konam 34cf7e0
chore: add update status method for intake work items and list archiv…
akhil-vamshi-konam 2d54793
chore: add title field to CreateWorkItemLink
akhil-vamshi-konam 678dc5d
chore: add delete methods for workspace and project pages
akhil-vamshi-konam File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| from collections.abc import Mapping | ||
| from typing import Any | ||
|
|
||
| from ...models.work_item_pages import ( | ||
| CreateWorkItemPage, | ||
| PaginatedWorkItemPageResponse, | ||
| WorkItemPage, | ||
| ) | ||
| from ..base_resource import BaseResource | ||
|
|
||
|
|
||
| class WorkItemPages(BaseResource): | ||
| def __init__(self, config: Any) -> None: | ||
| super().__init__(config, "/workspaces/") | ||
|
|
||
| def list( | ||
| self, | ||
| workspace_slug: str, | ||
| project_id: str, | ||
| work_item_id: str, | ||
| params: Mapping[str, Any] | None = None, | ||
| ) -> PaginatedWorkItemPageResponse: | ||
| """List page links for a work item. | ||
|
|
||
| Args: | ||
| workspace_slug: The workspace slug identifier | ||
| project_id: UUID of the project | ||
| work_item_id: UUID of the work item | ||
| params: Optional query parameters | ||
| """ | ||
| response = self._get( | ||
| f"{workspace_slug}/projects/{project_id}/work-items/{work_item_id}/pages", | ||
| params=params, | ||
| ) | ||
|
akhil-vamshi-konam marked this conversation as resolved.
|
||
| return PaginatedWorkItemPageResponse.model_validate(response) | ||
|
|
||
| def retrieve( | ||
| self, | ||
| workspace_slug: str, | ||
| project_id: str, | ||
| work_item_id: str, | ||
| work_item_page_id: str, | ||
| ) -> WorkItemPage: | ||
| """Retrieve a specific page link for a work item. | ||
|
|
||
| Args: | ||
| workspace_slug: The workspace slug identifier | ||
| project_id: UUID of the project | ||
| work_item_id: UUID of the work item | ||
| work_item_page_id: UUID of the work item page link | ||
| """ | ||
| response = self._get( | ||
| f"{workspace_slug}/projects/{project_id}/work-items/{work_item_id}/pages/{work_item_page_id}" | ||
| ) | ||
| return WorkItemPage.model_validate(response) | ||
|
|
||
| def create( | ||
| self, | ||
| workspace_slug: str, | ||
| project_id: str, | ||
| work_item_id: str, | ||
| data: CreateWorkItemPage, | ||
| ) -> WorkItemPage: | ||
| """Link a page to a work item. | ||
|
|
||
| Args: | ||
| workspace_slug: The workspace slug identifier | ||
| project_id: UUID of the project | ||
| work_item_id: UUID of the work item | ||
| data: Page link data containing page_id | ||
| """ | ||
| response = self._post( | ||
| f"{workspace_slug}/projects/{project_id}/work-items/{work_item_id}/pages", | ||
| data.model_dump(exclude_none=True), | ||
| ) | ||
| return WorkItemPage.model_validate(response) | ||
|
|
||
| def delete( | ||
| self, | ||
| workspace_slug: str, | ||
| project_id: str, | ||
| work_item_id: str, | ||
| work_item_page_id: str, | ||
| ) -> None: | ||
| """Remove a page link from a work item. | ||
|
|
||
| Args: | ||
| workspace_slug: The workspace slug identifier | ||
| project_id: UUID of the project | ||
| work_item_id: UUID of the work item | ||
| work_item_page_id: UUID of the work item page link | ||
| """ | ||
| return self._delete( | ||
| f"{workspace_slug}/projects/{project_id}/work-items/{work_item_id}/pages/{work_item_page_id}" | ||
| ) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| from typing import Any | ||
|
|
||
| from pydantic import BaseModel, ConfigDict | ||
|
|
||
| from .pagination import PaginatedResponse | ||
|
|
||
|
|
||
| class WorkItemPageLite(BaseModel): | ||
| """Nested page info returned inside a WorkItemPage response.""" | ||
|
|
||
| model_config = ConfigDict(extra="allow", populate_by_name=True) | ||
|
|
||
| id: str | None = None | ||
| name: str | None = None | ||
| created_at: str | None = None | ||
| updated_at: str | None = None | ||
| created_by: str | None = None | ||
| is_global: bool | None = None | ||
| logo_props: Any | None = None | ||
|
|
||
|
|
||
| class WorkItemPage(BaseModel): | ||
| """Work item to page link.""" | ||
|
|
||
| model_config = ConfigDict(extra="allow", populate_by_name=True) | ||
|
|
||
| id: str | None = None | ||
| page: WorkItemPageLite | None = None | ||
| issue: str | None = None | ||
| project: str | None = None | ||
| workspace: str | None = None | ||
| created_at: str | None = None | ||
| updated_at: str | None = None | ||
| created_by: str | None = None | ||
|
|
||
|
|
||
| class CreateWorkItemPage(BaseModel): | ||
| """Request model for linking a page to a work item.""" | ||
|
|
||
| model_config = ConfigDict(extra="ignore", populate_by_name=True) | ||
|
|
||
| page_id: str | ||
|
|
||
|
|
||
| class PaginatedWorkItemPageResponse(PaginatedResponse): | ||
| """Paginated response for work item page links.""" | ||
|
|
||
| model_config = ConfigDict(extra="allow", populate_by_name=True) | ||
|
|
||
| results: list[WorkItemPage] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.