Skip to content

Commit

Permalink
feat(sdk): make offset and count parameters optional and None by default
Browse files Browse the repository at this point in the history
  • Loading branch information
catcombo committed Mar 15, 2024
1 parent 67890f1 commit 77978a3
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions youtrack_sdk/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ def get_issues[T](
model: Type[T] = Issue,
query: Optional[str] = None,
custom_fields: Sequence[str] = (),
offset: int = 0,
count: int = -1,
offset: Optional[int] = None,
count: Optional[int] = None,
) -> Sequence[T]:
"""Get all issues that match the specified query.
If you don't provide the query parameter, the server returns all issues.
Expand Down Expand Up @@ -220,8 +220,8 @@ def get_issue_custom_fields(
self,
*,
issue_id: str,
offset: int = 0,
count: int = -1,
offset: Optional[int] = None,
count: Optional[int] = None,
) -> Sequence[IssueCustomFieldType]:
"""Get the list of available custom fields of the issue.
Expand Down Expand Up @@ -275,8 +275,8 @@ def get_issue_comments(
self,
*,
issue_id: str,
offset: int = 0,
count: int = -1,
offset: Optional[int] = None,
count: Optional[int] = None,
) -> Sequence[IssueComment]:
"""Get all accessible comments of the specific issue.
Expand Down Expand Up @@ -360,8 +360,8 @@ def get_issue_attachments(
self,
*,
issue_id: str,
offset: int = 0,
count: int = -1,
offset: Optional[int] = None,
count: Optional[int] = None,
) -> Sequence[IssueAttachment]:
"""Get a list of all attachments of the specific issue.
Expand Down Expand Up @@ -416,7 +416,7 @@ def create_comment_attachments(
),
)

def get_issue_work_items(self, *, issue_id: str, offset: int = 0, count: int = -1) -> Sequence[IssueWorkItem]:
def get_issue_work_items(self, *, issue_id: str, offset: Optional[int] = None, count: Optional[int] = None) -> Sequence[IssueWorkItem]:
"""Get the list of all work items of the specific issue.
https://www.jetbrains.com/help/youtrack/devportal/resource-api-issues-issueID-timeTracking-workItems.html#get_all-IssueWorkItem-method
Expand Down Expand Up @@ -447,7 +447,7 @@ def create_issue_work_item(self, *, issue_id: str, issue_work_item: IssueWorkIte
),
)

def get_projects(self, offset: int = 0, count: int = -1) -> Sequence[Project]:
def get_projects(self, offset: Optional[int] = None, count: Optional[int] = None) -> Sequence[Project]:
"""Get a list of all available projects in the system.
https://www.jetbrains.com/help/youtrack/devportal/resource-api-admin-projects.html#get_all-Project-method
Expand All @@ -467,8 +467,8 @@ def get_project_work_item_types(
self,
*,
project_id: str,
offset: int = 0,
count: int = -1,
offset: Optional[int] = None,
count: Optional[int] = None,
) -> Sequence[WorkItemType]:
"""Get the list of all work item types that are used in the project.
Expand All @@ -485,7 +485,7 @@ def get_project_work_item_types(
),
)

def get_tags(self, offset: int = 0, count: int = -1) -> Sequence[Tag]:
def get_tags(self, offset: Optional[int] = None, count: Optional[int] = None) -> Sequence[Tag]:
"""Get all tags that are visible to the current user.
https://www.jetbrains.com/help/youtrack/devportal/resource-api-tags.html#get_all-Tag-method
Expand Down Expand Up @@ -513,7 +513,7 @@ def add_issue_tag(self, *, issue_id: str, tag: Tag):
data=tag,
)

def get_users(self, offset: int = 0, count: int = -1) -> Sequence[User]:
def get_users(self, offset: Optional[int] = None, count: Optional[int] = None) -> Sequence[User]:
"""Read the list of users in YouTrack.
https://www.jetbrains.com/help/youtrack/devportal/resource-api-users.html#get_all-User-method
Expand All @@ -532,8 +532,8 @@ def get_users(self, offset: int = 0, count: int = -1) -> Sequence[User]:
def get_issue_links(
self,
issue_id: str,
offset: int = 0,
count: int = -1,
offset: Optional[int] = None,
count: Optional[int] = None,
) -> Sequence[IssueLink]:
"""Read the list of links for the issue in YouTrack.
Expand All @@ -552,8 +552,8 @@ def get_issue_links(

def get_issue_link_types(
self,
offset: int = 0,
count: int = -1,
offset: Optional[int] = None,
count: Optional[int] = None,
) -> Sequence[IssueLinkType]:
"""Read the list of all available link types in in YouTrack.
Expand Down Expand Up @@ -609,7 +609,7 @@ def delete_issue_link(
),
)

def get_agiles(self, *, offset: int = 0, count: int = -1) -> Sequence[Agile]:
def get_agiles(self, *, offset: Optional[int] = None, count: Optional[int] = None) -> Sequence[Agile]:
"""Get the list of all available agile boards in the system.
https://www.jetbrains.com/help/youtrack/devportal/resource-api-agiles.html#get_all-Agile-method
Expand Down Expand Up @@ -643,8 +643,8 @@ def get_sprints(
self,
*,
agile_id: str,
offset: int = 0,
count: int = -1,
offset: Optional[int] = None,
count: Optional[int] = None,
) -> Sequence[Sprint]:
"""Get the list of all sprints of the agile board.
Expand Down

0 comments on commit 77978a3

Please sign in to comment.