|
14 | 14 | REQUEST_METHOD_POST, |
15 | 15 | QueryParameters, |
16 | 16 | RequestHelper, |
| 17 | + REQUEST_METHOD_PUT, |
17 | 18 | ) |
18 | 19 | from workos.types.list_resource import ( |
19 | 20 | ListArgs, |
@@ -167,11 +168,29 @@ def list_connections( |
167 | 168 | """ |
168 | 169 | ... |
169 | 170 |
|
| 171 | + def update_connection( |
| 172 | + self, |
| 173 | + *, |
| 174 | + connection_id: str, |
| 175 | + saml_options_signing_key: Optional[str] = None, |
| 176 | + saml_options_signing_cert: Optional[str] = None, |
| 177 | + ) -> SyncOrAsync[ConnectionWithDomains]: |
| 178 | + """Updates a single connection |
| 179 | +
|
| 180 | + Args: |
| 181 | + connection_id (str): Connection unique identifier |
| 182 | + saml_options_signing_key (str): Signing key for the connection (Optional) |
| 183 | + saml_options_signing_cert (str): Signing certificate for the connection (Optional) |
| 184 | + Returns: |
| 185 | + None |
| 186 | + """ |
| 187 | + ... |
| 188 | + |
170 | 189 | def delete_connection(self, connection_id: str) -> SyncOrAsync[None]: |
171 | 190 | """Deletes a single Connection |
172 | 191 |
|
173 | 192 | Args: |
174 | | - connection (str): Connection unique identifier |
| 193 | + connection_id (str): Connection unique identifier |
175 | 194 |
|
176 | 195 | Returns: |
177 | 196 | None |
@@ -255,6 +274,28 @@ def list_connections( |
255 | 274 | **ListPage[ConnectionWithDomains](**response).model_dump(), |
256 | 275 | ) |
257 | 276 |
|
| 277 | + def update_connection( |
| 278 | + self, |
| 279 | + *, |
| 280 | + connection_id: str, |
| 281 | + saml_options_signing_key: Optional[str] = None, |
| 282 | + saml_options_signing_cert: Optional[str] = None, |
| 283 | + ) -> ConnectionWithDomains: |
| 284 | + json = { |
| 285 | + "options": { |
| 286 | + "signing_key": saml_options_signing_key, |
| 287 | + "signing_cert": saml_options_signing_cert, |
| 288 | + } |
| 289 | + } |
| 290 | + |
| 291 | + response = self._http_client.request( |
| 292 | + f"connections/{connection_id}", |
| 293 | + method=REQUEST_METHOD_PUT, |
| 294 | + json=json, |
| 295 | + ) |
| 296 | + |
| 297 | + return ConnectionWithDomains.model_validate(response) |
| 298 | + |
258 | 299 | def delete_connection(self, connection_id: str) -> None: |
259 | 300 | self._http_client.request( |
260 | 301 | f"connections/{connection_id}", method=REQUEST_METHOD_DELETE |
@@ -335,6 +376,28 @@ async def list_connections( |
335 | 376 | **ListPage[ConnectionWithDomains](**response).model_dump(), |
336 | 377 | ) |
337 | 378 |
|
| 379 | + async def update_connection( |
| 380 | + self, |
| 381 | + *, |
| 382 | + connection_id: str, |
| 383 | + saml_options_signing_key: Optional[str] = None, |
| 384 | + saml_options_signing_cert: Optional[str] = None, |
| 385 | + ) -> ConnectionWithDomains: |
| 386 | + json = { |
| 387 | + "options": { |
| 388 | + "signing_key": saml_options_signing_key, |
| 389 | + "signing_cert": saml_options_signing_cert, |
| 390 | + } |
| 391 | + } |
| 392 | + |
| 393 | + response = await self._http_client.request( |
| 394 | + f"connections/{connection_id}", |
| 395 | + method=REQUEST_METHOD_PUT, |
| 396 | + json=json, |
| 397 | + ) |
| 398 | + |
| 399 | + return ConnectionWithDomains.model_validate(response) |
| 400 | + |
338 | 401 | async def delete_connection(self, connection_id: str) -> None: |
339 | 402 | await self._http_client.request( |
340 | 403 | f"connections/{connection_id}", |
|
0 commit comments