Skip to content

Commit b3b5f39

Browse files
committed
Update dependencies and refactor API client for async support
- Changed Python version requirement from 3.9 to 3.8. - Updated urllib3 version constraint to >= 1.25.3, < 3.0.0. - Added aiohttp and aiohttp-retry as dependencies. - Refactored API client and related API methods to support asynchronous operations. - Updated documentation examples to reflect async usage. - Adjusted unit tests to utilize async test cases.
1 parent 7b70d31 commit b3b5f39

26 files changed

+357
-389
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ configuration = monday_code.Configuration(
2424

2525

2626
# Enter a context with an instance of the API client
27-
with monday_code.ApiClient(configuration) as api_client:
27+
async with monday_code.ApiClient(configuration) as api_client:
2828
# Create an instance of the API class
2929
api_instance = monday_code.EnvironmentVariablesApi(api_client)
3030
name = 'name_example' # str |
3131

3232
try:
33-
api_response = api_instance.get_environment_variable(name)
33+
api_response = await api_instance.get_environment_variable(name)
3434
print("The response of EnvironmentVariablesApi->get_environment_variable:\n")
3535
pprint(api_response)
3636
except ApiException as e:

docs/EnvironmentVariablesApi.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Method | HTTP request | Description
1111
# **get_environment_variable**
1212
> object get_environment_variable(name)
1313
14+
15+
1416
### Example
1517

1618

@@ -27,13 +29,13 @@ configuration = monday_code.Configuration(
2729

2830

2931
# Enter a context with an instance of the API client
30-
with monday_code.ApiClient(configuration) as api_client:
32+
async with monday_code.ApiClient(configuration) as api_client:
3133
# Create an instance of the API class
3234
api_instance = monday_code.EnvironmentVariablesApi(api_client)
3335
name = 'name_example' # str |
3436

3537
try:
36-
api_response = api_instance.get_environment_variable(name)
38+
api_response = await api_instance.get_environment_variable(name)
3739
print("The response of EnvironmentVariablesApi->get_environment_variable:\n")
3840
pprint(api_response)
3941
except Exception as e:
@@ -74,6 +76,8 @@ No authorization required
7476
# **get_environment_variable_keys**
7577
> List[str] get_environment_variable_keys()
7678
79+
80+
7781
### Example
7882

7983

@@ -90,12 +94,12 @@ configuration = monday_code.Configuration(
9094

9195

9296
# Enter a context with an instance of the API client
93-
with monday_code.ApiClient(configuration) as api_client:
97+
async with monday_code.ApiClient(configuration) as api_client:
9498
# Create an instance of the API class
9599
api_instance = monday_code.EnvironmentVariablesApi(api_client)
96100

97101
try:
98-
api_response = api_instance.get_environment_variable_keys()
102+
api_response = await api_instance.get_environment_variable_keys()
99103
print("The response of EnvironmentVariablesApi->get_environment_variable_keys:\n")
100104
pprint(api_response)
101105
except Exception as e:

docs/LogsApi.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Method | HTTP request | Description
1010
# **write_log**
1111
> write_log(write_log_request_body)
1212
13+
14+
1315
### Example
1416

1517

@@ -27,13 +29,13 @@ configuration = monday_code.Configuration(
2729

2830

2931
# Enter a context with an instance of the API client
30-
with monday_code.ApiClient(configuration) as api_client:
32+
async with monday_code.ApiClient(configuration) as api_client:
3133
# Create an instance of the API class
3234
api_instance = monday_code.LogsApi(api_client)
3335
write_log_request_body = monday_code.WriteLogRequestBody() # WriteLogRequestBody |
3436

3537
try:
36-
api_instance.write_log(write_log_request_body)
38+
await api_instance.write_log(write_log_request_body)
3739
except Exception as e:
3840
print("Exception when calling LogsApi->write_log: %s\n" % e)
3941
```

docs/QueueApi.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Method | HTTP request | Description
1111
# **publish_message**
1212
> PublishMessageResponse publish_message(publish_message_params)
1313
14+
15+
1416
### Example
1517

1618

@@ -29,13 +31,13 @@ configuration = monday_code.Configuration(
2931

3032

3133
# Enter a context with an instance of the API client
32-
with monday_code.ApiClient(configuration) as api_client:
34+
async with monday_code.ApiClient(configuration) as api_client:
3335
# Create an instance of the API class
3436
api_instance = monday_code.QueueApi(api_client)
3537
publish_message_params = monday_code.PublishMessageParams() # PublishMessageParams |
3638

3739
try:
38-
api_response = api_instance.publish_message(publish_message_params)
40+
api_response = await api_instance.publish_message(publish_message_params)
3941
print("The response of QueueApi->publish_message:\n")
4042
pprint(api_response)
4143
except Exception as e:
@@ -75,6 +77,8 @@ No authorization required
7577
# **validate_secret**
7678
> ValidateSecretResponse validate_secret(validate_secret_params)
7779
80+
81+
7882
### Example
7983

8084

@@ -93,13 +97,13 @@ configuration = monday_code.Configuration(
9397

9498

9599
# Enter a context with an instance of the API client
96-
with monday_code.ApiClient(configuration) as api_client:
100+
async with monday_code.ApiClient(configuration) as api_client:
97101
# Create an instance of the API class
98102
api_instance = monday_code.QueueApi(api_client)
99103
validate_secret_params = monday_code.ValidateSecretParams() # ValidateSecretParams |
100104

101105
try:
102-
api_response = api_instance.validate_secret(validate_secret_params)
106+
api_response = await api_instance.validate_secret(validate_secret_params)
103107
print("The response of QueueApi->validate_secret:\n")
104108
pprint(api_response)
105109
except Exception as e:

docs/SecretsApi.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Method | HTTP request | Description
1111
# **get_secret**
1212
> str get_secret(name)
1313
14+
15+
1416
### Example
1517

1618

@@ -27,13 +29,13 @@ configuration = monday_code.Configuration(
2729

2830

2931
# Enter a context with an instance of the API client
30-
with monday_code.ApiClient(configuration) as api_client:
32+
async with monday_code.ApiClient(configuration) as api_client:
3133
# Create an instance of the API class
3234
api_instance = monday_code.SecretsApi(api_client)
3335
name = 'name_example' # str |
3436

3537
try:
36-
api_response = api_instance.get_secret(name)
38+
api_response = await api_instance.get_secret(name)
3739
print("The response of SecretsApi->get_secret:\n")
3840
pprint(api_response)
3941
except Exception as e:
@@ -74,6 +76,8 @@ No authorization required
7476
# **get_secret_keys**
7577
> List[str] get_secret_keys()
7678
79+
80+
7781
### Example
7882

7983

@@ -90,12 +94,12 @@ configuration = monday_code.Configuration(
9094

9195

9296
# Enter a context with an instance of the API client
93-
with monday_code.ApiClient(configuration) as api_client:
97+
async with monday_code.ApiClient(configuration) as api_client:
9498
# Create an instance of the API class
9599
api_instance = monday_code.SecretsApi(api_client)
96100

97101
try:
98-
api_response = api_instance.get_secret_keys()
102+
api_response = await api_instance.get_secret_keys()
99103
print("The response of SecretsApi->get_secret_keys:\n")
100104
pprint(api_response)
101105
except Exception as e:

docs/SecureStorageApi.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Method | HTTP request | Description
1212
# **delete_secure_storage**
1313
> delete_secure_storage(key)
1414
15+
16+
1517
### Example
1618

1719

@@ -28,13 +30,13 @@ configuration = monday_code.Configuration(
2830

2931

3032
# Enter a context with an instance of the API client
31-
with monday_code.ApiClient(configuration) as api_client:
33+
async with monday_code.ApiClient(configuration) as api_client:
3234
# Create an instance of the API class
3335
api_instance = monday_code.SecureStorageApi(api_client)
3436
key = 'key_example' # str |
3537

3638
try:
37-
api_instance.delete_secure_storage(key)
39+
await api_instance.delete_secure_storage(key)
3840
except Exception as e:
3941
print("Exception when calling SecureStorageApi->delete_secure_storage: %s\n" % e)
4042
```
@@ -72,6 +74,8 @@ No authorization required
7274
# **get_secure_storage**
7375
> JsonDataContract get_secure_storage(key)
7476
77+
78+
7579
### Example
7680

7781

@@ -89,13 +93,13 @@ configuration = monday_code.Configuration(
8993

9094

9195
# Enter a context with an instance of the API client
92-
with monday_code.ApiClient(configuration) as api_client:
96+
async with monday_code.ApiClient(configuration) as api_client:
9397
# Create an instance of the API class
9498
api_instance = monday_code.SecureStorageApi(api_client)
9599
key = 'key_example' # str |
96100

97101
try:
98-
api_response = api_instance.get_secure_storage(key)
102+
api_response = await api_instance.get_secure_storage(key)
99103
print("The response of SecureStorageApi->get_secure_storage:\n")
100104
pprint(api_response)
101105
except Exception as e:
@@ -136,6 +140,8 @@ No authorization required
136140
# **put_secure_storage**
137141
> bool put_secure_storage(key, json_data_contract)
138142
143+
144+
139145
### Example
140146

141147

@@ -153,14 +159,14 @@ configuration = monday_code.Configuration(
153159

154160

155161
# Enter a context with an instance of the API client
156-
with monday_code.ApiClient(configuration) as api_client:
162+
async with monday_code.ApiClient(configuration) as api_client:
157163
# Create an instance of the API class
158164
api_instance = monday_code.SecureStorageApi(api_client)
159165
key = 'key_example' # str |
160166
json_data_contract = monday_code.JsonDataContract() # JsonDataContract |
161167

162168
try:
163-
api_response = api_instance.put_secure_storage(key, json_data_contract)
169+
api_response = await api_instance.put_secure_storage(key, json_data_contract)
164170
print("The response of SecureStorageApi->put_secure_storage:\n")
165171
pprint(api_response)
166172
except Exception as e:

docs/StorageApi.md

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Method | HTTP request | Description
1414
# **delete_by_key_from_storage**
1515
> delete_by_key_from_storage(key, x_monday_access_token)
1616
17+
18+
1719
### Example
1820

1921

@@ -30,14 +32,14 @@ configuration = monday_code.Configuration(
3032

3133

3234
# Enter a context with an instance of the API client
33-
with monday_code.ApiClient(configuration) as api_client:
35+
async with monday_code.ApiClient(configuration) as api_client:
3436
# Create an instance of the API class
3537
api_instance = monday_code.StorageApi(api_client)
3638
key = 'key_example' # str |
3739
x_monday_access_token = 'x_monday_access_token_example' # str |
3840

3941
try:
40-
api_instance.delete_by_key_from_storage(key, x_monday_access_token)
42+
await api_instance.delete_by_key_from_storage(key, x_monday_access_token)
4143
except Exception as e:
4244
print("Exception when calling StorageApi->delete_by_key_from_storage: %s\n" % e)
4345
```
@@ -76,6 +78,8 @@ No authorization required
7678
# **get_by_key_from_storage**
7779
> StorageDataContract get_by_key_from_storage(key, shared, x_monday_access_token)
7880
81+
82+
7983
### Example
8084

8185

@@ -93,15 +97,15 @@ configuration = monday_code.Configuration(
9397

9498

9599
# Enter a context with an instance of the API client
96-
with monday_code.ApiClient(configuration) as api_client:
100+
async with monday_code.ApiClient(configuration) as api_client:
97101
# Create an instance of the API class
98102
api_instance = monday_code.StorageApi(api_client)
99103
key = 'key_example' # str |
100104
shared = True # bool |
101105
x_monday_access_token = 'x_monday_access_token_example' # str |
102106

103107
try:
104-
api_response = api_instance.get_by_key_from_storage(key, shared, x_monday_access_token)
108+
api_response = await api_instance.get_by_key_from_storage(key, shared, x_monday_access_token)
105109
print("The response of StorageApi->get_by_key_from_storage:\n")
106110
pprint(api_response)
107111
except Exception as e:
@@ -145,6 +149,8 @@ No authorization required
145149
# **increment_counter**
146150
> IncrementCounter200Response increment_counter(x_monday_access_token, increment_counter_params)
147151
152+
153+
148154
### Example
149155

150156

@@ -163,14 +169,14 @@ configuration = monday_code.Configuration(
163169

164170

165171
# Enter a context with an instance of the API client
166-
with monday_code.ApiClient(configuration) as api_client:
172+
async with monday_code.ApiClient(configuration) as api_client:
167173
# Create an instance of the API class
168174
api_instance = monday_code.StorageApi(api_client)
169175
x_monday_access_token = 'x_monday_access_token_example' # str |
170176
increment_counter_params = monday_code.IncrementCounterParams() # IncrementCounterParams |
171177

172178
try:
173-
api_response = api_instance.increment_counter(x_monday_access_token, increment_counter_params)
179+
api_response = await api_instance.increment_counter(x_monday_access_token, increment_counter_params)
174180
print("The response of StorageApi->increment_counter:\n")
175181
pprint(api_response)
176182
except Exception as e:
@@ -211,6 +217,8 @@ No authorization required
211217
# **search_record**
212218
> object search_record(term, x_monday_access_token, cursor=cursor)
213219
220+
221+
214222
### Example
215223

216224

@@ -227,15 +235,15 @@ configuration = monday_code.Configuration(
227235

228236

229237
# Enter a context with an instance of the API client
230-
with monday_code.ApiClient(configuration) as api_client:
238+
async with monday_code.ApiClient(configuration) as api_client:
231239
# Create an instance of the API class
232240
api_instance = monday_code.StorageApi(api_client)
233241
term = 'term_example' # str |
234242
x_monday_access_token = 'x_monday_access_token_example' # str |
235243
cursor = 'cursor_example' # str | (optional)
236244

237245
try:
238-
api_response = api_instance.search_record(term, x_monday_access_token, cursor=cursor)
246+
api_response = await api_instance.search_record(term, x_monday_access_token, cursor=cursor)
239247
print("The response of StorageApi->search_record:\n")
240248
pprint(api_response)
241249
except Exception as e:
@@ -279,6 +287,8 @@ No authorization required
279287
# **upsert_by_key_from_storage**
280288
> UpsertByKeyFromStorage200Response upsert_by_key_from_storage(key, x_monday_access_token, json_data_contract, shared=shared, previous_version=previous_version, ttl=ttl)
281289
290+
291+
282292
### Example
283293

284294

@@ -297,7 +307,7 @@ configuration = monday_code.Configuration(
297307

298308

299309
# Enter a context with an instance of the API client
300-
with monday_code.ApiClient(configuration) as api_client:
310+
async with monday_code.ApiClient(configuration) as api_client:
301311
# Create an instance of the API class
302312
api_instance = monday_code.StorageApi(api_client)
303313
key = 'key_example' # str |
@@ -308,7 +318,7 @@ with monday_code.ApiClient(configuration) as api_client:
308318
ttl = 3.4 # float | (optional)
309319

310320
try:
311-
api_response = api_instance.upsert_by_key_from_storage(key, x_monday_access_token, json_data_contract, shared=shared, previous_version=previous_version, ttl=ttl)
321+
api_response = await api_instance.upsert_by_key_from_storage(key, x_monday_access_token, json_data_contract, shared=shared, previous_version=previous_version, ttl=ttl)
312322
print("The response of StorageApi->upsert_by_key_from_storage:\n")
313323
pprint(api_response)
314324
except Exception as e:

0 commit comments

Comments
 (0)