Skip to content

Commit 187f83f

Browse files
committed
fix: one more regen
1 parent 6792792 commit 187f83f

File tree

4 files changed

+40
-62
lines changed

4 files changed

+40
-62
lines changed

src/workos/audit_logs/_resource.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class AuditLogs:
2828
def __init__(self, client: "WorkOSClient") -> None:
2929
self._client = client
3030

31-
def list_organization_audit_logs_retention(
31+
def get_organization_audit_logs_retention(
3232
self,
3333
id: str,
3434
*,
@@ -383,7 +383,7 @@ class AsyncAuditLogs:
383383
def __init__(self, client: "AsyncWorkOSClient") -> None:
384384
self._client = client
385385

386-
async def list_organization_audit_logs_retention(
386+
async def get_organization_audit_logs_retention(
387387
self,
388388
id: str,
389389
*,

src/workos/organizations/_resource.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ def delete_organization(
281281
request_options=request_options,
282282
)
283283

284-
def list_organization_audit_log_configuration(
284+
def get_audit_log_configuration(
285285
self,
286286
id: str,
287287
*,
@@ -580,7 +580,7 @@ async def delete_organization(
580580
request_options=request_options,
581581
)
582582

583-
async def list_organization_audit_log_configuration(
583+
async def get_audit_log_configuration(
584584
self,
585585
id: str,
586586
*,

tests/test_audit_logs.py

Lines changed: 32 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@
2626

2727

2828
class TestAuditLogs:
29-
def test_list_organization_audit_logs_retention(self, workos, httpx_mock):
29+
def test_get_organization_audit_logs_retention(self, workos, httpx_mock):
3030
httpx_mock.add_response(
3131
json=load_fixture("audit_logs_retention_json.json"),
3232
)
33-
result = workos.audit_logs.list_organization_audit_logs_retention("test_id")
33+
result = workos.audit_logs.get_organization_audit_logs_retention("test_id")
3434
assert isinstance(result, AuditLogsRetentionJson)
3535
assert result.retention_period_in_days == 30
3636
request = httpx_mock.get_request()
@@ -172,38 +172,38 @@ def test_get_export(self, workos, httpx_mock):
172172
assert request.method == "GET"
173173
assert request.url.path.endswith("/audit_logs/exports/test_auditLogExportId")
174174

175-
def test_list_organization_audit_logs_retention_with_request_options(
175+
def test_get_organization_audit_logs_retention_with_request_options(
176176
self, workos, httpx_mock
177177
):
178178
httpx_mock.add_response(json=load_fixture("audit_logs_retention_json.json"))
179-
workos.audit_logs.list_organization_audit_logs_retention(
179+
workos.audit_logs.get_organization_audit_logs_retention(
180180
"test_id", request_options={"extra_headers": {"X-Custom": "value"}}
181181
)
182182
request = httpx_mock.get_request()
183183
assert request.headers["X-Custom"] == "value"
184184

185-
def test_list_organization_audit_logs_retention_unauthorized(
185+
def test_get_organization_audit_logs_retention_unauthorized(
186186
self, workos, httpx_mock
187187
):
188188
httpx_mock.add_response(
189189
status_code=401,
190190
json={"message": "Unauthorized"},
191191
)
192192
with pytest.raises(AuthenticationError):
193-
workos.audit_logs.list_organization_audit_logs_retention("test_id")
193+
workos.audit_logs.get_organization_audit_logs_retention("test_id")
194194

195-
def test_list_organization_audit_logs_retention_not_found(self, httpx_mock):
195+
def test_get_organization_audit_logs_retention_not_found(self, httpx_mock):
196196
workos = WorkOSClient(
197197
api_key="sk_test_123", client_id="client_test", max_retries=0
198198
)
199199
try:
200200
httpx_mock.add_response(status_code=404, json={"message": "Not found"})
201201
with pytest.raises(NotFoundError):
202-
workos.audit_logs.list_organization_audit_logs_retention("test_id")
202+
workos.audit_logs.get_organization_audit_logs_retention("test_id")
203203
finally:
204204
workos.close()
205205

206-
def test_list_organization_audit_logs_retention_rate_limited(self, httpx_mock):
206+
def test_get_organization_audit_logs_retention_rate_limited(self, httpx_mock):
207207
workos = WorkOSClient(
208208
api_key="sk_test_123", client_id="client_test", max_retries=0
209209
)
@@ -214,51 +214,51 @@ def test_list_organization_audit_logs_retention_rate_limited(self, httpx_mock):
214214
json={"message": "Slow down"},
215215
)
216216
with pytest.raises(RateLimitExceededError):
217-
workos.audit_logs.list_organization_audit_logs_retention("test_id")
217+
workos.audit_logs.get_organization_audit_logs_retention("test_id")
218218
finally:
219219
workos.close()
220220

221-
def test_list_organization_audit_logs_retention_server_error(self, httpx_mock):
221+
def test_get_organization_audit_logs_retention_server_error(self, httpx_mock):
222222
workos = WorkOSClient(
223223
api_key="sk_test_123", client_id="client_test", max_retries=0
224224
)
225225
try:
226226
httpx_mock.add_response(status_code=500, json={"message": "Server error"})
227227
with pytest.raises(ServerError):
228-
workos.audit_logs.list_organization_audit_logs_retention("test_id")
228+
workos.audit_logs.get_organization_audit_logs_retention("test_id")
229229
finally:
230230
workos.close()
231231

232-
def test_list_organization_audit_logs_retention_bad_request(self, httpx_mock):
232+
def test_get_organization_audit_logs_retention_bad_request(self, httpx_mock):
233233
workos = WorkOSClient(
234234
api_key="sk_test_123", client_id="client_test", max_retries=0
235235
)
236236
try:
237237
httpx_mock.add_response(status_code=400, json={"message": "Bad request"})
238238
with pytest.raises(BadRequestError):
239-
workos.audit_logs.list_organization_audit_logs_retention("test_id")
239+
workos.audit_logs.get_organization_audit_logs_retention("test_id")
240240
finally:
241241
workos.close()
242242

243-
def test_list_organization_audit_logs_retention_unprocessable(self, httpx_mock):
243+
def test_get_organization_audit_logs_retention_unprocessable(self, httpx_mock):
244244
workos = WorkOSClient(
245245
api_key="sk_test_123", client_id="client_test", max_retries=0
246246
)
247247
try:
248248
httpx_mock.add_response(status_code=422, json={"message": "Unprocessable"})
249249
with pytest.raises(UnprocessableEntityError):
250-
workos.audit_logs.list_organization_audit_logs_retention("test_id")
250+
workos.audit_logs.get_organization_audit_logs_retention("test_id")
251251
finally:
252252
workos.close()
253253

254254

255255
class TestAsyncAuditLogs:
256256
@pytest.mark.asyncio
257-
async def test_list_organization_audit_logs_retention(
257+
async def test_get_organization_audit_logs_retention(
258258
self, async_workos, httpx_mock
259259
):
260260
httpx_mock.add_response(json=load_fixture("audit_logs_retention_json.json"))
261-
result = await async_workos.audit_logs.list_organization_audit_logs_retention(
261+
result = await async_workos.audit_logs.get_organization_audit_logs_retention(
262262
"test_id"
263263
)
264264
assert isinstance(result, AuditLogsRetentionJson)
@@ -397,44 +397,40 @@ async def test_get_export(self, async_workos, httpx_mock):
397397
assert request.url.path.endswith("/audit_logs/exports/test_auditLogExportId")
398398

399399
@pytest.mark.asyncio
400-
async def test_list_organization_audit_logs_retention_with_request_options(
400+
async def test_get_organization_audit_logs_retention_with_request_options(
401401
self, async_workos, httpx_mock
402402
):
403403
httpx_mock.add_response(json=load_fixture("audit_logs_retention_json.json"))
404-
await async_workos.audit_logs.list_organization_audit_logs_retention(
404+
await async_workos.audit_logs.get_organization_audit_logs_retention(
405405
"test_id", request_options={"extra_headers": {"X-Custom": "value"}}
406406
)
407407
request = httpx_mock.get_request()
408408
assert request.headers["X-Custom"] == "value"
409409

410410
@pytest.mark.asyncio
411-
async def test_list_organization_audit_logs_retention_unauthorized(
411+
async def test_get_organization_audit_logs_retention_unauthorized(
412412
self, async_workos, httpx_mock
413413
):
414414
httpx_mock.add_response(status_code=401, json={"message": "Unauthorized"})
415415
with pytest.raises(AuthenticationError):
416-
await async_workos.audit_logs.list_organization_audit_logs_retention(
416+
await async_workos.audit_logs.get_organization_audit_logs_retention(
417417
"test_id"
418418
)
419419

420420
@pytest.mark.asyncio
421-
async def test_list_organization_audit_logs_retention_not_found(self, httpx_mock):
421+
async def test_get_organization_audit_logs_retention_not_found(self, httpx_mock):
422422
workos = AsyncWorkOSClient(
423423
api_key="sk_test_123", client_id="client_test", max_retries=0
424424
)
425425
try:
426426
httpx_mock.add_response(status_code=404, json={"message": "Not found"})
427427
with pytest.raises(NotFoundError):
428-
await workos.audit_logs.list_organization_audit_logs_retention(
429-
"test_id"
430-
)
428+
await workos.audit_logs.get_organization_audit_logs_retention("test_id")
431429
finally:
432430
await workos.close()
433431

434432
@pytest.mark.asyncio
435-
async def test_list_organization_audit_logs_retention_rate_limited(
436-
self, httpx_mock
437-
):
433+
async def test_get_organization_audit_logs_retention_rate_limited(self, httpx_mock):
438434
workos = AsyncWorkOSClient(
439435
api_key="sk_test_123", client_id="client_test", max_retries=0
440436
)
@@ -445,44 +441,36 @@ async def test_list_organization_audit_logs_retention_rate_limited(
445441
json={"message": "Slow down"},
446442
)
447443
with pytest.raises(RateLimitExceededError):
448-
await workos.audit_logs.list_organization_audit_logs_retention(
449-
"test_id"
450-
)
444+
await workos.audit_logs.get_organization_audit_logs_retention("test_id")
451445
finally:
452446
await workos.close()
453447

454448
@pytest.mark.asyncio
455-
async def test_list_organization_audit_logs_retention_server_error(
456-
self, httpx_mock
457-
):
449+
async def test_get_organization_audit_logs_retention_server_error(self, httpx_mock):
458450
workos = AsyncWorkOSClient(
459451
api_key="sk_test_123", client_id="client_test", max_retries=0
460452
)
461453
try:
462454
httpx_mock.add_response(status_code=500, json={"message": "Server error"})
463455
with pytest.raises(ServerError):
464-
await workos.audit_logs.list_organization_audit_logs_retention(
465-
"test_id"
466-
)
456+
await workos.audit_logs.get_organization_audit_logs_retention("test_id")
467457
finally:
468458
await workos.close()
469459

470460
@pytest.mark.asyncio
471-
async def test_list_organization_audit_logs_retention_bad_request(self, httpx_mock):
461+
async def test_get_organization_audit_logs_retention_bad_request(self, httpx_mock):
472462
workos = AsyncWorkOSClient(
473463
api_key="sk_test_123", client_id="client_test", max_retries=0
474464
)
475465
try:
476466
httpx_mock.add_response(status_code=400, json={"message": "Bad request"})
477467
with pytest.raises(BadRequestError):
478-
await workos.audit_logs.list_organization_audit_logs_retention(
479-
"test_id"
480-
)
468+
await workos.audit_logs.get_organization_audit_logs_retention("test_id")
481469
finally:
482470
await workos.close()
483471

484472
@pytest.mark.asyncio
485-
async def test_list_organization_audit_logs_retention_unprocessable(
473+
async def test_get_organization_audit_logs_retention_unprocessable(
486474
self, httpx_mock
487475
):
488476
workos = AsyncWorkOSClient(
@@ -491,8 +479,6 @@ async def test_list_organization_audit_logs_retention_unprocessable(
491479
try:
492480
httpx_mock.add_response(status_code=422, json={"message": "Unprocessable"})
493481
with pytest.raises(UnprocessableEntityError):
494-
await workos.audit_logs.list_organization_audit_logs_retention(
495-
"test_id"
496-
)
482+
await workos.audit_logs.get_organization_audit_logs_retention("test_id")
497483
finally:
498484
await workos.close()

tests/test_organizations.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,11 @@ def test_delete_organization(self, workos, httpx_mock):
115115
assert request.method == "DELETE"
116116
assert request.url.path.endswith("/organizations/test_id")
117117

118-
def test_list_organization_audit_log_configuration(self, workos, httpx_mock):
118+
def test_get_audit_log_configuration(self, workos, httpx_mock):
119119
httpx_mock.add_response(
120120
json=load_fixture("audit_log_configuration.json"),
121121
)
122-
result = workos.organizations.list_organization_audit_log_configuration(
123-
"test_id"
124-
)
122+
result = workos.organizations.get_audit_log_configuration("test_id")
125123
assert isinstance(result, AuditLogConfiguration)
126124
assert result.organization_id == "org_01EHZNVPK3SFK441A1RGBFSHRT"
127125
assert result.retention_period_in_days == 30
@@ -299,15 +297,9 @@ async def test_delete_organization(self, async_workos, httpx_mock):
299297
assert request.url.path.endswith("/organizations/test_id")
300298

301299
@pytest.mark.asyncio
302-
async def test_list_organization_audit_log_configuration(
303-
self, async_workos, httpx_mock
304-
):
300+
async def test_get_audit_log_configuration(self, async_workos, httpx_mock):
305301
httpx_mock.add_response(json=load_fixture("audit_log_configuration.json"))
306-
result = (
307-
await async_workos.organizations.list_organization_audit_log_configuration(
308-
"test_id"
309-
)
310-
)
302+
result = await async_workos.organizations.get_audit_log_configuration("test_id")
311303
assert isinstance(result, AuditLogConfiguration)
312304
assert result.organization_id == "org_01EHZNVPK3SFK441A1RGBFSHRT"
313305
assert result.retention_period_in_days == 30

0 commit comments

Comments
 (0)