Skip to content

Commit e67e22d

Browse files
feat: rename disallow aksk to apikey required
1 parent 7f1d3fb commit e67e22d

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

volcenginesdkarkruntime/_utils/_utils.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,23 +91,23 @@ def _insert_sts_token(args, kwargs):
9191
kwargs["extra_headers"] = {**default_auth_header, **extra_headers}
9292

9393

94-
def disallow_aksk(func):
94+
def apikey_required(func):
9595
def wrapper(*args, **kwargs):
96-
_restrict_aksk(args, kwargs)
96+
_assert_apikey(args, kwargs)
9797
return func(*args, **kwargs)
9898

9999
return wrapper
100100

101101

102-
def async_disallow_aksk(func):
102+
def async_apikey_required(func):
103103
async def wrapper(*args, **kwargs):
104-
_restrict_aksk(args, kwargs)
104+
_assert_apikey(args, kwargs)
105105
return await func(*args, **kwargs)
106106

107107
return wrapper
108108

109109

110-
def _restrict_aksk(args, kwargs):
110+
def _assert_apikey(args, kwargs):
111111
assert len(args) > 0
112112

113113
ark_client = args[0]._client

volcenginesdkarkruntime/resources/content_generation/tasks.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from volcenginesdkarkruntime.types.content_generation.create_task_content_param import CreateTaskContentParam
1111
from ..._response import to_raw_response_wrapper, async_to_raw_response_wrapper
1212
from ..._types import Body, Query, Headers
13-
from ..._utils._utils import disallow_aksk, async_disallow_aksk
13+
from ..._utils._utils import apikey_required, async_apikey_required
1414
from ...types.content_generation.content_generation_task import ContentGenerationTask
1515
from ...types.content_generation.content_generation_task_id import ContentGenerationTaskID
1616
from ...types.content_generation.list_content_generation_tasks_response import ListContentGenerationTasksResponse
@@ -21,7 +21,7 @@ class Tasks(SyncAPIResource):
2121
def with_raw_response(self) -> TasksWithRawResponse:
2222
return TasksWithRawResponse(self)
2323

24-
@disallow_aksk
24+
@apikey_required
2525
def create(
2626
self,
2727
*,
@@ -48,7 +48,7 @@ def create(
4848
)
4949
return resp
5050

51-
@disallow_aksk
51+
@apikey_required
5252
def get(
5353
self,
5454
*,
@@ -70,7 +70,7 @@ def get(
7070
)
7171
return resp
7272

73-
@disallow_aksk
73+
@apikey_required
7474
def list(
7575
self,
7676
page_num: int | None = None,
@@ -112,7 +112,7 @@ def list(
112112
)
113113
return resp
114114

115-
@disallow_aksk
115+
@apikey_required
116116
def delete(
117117
self,
118118
task_id: str,
@@ -139,7 +139,7 @@ class AsyncTasks(AsyncAPIResource):
139139
def with_raw_response(self) -> AsyncTasksWithRawResponse:
140140
return AsyncTasksWithRawResponse(self)
141141

142-
@async_disallow_aksk
142+
@async_apikey_required
143143
async def create(
144144
self,
145145
*,
@@ -166,7 +166,7 @@ async def create(
166166
)
167167
return resp
168168

169-
@async_disallow_aksk
169+
@async_apikey_required
170170
async def get(
171171
self,
172172
*,
@@ -188,7 +188,7 @@ async def get(
188188
)
189189
return resp
190190

191-
@async_disallow_aksk
191+
@async_apikey_required
192192
async def list(
193193
self,
194194
page_num: int | None = None,
@@ -230,7 +230,7 @@ async def list(
230230
)
231231
return resp
232232

233-
@async_disallow_aksk
233+
@async_apikey_required
234234
async def delete(
235235
self,
236236
task_id: str,

0 commit comments

Comments
 (0)