Skip to content

Commit 78eec34

Browse files
committed
added support for async and tests for all api services
1 parent d037c91 commit 78eec34

12 files changed

+1552
-187
lines changed

monday_code/api/environment_variables_api.py

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
from monday_code.api_client import ApiClient, RequestSerialized
2323
from monday_code.api_response import ApiResponse
2424
from monday_code.rest import RESTResponseType
25+
from monday_code.sdk_logger import log_sdk_usage
2526

2627

2728
class EnvironmentVariablesApi:
@@ -36,7 +37,6 @@ def __init__(self, api_client=None) -> None:
3637
api_client = ApiClient.get_default()
3738
self.api_client = api_client
3839

39-
4040
@validate_call
4141
async def get_environment_variable(
4242
self,
@@ -79,7 +79,10 @@ async def get_environment_variable(
7979
in the spec for a single request.
8080
:type _host_index: int, optional
8181
:return: Returns the result object.
82-
""" # noqa: E501
82+
""" # noqa: E501
83+
84+
# Log environment variable usage
85+
log_sdk_usage(f"🌍 Getting environment variable: '{name}'")
8386

8487
_param = self._get_environment_variable_serialize(
8588
name=name,
@@ -103,7 +106,6 @@ async def get_environment_variable(
103106
response_types_map=_response_types_map,
104107
).data
105108

106-
107109
@validate_call
108110
async def get_environment_variable_with_http_info(
109111
self,
@@ -146,7 +148,7 @@ async def get_environment_variable_with_http_info(
146148
in the spec for a single request.
147149
:type _host_index: int, optional
148150
:return: Returns the result object.
149-
""" # noqa: E501
151+
""" # noqa: E501
150152

151153
_param = self._get_environment_variable_serialize(
152154
name=name,
@@ -170,7 +172,6 @@ async def get_environment_variable_with_http_info(
170172
response_types_map=_response_types_map,
171173
)
172174

173-
174175
@validate_call
175176
async def get_environment_variable_without_preload_content(
176177
self,
@@ -213,7 +214,7 @@ async def get_environment_variable_without_preload_content(
213214
in the spec for a single request.
214215
:type _host_index: int, optional
215216
:return: Returns the result object.
216-
""" # noqa: E501
217+
""" # noqa: E501
217218

218219
_param = self._get_environment_variable_serialize(
219220
name=name,
@@ -233,7 +234,6 @@ async def get_environment_variable_without_preload_content(
233234
)
234235
return response_data.response
235236

236-
237237
def _get_environment_variable_serialize(
238238
self,
239239
name,
@@ -265,7 +265,6 @@ def _get_environment_variable_serialize(
265265
# process the form parameters
266266
# process the body parameter
267267

268-
269268
# set the HTTP header `Accept`
270269
if 'Accept' not in _header_params:
271270
_header_params['Accept'] = self.api_client.select_header_accept(
@@ -274,7 +273,6 @@ def _get_environment_variable_serialize(
274273
]
275274
)
276275

277-
278276
# authentication setting
279277
_auth_settings: List[str] = [
280278
]
@@ -294,9 +292,6 @@ def _get_environment_variable_serialize(
294292
_request_auth=_request_auth
295293
)
296294

297-
298-
299-
300295
@validate_call
301296
async def get_environment_variable_keys(
302297
self,
@@ -336,7 +331,10 @@ async def get_environment_variable_keys(
336331
in the spec for a single request.
337332
:type _host_index: int, optional
338333
:return: Returns the result object.
339-
""" # noqa: E501
334+
""" # noqa: E501
335+
336+
# Log environment variable usage
337+
log_sdk_usage("🌍 Getting all environment variable keys")
340338

341339
_param = self._get_environment_variable_keys_serialize(
342340
_request_auth=_request_auth,
@@ -358,7 +356,6 @@ async def get_environment_variable_keys(
358356
response_types_map=_response_types_map,
359357
).data
360358

361-
362359
@validate_call
363360
async def get_environment_variable_keys_with_http_info(
364361
self,
@@ -398,7 +395,7 @@ async def get_environment_variable_keys_with_http_info(
398395
in the spec for a single request.
399396
:type _host_index: int, optional
400397
:return: Returns the result object.
401-
""" # noqa: E501
398+
""" # noqa: E501
402399

403400
_param = self._get_environment_variable_keys_serialize(
404401
_request_auth=_request_auth,
@@ -420,7 +417,6 @@ async def get_environment_variable_keys_with_http_info(
420417
response_types_map=_response_types_map,
421418
)
422419

423-
424420
@validate_call
425421
async def get_environment_variable_keys_without_preload_content(
426422
self,
@@ -460,7 +456,7 @@ async def get_environment_variable_keys_without_preload_content(
460456
in the spec for a single request.
461457
:type _host_index: int, optional
462458
:return: Returns the result object.
463-
""" # noqa: E501
459+
""" # noqa: E501
464460

465461
_param = self._get_environment_variable_keys_serialize(
466462
_request_auth=_request_auth,
@@ -478,7 +474,6 @@ async def get_environment_variable_keys_without_preload_content(
478474
)
479475
return response_data.response
480476

481-
482477
def _get_environment_variable_keys_serialize(
483478
self,
484479
_request_auth,
@@ -507,7 +502,6 @@ def _get_environment_variable_keys_serialize(
507502
# process the form parameters
508503
# process the body parameter
509504

510-
511505
# set the HTTP header `Accept`
512506
if 'Accept' not in _header_params:
513507
_header_params['Accept'] = self.api_client.select_header_accept(
@@ -516,7 +510,6 @@ def _get_environment_variable_keys_serialize(
516510
]
517511
)
518512

519-
520513
# authentication setting
521514
_auth_settings: List[str] = [
522515
]
@@ -535,5 +528,3 @@ def _get_environment_variable_keys_serialize(
535528
_host=_host,
536529
_request_auth=_request_auth
537530
)
538-
539-

monday_code/api/logs_api.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from monday_code.api_client import ApiClient, RequestSerialized
2222
from monday_code.api_response import ApiResponse
2323
from monday_code.rest import RESTResponseType
24+
from monday_code.sdk_logger import log_sdk_usage
2425

2526

2627
class LogsApi:
@@ -35,7 +36,6 @@ def __init__(self, api_client=None) -> None:
3536
api_client = ApiClient.get_default()
3637
self.api_client = api_client
3738

38-
3939
@validate_call
4040
async def write_log(
4141
self,
@@ -78,7 +78,10 @@ async def write_log(
7878
in the spec for a single request.
7979
:type _host_index: int, optional
8080
:return: Returns the result object.
81-
""" # noqa: E501
81+
""" # noqa: E501
82+
83+
# Log write operation
84+
log_sdk_usage("📝 Writing log entry")
8285

8386
_param = self._write_log_serialize(
8487
write_log_request_body=write_log_request_body,
@@ -101,7 +104,6 @@ async def write_log(
101104
response_types_map=_response_types_map,
102105
).data
103106

104-
105107
@validate_call
106108
async def write_log_with_http_info(
107109
self,
@@ -144,7 +146,7 @@ async def write_log_with_http_info(
144146
in the spec for a single request.
145147
:type _host_index: int, optional
146148
:return: Returns the result object.
147-
""" # noqa: E501
149+
""" # noqa: E501
148150

149151
_param = self._write_log_serialize(
150152
write_log_request_body=write_log_request_body,
@@ -167,7 +169,6 @@ async def write_log_with_http_info(
167169
response_types_map=_response_types_map,
168170
)
169171

170-
171172
@validate_call
172173
async def write_log_without_preload_content(
173174
self,
@@ -210,7 +211,7 @@ async def write_log_without_preload_content(
210211
in the spec for a single request.
211212
:type _host_index: int, optional
212213
:return: Returns the result object.
213-
""" # noqa: E501
214+
""" # noqa: E501
214215

215216
_param = self._write_log_serialize(
216217
write_log_request_body=write_log_request_body,
@@ -229,7 +230,6 @@ async def write_log_without_preload_content(
229230
)
230231
return response_data.response
231232

232-
233233
def _write_log_serialize(
234234
self,
235235
write_log_request_body,
@@ -261,8 +261,6 @@ def _write_log_serialize(
261261
if write_log_request_body is not None:
262262
_body_params = write_log_request_body
263263

264-
265-
266264
# set the HTTP header `Content-Type`
267265
if _content_type:
268266
_header_params['Content-Type'] = _content_type
@@ -295,5 +293,3 @@ def _write_log_serialize(
295293
_host=_host,
296294
_request_auth=_request_auth
297295
)
298-
299-

0 commit comments

Comments
 (0)