Skip to content

Commit 2b2e9e2

Browse files
committed
fix: slight rename
1 parent 807437c commit 2b2e9e2

File tree

14 files changed

+138
-138
lines changed

14 files changed

+138
-138
lines changed

src/workos/api_keys/_resource.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class ApiKeys:
1919
def __init__(self, client: "WorkOSClient") -> None:
2020
self._client = client
2121

22-
def create_validations(
22+
def create_validation(
2323
self,
2424
*,
2525
value: str,
@@ -128,7 +128,7 @@ def list_organization_api_keys(
128128
request_options=request_options,
129129
)
130130

131-
def create_organization_api_keys(
131+
def create_organization_api_key(
132132
self,
133133
organization_id: str,
134134
*,
@@ -179,7 +179,7 @@ class AsyncApiKeys:
179179
def __init__(self, client: "AsyncWorkOSClient") -> None:
180180
self._client = client
181181

182-
async def create_validations(
182+
async def create_validation(
183183
self,
184184
*,
185185
value: str,
@@ -288,7 +288,7 @@ async def list_organization_api_keys(
288288
request_options=request_options,
289289
)
290290

291-
async def create_organization_api_keys(
291+
async def create_organization_api_key(
292292
self,
293293
organization_id: str,
294294
*,

src/workos/authorization/_resource.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ def delete_organization_role(
518518
request_options=request_options,
519519
)
520520

521-
def create_role_permissions(
521+
def create_role_permission(
522522
self,
523523
organization_id: str,
524524
slug: str,
@@ -2075,7 +2075,7 @@ async def delete_organization_role(
20752075
request_options=request_options,
20762076
)
20772077

2078-
async def create_role_permissions(
2078+
async def create_role_permission(
20792079
self,
20802080
organization_id: str,
20812081
slug: str,

src/workos/connect/_resource.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def list_applications(
138138
request_options=request_options,
139139
)
140140

141-
def create_applications(
141+
def create_application(
142142
self,
143143
*,
144144
body: Union[CreateOAuthApplication, CreateM2MApplication, Dict[str, Any]],
@@ -377,7 +377,7 @@ def list_application_client_secrets(
377377
for item in raw
378378
]
379379

380-
def create_application_client_secrets(
380+
def create_application_client_secret(
381381
self,
382382
id: str,
383383
*,
@@ -552,7 +552,7 @@ async def list_applications(
552552
request_options=request_options,
553553
)
554554

555-
async def create_applications(
555+
async def create_application(
556556
self,
557557
*,
558558
body: Union[CreateOAuthApplication, CreateM2MApplication, Dict[str, Any]],
@@ -791,7 +791,7 @@ async def list_application_client_secrets(
791791
for item in raw
792792
]
793793

794-
async def create_application_client_secrets(
794+
async def create_application_client_secret(
795795
self,
796796
id: str,
797797
*,

src/workos/multi_factor_auth/_resource.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ def list_user_auth_factors(
264264
request_options=request_options,
265265
)
266266

267-
def create_user_auth_factors(
267+
def create_user_auth_factor(
268268
self,
269269
userland_user_id: str,
270270
*,
@@ -556,7 +556,7 @@ async def list_user_auth_factors(
556556
request_options=request_options,
557557
)
558558

559-
async def create_user_auth_factors(
559+
async def create_user_auth_factor(
560560
self,
561561
userland_user_id: str,
562562
*,

src/workos/organization_domains/_resource.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class OrganizationDomains:
1717
def __init__(self, client: "WorkOSClient") -> None:
1818
self._client = client
1919

20-
def create_organization_domains(
20+
def create_organization_domain(
2121
self,
2222
*,
2323
domain: str,
@@ -147,7 +147,7 @@ class AsyncOrganizationDomains:
147147
def __init__(self, client: "AsyncWorkOSClient") -> None:
148148
self._client = client
149149

150-
async def create_organization_domains(
150+
async def create_organization_domain(
151151
self,
152152
*,
153153
domain: str,

src/workos/radar/_resource.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class Radar:
2424
def __init__(self, client: "WorkOSClient") -> None:
2525
self._client = client
2626

27-
def create_attempts(
27+
def create_attempt(
2828
self,
2929
*,
3030
ip_address: str,
@@ -200,7 +200,7 @@ class AsyncRadar:
200200
def __init__(self, client: "AsyncWorkOSClient") -> None:
201201
self._client = client
202202

203-
async def create_attempts(
203+
async def create_attempt(
204204
self,
205205
*,
206206
ip_address: str,

src/workos/webhooks/_resource.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def list_webhook_endpoints(
7878
request_options=request_options,
7979
)
8080

81-
def create_webhook_endpoints(
81+
def create_webhook_endpoint(
8282
self,
8383
*,
8484
endpoint_url: str,
@@ -333,7 +333,7 @@ async def list_webhook_endpoints(
333333
request_options=request_options,
334334
)
335335

336-
async def create_webhook_endpoints(
336+
async def create_webhook_endpoint(
337337
self,
338338
*,
339339
endpoint_url: str,

tests/test_api_keys.py

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@
2323

2424

2525
class TestApiKeys:
26-
def test_create_validations(self, workos, httpx_mock):
26+
def test_create_validation(self, workos, httpx_mock):
2727
httpx_mock.add_response(
2828
json=load_fixture("api_key_validation_response.json"),
2929
)
30-
result = workos.api_keys.create_validations(value="test_value")
30+
result = workos.api_keys.create_validation(value="test_value")
3131
assert isinstance(result, ApiKeyValidationResponse)
3232
request = httpx_mock.get_request()
3333
assert request.method == "POST"
@@ -72,11 +72,11 @@ def test_list_organization_api_keys_encodes_query_params(self, workos, httpx_moc
7272
assert request.url.params["after"] == "cursor/after"
7373
assert request.url.params["order"] == "normal"
7474

75-
def test_create_organization_api_keys(self, workos, httpx_mock):
75+
def test_create_organization_api_key(self, workos, httpx_mock):
7676
httpx_mock.add_response(
7777
json=load_fixture("api_key_with_value.json"),
7878
)
79-
result = workos.api_keys.create_organization_api_keys(
79+
result = workos.api_keys.create_organization_api_key(
8080
"test_organizationId", name="test_name"
8181
)
8282
assert isinstance(result, ApiKeyWithValue)
@@ -88,34 +88,34 @@ def test_create_organization_api_keys(self, workos, httpx_mock):
8888
body = json.loads(request.content)
8989
assert body["name"] == "test_name"
9090

91-
def test_create_validations_with_request_options(self, workos, httpx_mock):
91+
def test_create_validation_with_request_options(self, workos, httpx_mock):
9292
httpx_mock.add_response(json=load_fixture("api_key_validation_response.json"))
93-
workos.api_keys.create_validations(
93+
workos.api_keys.create_validation(
9494
value="test_value", request_options={"extra_headers": {"X-Custom": "value"}}
9595
)
9696
request = httpx_mock.get_request()
9797
assert request.headers["X-Custom"] == "value"
9898

99-
def test_create_validations_unauthorized(self, workos, httpx_mock):
99+
def test_create_validation_unauthorized(self, workos, httpx_mock):
100100
httpx_mock.add_response(
101101
status_code=401,
102102
json={"message": "Unauthorized"},
103103
)
104104
with pytest.raises(AuthenticationError):
105-
workos.api_keys.create_validations(value="test_value")
105+
workos.api_keys.create_validation(value="test_value")
106106

107-
def test_create_validations_not_found(self, httpx_mock):
107+
def test_create_validation_not_found(self, httpx_mock):
108108
workos = WorkOSClient(
109109
api_key="sk_test_123", client_id="client_test", max_retries=0
110110
)
111111
try:
112112
httpx_mock.add_response(status_code=404, json={"message": "Not found"})
113113
with pytest.raises(NotFoundError):
114-
workos.api_keys.create_validations(value="test_value")
114+
workos.api_keys.create_validation(value="test_value")
115115
finally:
116116
workos.close()
117117

118-
def test_create_validations_rate_limited(self, httpx_mock):
118+
def test_create_validation_rate_limited(self, httpx_mock):
119119
workos = WorkOSClient(
120120
api_key="sk_test_123", client_id="client_test", max_retries=0
121121
)
@@ -126,49 +126,49 @@ def test_create_validations_rate_limited(self, httpx_mock):
126126
json={"message": "Slow down"},
127127
)
128128
with pytest.raises(RateLimitExceededError):
129-
workos.api_keys.create_validations(value="test_value")
129+
workos.api_keys.create_validation(value="test_value")
130130
finally:
131131
workos.close()
132132

133-
def test_create_validations_server_error(self, httpx_mock):
133+
def test_create_validation_server_error(self, httpx_mock):
134134
workos = WorkOSClient(
135135
api_key="sk_test_123", client_id="client_test", max_retries=0
136136
)
137137
try:
138138
httpx_mock.add_response(status_code=500, json={"message": "Server error"})
139139
with pytest.raises(ServerError):
140-
workos.api_keys.create_validations(value="test_value")
140+
workos.api_keys.create_validation(value="test_value")
141141
finally:
142142
workos.close()
143143

144-
def test_create_validations_bad_request(self, httpx_mock):
144+
def test_create_validation_bad_request(self, httpx_mock):
145145
workos = WorkOSClient(
146146
api_key="sk_test_123", client_id="client_test", max_retries=0
147147
)
148148
try:
149149
httpx_mock.add_response(status_code=400, json={"message": "Bad request"})
150150
with pytest.raises(BadRequestError):
151-
workos.api_keys.create_validations(value="test_value")
151+
workos.api_keys.create_validation(value="test_value")
152152
finally:
153153
workos.close()
154154

155-
def test_create_validations_unprocessable(self, httpx_mock):
155+
def test_create_validation_unprocessable(self, httpx_mock):
156156
workos = WorkOSClient(
157157
api_key="sk_test_123", client_id="client_test", max_retries=0
158158
)
159159
try:
160160
httpx_mock.add_response(status_code=422, json={"message": "Unprocessable"})
161161
with pytest.raises(UnprocessableEntityError):
162-
workos.api_keys.create_validations(value="test_value")
162+
workos.api_keys.create_validation(value="test_value")
163163
finally:
164164
workos.close()
165165

166166

167167
class TestAsyncApiKeys:
168168
@pytest.mark.asyncio
169-
async def test_create_validations(self, async_workos, httpx_mock):
169+
async def test_create_validation(self, async_workos, httpx_mock):
170170
httpx_mock.add_response(json=load_fixture("api_key_validation_response.json"))
171-
result = await async_workos.api_keys.create_validations(value="test_value")
171+
result = await async_workos.api_keys.create_validation(value="test_value")
172172
assert isinstance(result, ApiKeyValidationResponse)
173173
request = httpx_mock.get_request()
174174
assert request.method == "POST"
@@ -222,9 +222,9 @@ async def test_list_organization_api_keys_encodes_query_params(
222222
assert request.url.params["order"] == "normal"
223223

224224
@pytest.mark.asyncio
225-
async def test_create_organization_api_keys(self, async_workos, httpx_mock):
225+
async def test_create_organization_api_key(self, async_workos, httpx_mock):
226226
httpx_mock.add_response(json=load_fixture("api_key_with_value.json"))
227-
result = await async_workos.api_keys.create_organization_api_keys(
227+
result = await async_workos.api_keys.create_organization_api_key(
228228
"test_organizationId", name="test_name"
229229
)
230230
assert isinstance(result, ApiKeyWithValue)
@@ -235,36 +235,36 @@ async def test_create_organization_api_keys(self, async_workos, httpx_mock):
235235
assert request.url.path.endswith("/organizations/test_organizationId/api_keys")
236236

237237
@pytest.mark.asyncio
238-
async def test_create_validations_with_request_options(
238+
async def test_create_validation_with_request_options(
239239
self, async_workos, httpx_mock
240240
):
241241
httpx_mock.add_response(json=load_fixture("api_key_validation_response.json"))
242-
await async_workos.api_keys.create_validations(
242+
await async_workos.api_keys.create_validation(
243243
value="test_value", request_options={"extra_headers": {"X-Custom": "value"}}
244244
)
245245
request = httpx_mock.get_request()
246246
assert request.headers["X-Custom"] == "value"
247247

248248
@pytest.mark.asyncio
249-
async def test_create_validations_unauthorized(self, async_workos, httpx_mock):
249+
async def test_create_validation_unauthorized(self, async_workos, httpx_mock):
250250
httpx_mock.add_response(status_code=401, json={"message": "Unauthorized"})
251251
with pytest.raises(AuthenticationError):
252-
await async_workos.api_keys.create_validations(value="test_value")
252+
await async_workos.api_keys.create_validation(value="test_value")
253253

254254
@pytest.mark.asyncio
255-
async def test_create_validations_not_found(self, httpx_mock):
255+
async def test_create_validation_not_found(self, httpx_mock):
256256
workos = AsyncWorkOSClient(
257257
api_key="sk_test_123", client_id="client_test", max_retries=0
258258
)
259259
try:
260260
httpx_mock.add_response(status_code=404, json={"message": "Not found"})
261261
with pytest.raises(NotFoundError):
262-
await workos.api_keys.create_validations(value="test_value")
262+
await workos.api_keys.create_validation(value="test_value")
263263
finally:
264264
await workos.close()
265265

266266
@pytest.mark.asyncio
267-
async def test_create_validations_rate_limited(self, httpx_mock):
267+
async def test_create_validation_rate_limited(self, httpx_mock):
268268
workos = AsyncWorkOSClient(
269269
api_key="sk_test_123", client_id="client_test", max_retries=0
270270
)
@@ -275,42 +275,42 @@ async def test_create_validations_rate_limited(self, httpx_mock):
275275
json={"message": "Slow down"},
276276
)
277277
with pytest.raises(RateLimitExceededError):
278-
await workos.api_keys.create_validations(value="test_value")
278+
await workos.api_keys.create_validation(value="test_value")
279279
finally:
280280
await workos.close()
281281

282282
@pytest.mark.asyncio
283-
async def test_create_validations_server_error(self, httpx_mock):
283+
async def test_create_validation_server_error(self, httpx_mock):
284284
workos = AsyncWorkOSClient(
285285
api_key="sk_test_123", client_id="client_test", max_retries=0
286286
)
287287
try:
288288
httpx_mock.add_response(status_code=500, json={"message": "Server error"})
289289
with pytest.raises(ServerError):
290-
await workos.api_keys.create_validations(value="test_value")
290+
await workos.api_keys.create_validation(value="test_value")
291291
finally:
292292
await workos.close()
293293

294294
@pytest.mark.asyncio
295-
async def test_create_validations_bad_request(self, httpx_mock):
295+
async def test_create_validation_bad_request(self, httpx_mock):
296296
workos = AsyncWorkOSClient(
297297
api_key="sk_test_123", client_id="client_test", max_retries=0
298298
)
299299
try:
300300
httpx_mock.add_response(status_code=400, json={"message": "Bad request"})
301301
with pytest.raises(BadRequestError):
302-
await workos.api_keys.create_validations(value="test_value")
302+
await workos.api_keys.create_validation(value="test_value")
303303
finally:
304304
await workos.close()
305305

306306
@pytest.mark.asyncio
307-
async def test_create_validations_unprocessable(self, httpx_mock):
307+
async def test_create_validation_unprocessable(self, httpx_mock):
308308
workos = AsyncWorkOSClient(
309309
api_key="sk_test_123", client_id="client_test", max_retries=0
310310
)
311311
try:
312312
httpx_mock.add_response(status_code=422, json={"message": "Unprocessable"})
313313
with pytest.raises(UnprocessableEntityError):
314-
await workos.api_keys.create_validations(value="test_value")
314+
await workos.api_keys.create_validation(value="test_value")
315315
finally:
316316
await workos.close()

0 commit comments

Comments
 (0)