@@ -31,15 +31,18 @@ configuration.password = 'YOUR_PASSWORD'
3131
3232# Defining host is optional and default to https://api.messente.com/v1
3333configuration.host = " https://api.messente.com/v1"
34- # Create an instance of the API class
35- api_instance = messente_api.BlacklistApi(messente_api.ApiClient(configuration))
36- number_to_blacklist = {" phoneNumber" :" +37251000000" } # NumberToBlacklist | Phone number to be blacklisted
37-
38- try :
39- # Adds a phone number to the blacklist
40- api_instance.add_to_blacklist(number_to_blacklist)
41- except ApiException as e:
42- print (" Exception when calling BlacklistApi->add_to_blacklist: %s \n " % e)
34+
35+ # Enter a context with an instance of the API client
36+ with messente_api.ApiClient(configuration) as api_client:
37+ # Create an instance of the API class
38+ api_instance = messente_api.BlacklistApi(api_client)
39+ number_to_blacklist = {" phoneNumber" :" +37251000000" } # NumberToBlacklist | Phone number to be blacklisted
40+
41+ try :
42+ # Adds a phone number to the blacklist
43+ api_instance.add_to_blacklist(number_to_blacklist)
44+ except ApiException as e:
45+ print (" Exception when calling BlacklistApi->add_to_blacklist: %s \n " % e)
4346```
4447
4548### Parameters
@@ -93,15 +96,18 @@ configuration.password = 'YOUR_PASSWORD'
9396
9497# Defining host is optional and default to https://api.messente.com/v1
9598configuration.host = " https://api.messente.com/v1"
96- # Create an instance of the API class
97- api_instance = messente_api.BlacklistApi(messente_api.ApiClient(configuration))
98- phone = ' +37251000000' # str | A phone number
99-
100- try :
101- # Deletes a phone number from the blacklist
102- api_instance.delete_from_blacklist(phone)
103- except ApiException as e:
104- print (" Exception when calling BlacklistApi->delete_from_blacklist: %s \n " % e)
99+
100+ # Enter a context with an instance of the API client
101+ with messente_api.ApiClient(configuration) as api_client:
102+ # Create an instance of the API class
103+ api_instance = messente_api.BlacklistApi(api_client)
104+ phone = ' +37251000000' # str | A phone number
105+
106+ try :
107+ # Deletes a phone number from the blacklist
108+ api_instance.delete_from_blacklist(phone)
109+ except ApiException as e:
110+ print (" Exception when calling BlacklistApi->delete_from_blacklist: %s \n " % e)
105111```
106112
107113### Parameters
@@ -155,15 +161,18 @@ configuration.password = 'YOUR_PASSWORD'
155161
156162# Defining host is optional and default to https://api.messente.com/v1
157163configuration.host = " https://api.messente.com/v1"
158- # Create an instance of the API class
159- api_instance = messente_api.BlacklistApi(messente_api.ApiClient(configuration))
160-
161- try :
162- # Returns all blacklisted phone numbers
163- api_response = api_instance.fetch_blacklist()
164- pprint(api_response)
165- except ApiException as e:
166- print (" Exception when calling BlacklistApi->fetch_blacklist: %s \n " % e)
164+
165+ # Enter a context with an instance of the API client
166+ with messente_api.ApiClient(configuration) as api_client:
167+ # Create an instance of the API class
168+ api_instance = messente_api.BlacklistApi(api_client)
169+
170+ try :
171+ # Returns all blacklisted phone numbers
172+ api_response = api_instance.fetch_blacklist()
173+ pprint(api_response)
174+ except ApiException as e:
175+ print (" Exception when calling BlacklistApi->fetch_blacklist: %s \n " % e)
167176```
168177
169178### Parameters
@@ -212,15 +221,18 @@ configuration.password = 'YOUR_PASSWORD'
212221
213222# Defining host is optional and default to https://api.messente.com/v1
214223configuration.host = " https://api.messente.com/v1"
215- # Create an instance of the API class
216- api_instance = messente_api.BlacklistApi(messente_api.ApiClient(configuration))
217- phone = ' +37251000000' # str | A phone number
218-
219- try :
220- # Checks if a phone number is blacklisted
221- api_instance.is_blacklisted(phone)
222- except ApiException as e:
223- print (" Exception when calling BlacklistApi->is_blacklisted: %s \n " % e)
224+
225+ # Enter a context with an instance of the API client
226+ with messente_api.ApiClient(configuration) as api_client:
227+ # Create an instance of the API class
228+ api_instance = messente_api.BlacklistApi(api_client)
229+ phone = ' +37251000000' # str | A phone number
230+
231+ try :
232+ # Checks if a phone number is blacklisted
233+ api_instance.is_blacklisted(phone)
234+ except ApiException as e:
235+ print (" Exception when calling BlacklistApi->is_blacklisted: %s \n " % e)
224236```
225237
226238### Parameters
0 commit comments