|
| 1 | +# coding: utf-8 |
| 2 | + |
| 3 | +from __future__ import absolute_import |
| 4 | + |
| 5 | +import six |
| 6 | +import re |
| 7 | + |
| 8 | +from wallee.api_client import ApiClient |
| 9 | + |
| 10 | +class DunningCaseLevelServiceApi: |
| 11 | + |
| 12 | + def __init__(self, configuration): |
| 13 | + self.api_client = ApiClient(configuration=configuration) |
| 14 | + |
| 15 | + def count(self, space_id, **kwargs): |
| 16 | + """Count |
| 17 | +
|
| 18 | + Counts the number of items in the database as restricted by the given filter. |
| 19 | + This method makes a synchronous HTTP request by default. To make an |
| 20 | + asynchronous HTTP request, please pass async_req=True. |
| 21 | + |
| 22 | + >>> thread = api.count(space_id, async_req=True) |
| 23 | + >>> result = thread.get() |
| 24 | +
|
| 25 | + :param async_req bool |
| 26 | + :param int space_id: (required) |
| 27 | + :param EntityQueryFilter filter: The filter which restricts the entities which are used to calculate the count. |
| 28 | + :return: int |
| 29 | + If the method is called asynchronously, |
| 30 | + returns the request thread. |
| 31 | + """ |
| 32 | + kwargs['_return_http_data_only'] = True |
| 33 | + |
| 34 | + kwargs['request_timeout'] = self.api_client.configuration.request_timeout |
| 35 | + if kwargs.get('async_req'): |
| 36 | + return self.count_with_http_info(space_id, **kwargs) |
| 37 | + else: |
| 38 | + (data) = self.count_with_http_info(space_id, **kwargs) |
| 39 | + return data |
| 40 | + |
| 41 | + def count_with_http_info(self, space_id, **kwargs): |
| 42 | + """Count |
| 43 | +
|
| 44 | + Counts the number of items in the database as restricted by the given filter. |
| 45 | + This method makes a synchronous HTTP request by default. To make an |
| 46 | + asynchronous HTTP request, please pass async_req=True. |
| 47 | + |
| 48 | + >>> thread = api.count_with_http_info(space_id, async_req=True) |
| 49 | + >>> result = thread.get() |
| 50 | +
|
| 51 | + :param async_req bool |
| 52 | + :param int space_id: (required) |
| 53 | + :param EntityQueryFilter filter: The filter which restricts the entities which are used to calculate the count. |
| 54 | + :return: int |
| 55 | + If the method is called asynchronously, |
| 56 | + returns the request thread. |
| 57 | + """ |
| 58 | + |
| 59 | + all_params = ['space_id', 'filter'] |
| 60 | + all_params.append('async_req') |
| 61 | + all_params.append('_return_http_data_only') |
| 62 | + all_params.append('_preload_content') |
| 63 | + all_params.append('request_timeout') |
| 64 | + |
| 65 | + params = locals() |
| 66 | + for key, val in six.iteritems(params['kwargs']): |
| 67 | + if key not in all_params: |
| 68 | + raise TypeError( |
| 69 | + "Got an unexpected keyword argument '%s'" |
| 70 | + " to method count" % key |
| 71 | + ) |
| 72 | + params[key] = val |
| 73 | + del params['kwargs'] |
| 74 | + # verify the required parameter 'space_id' is set |
| 75 | + if ('space_id' not in params or |
| 76 | + params['space_id'] is None): |
| 77 | + raise ValueError("Missing the required parameter `space_id` when calling `count`") |
| 78 | + |
| 79 | + collection_formats = {} |
| 80 | + |
| 81 | + path_params = {} |
| 82 | + |
| 83 | + query_params = [] |
| 84 | + if 'space_id' in params: |
| 85 | + query_params.append(('spaceId', params['space_id'])) |
| 86 | + |
| 87 | + header_params = {} |
| 88 | + |
| 89 | + form_params = [] |
| 90 | + local_var_files = {} |
| 91 | + |
| 92 | + body_params = None |
| 93 | + if 'filter' in params: |
| 94 | + body_params = params['filter'] |
| 95 | + # HTTP header `Accept` |
| 96 | + header_params['Accept'] = self.api_client.select_header_accept( |
| 97 | + ['application/json;charset=utf-8']) |
| 98 | + |
| 99 | + # HTTP header `Content-Type` |
| 100 | + header_params['Content-Type'] = self.api_client.select_header_content_type( |
| 101 | + ['application/json;charset=utf-8']) |
| 102 | + |
| 103 | + # Authentication setting |
| 104 | + auth_settings = [] |
| 105 | + |
| 106 | + return self.api_client.call_api( |
| 107 | + '/dunning-case-level/count', 'POST', |
| 108 | + path_params, |
| 109 | + query_params, |
| 110 | + header_params, |
| 111 | + body=body_params, |
| 112 | + post_params=form_params, |
| 113 | + files=local_var_files, |
| 114 | + response_type='int', |
| 115 | + auth_settings=auth_settings, |
| 116 | + async_req=params.get('async_req'), |
| 117 | + _return_http_data_only=params.get('_return_http_data_only'), |
| 118 | + _preload_content=params.get('_preload_content', True), |
| 119 | + _request_timeout=params.get('request_timeout'), |
| 120 | + collection_formats=collection_formats) |
| 121 | + |
| 122 | + def read(self, space_id, id, **kwargs): |
| 123 | + """Read |
| 124 | +
|
| 125 | + Reads the entity with the given 'id' and returns it. |
| 126 | + This method makes a synchronous HTTP request by default. To make an |
| 127 | + asynchronous HTTP request, please pass async_req=True. |
| 128 | + |
| 129 | + >>> thread = api.read(space_id, id, async_req=True) |
| 130 | + >>> result = thread.get() |
| 131 | +
|
| 132 | + :param async_req bool |
| 133 | + :param int space_id: (required) |
| 134 | + :param int id: ID of the dunning case level to return. (required) |
| 135 | + :return: DunningCaseLevel |
| 136 | + If the method is called asynchronously, |
| 137 | + returns the request thread. |
| 138 | + """ |
| 139 | + kwargs['_return_http_data_only'] = True |
| 140 | + |
| 141 | + kwargs['request_timeout'] = self.api_client.configuration.request_timeout |
| 142 | + if kwargs.get('async_req'): |
| 143 | + return self.read_with_http_info(space_id, id, **kwargs) |
| 144 | + else: |
| 145 | + (data) = self.read_with_http_info(space_id, id, **kwargs) |
| 146 | + return data |
| 147 | + |
| 148 | + def read_with_http_info(self, space_id, id, **kwargs): |
| 149 | + """Read |
| 150 | +
|
| 151 | + Reads the entity with the given 'id' and returns it. |
| 152 | + This method makes a synchronous HTTP request by default. To make an |
| 153 | + asynchronous HTTP request, please pass async_req=True. |
| 154 | + |
| 155 | + >>> thread = api.read_with_http_info(space_id, id, async_req=True) |
| 156 | + >>> result = thread.get() |
| 157 | +
|
| 158 | + :param async_req bool |
| 159 | + :param int space_id: (required) |
| 160 | + :param int id: ID of the dunning case level to return. (required) |
| 161 | + :return: DunningCaseLevel |
| 162 | + If the method is called asynchronously, |
| 163 | + returns the request thread. |
| 164 | + """ |
| 165 | + |
| 166 | + all_params = ['space_id', 'id'] |
| 167 | + all_params.append('async_req') |
| 168 | + all_params.append('_return_http_data_only') |
| 169 | + all_params.append('_preload_content') |
| 170 | + all_params.append('request_timeout') |
| 171 | + |
| 172 | + params = locals() |
| 173 | + for key, val in six.iteritems(params['kwargs']): |
| 174 | + if key not in all_params: |
| 175 | + raise TypeError( |
| 176 | + "Got an unexpected keyword argument '%s'" |
| 177 | + " to method read" % key |
| 178 | + ) |
| 179 | + params[key] = val |
| 180 | + del params['kwargs'] |
| 181 | + # verify the required parameter 'space_id' is set |
| 182 | + if ('space_id' not in params or |
| 183 | + params['space_id'] is None): |
| 184 | + raise ValueError("Missing the required parameter `space_id` when calling `read`") |
| 185 | + # verify the required parameter 'id' is set |
| 186 | + if ('id' not in params or |
| 187 | + params['id'] is None): |
| 188 | + raise ValueError("Missing the required parameter `id` when calling `read`") |
| 189 | + |
| 190 | + collection_formats = {} |
| 191 | + |
| 192 | + path_params = {} |
| 193 | + |
| 194 | + query_params = [] |
| 195 | + if 'space_id' in params: |
| 196 | + query_params.append(('spaceId', params['space_id'])) |
| 197 | + if 'id' in params: |
| 198 | + query_params.append(('id', params['id'])) |
| 199 | + |
| 200 | + header_params = {} |
| 201 | + |
| 202 | + form_params = [] |
| 203 | + local_var_files = {} |
| 204 | + |
| 205 | + body_params = None |
| 206 | + # HTTP header `Accept` |
| 207 | + header_params['Accept'] = self.api_client.select_header_accept( |
| 208 | + ['application/json;charset=utf-8']) |
| 209 | + |
| 210 | + # HTTP header `Content-Type` |
| 211 | + header_params['Content-Type'] = self.api_client.select_header_content_type( |
| 212 | + ['*/*']) |
| 213 | + |
| 214 | + # Authentication setting |
| 215 | + auth_settings = [] |
| 216 | + |
| 217 | + return self.api_client.call_api( |
| 218 | + '/dunning-case-level/read', 'GET', |
| 219 | + path_params, |
| 220 | + query_params, |
| 221 | + header_params, |
| 222 | + body=body_params, |
| 223 | + post_params=form_params, |
| 224 | + files=local_var_files, |
| 225 | + response_type='DunningCaseLevel', |
| 226 | + auth_settings=auth_settings, |
| 227 | + async_req=params.get('async_req'), |
| 228 | + _return_http_data_only=params.get('_return_http_data_only'), |
| 229 | + _preload_content=params.get('_preload_content', True), |
| 230 | + _request_timeout=params.get('request_timeout'), |
| 231 | + collection_formats=collection_formats) |
| 232 | + |
| 233 | + def search(self, space_id, query, **kwargs): |
| 234 | + """Search |
| 235 | +
|
| 236 | + Searches for the entities as specified by the given query. |
| 237 | + This method makes a synchronous HTTP request by default. To make an |
| 238 | + asynchronous HTTP request, please pass async_req=True. |
| 239 | + |
| 240 | + >>> thread = api.search(space_id, query, async_req=True) |
| 241 | + >>> result = thread.get() |
| 242 | +
|
| 243 | + :param async_req bool |
| 244 | + :param int space_id: (required) |
| 245 | + :param EntityQuery query: Query restricting the returned dunning case levels. (required) |
| 246 | + :return: list[DunningCaseLevel] |
| 247 | + If the method is called asynchronously, |
| 248 | + returns the request thread. |
| 249 | + """ |
| 250 | + kwargs['_return_http_data_only'] = True |
| 251 | + |
| 252 | + kwargs['request_timeout'] = self.api_client.configuration.request_timeout |
| 253 | + if kwargs.get('async_req'): |
| 254 | + return self.search_with_http_info(space_id, query, **kwargs) |
| 255 | + else: |
| 256 | + (data) = self.search_with_http_info(space_id, query, **kwargs) |
| 257 | + return data |
| 258 | + |
| 259 | + def search_with_http_info(self, space_id, query, **kwargs): |
| 260 | + """Search |
| 261 | +
|
| 262 | + Searches for the entities as specified by the given query. |
| 263 | + This method makes a synchronous HTTP request by default. To make an |
| 264 | + asynchronous HTTP request, please pass async_req=True. |
| 265 | + |
| 266 | + >>> thread = api.search_with_http_info(space_id, query, async_req=True) |
| 267 | + >>> result = thread.get() |
| 268 | +
|
| 269 | + :param async_req bool |
| 270 | + :param int space_id: (required) |
| 271 | + :param EntityQuery query: Query restricting the returned dunning case levels. (required) |
| 272 | + :return: list[DunningCaseLevel] |
| 273 | + If the method is called asynchronously, |
| 274 | + returns the request thread. |
| 275 | + """ |
| 276 | + |
| 277 | + all_params = ['space_id', 'query'] |
| 278 | + all_params.append('async_req') |
| 279 | + all_params.append('_return_http_data_only') |
| 280 | + all_params.append('_preload_content') |
| 281 | + all_params.append('request_timeout') |
| 282 | + |
| 283 | + params = locals() |
| 284 | + for key, val in six.iteritems(params['kwargs']): |
| 285 | + if key not in all_params: |
| 286 | + raise TypeError( |
| 287 | + "Got an unexpected keyword argument '%s'" |
| 288 | + " to method search" % key |
| 289 | + ) |
| 290 | + params[key] = val |
| 291 | + del params['kwargs'] |
| 292 | + # verify the required parameter 'space_id' is set |
| 293 | + if ('space_id' not in params or |
| 294 | + params['space_id'] is None): |
| 295 | + raise ValueError("Missing the required parameter `space_id` when calling `search`") |
| 296 | + # verify the required parameter 'query' is set |
| 297 | + if ('query' not in params or |
| 298 | + params['query'] is None): |
| 299 | + raise ValueError("Missing the required parameter `query` when calling `search`") |
| 300 | + |
| 301 | + collection_formats = {} |
| 302 | + |
| 303 | + path_params = {} |
| 304 | + |
| 305 | + query_params = [] |
| 306 | + if 'space_id' in params: |
| 307 | + query_params.append(('spaceId', params['space_id'])) |
| 308 | + |
| 309 | + header_params = {} |
| 310 | + |
| 311 | + form_params = [] |
| 312 | + local_var_files = {} |
| 313 | + |
| 314 | + body_params = None |
| 315 | + if 'query' in params: |
| 316 | + body_params = params['query'] |
| 317 | + # HTTP header `Accept` |
| 318 | + header_params['Accept'] = self.api_client.select_header_accept( |
| 319 | + ['application/json;charset=utf-8']) |
| 320 | + |
| 321 | + # HTTP header `Content-Type` |
| 322 | + header_params['Content-Type'] = self.api_client.select_header_content_type( |
| 323 | + ['application/json;charset=utf-8']) |
| 324 | + |
| 325 | + # Authentication setting |
| 326 | + auth_settings = [] |
| 327 | + |
| 328 | + return self.api_client.call_api( |
| 329 | + '/dunning-case-level/search', 'POST', |
| 330 | + path_params, |
| 331 | + query_params, |
| 332 | + header_params, |
| 333 | + body=body_params, |
| 334 | + post_params=form_params, |
| 335 | + files=local_var_files, |
| 336 | + response_type='list[DunningCaseLevel]', |
| 337 | + auth_settings=auth_settings, |
| 338 | + async_req=params.get('async_req'), |
| 339 | + _return_http_data_only=params.get('_return_http_data_only'), |
| 340 | + _preload_content=params.get('_preload_content', True), |
| 341 | + _request_timeout=params.get('request_timeout'), |
| 342 | + collection_formats=collection_formats) |
0 commit comments