Skip to content

Commit 2954f3e

Browse files
feat(api): api update
1 parent 55b0723 commit 2954f3e

File tree

4 files changed

+11
-19
lines changed

4 files changed

+11
-19
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 46
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-d31af54a2b29a3535df6342584c2511b59a10a7c11c9c983f1cf209199c6ed0e.yml
3-
openapi_spec_hash: 6643320491f28a8bca49846e1b718c70
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-47c01c819b97af4a1a342357c958d7072f88f43bfdc5885462f9330dcf99773c.yml
3+
openapi_spec_hash: 15b236a1f536d8fb2e4356ea57de0836
44
config_hash: 53778a0b839c4f6ad34fbba051f5e8a6

src/finch/pagination.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,8 @@ def _get_page_items(self) -> List[_T]:
136136
def next_page_info(self) -> Optional[PageInfo]:
137137
offset = None
138138
if self.paging is not None: # pyright: ignore[reportUnnecessaryComparison]
139-
if self.paging.offset is not None:
139+
if self.paging.offset is not None: # pyright: ignore[reportUnnecessaryComparison]
140140
offset = self.paging.offset
141-
if offset is None:
142-
return None
143141

144142
length = len(self._get_page_items())
145143
current_count = offset + length
@@ -173,10 +171,8 @@ def _get_page_items(self) -> List[_T]:
173171
def next_page_info(self) -> Optional[PageInfo]:
174172
offset = None
175173
if self.paging is not None: # pyright: ignore[reportUnnecessaryComparison]
176-
if self.paging.offset is not None:
174+
if self.paging.offset is not None: # pyright: ignore[reportUnnecessaryComparison]
177175
offset = self.paging.offset
178-
if offset is None:
179-
return None
180176

181177
length = len(self._get_page_items())
182178
current_count = offset + length
@@ -209,10 +205,8 @@ def _get_page_items(self) -> List[_T]:
209205
def next_page_info(self) -> Optional[PageInfo]:
210206
offset = None
211207
if self.paging is not None: # pyright: ignore[reportUnnecessaryComparison]
212-
if self.paging.offset is not None:
208+
if self.paging.offset is not None: # pyright: ignore[reportUnnecessaryComparison]
213209
offset = self.paging.offset
214-
if offset is None:
215-
return None
216210

217211
length = len(self._get_page_items())
218212
current_count = offset + length
@@ -245,10 +239,8 @@ def _get_page_items(self) -> List[_T]:
245239
def next_page_info(self) -> Optional[PageInfo]:
246240
offset = None
247241
if self.paging is not None: # pyright: ignore[reportUnnecessaryComparison]
248-
if self.paging.offset is not None:
242+
if self.paging.offset is not None: # pyright: ignore[reportUnnecessaryComparison]
249243
offset = self.paging.offset
250-
if offset is None:
251-
return None
252244

253245
length = len(self._get_page_items())
254246
current_count = offset + length

src/finch/types/hris/individual_in_directory.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ class Department(BaseModel):
1313

1414

1515
class Manager(BaseModel):
16-
id: Optional[str] = None
16+
id: str
1717
"""A stable Finch `id` (UUID v4) for an individual in the company."""
1818

1919

2020
class IndividualInDirectory(BaseModel):
21-
id: Optional[str] = None
21+
id: str
2222
"""A stable Finch `id` (UUID v4) for an individual in the company."""
2323

2424
department: Optional[Department] = None

src/finch/types/shared/paging.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99

1010
class Paging(BaseModel):
11+
offset: int
12+
"""The current start index of the returned list of elements"""
13+
1114
count: Optional[int] = None
1215
"""The total number of elements for the entire query (not just the given page)"""
13-
14-
offset: Optional[int] = None
15-
"""The current start index of the returned list of elements"""

0 commit comments

Comments
 (0)