|
2 | 2 |
|
3 | 3 | from __future__ import annotations
|
4 | 4 |
|
| 5 | +import typing_extensions |
| 6 | + |
5 | 7 | from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
6 | 8 | from ..._utils import maybe_transform
|
7 | 9 | from ..._resource import SyncAPIResource, AsyncAPIResource
|
8 | 10 | from ...pagination import SyncIndividualsPage, AsyncIndividualsPage
|
9 |
| -from ...types.hris import IndividualInDirectory, directory_list_individuals_params |
| 11 | +from ...types.hris import IndividualInDirectory, directory_list_params |
10 | 12 | from ..._base_client import AsyncPaginator, make_request_options
|
11 | 13 |
|
12 | 14 | __all__ = ["Directory", "AsyncDirectory"]
|
13 | 15 |
|
14 | 16 |
|
15 | 17 | class Directory(SyncAPIResource):
|
16 |
| - def list_individuals( |
| 18 | + def list( |
17 | 19 | self,
|
18 | 20 | *,
|
19 | 21 | limit: int | NotGiven = NOT_GIVEN,
|
@@ -54,15 +56,53 @@ def list_individuals(
|
54 | 56 | "limit": limit,
|
55 | 57 | "offset": offset,
|
56 | 58 | },
|
57 |
| - directory_list_individuals_params.DirectoryListIndividualsParams, |
| 59 | + directory_list_params.DirectoryListParams, |
58 | 60 | ),
|
59 | 61 | ),
|
60 | 62 | model=IndividualInDirectory,
|
61 | 63 | )
|
62 | 64 |
|
| 65 | + @typing_extensions.deprecated("use `list` instead") |
| 66 | + def list_individuals( |
| 67 | + self, |
| 68 | + *, |
| 69 | + limit: int | NotGiven = NOT_GIVEN, |
| 70 | + offset: int | NotGiven = NOT_GIVEN, |
| 71 | + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 72 | + # The extra values given here take precedence over values defined on the client or passed to this method. |
| 73 | + extra_headers: Headers | None = None, |
| 74 | + extra_query: Query | None = None, |
| 75 | + extra_body: Body | None = None, |
| 76 | + timeout: float | None | NotGiven = NOT_GIVEN, |
| 77 | + ) -> SyncIndividualsPage[IndividualInDirectory]: |
| 78 | + """ |
| 79 | + Read company directory and organization structure |
| 80 | +
|
| 81 | + Args: |
| 82 | + limit: Number of employees to return (defaults to all) |
| 83 | +
|
| 84 | + offset: Index to start from (defaults to 0) |
| 85 | +
|
| 86 | + extra_headers: Send extra headers |
| 87 | +
|
| 88 | + extra_query: Add additional query parameters to the request |
| 89 | +
|
| 90 | + extra_body: Add additional JSON properties to the request |
| 91 | +
|
| 92 | + timeout: Override the client-level default timeout for this request, in seconds |
| 93 | + """ |
| 94 | + return self.list( |
| 95 | + limit=limit, |
| 96 | + offset=offset, |
| 97 | + extra_headers=extra_headers, |
| 98 | + extra_query=extra_query, |
| 99 | + extra_body=extra_body, |
| 100 | + timeout=timeout, |
| 101 | + ) |
| 102 | + |
63 | 103 |
|
64 | 104 | class AsyncDirectory(AsyncAPIResource):
|
65 |
| - def list_individuals( |
| 105 | + def list( |
66 | 106 | self,
|
67 | 107 | *,
|
68 | 108 | limit: int | NotGiven = NOT_GIVEN,
|
@@ -103,8 +143,46 @@ def list_individuals(
|
103 | 143 | "limit": limit,
|
104 | 144 | "offset": offset,
|
105 | 145 | },
|
106 |
| - directory_list_individuals_params.DirectoryListIndividualsParams, |
| 146 | + directory_list_params.DirectoryListParams, |
107 | 147 | ),
|
108 | 148 | ),
|
109 | 149 | model=IndividualInDirectory,
|
110 | 150 | )
|
| 151 | + |
| 152 | + @typing_extensions.deprecated("use `list` instead") |
| 153 | + def list_individuals( |
| 154 | + self, |
| 155 | + *, |
| 156 | + limit: int | NotGiven = NOT_GIVEN, |
| 157 | + offset: int | NotGiven = NOT_GIVEN, |
| 158 | + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 159 | + # The extra values given here take precedence over values defined on the client or passed to this method. |
| 160 | + extra_headers: Headers | None = None, |
| 161 | + extra_query: Query | None = None, |
| 162 | + extra_body: Body | None = None, |
| 163 | + timeout: float | None | NotGiven = NOT_GIVEN, |
| 164 | + ) -> AsyncPaginator[IndividualInDirectory, AsyncIndividualsPage[IndividualInDirectory]]: |
| 165 | + """ |
| 166 | + Read company directory and organization structure |
| 167 | +
|
| 168 | + Args: |
| 169 | + limit: Number of employees to return (defaults to all) |
| 170 | +
|
| 171 | + offset: Index to start from (defaults to 0) |
| 172 | +
|
| 173 | + extra_headers: Send extra headers |
| 174 | +
|
| 175 | + extra_query: Add additional query parameters to the request |
| 176 | +
|
| 177 | + extra_body: Add additional JSON properties to the request |
| 178 | +
|
| 179 | + timeout: Override the client-level default timeout for this request, in seconds |
| 180 | + """ |
| 181 | + return self.list( |
| 182 | + limit=limit, |
| 183 | + offset=offset, |
| 184 | + extra_headers=extra_headers, |
| 185 | + extra_query=extra_query, |
| 186 | + extra_body=extra_body, |
| 187 | + timeout=timeout, |
| 188 | + ) |
0 commit comments